[HOWTO] Show lockscreen before launcher after reboot.

Search This thread

sorg

Senior Member
Sep 5, 2006
1,049
1,137
台灣
Hi,

Since android started to use keyguard as separate package, one bug always disturbed me: When device boots, it shows the launcher with home screen and then in couple of seconds the lockscreen.
To my surprise, when i start to work with Note 4 ROM I've discovered the absence of such bug! Lockscreen shown first after animated boot logo.

So, here is the fix.
You need to decompile Keyguard.apk by Apktool and then in AndroidManifest.xml replace:
Code:
    <application android:label="@string/app_name" android:largeHeap="true" android:persistent="true" android:process="com.android.[B][COLOR=Red]systemui[/COLOR][/B]" android:supportsRtl="true">
to (note the red part)
Code:
    <application android:label="@string/app_name"  android:largeHeap="true" android:persistent="true"  android:process="com.android.[B][COLOR=Red]keyguard[/COLOR][/B]" android:supportsRtl="true">
Then compile Keyguard.apk and push it to device (/system/priv-app).
From now, keyguard will have its own process and won't affect SystemUI even if FC (the same SystemUI won't crash Keyguard if FC).

Probably, this bug belongs to Samsung. I think most pre-Note4 devices with KitKat are affected and can be fixed as shown above. The line can look a little different, but you should find the first red part and replace by second red part without touching anything not red.

Devs can freely use this fix without permission. Just give a proper credit.
 
Last edited:

ocd_amp

Senior Member
May 28, 2014
373
202
Will report to you when I get around to Testing this.

I cannot believe so many ROM Devs over look this. This happened to me today after a Dalvik/Cache wipe.

After "Android is Upgrading" message was over, the Phone showed the Launcher/HomeScreen and then the Lock Screen show after 2 seconds.

This is very unprofessional. ROMS with this issue should never be allowed to ship with this "feature". This is akin to your arrive at your house, your front door opens, so everyone can see inside, then quickly closes, and then you have to use your key to get in.

Thanks for your post,

Kind Regards.

As i've wrote above, lockscreen is the first thing u see after animated boot logo.
 

cstayton

Inactive Recognized Developer
Mar 5, 2011
2,591
4,087
Waite Park, MN.
just tested on Keyguard.apk from OEM G900FXXU1ANJ1 build, unfortunately this doesn't work it kills the keyguard completely and causes errors with the fingerprint sensor.
 

ocd_amp

Senior Member
May 28, 2014
373
202
Had trouble even compiling the apk, something about my machine and java not liking each other perhaps. But the rest of my stuff works so...if I'm not sure what's broke.... Then what I thought was done (compiling process froze), looks like it didnt work here either on CM 11, Complete fail to even boot the first time. No message, nothing. Wipe Dalvik, Put backup APK, then Force closes next time around. I may have more than 1 problem though. Whatever this bug is, its a major oversight on the way KitKat works, and it looks unprofessional in the face of competing products. Why do you think they let this Slip?
 

sorg

Senior Member
Sep 5, 2006
1,049
1,137
台灣
just tested on Keyguard.apk from OEM G900FXXU1ANJ1 build, unfortunately this doesn't work it kills the keyguard completely and causes errors with the fingerprint sensor.
Since you are "recognized developer", i think you should have more experience to track the problems than just describe what you see. At least you can look into logcat to check what exactly causes the problem. May be old settings (data folder) of keyguard conflicts with new process id.
Generally speaking, my SHV-E330S is the same as your SM-G900F. Even ROMs from G900F with some tweaks can work on my E330S device. Thus, I think this tweak should be compatible. There is a little chance that fingerprint service prevents it from working, but i really doubt.
If you believe you made the change correctly, then make full backup of device (in TWRP or CWM), then do a master reset and check if problem still exists. Sometimes, if i see strange things, i do this way to make sure where the problem comes. And without checking logcat there is a little (if none) chance to understand where is the problem.
 
Last edited:

cstayton

Inactive Recognized Developer
Mar 5, 2011
2,591
4,087
Waite Park, MN.
Since you are "recognized developer", i think you should have more experience to track the problems than just describe what you see. At least you can look into logcat to check what exactly causes the problem. May be old settings (data folder) of keyguard conflicts with new process id.
Generally speaking, my SHV-E330S is the same as your SM-G900F. Even ROMs from G900F with some tweaks can work on my E330S device. Thus, I think this tweak should be compatible. There is a little chance that fingerprint service prevents it from working, but i really doubt.
If you believe you made the change correctly, then make full backup of device (in TWRP or CWM), then do a master reset and check if problem still exists. Sometimes, if i see strange things, i do this way to make sure where the problem comes. And without checking logcat there is a little (if none) chance to understand where is the problem.

OK, first off log cats are eronious and rarely provide accurate reflection of issues that's why using the app log created in /data/log is prefered. Second your assuming I didn't check any logs. Third I did none where created. Fourth I am well aware of processes and how things work I have been a developer by profession for nearly 20 years.

I merely posted as a note that it did not work I did not ask for nor do I need support from you for your mod.

Thanks for your reply. :thumbdown:

Sent from my SAMSUNG-SM-G900A using XDA Free mobile app
 

ocd_amp

Senior Member
May 28, 2014
373
202
Ok, so aside from the little skirmish, if you fix this problem can you wake up the CM team and let them know about it?

It seems an overall KitKat CM based issue. It is not working in my Galaxy S2 Skyrocket, and not working in my Galaxy S3 D2LTE. I cannot even decompile the apk now, even though I have the proper tools and I can even use zipsigner to sign this thing right on the device if needed. However, I am having Java issues. So if you've got something that works, please post and make it known.

btw, no logs were created in /data

Phone simply stuck on boot is the result. CM Keyguard = Kaput.

OK, first off log cats are eronious and rarely provide accurate reflection of issues that's why using the app log created in /data/log is prefered. Second your assuming I didn't check any logs. Third I did none where created. Fourth I am well aware of processes and how things work I have been a developer by profession for nearly 20 years.

I merely posted as a note that it did not work I did not ask for nor do I need support from you for your mod.

Thanks for your reply. :thumbdown:

Sent from my SAMSUNG-SM-G900A using XDA Free mobile app
 

slimshouki

Senior Member
Dec 5, 2012
713
142
Hi,

Since android started to use keyguard as separate package, one bug always disturbed me: When device boots, it shows the launcher with home screen and then in couple of seconds the lockscreen.
To my surprise, when i start to work with Note 4 ROM I've discovered the absence of such bug! Lockscreen shown first after animated boot logo.

So, here is the fix.
You need to decompile Keyguard.apk by Apktool and then in AndroidManifest.xml replace:
Code:
    <application android:label="@string/app_name" android:largeHeap="true" android:persistent="true" android:process="com.android.[B][COLOR=Red]systemui[/COLOR][/B]" android:supportsRtl="true">
to (note the red part)
Code:
    <application android:label="@string/app_name"  android:largeHeap="true" android:persistent="true"  android:process="com.android.[B][COLOR=Red]keyguard[/COLOR][/B]" android:supportsRtl="true">
Then compile Keyguard.apk and push it to device (/system/priv-app).
From now, keyguard will have its own process and won't affect SystemUI even if FC (the same SystemUI won't crash Keyguard if FC).

Probably, this bug belongs to Samsung. I think most pre-Note4 devices with KitKat are affected and can be fixed as shown above. The line can look a little different, but you should find the first red part and replace by second red part without touching anything not red.

Devs can freely use this fix without permission. Just give a proper credit.

There is no keyguard.apk in lollipop 5.0.1 for e330s !!
 

Geris

Senior Member
Dec 26, 2010
399
870
campinas
plus.google.com
Hi,

Since android started to use keyguard as separate package, one bug always disturbed me: When device boots, it shows the launcher with home screen and then in couple of seconds the lockscreen.
To my surprise, when i start to work with Note 4 ROM I've discovered the absence of such bug! Lockscreen shown first after animated boot logo.

So, here is the fix.
You need to decompile Keyguard.apk by Apktool and then in AndroidManifest.xml replace:
Code:
    <application android:label="@string/app_name" android:largeHeap="true" android:persistent="true" android:process="com.android.[B][COLOR=Red]systemui[/COLOR][/B]" android:supportsRtl="true">
to (note the red part)
Code:
    <application android:label="@string/app_name"  android:largeHeap="true" android:persistent="true"  android:process="com.android.[B][COLOR=Red]keyguard[/COLOR][/B]" android:supportsRtl="true">
Then compile Keyguard.apk and push it to device (/system/priv-app).
From now, keyguard will have its own process and won't affect SystemUI even if FC (the same SystemUI won't crash Keyguard if FC).

Probably, this bug belongs to Samsung. I think most pre-Note4 devices with KitKat are affected and can be fixed as shown above. The line can look a little different, but you should find the first red part and replace by second red part without touching anything not red.

Devs can freely use this fix without permission. Just give a proper credit.

how to make the galaxy s5 has Keyguard.apk ?
 

ocd_amp

Senior Member
May 28, 2014
373
202
I can see this is bothering a lot of people. I am still working on it. If I have good news I will post it here. The OP of this thread gave VERY little information on what is to be actually done. If I get this figured out, I will post a whole new thread with instructions on how to do it.
 
  • Like
Reactions: Geris

ocd_amp

Senior Member
May 28, 2014
373
202
After spending close to 3 hours on this, and meticulously looking at every line, every resource, I think this is a closed source issue. I am coming to a conclusion that Cyanogenmod steals, borrows, hacks, bribes, whatever it takes to get their product out as fast as possible without proper testing. I am willing to bet this issue affects thousands of CM11 users that are out there. Every single person I know on Kitkat with a Samsung phone has this problem. I am sorely disappointed with this and I find it hard to believe that many ROM devs have been quiet about it. For now, there is nothing I can do unless someone with higher knowledge comes in here and guides me so I can fix this problem for everyone.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 9
    Hi,

    Since android started to use keyguard as separate package, one bug always disturbed me: When device boots, it shows the launcher with home screen and then in couple of seconds the lockscreen.
    To my surprise, when i start to work with Note 4 ROM I've discovered the absence of such bug! Lockscreen shown first after animated boot logo.

    So, here is the fix.
    You need to decompile Keyguard.apk by Apktool and then in AndroidManifest.xml replace:
    Code:
        <application android:label="@string/app_name" android:largeHeap="true" android:persistent="true" android:process="com.android.[B][COLOR=Red]systemui[/COLOR][/B]" android:supportsRtl="true">
    to (note the red part)
    Code:
        <application android:label="@string/app_name"  android:largeHeap="true" android:persistent="true"  android:process="com.android.[B][COLOR=Red]keyguard[/COLOR][/B]" android:supportsRtl="true">
    Then compile Keyguard.apk and push it to device (/system/priv-app).
    From now, keyguard will have its own process and won't affect SystemUI even if FC (the same SystemUI won't crash Keyguard if FC).

    Probably, this bug belongs to Samsung. I think most pre-Note4 devices with KitKat are affected and can be fixed as shown above. The line can look a little different, but you should find the first red part and replace by second red part without touching anything not red.

    Devs can freely use this fix without permission. Just give a proper credit.
    1
    so now the lockscreen appears immediatly? :p
    As i've wrote above, lockscreen is the first thing u see after animated boot logo.
    1
    I can see this is bothering a lot of people. I am still working on it. If I have good news I will post it here. The OP of this thread gave VERY little information on what is to be actually done. If I get this figured out, I will post a whole new thread with instructions on how to do it.
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone