[XPOSED][MOD][4.0+] CompleteKeyguardDisabler completely disables your keyguard

Search This thread

dtreth

Senior Member
Dec 12, 2013
59
20
NEW! Navbar button issue appears to have been resolved.

This is my first go at an Xposed module, or any Android app for that matter, so wish me luck!

Intro:
Anyway, I was using a lot of Xposed mods that were cool, but my IT policy has the lockscreen set to pin or password and none of the bypasses around quite gave me what I wanted. LucasR93 created this really nice mod for those of you that really like just a sliding lock on your screen, but I really wanted to use the fantastic NFCSecure Lockscreen, which works best with no lockscreen enabled at all. (PS. you guys should check out NFCSecure, it's so much easier than even a pattern! And the developer is pretty responsive, open to any suggestions you have. *this spot is not paid for by the developer of the app. I just really like it that much*)
So, I made my own mod.

What it does:
The mod utilizes the Xposed Framework to find the KeyguardViewMediator class and hook the doKeyguardLocked method, completely mocking it out. Therefore, any time the system tries to lock the screen it'll just go down the memory hole, and do nothing. Thus, even if you have a device policy mandating a pin/password the phone will never lock, ever.

This works like the aforementioned mod by LucasR93, in that it doesn't touch the actual lock policy or setup; if you go into your settings, to the security section, you will see all of the settings as normal. Nothing that needs the pin/password will complain because as far as they know it works just fine. This is (IMHO) much safer than attacking the policy and security parts of the OS directly, as they could open some more serious vulnerabilities.

What devices this mod works on:
I only have a Droid MAXX running 4.4 right now, but the way the code is implemented it should be able to work on anything 4.0+ and AOSPish, as long as Xposed Framework works properly.

Nexus 4 and Nexus 5 reported working, KitKat stock and ParanoidAndroid ROM.

I'd like to formally request anyone running Xposed on 4.0-4.3 to test this and give feedback as to if it works on these devices.
I am using some of the info provided to LucasR93 to try to also add support for the HTC lockscreen but I'll need some HTC testers for that one.

Installation Instructions:
Ensure that the Xposed Framework (a.k.a. Xposed Installer) is installed and properly functioning on your device.
Go to the Download section of the Xposed Installer, or here, to find the Complete Keyguard Disabler. Check the box in the Xposed Installer Modules list, and reboot the phone.
Upon reboot, you may or may not see your lockscreen. Some devices (Nexus devices it seems) show the lockscreen on boot, but never again. Some devices (Droid line, possibly Moto X) are completely unlocked upon reboot.
Every time your phone would normally lock, a log entry will be written to the Xposed log "Not locking the screen".

If it doesn't work:
Uncheck all other Xposed modules. Reboot. If it still doesn't work, copy the logs from the Xposed Installer and post them in this thread, with your phone model and Android version, and I'll try to help.

This new experimental build tries a few things, and logs a LOT of things. Try it out.

Is this unsafe?
Actually, maybe. If you lose your phone you will be unable to lock it remotely by using Android Device Manager (or probably carrier/manufacturer/corporate specific device admins as well). You can, however, locate and wipe without issue.

I am pondering a way to detect the ADM lock and toggle the screen, but if you use this to get NFC lockscreens working it's not something you have to worry about.

Special Thanks: @rovo89, obviously, for the Xposed Framework. @LucasR93, for his initial app that gave me most of the inspiration for this.
 
Last edited:

dtreth

Senior Member
Dec 12, 2013
59
20
Does not work on my S4 :(

No relevant logs found to post :/

OK, first, Samsungs are usually nowhere near aosp, but I could try to see if I could make it work.

Second, what version of Android are you running? And is it a stock or custom ROM?

Third, I know you said nothing is relevant in the logs, but if you could post what's there I'd know if my module even loaded.
 

fabi280

Senior Member
Oct 20, 2010
347
365
Karlsruhe
It works on my nexus 4, but just partially.
As soon as the module is active and I chose anything else than no Lockscreen I'm getting a result as on the screenshot - no navigation keys
uploadfromtaptalk1389712263974.jpg

Gesendet von meinem Nexus 4
 

dtreth

Senior Member
Dec 12, 2013
59
20
It works on my nexus 4, but just partially.
As soon as the module is active and I chose anything else than no Lockscreen I'm getting a result as on the screenshot - no navigation keys
View attachment 2515462

Gesendet von meinem Nexus 4

Oh?! That's really interesting. It appears you have the lockscreen navigation bar. That's, if I may be candid, pretty cool :silly:. Can I get the android version you're on? I can assume I know what the log says (although this will give a hint as to your version as well). I have capacitive navigation keys, so I did not see that one coming.
 

dtreth

Senior Member
Dec 12, 2013
59
20
I'm on the latest Omni Rom build (14th January one, 4.4.2)

Gesendet von meinem Nexus 4

I'm working on it. Can you try something for me? Switch your keyguard to no lock (whatever got you the buttons) and reboot, then switch to a pin unlock and see if the mod works correctly.
 

fabi280

Senior Member
Oct 20, 2010
347
365
Karlsruhe
No, I'm getting those buttons on every setting except on the No Lockscreen setting.
Upon reboot the buttons are there, until I press the standby button, then they are gone and it doesn't matter whether I go from pin to pattern/swipe or pattern to pin/swipe or swipe to pattern/pin. They only go back to normal after setting it to no Lockscreen.

Gesendet von meinem Nexus 4
 

dtreth

Senior Member
Dec 12, 2013
59
20
No, I'm getting those buttons on every setting except on the No Lockscreen setting.
Upon reboot the buttons are there, until I press the standby button, then they are gone and it doesn't matter whether I go from pin to pattern/swipe or pattern to pin/swipe or swipe to pattern/pin. They only go back to normal after setting it to no Lockscreen.

Gesendet von meinem Nexus 4

OK, so to be clear, if you boot up the phone in "No Lockscreen" you have the normal buttons (Back, Home, Recents) but the instant you enable any lockscreen you get the lockscreen navigation bar buttons, correct? You do not have to do a reboot to get the buttons to break? That makes it more straightforward to fix, I believe, but it isn't as clean of a solution.

I had thought maybe it was giving you those buttons because on boot the phone tries to start in locked mode, which I thwart. But it appears as if every time the phone is "locked" the system updates the navigation bar buttons and also shows the keyguard. I'll look into nuking these functions, but I was hoping i could just nuke the call that sets them that way.
 

fabi280

Senior Member
Oct 20, 2010
347
365
Karlsruhe
OK, so to be clear, if you boot up the phone in "No Lockscreen" you have the normal buttons (Back, Home, Recents) but the instant you enable any lockscreen you get the lockscreen navigation bar buttons, correct? You do not have to do a reboot to get the buttons to break? That makes it more straightforward to fix, I believe, but it isn't as clean of a solution.

I had thought maybe it was giving you those buttons because on boot the phone tries to start in locked mode, which I thwart. But it appears as if every time the phone is "locked" the system updates the navigation bar buttons and also shows the keyguard. I'll look into nuking these functions, but I was hoping i could just nuke the call that sets them that way.

No, it doesn't matter which keyguard Mode i've set up before rebooting.
As soon as I am locking the phone I'm getting the Lockscreen navigation bar on unlocking again.
The only way to get back to normal is setting to no keyguard. And if I reboot without keyguard set, they don't switch to Lockscreen navigation bar after locking and unlocking.

Sorry English isn't my mother's tongue

Gesendet von meinem Nexus 4
 

dtreth

Senior Member
Dec 12, 2013
59
20
No, it doesn't matter which keyguard Mode i've set up before rebooting.
As soon as I am locking the phone I'm getting the Lockscreen navigation bar on unlocking again.
The only way to get back to normal is setting to no keyguard. And if I reboot without keyguard set, they don't switch to Lockscreen navigation bar after locking and unlocking.

Sorry English isn't my mother's tongue

Gesendet von meinem Nexus 4

Don't apologize, I was getting very specific and you responded prefectly. Thanks. I'll get a new version uploaded later today, with some exploration code to uncover what's causing this.
 
  • Like
Reactions: fabi280

dtreth

Senior Member
Dec 12, 2013
59
20
No, it doesn't matter which keyguard Mode i've set up before rebooting.
As soon as I am locking the phone I'm getting the Lockscreen navigation bar on unlocking again.
The only way to get back to normal is setting to no keyguard. And if I reboot without keyguard set, they don't switch to Lockscreen navigation bar after locking and unlocking.

Sorry English isn't my mother's tongue

Gesendet von meinem Nexus 4

Try this new build. I will be updating the OP soon.

Does not work on my S4 :(

No relevant logs found to post :/

Also try this new build. It has Experimental SUPERDEBUG enabled, which is just me looking for possible apks to hack on others' phones.
 

Attachments

  • CompleteKeyguardDisabler-1.0a.apk
    260.3 KB · Views: 136
  • Like
Reactions: fabi280

fabi280

Senior Member
Oct 20, 2010
347
365
Karlsruhe
Don't apologize, I was getting very specific and you responded prefectly. Thanks. I'll get a new version uploaded later today, with some exploration code to uncover what's causing this.

1. Downloaded your updated module
2. Activated it
3. Set a Pin (0000)
4. Reboot
5. It asked me for the pin the first time
6. Standby
7. Wake-Up: Lockscreen Navigation bar; No Pin
8. Sent the log to my computer
9. Reproduced 6 & 7 for 3 more times.
10. Set keyguard to no lock -> Standby -> Normal Nav Bar (not on the log anymore)

Code:
-----------------
15.01.2014 07:59:19 UTC
Loading Xposed v42 (for Zygote)...
Loading modules from /data/app/net.treth.d.completekeyguarddisabler-2.apk
  Loading class net.treth.d.completekeyguarddisabler.CompleteKeyguardDisabler
In package com.android.keyguard [4.4]
hooking method doKeyguardLocked in class 'com.android.keyguard.KeyguardViewMediator'
hooking method adjustStatusBarLocked in class 'com.android.keyguard.KeyguardViewMediator'
Not adjusting the statusbar (and navigation bar) [hopefully]
Not locking the screen
Not adjusting the statusbar (and navigation bar) [hopefully]
Not locking the screen
This package seems like it could be a keyguard com.android.deskclock [SUPERDEBUG]
This package seems like it could be a keyguard com.teamkang.fauxclock [SUPERDEBUG]

I doubt fauxclock could be a keyguard, it's a kernel setup tool.

Oh more logs:
Code:
-----------------
15.01.2014 07:59:19 UTC
Loading Xposed v42 (for Zygote)...
Loading modules from /data/app/net.treth.d.completekeyguarddisabler-2.apk
  Loading class net.treth.d.completekeyguarddisabler.CompleteKeyguardDisabler
In package com.android.keyguard [4.4]
hooking method doKeyguardLocked in class 'com.android.keyguard.KeyguardViewMediator'
hooking method adjustStatusBarLocked in class 'com.android.keyguard.KeyguardViewMediator'
Not adjusting the statusbar (and navigation bar) [hopefully]
Not locking the screen
Not adjusting the statusbar (and navigation bar) [hopefully]
Not locking the screen
This package seems like it could be a keyguard com.android.deskclock [SUPERDEBUG]
This package seems like it could be a keyguard com.teamkang.fauxclock [SUPERDEBUG]
Not locking the screen
This package seems like it could be a keyguard com.android.deskclock [SUPERDEBUG]
This package seems like it could be a keyguard pl.solidexplorer.unlocker [SUPERDEBUG]
Not locking the screen
This package seems like it could be a keyguard com.android.deskclock [SUPERDEBUG]
This package seems like it could be a keyguard net.nurik.roman.dashclock [SUPERDEBUG]
Not locking the screen
Not locking the screen
This package seems like it could be a keyguard net.nurik.roman.dashclock [SUPERDEBUG]
This package seems like it could be a keyguard pl.solidexplorer.unlocker [SUPERDEBUG]
This package seems like it could be a keyguard com.android.deskclock [SUPERDEBUG]
Not locking the screen
This package seems like it could be a keyguard net.nurik.roman.dashclock [SUPERDEBUG]
Not locking the screen
Not locking the screen
Not locking the screen
This package seems like it could be a keyguard net.nurik.roman.dashclock [SUPERDEBUG]
This package seems like it could be a keyguard pl.solidexplorer.unlocker [SUPERDEBUG]
This package seems like it could be a keyguard net.nurik.roman.dashclock [SUPERDEBUG]
This package seems like it could be a keyguard pl.solidexplorer.unlocker [SUPERDEBUG]
Not locking the screen
This package seems like it could be a keyguard net.nurik.roman.dashclock [SUPERDEBUG]
Not locking the screen
Not locking the screen
This package seems like it could be a keyguard net.nurik.roman.dashclock [SUPERDEBUG]
In package com.android.keyguard [4.4]
hooking method doKeyguardLocked in class 'com.android.keyguard.KeyguardViewMediator'
hooking method adjustStatusBarLocked in class 'com.android.keyguard.KeyguardViewMediator'
Not locking the screen
Not adjusting the statusbar (and navigation bar) [hopefully]
Not locking the screen
Not locking the screen
Not locking the screen
Not locking the screen
 
Last edited:

dtreth

Senior Member
Dec 12, 2013
59
20
1. Downloaded your updated module
2. Activated it
3. Set a Pin (0000)
4. Reboot
5. It asked me for the pin the first time
6. Standby
7. Wake-Up: Lockscreen Navigation bar; No Pin
8. Sent the log to my computer
9. Reproduced 6 & 7 for 3 more times.
10. Set keyguard to no lock -> Standby -> Normal Nav Bar (not on the log anymore)

Code:
-----------------
15.01.2014 07:59:19 UTC
Loading Xposed v42 (for Zygote)...
Loading modules from /data/app/net.treth.d.completekeyguarddisabler-2.apk
  Loading class net.treth.d.completekeyguarddisabler.CompleteKeyguardDisabler
In package com.android.keyguard [4.4]
hooking method doKeyguardLocked in class 'com.android.keyguard.KeyguardViewMediator'
hooking method adjustStatusBarLocked in class 'com.android.keyguard.KeyguardViewMediator'
Not adjusting the statusbar (and navigation bar) [hopefully]
Not locking the screen
Not adjusting the statusbar (and navigation bar) [hopefully]
Not locking the screen
This package seems like it could be a keyguard com.android.deskclock [SUPERDEBUG]
This package seems like it could be a keyguard com.teamkang.fauxclock [SUPERDEBUG]

I doubt fauxclock could be a keyguard, it's a kernel setup tool.

Oh more logs:
Code:
-----------------
15.01.2014 07:59:19 UTC
Loading Xposed v42 (for Zygote)...
Loading modules from /data/app/net.treth.d.completekeyguarddisabler-2.apk
  Loading class net.treth.d.completekeyguarddisabler.CompleteKeyguardDisabler
In package com.android.keyguard [4.4]
hooking method doKeyguardLocked in class 'com.android.keyguard.KeyguardViewMediator'
hooking method adjustStatusBarLocked in class 'com.android.keyguard.KeyguardViewMediator'
Not adjusting the statusbar (and navigation bar) [hopefully]
Not locking the screen
Not adjusting the statusbar (and navigation bar) [hopefully]
Not locking the screen
This package seems like it could be a keyguard com.android.deskclock [SUPERDEBUG]
This package seems like it could be a keyguard com.teamkang.fauxclock [SUPERDEBUG]
Not locking the screen
This package seems like it could be a keyguard com.android.deskclock [SUPERDEBUG]
This package seems like it could be a keyguard pl.solidexplorer.unlocker [SUPERDEBUG]
Not locking the screen
This package seems like it could be a keyguard com.android.deskclock [SUPERDEBUG]
This package seems like it could be a keyguard net.nurik.roman.dashclock [SUPERDEBUG]
Not locking the screen
Not locking the screen
This package seems like it could be a keyguard net.nurik.roman.dashclock [SUPERDEBUG]
This package seems like it could be a keyguard pl.solidexplorer.unlocker [SUPERDEBUG]
This package seems like it could be a keyguard com.android.deskclock [SUPERDEBUG]
Not locking the screen
This package seems like it could be a keyguard net.nurik.roman.dashclock [SUPERDEBUG]
Not locking the screen
Not locking the screen
Not locking the screen
This package seems like it could be a keyguard net.nurik.roman.dashclock [SUPERDEBUG]
This package seems like it could be a keyguard pl.solidexplorer.unlocker [SUPERDEBUG]
This package seems like it could be a keyguard net.nurik.roman.dashclock [SUPERDEBUG]
This package seems like it could be a keyguard pl.solidexplorer.unlocker [SUPERDEBUG]
Not locking the screen
This package seems like it could be a keyguard net.nurik.roman.dashclock [SUPERDEBUG]
Not locking the screen
Not locking the screen
This package seems like it could be a keyguard net.nurik.roman.dashclock [SUPERDEBUG]
In package com.android.keyguard [4.4]
hooking method doKeyguardLocked in class 'com.android.keyguard.KeyguardViewMediator'
hooking method adjustStatusBarLocked in class 'com.android.keyguard.KeyguardViewMediator'
Not locking the screen
Not adjusting the statusbar (and navigation bar) [hopefully]
Not locking the screen
Not locking the screen
Not locking the screen
Not locking the screen

Yeah, thanks. The [SUPERDEBUG] lines are just searching any loaded package that has "lock" or "guard" in the name. I found the samsung lockscreen this way: "com.sec.android.app.keyguard".

I am currently trying out a new hook spot for the show lockscreen part, but I doubt it'll affect your issue. It does, however, make the hack work smoother on my phone. I'll push that one soon. I still need to do some more digging in the code to even find points to test, and it's slow goign when I have no soft nav to play with. I think I will just have to buy that nexus 7 after all :silly:. (Really waiting as long as I can for a new Nexus 10)

It's weird that the statusbar log message appears to function almost at the right time. I wish there was a KeyguardDispatchNavigationUpdate or something, that would make this easy.
 

fabi280

Senior Member
Oct 20, 2010
347
365
Karlsruhe
I've got an idea. In the security settings there is something like automatically lock. If you set this value to not instant lock and the phone goes into standby by timeout you aren't asked for your pin.


So maybe you could override this value to like -1 or any other value it can't reach and link the powerbuttons standby to the timeout standby.

I'm not familiar with xposed module development, just did some heavy amount of Java coding for desktop/server applications... So this is just an idea, I'm unsure if it is doable.

If this would work fine it'd be an awesome solution for the VPN password requirements

Sent from my Nexus 4
 

dtreth

Senior Member
Dec 12, 2013
59
20
I've got an idea. In the security settings there is something like automatically lock. If you set this value to not instant lock and the phone goes into standby by timeout you aren't asked for your pin.


So maybe you could override this value to like -1 or any other value it can't reach and link the powerbuttons standby to the timeout standby.

I'm not familiar with xposed module development, just did some heavy amount of Java coding for desktop/server applications... So this is just an idea, I'm unsure if it is doable.

If this would work fine it'd be an awesome solution for the VPN password requirements

Sent from my Nexus 4

Yes, you have a very good point, although I think the problem there is the system could still call the lockscreen through other means, like upon first boot. That's not something we really want. Well, I don't really want that, but I'll definitely look into that.
 

dtreth

Senior Member
Dec 12, 2013
59
20
I've got an idea. In the security settings there is something like automatically lock. If you set this value to not instant lock and the phone goes into standby by timeout you aren't asked for your pin.


So maybe you could override this value to like -1 or any other value it can't reach and link the powerbuttons standby to the timeout standby.

I'm not familiar with xposed module development, just did some heavy amount of Java coding for desktop/server applications... So this is just an idea, I'm unsure if it is doable.

If this would work fine it'd be an awesome solution for the VPN password requirements

Sent from my Nexus 4

In the source of KeyguardViewMediator I found "Temporary enable/disable (e.g. the "back" button) are done in KeyguardHostView." so I am trying to also mock out showSecurityScreen there. Try this version and tell me what the logs say if it doesn't work. Also, if it almost works, but doesn't show recents, I can fix that pretty quickly.

FINGERS CROSSED! [NOTE: alpha build will NOT work on anything but 4.4 AOSP for this fix. I will build it for all if this is confirmed working. ]
 

Attachments

  • CompleteKeyguardDisabler-1.07a.apk
    259.8 KB · Views: 26

fabi280

Senior Member
Oct 20, 2010
347
365
Karlsruhe
In the source of KeyguardViewMediator I found "Temporary enable/disable (e.g. the "back" button) are done in KeyguardHostView." so I am trying to also mock out showSecurityScreen there. Try this version and tell me what the logs say if it doesn't work. Also, if it almost works, but doesn't show recents, I can fix that pretty quickly.

FINGERS CROSSED! [NOTE: alpha build will NOT work on anything but 4.4 AOSP for this fix. I will build it for all if this is confirmed working. ]

I think it could actually work if I'd use Stock AOSP and not Omni

Code:
-----------------
15.01.2014 21:56:44 UTC
Loading Xposed v42 (for Zygote)...
Loading modules from /data/app/net.treth.d.completekeyguarddisabler-1.apk
  Loading class net.treth.d.completekeyguarddisabler.CompleteKeyguardDisabler
In package com.android.keyguard [4.4]
hooking method showLocked in class 'com.android.keyguard.KeyguardViewMediator'
hooking method showSecurityScreen in class 'com.android.keyguard.KeyguardViewHost'
de.robv.android.xposed.XposedHelpers$ClassNotFoundError: java.lang.ClassNotFoundException: com.android.keyguard.KeyguardViewHost
	at de.robv.android.xposed.XposedHelpers.findClass(XposedHelpers.java:52)
	at de.robv.android.xposed.XposedHelpers.findAndHookMethod(XposedHelpers.java:179)
	at net.treth.d.completekeyguarddisabler.CompleteKeyguardDisabler.handleLoadPackage(CompleteKeyguardDisabler.java:37)
	at de.robv.android.xposed.IXposedHookLoadPackage$Wrapper.handleLoadPackage(IXposedHookLoadPackage.java:20)
	at de.robv.android.xposed.callbacks.XC_LoadPackage.call(XC_LoadPackage.java:34)
	at de.robv.android.xposed.callbacks.XCallback.callAll(XCallback.java:70)
	at de.robv.android.xposed.XposedBridge$2.beforeHookedMethod(XposedBridge.java:202)
	at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:527)
	at android.app.ActivityThread.handleBindApplication(Native Method)
	at android.app.ActivityThread.access$1500(ActivityThread.java:135)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loop(Looper.java:136)
	at android.app.ActivityThread.main(ActivityThread.java:5017)
	at java.lang.reflect.Method.invokeNative(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:515)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
	at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:126)
	at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: com.android.keyguard.KeyguardViewHost
	at java.lang.Class.classForName(Native Method)
	at java.lang.Class.forName(Class.java:251)
	at external.org.apache.commons.lang3.ClassUtils.getClass(ClassUtils.java:823)
	at de.robv.android.xposed.XposedHelpers.findClass(XposedHelpers.java:50)
	... 19 more
Caused by: java.lang.NoClassDefFoundError: com/android/keyguard/KeyguardViewHost
	... 23 more
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.android.keyguard.KeyguardViewHost" on path: DexPathList[[zip file "/system/priv-app/Keyguard.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
	... 23 more
Not locking the screen
Not locking the screen
Not locking the screen
Not locking the screen
Not locking the screen

I've noticed that effect also on the Active Display feature of the rom. I guess they have fixed it...

Take a look at this:
https://github.com/omnirom/android_...r/policy/activedisplay/ActiveDisplayView.java
Line 675
Code:
    private void unlockKeyguardActivity() {
        try {
             // The intent we are sending is for the application, which
             // won't have permission to immediately start an activity after
             // the user switches to home.  We know it is safe to do at this
             // point, so make sure new activity switches are now allowed.
             ActivityManagerNative.getDefault().resumeAppSwitches();
             // Also, notifications can be launched from the lock screen,
             // so dismiss the lock screen when the activity starts.
             ActivityManagerNative.getDefault().dismissKeyguardOnNextActivity();
        } catch (RemoteException e) {
        }
        handleForceHideNotificationView();
    }

I guess this could help

This was the change that fixed it - at least I'm thinking that it would be: https://github.com/omnirom/android_frameworks_base/commit/72642b27a90bc760ee803c40a15c164a6a2ffa1c
Look at Line 645-660
 

dtreth

Senior Member
Dec 12, 2013
59
20
I think it could actually work if I'd use Stock AOSP and not Omni

Code:
-----------------
15.01.2014 21:56:44 UTC
Loading Xposed v42 (for Zygote)...
Loading modules from /data/app/net.treth.d.completekeyguarddisabler-1.apk
  Loading class net.treth.d.completekeyguarddisabler.CompleteKeyguardDisabler
In package com.android.keyguard [4.4]
hooking method showLocked in class 'com.android.keyguard.KeyguardViewMediator'
hooking method showSecurityScreen in class 'com.android.keyguard.KeyguardViewHost'
de.robv.android.xposed.XposedHelpers$ClassNotFoundError: java.lang.ClassNotFoundException: com.android.keyguard.KeyguardViewHost
	at de.robv.android.xposed.XposedHelpers.findClass(XposedHelpers.java:52)
	at de.robv.android.xposed.XposedHelpers.findAndHookMethod(XposedHelpers.java:179)
	at net.treth.d.completekeyguarddisabler.CompleteKeyguardDisabler.handleLoadPackage(CompleteKeyguardDisabler.java:37)
	at de.robv.android.xposed.IXposedHookLoadPackage$Wrapper.handleLoadPackage(IXposedHookLoadPackage.java:20)
	at de.robv.android.xposed.callbacks.XC_LoadPackage.call(XC_LoadPackage.java:34)
	at de.robv.android.xposed.callbacks.XCallback.callAll(XCallback.java:70)
	at de.robv.android.xposed.XposedBridge$2.beforeHookedMethod(XposedBridge.java:202)
	at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:527)
	at android.app.ActivityThread.handleBindApplication(Native Method)
	at android.app.ActivityThread.access$1500(ActivityThread.java:135)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loop(Looper.java:136)
	at android.app.ActivityThread.main(ActivityThread.java:5017)
	at java.lang.reflect.Method.invokeNative(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:515)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
	at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:126)
	at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: com.android.keyguard.KeyguardViewHost
	at java.lang.Class.classForName(Native Method)
	at java.lang.Class.forName(Class.java:251)
	at external.org.apache.commons.lang3.ClassUtils.getClass(ClassUtils.java:823)
	at de.robv.android.xposed.XposedHelpers.findClass(XposedHelpers.java:50)
	... 19 more
Caused by: java.lang.NoClassDefFoundError: com/android/keyguard/KeyguardViewHost
	... 23 more
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.android.keyguard.KeyguardViewHost" on path: DexPathList[[zip file "/system/priv-app/Keyguard.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
	... 23 more
Not locking the screen
Not locking the screen
Not locking the screen
Not locking the screen
Not locking the screen

I've noticed that effect also on the Active Display feature of the rom. I guess they have fixed it...

Take a look at this:
https://github.com/omnirom/android_...r/policy/activedisplay/ActiveDisplayView.java
Line 675
Code:
    private void unlockKeyguardActivity() {
        try {
             // The intent we are sending is for the application, which
             // won't have permission to immediately start an activity after
             // the user switches to home.  We know it is safe to do at this
             // point, so make sure new activity switches are now allowed.
             ActivityManagerNative.getDefault().resumeAppSwitches();
             // Also, notifications can be launched from the lock screen,
             // so dismiss the lock screen when the activity starts.
             ActivityManagerNative.getDefault().dismissKeyguardOnNextActivity();
        } catch (RemoteException e) {
        }
        handleForceHideNotificationView();
    }

I guess this could help

This was the change that fixed it - at least I'm thinking that it would be: https://github.com/omnirom/android_frameworks_base/commit/72642b27a90bc760ee803c40a15c164a6a2ffa1c
Look at Line 645-660

Yeah, that build had, like, 6 typos in it, sorry. I cannot use that idea as posted (already tried it earlier and it completely borks), due to the way I slice into the keyguard and disable the lock. Somewhere there's a message that gets sent out to the navbar, I just can't find it. It doesn't help that if you google "navigation bar" google's results are full of "action bar" either....

Well, I cleaned some things up, this one shouldn't give you any exceptions, but I'd bet it still won't work. I'm gonna just buy a Nexus I think. I wanted one anyway. But I'll spend tonight trying to understand the navigation bar code and seeing if I can get it from that side.

In a related note, if anyone just wants to mock out a method, I wrote this snippet that simplifies the Xposed work:
Code:
private boolean mockOutMethod(final String logMessage,
								  ClassLoader cl,
								  String className, 
								  String methodName, 
								  Object... parameterTypes) {
		try {
			XposedBridge.log("hooking method '" + methodName + "' in class '" + className + "'");
			// create the XCReplacement
			XC_MethodReplacement mockOut = new XC_MethodReplacement() {
				// do a full replacement of the method
				@Override
				protected Object replaceHookedMethod(MethodHookParam param) throws Throwable {
					// do nothing, but log it
					XposedBridge.log(logMessage);
					return null;
				}
			};
			// build the parameter list
			Object[] parameterTypesAndCallback = Arrays.copyOf(parameterTypes, parameterTypes.length + 1);
			parameterTypesAndCallback[parameterTypes.length] = mockOut;
			// actually hook the method
			XposedHelpers.findAndHookMethod(
				className, 
				cl,
				methodName, parameterTypesAndCallback);
	
		}
		catch (Throwable t) {
			XposedBridge.log(t);
			XposedBridge.log("hook method failed: '" + className + "." + methodName + "'");
			return false;
		}
		return true;
	}
 

Attachments

  • CompleteKeyguardDisabler-1.09a.apk
    259.8 KB · Views: 16
Last edited:

fabi280

Senior Member
Oct 20, 2010
347
365
Karlsruhe
Yeah, that build had, like, 6 typos in it, sorry. I cannot use that idea as posted (already tried it earlier and it completely borks), due to the way I slice into the keyguard and disable the lock. Somewhere there's a message that gets sent out to the navbar, I just can't find it. It doesn't help that if you google "navigation bar" google's results are full of "action bar" either....

Well, I cleaned some things up, this one shouldn't give you any exceptions, but I'd bet it still won't work. I'm gonna just buy a Nexus I think. I wanted one anyway. But I'll spend tonight trying to understand the navigation bar code and seeing if I can get it from that side.

Code:
16.01.2014 00:25:17 UTC
Loading Xposed v42 (for Zygote)...
Loading modules from /data/app/net.treth.d.completekeyguarddisabler-2.apk
  Loading class net.treth.d.completekeyguarddisabler.CompleteKeyguardDisabler
In package com.android.keyguard [4.4]
hooking method 'showLocked' in class 'com.android.keyguard.KeyguardViewMediator'
hooking method 'showSecurityScreen' in class 'com.android.keyguard.KeyguardHostView'
Not locking the screen
Not showing the screen
Not showing the screen
Not locking the screen
Not locking the screen

Upon reboot after the update (with "slide away" keyguard) I had a lockscreen without any unlock element and a home button :eek:

But after the first lock and unlock it showed the Lockscreen Navbar
 

Top Liked Posts

  • There are no posts matching your filters.
  • 8
    NEW! Navbar button issue appears to have been resolved.

    This is my first go at an Xposed module, or any Android app for that matter, so wish me luck!

    Intro:
    Anyway, I was using a lot of Xposed mods that were cool, but my IT policy has the lockscreen set to pin or password and none of the bypasses around quite gave me what I wanted. LucasR93 created this really nice mod for those of you that really like just a sliding lock on your screen, but I really wanted to use the fantastic NFCSecure Lockscreen, which works best with no lockscreen enabled at all. (PS. you guys should check out NFCSecure, it's so much easier than even a pattern! And the developer is pretty responsive, open to any suggestions you have. *this spot is not paid for by the developer of the app. I just really like it that much*)
    So, I made my own mod.

    What it does:
    The mod utilizes the Xposed Framework to find the KeyguardViewMediator class and hook the doKeyguardLocked method, completely mocking it out. Therefore, any time the system tries to lock the screen it'll just go down the memory hole, and do nothing. Thus, even if you have a device policy mandating a pin/password the phone will never lock, ever.

    This works like the aforementioned mod by LucasR93, in that it doesn't touch the actual lock policy or setup; if you go into your settings, to the security section, you will see all of the settings as normal. Nothing that needs the pin/password will complain because as far as they know it works just fine. This is (IMHO) much safer than attacking the policy and security parts of the OS directly, as they could open some more serious vulnerabilities.

    What devices this mod works on:
    I only have a Droid MAXX running 4.4 right now, but the way the code is implemented it should be able to work on anything 4.0+ and AOSPish, as long as Xposed Framework works properly.

    Nexus 4 and Nexus 5 reported working, KitKat stock and ParanoidAndroid ROM.

    I'd like to formally request anyone running Xposed on 4.0-4.3 to test this and give feedback as to if it works on these devices.
    I am using some of the info provided to LucasR93 to try to also add support for the HTC lockscreen but I'll need some HTC testers for that one.

    Installation Instructions:
    Ensure that the Xposed Framework (a.k.a. Xposed Installer) is installed and properly functioning on your device.
    Go to the Download section of the Xposed Installer, or here, to find the Complete Keyguard Disabler. Check the box in the Xposed Installer Modules list, and reboot the phone.
    Upon reboot, you may or may not see your lockscreen. Some devices (Nexus devices it seems) show the lockscreen on boot, but never again. Some devices (Droid line, possibly Moto X) are completely unlocked upon reboot.
    Every time your phone would normally lock, a log entry will be written to the Xposed log "Not locking the screen".

    If it doesn't work:
    Uncheck all other Xposed modules. Reboot. If it still doesn't work, copy the logs from the Xposed Installer and post them in this thread, with your phone model and Android version, and I'll try to help.

    This new experimental build tries a few things, and logs a LOT of things. Try it out.

    Is this unsafe?
    Actually, maybe. If you lose your phone you will be unable to lock it remotely by using Android Device Manager (or probably carrier/manufacturer/corporate specific device admins as well). You can, however, locate and wipe without issue.

    I am pondering a way to detect the ADM lock and toggle the screen, but if you use this to get NFC lockscreens working it's not something you have to worry about.

    Special Thanks: @rovo89, obviously, for the Xposed Framework. @LucasR93, for his initial app that gave me most of the inspiration for this.
    1
    No, it doesn't matter which keyguard Mode i've set up before rebooting.
    As soon as I am locking the phone I'm getting the Lockscreen navigation bar on unlocking again.
    The only way to get back to normal is setting to no keyguard. And if I reboot without keyguard set, they don't switch to Lockscreen navigation bar after locking and unlocking.

    Sorry English isn't my mother's tongue

    Gesendet von meinem Nexus 4

    Don't apologize, I was getting very specific and you responded prefectly. Thanks. I'll get a new version uploaded later today, with some exploration code to uncover what's causing this.
    1
    No, it doesn't matter which keyguard Mode i've set up before rebooting.
    As soon as I am locking the phone I'm getting the Lockscreen navigation bar on unlocking again.
    The only way to get back to normal is setting to no keyguard. And if I reboot without keyguard set, they don't switch to Lockscreen navigation bar after locking and unlocking.

    Sorry English isn't my mother's tongue

    Gesendet von meinem Nexus 4

    Try this new build. I will be updating the OP soon.

    Does not work on my S4 :(

    No relevant logs found to post :/

    Also try this new build. It has Experimental SUPERDEBUG enabled, which is just me looking for possible apks to hack on others' phones.
    1
    Hi a little off topic.

    What is the mod to add this arrow and camara's icon at the end of the screen? tks

    It's not a mod. It was a bug.
    The Nexus 4 has no hardware navigation keys (home, back, multitasking), so it uses a navigation bar.
    The navigation bar is onscreen, which means a part of your screen is nearly always "wasted" (there is an immersive mode which hides the status bar).
    On the lockscreen you aren't allowed to press the home/back or multitasking button, but you can go to a "locked" camera (which doesn't allow you to go back to your homescreen if your device has a security method turned on) or you can use Google Now (the arrow; I don't know what happens if you start it with a security method turned on).

    So yeah, at the first few versions there was this bug, but now it's eliminated (dtreth and me worked together by mail).
    It was a big problem because you weren't able to go back / to the homescreen.
    1
    I love this app. It used to work perfectly on my HTC one m8. Can you please feed it to support galaxy s5 as well?

    Edit: Works perfectly on my s5 now.

    Sent from my SM-G900T using Tapatalk