[Guide]Lenovo S5 K520: TWRP, Root and Decrypt data

Search This thread

C4lculated

Member
Nov 4, 2015
22
21
Hello everyone, after struggling for a few hours I managed to finally disable force encryption in my phone (so that TWRP could backup the data partition).
I'd like to write a quick list of what I did in the form of a guide to unlocking the bootloader, installing TWRP and getting root with Magisk. I'm just a user, not a developer and this guide is brief, it's not a detailed tutorial and does not include trivial steps (like how to install drivers for your OS).

Warnings: Although small, there is always the chance this bricks your phone. I take no responsibilities.
This will factory reset your phone so back up everything before you start.


My phone is Lenovo S5 (K520) Global version (see screenshot) I don't know if this will work for other firmwares.



Prerequisites:
If you chose to use Micro SD card, you can insert it now.
Note: I know there is a way to push these files directly to TWRP from PC through USB instead of using SD Card/Flash drive but I've never tried it.

Lets start:
1. Go to 'Settings>About phone' and tap on "Lenovo version" several times until developer options are enabled.
2. Go to 'Settings>System>Developer options' and enable "OEM unlocking" (Note: for me this option was greyed out and I had to connect to wifi and wait for a minute or two).
Optional: Enable "USB debugging" if you wish to enter fastboot via ADB.
3. Turn off the phone and press and hold 'Volume down'+'Power' buttons until you see "fastboot mode" on the phone screen (alternatively, don't turn off the phone and instead enter fastboot mode via ADB (adb.exe reboot bootloader)).
4. Connect the phone to the PC via USB and open a command prompt in the location that you installed fastboot binary to.
Type (after each command press enter):
Code:
fastboot devices
To verify that the phone is recognized. And if it is type:
Code:
fastboot oem unlock

Now on the phone LCD navigate to "Yes" with volume buttons and press power to select it.
Your phone will factory reset, this will take a few minutes. Let it finish.

5. Put the TWRP image in your fastboot path. I used "recovery-twrp-3.2.3-crn-seoul(v3.2.3-1).img" downloaded from this URL:
https://xdaforums.com/android/development/lenovo-s5-k520-twrps-t3863860
But I included 2 more files that I found (I did not try them).

6. Enter fasboot mode again and type:
Code:
fastboot flash recovery recovery-twrp-3.2.3-crn-seoul(v3.2.3-1).img
(Substitute "recovery-twrp-3.2.3-crn-seoul(v3.2.3-1).img" with the recovery filename of you choice)

7. If successful, disconnect the USB cable and enter Recovery mode, do not turn off or reboot the phone because upon restart the phone will revert to stock recovery (I.E. delete TWRP).
To enter Recovery mode press and hold 'Volume down'+'Power' buttons until you see "fastboot mode" and from there choose "Recovery mode" with the volume buttons and confirm with the power button.
(Alternatively, you can try holding 'Volume up'+'Power' to directly enter Recovery mode but I found it a little finicky)

8. In TWRP, swipe to allow changes. Press cancel when asked for a password to decrypt data.
If you chose to use a USB flash drive with an OTG adapter, connect it and mount it (Mount>usb-otg).

9. Go to Wipe>format data, type "yes" and confirm (if you have any data like installed apps, contacts etc., it will be deleted).

10. Go to Install and install "Disable_Dm-Verity_ForceEncrypt_12.16.2018.zip".
The files will be in (/external_sd/ or /usb-otg/).

11. Install "Magisk-v18.0.zip"

Important note: If you want to keep encryption (if you don't care if TWRP can't access /data/) and just obtain root, skip steps 9 and 10.

12. Reboot to system and wait for a few minutes for the initial setup.


If for some reason boot fails (nothing happens after 10 minutes) and you can still enter TWRP (hold 'Volume up'+'Power'), then you can revert the changes by restoring the stock boot image (TWRP>Install>Install image>boot.img - put a checkmark on "boot").


If this worked for you, please tell us by replying to this thread.
 
Last edited:

acost91

New member
Jan 10, 2019
3
3
Thanks a lot man. This phone is a beast in quality/price when talking about hardware. Costs a bit more than 100€ and has the same hard than others at 180-200€ at least. Bad thing is software but with TWRP and root everything is possible . Just found what project treble is, amazing possibilities. Can't beliebe nobody replied yet to yor post. Its a great guide and you show all the sources from where your downloads come. As you said in another thread its better this way so people can trust your content more:

I also wanted to root but I didn't want to run a bunch of unknown programs (from XN Logos), so I managed to install TWRP and root with magisk. I wrote a guide on how to do it:
https://xdaforums.com/general/rooting-roms/guide-lenovo-s5-k520-twrp-root-decrypt-t3882402

I am yet waiting for my Lenovo S5 to arrive but I will give this guide a try. I was about to follow XN logos (stupdroid) guide/software but I prefer yours. Just one question... have you checked whether the TWRP v3.2.3 (latest) from dmilz make proper working backups? Can I trust that a full backup will be loaded correctly after installing any unofficial ROM, to go back to stock if necessary? I made once the mistake of relying a TWRP and later I found out that one was ok for flashing but didn't create working backups. I asked him also the same question, but I guess you also tried yourself to make a backup and restore from it using TWRP.

Next step will be to flash an Android 8.1 or 9 GSI rom (did I already say I'm amazed by GSI/project treble roms? just found about them last days). I will update you about my luck following your guide :)
 

hotbaba1000

New member
Dec 7, 2015
1
0
Hi man, have you upgrade to gsi

Thanks a lot man. This phone is a beast in quality/price when talking about hardware. Costs a bit more than 100€ and has the same hard than others at 180-200€ at least. Bad thing is software but with TWRP and root everything is possible . Just found what project treble is, amazing possibilities. Can't beliebe nobody replied yet to yor post. Its a great guide and you show all the sources from where your downloads come. As you said in another thread its better this way so people can trust your content more:



I am yet waiting for my Lenovo S5 to arrive but I will give this guide a try. I was about to follow XN logos (stupdroid) guide/software but I prefer yours. Just one question... have you checked whether the TWRP v3.2.3 (latest) from dmilz make proper working backups? Can I trust that a full backup will be loaded correctly after installing any unofficial ROM, to go back to stock if necessary? I made once the mistake of relying a TWRP and later I found out that one was ok for flashing but didn't create working backups. I asked him also the same question, but I guess you also tried yourself to make a backup and restore from it using TWRP.

Next step will be to flash an Android 8.1 or 9 GSI rom (did I already say I'm amazed by GSI/project treble roms? just found about them last days). I will update you about my luck following your guide :)

Kindly drop the procedure am hitting brick with all the method i used .????????
 
Last edited:

B4ph0

New member
Mar 6, 2019
1
0
Stock firmware lenovo k520

I have tried your method on ROM that is based on China and also globally, and TWRP was successfully installed, and I have also tried several Rom GSI, and only AOSP Extended is successful, but with Bluetooth bugs it cannot be turned on, if others want flash files and stock firmware for k520, just let me know, thanks.
 

vladu234

Member
Dec 26, 2017
6
0
Working on S5 Pro too?

Hi! Can it work on S5 Pro too? I really want to root this device and I don't find out a way to get this happening. Thanks! :D
 

mlnbb

New member
Mar 14, 2019
3
1
I have tried your method on ROM that is based on China and also globally, and TWRP was successfully installed, and I have also tried several Rom GSI, and only AOSP Extended is successful, but with Bluetooth bugs it cannot be turned on, if others want flash files and stock firmware for k520, just let me know, thanks.

Hi! Sorry for offtopic!
Could you please PM me the link on AOSP extended image which you installed. Thank you!
 
  • Like
Reactions: bobwijan

redXdie

New member
Sep 16, 2017
1
0
I need some help..
Did anyone had lenovo s5 persist.img..
I lost my persist afer flashing global rom.208st via qfil..
I check the rom has no persist.img
 
After unlocking bootloader, is there anyway to remove the hideous "software can't check for corruption" warning? Thanks.

---------- Post added at 01:44 AM ---------- Previous post was at 01:39 AM ----------

hello guys, i always get into download mode,after press reboot system (twrp), any solution for my problem ?

This means no rom is installed in your phone. Either you accidentally wipe system in twrp, or the rom is corrupted.
Download the deodexed stock rom below and flash with twrp. Should fix your problem.
https://drive.google.com/open?id=13tRqo5eSpRiVJwKiA-iSj2GyIF353ATQ
 
Last edited:

Suryo75

Senior Member
Jul 28, 2018
175
12
Kelantan
Vivo Y51L
After unlocking bootloader, is there anyway to remove the hideous "software can't check for corruption" warning? Thanks.

---------- Post added at 01:44 AM ---------- Previous post was at 01:39 AM ----------



This means no rom is installed in your phone. Either you accidentally wipe system in twrp, or the rom is corrupted.
Download the deodexed stock rom below and flash with twrp. Should fix your problem.
https://drive.google.com/open?id=13tRqo5eSpRiVJwKiA-iSj2GyIF353ATQ

thank you i'll try
 

Virlito14

New member
Feb 13, 2020
1
0
Twrp gone

Hello sir thank you for this wonderful tutorial,
But I have a problem , after booting to TWRP , then boot to system after that when I try to go back to recovery mode TWRP , twrp is gone , stock recovery back
 

Top Liked Posts

  • There are no posts matching your filters.
  • 8
    Hello everyone, after struggling for a few hours I managed to finally disable force encryption in my phone (so that TWRP could backup the data partition).
    I'd like to write a quick list of what I did in the form of a guide to unlocking the bootloader, installing TWRP and getting root with Magisk. I'm just a user, not a developer and this guide is brief, it's not a detailed tutorial and does not include trivial steps (like how to install drivers for your OS).

    Warnings: Although small, there is always the chance this bricks your phone. I take no responsibilities.
    This will factory reset your phone so back up everything before you start.


    My phone is Lenovo S5 (K520) Global version (see screenshot) I don't know if this will work for other firmwares.



    Prerequisites:
    If you chose to use Micro SD card, you can insert it now.
    Note: I know there is a way to push these files directly to TWRP from PC through USB instead of using SD Card/Flash drive but I've never tried it.

    Lets start:
    1. Go to 'Settings>About phone' and tap on "Lenovo version" several times until developer options are enabled.
    2. Go to 'Settings>System>Developer options' and enable "OEM unlocking" (Note: for me this option was greyed out and I had to connect to wifi and wait for a minute or two).
    Optional: Enable "USB debugging" if you wish to enter fastboot via ADB.
    3. Turn off the phone and press and hold 'Volume down'+'Power' buttons until you see "fastboot mode" on the phone screen (alternatively, don't turn off the phone and instead enter fastboot mode via ADB (adb.exe reboot bootloader)).
    4. Connect the phone to the PC via USB and open a command prompt in the location that you installed fastboot binary to.
    Type (after each command press enter):
    Code:
    fastboot devices
    To verify that the phone is recognized. And if it is type:
    Code:
    fastboot oem unlock

    Now on the phone LCD navigate to "Yes" with volume buttons and press power to select it.
    Your phone will factory reset, this will take a few minutes. Let it finish.

    5. Put the TWRP image in your fastboot path. I used "recovery-twrp-3.2.3-crn-seoul(v3.2.3-1).img" downloaded from this URL:
    https://xdaforums.com/android/development/lenovo-s5-k520-twrps-t3863860
    But I included 2 more files that I found (I did not try them).

    6. Enter fasboot mode again and type:
    Code:
    fastboot flash recovery recovery-twrp-3.2.3-crn-seoul(v3.2.3-1).img
    (Substitute "recovery-twrp-3.2.3-crn-seoul(v3.2.3-1).img" with the recovery filename of you choice)

    7. If successful, disconnect the USB cable and enter Recovery mode, do not turn off or reboot the phone because upon restart the phone will revert to stock recovery (I.E. delete TWRP).
    To enter Recovery mode press and hold 'Volume down'+'Power' buttons until you see "fastboot mode" and from there choose "Recovery mode" with the volume buttons and confirm with the power button.
    (Alternatively, you can try holding 'Volume up'+'Power' to directly enter Recovery mode but I found it a little finicky)

    8. In TWRP, swipe to allow changes. Press cancel when asked for a password to decrypt data.
    If you chose to use a USB flash drive with an OTG adapter, connect it and mount it (Mount>usb-otg).

    9. Go to Wipe>format data, type "yes" and confirm (if you have any data like installed apps, contacts etc., it will be deleted).

    10. Go to Install and install "Disable_Dm-Verity_ForceEncrypt_12.16.2018.zip".
    The files will be in (/external_sd/ or /usb-otg/).

    11. Install "Magisk-v18.0.zip"

    Important note: If you want to keep encryption (if you don't care if TWRP can't access /data/) and just obtain root, skip steps 9 and 10.

    12. Reboot to system and wait for a few minutes for the initial setup.


    If for some reason boot fails (nothing happens after 10 minutes) and you can still enter TWRP (hold 'Volume up'+'Power'), then you can revert the changes by restoring the stock boot image (TWRP>Install>Install image>boot.img - put a checkmark on "boot").


    If this worked for you, please tell us by replying to this thread.
    2
    Thanks a lot man. This phone is a beast in quality/price when talking about hardware. Costs a bit more than 100€ and has the same hard than others at 180-200€ at least. Bad thing is software but with TWRP and root everything is possible . Just found what project treble is, amazing possibilities. Can't beliebe nobody replied yet to yor post. Its a great guide and you show all the sources from where your downloads come. As you said in another thread its better this way so people can trust your content more:

    I also wanted to root but I didn't want to run a bunch of unknown programs (from XN Logos), so I managed to install TWRP and root with magisk. I wrote a guide on how to do it:
    https://xdaforums.com/general/rooting-roms/guide-lenovo-s5-k520-twrp-root-decrypt-t3882402

    I am yet waiting for my Lenovo S5 to arrive but I will give this guide a try. I was about to follow XN logos (stupdroid) guide/software but I prefer yours. Just one question... have you checked whether the TWRP v3.2.3 (latest) from dmilz make proper working backups? Can I trust that a full backup will be loaded correctly after installing any unofficial ROM, to go back to stock if necessary? I made once the mistake of relying a TWRP and later I found out that one was ok for flashing but didn't create working backups. I asked him also the same question, but I guess you also tried yourself to make a backup and restore from it using TWRP.

    Next step will be to flash an Android 8.1 or 9 GSI rom (did I already say I'm amazed by GSI/project treble roms? just found about them last days). I will update you about my luck following your guide :)
    1
    I have tried your method on ROM that is based on China and also globally, and TWRP was successfully installed, and I have also tried several Rom GSI, and only AOSP Extended is successful, but with Bluetooth bugs it cannot be turned on, if others want flash files and stock firmware for k520, just let me know, thanks.

    Hi! Sorry for offtopic!
    Could you please PM me the link on AOSP extended image which you installed. Thank you!