Guide to fixing s2 lockscreen crash

Search This thread

ThE_MarD

Recognized Developer
Dec 10, 2014
3,848
4,605
Grande Prairie
LeEco Le Max 2
Moto X4
Heyyo, update on the lockscreen crashing bug! I think I figured out the REAL culprit!

  1. Backup EVERYTHING important off of your device, as this WILL completely wipe your userdata (internal storage).
  2. (optional) Create a TWRP backup of data.
  3. Reboot to boot loader
  4. Please ensure you have adb and fastboot installed on your PC's OS.
  5. fastboot format -w userdata
  6. Reboot to system
  7. (optional) Reboot to recovery and in Settings enable "Use rm -rf instead of formatting" and restore a TWRP data backup.
  8. Setup lockscreen security and reboot a lot of times and see if it works ok and then report back your results.

NOTES:
please use the official platform tools for Android adb and fastboot from here:
https://developer.android.com/studio/releases/platform-tools

I think the issue could be stemming from TWRP and the broken format function from the encryption footer days... Which could also explain why only some users who did format data were affected by this bug.

I know this fix has worked for 2 zl1 users from the Le Pro3 Telegram group, 2 x2 users from Le Max 2 Telegram group and another 3 x2 users from XDA.

Revisions:
Apr9, 2019 - added optional step to restore TWRP data backup
Apr25, 2019 - droped "-u" from format instructions as older versions of fastboot doesn't seem to have it
Sept6, 2019 - added recommended version of platform tools for adb and fastboot from Google
 
Last edited:

ImSpecialNot

Member
Nov 18, 2011
47
39
Tanta - طنطا
thanks I faced the same issue and fixed it using your method.

just a single modification as the command "fastboot format -u -w userdata" didn't work on windows using the latest fastboot,
it said "unknown option -- u"
so I formatted userdata using twrp and it worked successfully

thanks a lot :)
 
  • Like
Reactions: ThE_MarD

etijer

Member
Nov 12, 2013
41
3
Is a permanent solution or every time you change rom you have to reformat data in FastBoot?
To me, what gives me problems is the entry screen of the phone card pin (SIM) not the pin of Android, when I try to install AEX 6.4, I serve this to fix it?
Thank you

Enviado desde mi X52X mediante Tapatalk
 

ThE_MarD

Recognized Developer
Dec 10, 2014
3,848
4,605
Grande Prairie
LeEco Le Max 2
Moto X4
thanks I faced the same issue and fixed it using your method.

just a single modification as the command "fastboot format -u -w userdata" didn't work on windows using the latest fastboot,
it said "unknown option -- u"
so I formatted userdata using twrp and it worked successfully

thanks a lot :)
Heyyo, glad to hear this worked for you and @Rk585 ! :)

I guess fastboot on Windows isn't as up to date as the one for Linux? Is that the official fastboot from Google or a different one? I'll drop -u from my guide I guess as it shouldn't be critical for it to work.

fastboot format --help
Code:
-u            Do not erase partition before formatting.

Is a permanent solution or every time you change rom you have to reformat data in FastBoot?
To me, what gives me problems is the entry screen of the phone card pin (SIM) not the pin of Android, when I try to install AEX 6.4, I serve this to fix it?
Thank you

Enviado desde mi X52X mediante Tapatalk
It's permanent. The issue was caused by an old version of TWRP that had a bugged format data function. Formatting via fastboot is a permanent solution as it properly restores the encryption footer where-as sometimes even on newer TWRP it might not do so.

Private Unlock Key (PUK) is what you are referring to for unlocking your SIM card with a pin. That sounds like it could be a ROM-specific problem as I have heard for Le Pro3 builds of some ROMs that PUK doesn't work yet LineageOS 16.0 for x2 and zl1 does. I'd recommend reporting that bug to the s2 maintainer for AEX.
 
  • Like
Reactions: etijer

etijer

Member
Nov 12, 2013
41
3
Heyyo, glad to hear this worked for you and @Rk585 ! :)



I guess fastboot on Windows isn't as up to date as the one for Linux? Is that the official fastboot from Google or a different one? I'll drop -u from my guide I guess as it shouldn't be critical for it to work.



fastboot format --help

Code:
-u            Do not erase partition before formatting.





It's permanent. The issue was caused by an old version of TWRP that had a bugged format data function. Formatting via fastboot is a permanent solution as it properly restores the encryption footer where-as sometimes even on newer TWRP it might not do so.



Private Unlock Key (PUK) is what you are referring to for unlocking your SIM card with a pin. That sounds like it could be a ROM-specific problem as I have heard for Le Pro3 builds of some ROMs that PUK doesn't work yet LineageOS 16.0 for x2 and zl1 does. I'd recommend reporting that bug to the s2 maintainer for AEX.
At first I thought that, could be specific problem of the ROM, but I tried with other (pixel, Havoc, R. R and LINEAGEOS) all with the same result, they stay in loop on the screen of the phone card... If I try to boot without SIM card, I have problems with WiFi, connect but without Internet...
When I find time, I will try to format by FastBoot and comment the results... I understand that when formatting by fastboot, at least I will have the ROM installed clean, no?
Thank you

Enviado desde mi X52X mediante Tapatalk
 

ThE_MarD

Recognized Developer
Dec 10, 2014
3,848
4,605
Grande Prairie
LeEco Le Max 2
Moto X4
Heyyo @etijer , formatting with fastboot will completely wipe out all user data including any downloads or extra files on the device. Performing a full wipe and installing the ROM from scratch is optional but I'd recommend it to avoid any issues from a formatted user data partition.
 

kaew158

Senior Member
Nov 3, 2015
296
40
Or maybe you could just delete locksettings.db from /data/system and then look for a workaround.
Might save you the hassle!

How to delete locksettings.db when it screen locked?
First time locked, I fixed by fastboot format -w userdata and try aosp/crdroid/hovac last build then screen lock again. Yesterday I just format userdata again.)
 

E44O4

New member
Oct 20, 2019
2
0
How to delete locksettings.db when it screen locked?
First time locked, I fixed by fastboot format -w userdata and try aosp/crdroid/hovac last build then screen lock again. Yesterday I just format userdata again.)

Just reboot to recovery mode select advanced option there u can access file manager then just follow the path i.e. /data/system/locksettings.db and delete it.... now reboot the rom...Now when u swipe it will normally unlock ur phones.....
 

niyaziwaqar

Member
Aug 24, 2017
13
2
DeadMan
truthwuth.com
How to delete locksettings.db when it screen locked?
First time locked, I fixed by fastboot format -w userdata and try aosp/crdroid/hovac last build then screen lock again. Yesterday I just format userdata again.)

Even after deleting it, it might happen again after some reboots and you have to re-delete it. It happens in most of the pie ROMs.
The fix with fastboot provided in this thread is permanent and I believe the only solution. Though it didn't worked for me. I must be doing it wrong.
Might work for you.
 

kaew158

Senior Member
Nov 3, 2015
296
40
Even after deleting it, it might happen again after some reboots and you have to re-delete it. It happens in most of the pie ROMs.
The fix with fastboot provided in this thread is permanent and I believe the only solution. Though it didn't worked for me. I must be doing it wrong.
Might work for you.

Thank you.
 

unclee

Member
Jun 29, 2019
5
0
Heyyo @etijer , formatting with fastboot will completely wipe out all user data including any downloads or extra files on the device. Performing a full wipe and installing the ROM from scratch is optional but I'd recommend it to avoid any issues from a formatted user data partition.

Hi can I do this fix without PC? tia
 

unclee

Member
Jun 29, 2019
5
0
thanks I faced the same issue and fixed it using your method.

just a single modification as the command "fastboot format -u -w userdata" didn't work on windows using the latest fastboot,
it said "unknown option -- u"
so I formatted userdata using twrp and it worked successfully

thanks a lot :)

So can I fix this bug using the devices recovery without using a computer? Userdata as in internal storage?
 

Cleezy

New member
Mar 16, 2019
2
0
@unclee, you can try via only TWRP but from my tests in the past it did not solve it as it never restored the encryption footer. Only the fastboot format command restored the encryption footer for me.
If I were to use this command "fastboot format userdata"? Will it erase my Internal Storage or Media? Or just the Data /System ? And If I decided to format via TWRP what partition will I format should I check the Internal Storage or just data System?
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 8
    Heyyo, update on the lockscreen crashing bug! I think I figured out the REAL culprit!

    1. Backup EVERYTHING important off of your device, as this WILL completely wipe your userdata (internal storage).
    2. (optional) Create a TWRP backup of data.
    3. Reboot to boot loader
    4. Please ensure you have adb and fastboot installed on your PC's OS.
    5. fastboot format -w userdata
    6. Reboot to system
    7. (optional) Reboot to recovery and in Settings enable "Use rm -rf instead of formatting" and restore a TWRP data backup.
    8. Setup lockscreen security and reboot a lot of times and see if it works ok and then report back your results.

    NOTES:
    please use the official platform tools for Android adb and fastboot from here:
    https://developer.android.com/studio/releases/platform-tools

    I think the issue could be stemming from TWRP and the broken format function from the encryption footer days... Which could also explain why only some users who did format data were affected by this bug.

    I know this fix has worked for 2 zl1 users from the Le Pro3 Telegram group, 2 x2 users from Le Max 2 Telegram group and another 3 x2 users from XDA.

    Revisions:
    Apr9, 2019 - added optional step to restore TWRP data backup
    Apr25, 2019 - droped "-u" from format instructions as older versions of fastboot doesn't seem to have it
    Sept6, 2019 - added recommended version of platform tools for adb and fastboot from Google
    2
    @unclee, you can try via only TWRP but from my tests in the past it did not solve it as it never restored the encryption footer. Only the fastboot format command restored the encryption footer for me.
    1
    Works on s2. Can confirm :)
    1
    thanks I faced the same issue and fixed it using your method.

    just a single modification as the command "fastboot format -u -w userdata" didn't work on windows using the latest fastboot,
    it said "unknown option -- u"
    so I formatted userdata using twrp and it worked successfully

    thanks a lot :)
    1
    thanks I faced the same issue and fixed it using your method.

    just a single modification as the command "fastboot format -u -w userdata" didn't work on windows using the latest fastboot,
    it said "unknown option -- u"
    so I formatted userdata using twrp and it worked successfully

    thanks a lot :)
    Heyyo, glad to hear this worked for you and @Rk585 ! :)

    I guess fastboot on Windows isn't as up to date as the one for Linux? Is that the official fastboot from Google or a different one? I'll drop -u from my guide I guess as it shouldn't be critical for it to work.

    fastboot format --help
    Code:
    -u            Do not erase partition before formatting.

    Is a permanent solution or every time you change rom you have to reformat data in FastBoot?
    To me, what gives me problems is the entry screen of the phone card pin (SIM) not the pin of Android, when I try to install AEX 6.4, I serve this to fix it?
    Thank you

    Enviado desde mi X52X mediante Tapatalk
    It's permanent. The issue was caused by an old version of TWRP that had a bugged format data function. Formatting via fastboot is a permanent solution as it properly restores the encryption footer where-as sometimes even on newer TWRP it might not do so.

    Private Unlock Key (PUK) is what you are referring to for unlocking your SIM card with a pin. That sounds like it could be a ROM-specific problem as I have heard for Le Pro3 builds of some ROMs that PUK doesn't work yet LineageOS 16.0 for x2 and zl1 does. I'd recommend reporting that bug to the s2 maintainer for AEX.