You cannot replace the lock screen with a user application. All you do is hack and may or may not work on any device, and will most likely break with new releases. You can create something similar to a screen lock, but that will not work. In addition, in recent versions of Android (after ICS), unlocking the screen does extra things, such as unlocking the credential storage, which your application cannot do (because it does not have system permissions).
If you really want to replace the screen lock, you need to create your own Android-ROM by changing / replacing it.
source share