How to install TWRP on Xperia L running unlocked bootloader, rooted stock ROM? - Sony Xperia L

I have rooted my Xperia L stock ROM 15.3.A.1.17 and unlocked the bootloader. Now I wish to install TWRP recovery on a separate partition. As indicated on official TWRP page on Xperia L,
The Xperia devices have a recovery-in-boot arrangement. This means that the recovery is booted using the regular kernel / boot image in the device. Team Win has worked with the FreeXperia device maintainers to come up with a way to extract the ramdisk from the FOTAKernel partition and use the ramdisk from that partition instead of the recovery that is included in the boot image of your device. This means that if you install current CM nightlies and flash TWRP to the FOTAKernel partition, you will be able to use TWRP instead of the CWM or CM recovery that normally comes in a CM boot image. Other boot images including stock kernels can be repacked to include this extraction utility to allow you to use TWRP from the FOTAKernel partition. This setup allows you to choose what recovery you want to have installed and allows you to update your recovery more easily. Unfortunately this setup requires that the boot image that you have installed include the ramdisk extraction utility. The source for this utility is here.
This setup means that you must have a kernel or boot image installed that will use the FOTAKernel method. This utility is designed to work in conjunction with the current methods that most AOSP ROMs, like OmniROM or CyanogenMod, will support. Some rare stock kernels may also support the FOTAKernel method.
What does all this mean? It means that TWRP may not work on your device unless you install other custom software as well. Check with your ROM developer to see what they support.
Click to expand...
Click to collapse
However, the stock kernel does not support FOTAkernel method a.ka. extract_elf_ramdisk feature. The webpage does not address the issue of running TWRP on stock kernel. It's like a chicken and egg problem. To have TWRP running, one needs a custom kernel. To flash a custom ROM, one needs TWRP (or other custom recovery).
I can think of two possible ways of breaking this deadlock.
Possible method #1:
Flash TWRP using Recovery Installer Toolkit for Xperia L
Flash a custom ROM (zip) from this recovery
Flash TWRP to FOTAkernel using official TWRP app or dd-ing a TWRP raw image on FOTAkernel partition or using Recoveries and Recovery Installer for Taoshan
Possible method #2:
Use a stock ROM image with TWRP integrated:
Code:
adb flash boot boot_twrp2.img
Flash a custom ROM (zip) from this recovery
Flash TWRP to FOTAkernel using official TWRP app or dd-ing a TWRP raw image on FOTAkernel partition or using Recoveries and Recovery Installer for Taoshan
Possible method #3:
Boot into fastboot mode
Flash the TWRP image directly onto the boot partition
Code:
fastboot flash boot twrp.img
Reboot the phone which now should boot directly to TWRP recovery
The screen flickers when you are in recovery menu. However, flashing a custom ROM will fix the problem
Flash a custom ROM (zip) from this recovery
Flash TWRP to FOTAkernel using official TWRP app or dd-ing a TWRP raw image on FOTAkernel partition or using Recoveries and Recovery Installer for Taoshan
As of now, I installed TWRP on FOTAkernel partition using official TWRP app. As expected, when I issue,
Code:
adb reboot recovery[/CODEL] the phone boots to stock recovery instead of TWRP. This behavior is expected as stock kernel knows nothing about TWRP being located on FOTAkernel.
I don't even know if any of the proposed methods work. However, before embarking down any one of those routes, I want to ask the community if I am overlooking any straightforward, less cumbersome alternative(s).
[B]Credits:[/B]
[LIST]
[*] Dees_Troy
[*] Kungfu73
[/LIST]

Holmes.Sherlock said:
I have rooted my Xperia L stock ROM 15.3.A.1.17 and unlocked the bootloader. Now I wish to install TWRP recovery on a separate partition. As indicated on official TWRP page on Xperia L,
However, the stock kernel does not support FOTAkernel method a.ka. extract_elf_ramdisk feature. The webpage does not address the issue of running TWRP on stock kernel. It's like a chicken and egg problem. To have TWRP running, one needs a custom kernel. To flash a custom ROM, one needs TWRP (or other custom recovery).
I can think of two possible ways of breaking this deadlock.
Possible method #1:
Flash TWRP using Recovery Installer Toolkit for Xperia L
Flash a custom ROM (zip) from this recovery
Flash TWRP to FOTAkernel using official TWRP app or dd-ing a TWRP raw image on FOTAkernel partition or using Recoveries and Recovery Installer for Taoshan
Possible method #2:
Use a stock ROM image with TWRP integrated:
Code:
adb flash boot boot_twrp2.img
Flash a custom ROM (zip) from this recovery
Flash TWRP to FOTAkernel using official TWRP app or dd-ing a TWRP raw image on FOTAkernel partition or using Recoveries and Recovery Installer for Taoshan
As of now, I installed TWRP on FOTAkernel partition using official TWRP app. As expected, when I issue,
Code:
adb reboot recovery[/CODEL] the phone boots to stock recovery instead of TWRP. This behavior is expected as stock kernel knows nothing about TWRP being located on FOTAkernel.
I don't even know if any of the proposed methods work. However, before embarking down any one of those routes, I want to ask the community if I am overlooking any straightforward, less cumbersome alternative(s).[/QUOTE]
Well, I think installing latest TWRP directly from stock XL ROM for first time is hard for everyone :D
I myself exactly used first method and worked fine. Also please note that in step 2 of method 1, you should install some Lollipop or KitKat versions of custom ROM (because current recovery is old)
I've not tested 2nd method, but it should work too.
I think these methods are the most simple ones if you want to jump from stock to latest TWRP ;)[COLOR="Silver"]
[SIZE=1]---------- Post added at 12:06 PM ---------- Previous post was at 11:53 AM ----------[/SIZE]
[/COLOR]Oh I forgot to mention that there is another (a little risky) way to use latest TWRP.
Using adb&fastboot run this command:
[B]fastboot flash boot twrp.img[/B]
[I](twrp.img is your recovery image name)[/I]
This command flashes recovery image directly to boot partition and because of that, when you power on the phone, you jump directly to TWRP recovery!
[B] Please note that in this method, the screen flickers when you are in recovery menu, but it's normal and gets fixed by flashing custom ROM
Note 2: immediately after booting to recovery, flash your custom ROM to avoid any problems![/B]
If there were any problems, simply flash stock ROM to get back to normal state.
Click to expand...
Click to collapse

Kungfu73 said:
Also please note that in step 2 of method 1, you should install some Lollipop or KitKat versions of custom ROM (because current recovery is old)
Click to expand...
Click to collapse
I don't get the point why I need a KitKat/Lollipop based custom ROM. What do you mean by current recovery being old?
Oh I forgot to mention that there is another (a little risky) way to use latest TWRP.
Using adb&fastboot run this command:
fastboot flash boot twrp.img
(twrp.img is your recovery image name)
This command flashes recovery image directly to boot partition and because of that, when you power on the phone, you jump directly to TWRP recovery!
.
Click to expand...
Click to collapse
I talked to @Dees_Troy on IRC about the issue and he suggested the same to me.
.
Please note that in this method, the screen flickers when you are in recovery menu, but it's normal and gets fixed by flashing custom ROM
Note 2: immediately after booting to recovery, flash your custom ROM to avoid any problems!
If there were any problems, simply flash stock ROM to get back to normal state.
Click to expand...
Click to collapse
I am also experiencing flickering. It's surprising to hear that the problem is supposed to go away with custom ROM. Do you have any idea how does having a custom ROM make any difference at all?

Holmes.Sherlock said:
I don't get the point why I need a KitKat/Lollipop based custom ROM. What do you mean by current recovery being old?
Click to expand...
Click to collapse
Well, the version of twrp that recovery installer app flashes, is 2.7 or something like that (not 3.0.2) and it may fail to flash MM or N ROMs (it's mentioned in some official custom ROMs download page to use latest TWRP)
Holmes.Sherlock said:
I am also experiencing flickering. It's surprising to hear that the problem is supposed to go away with custom ROM. Do you have any idea how does having a custom ROM make any difference at all?
Click to expand...
Click to collapse
If you mean by difference, fixing the flickering, well it wipes boot partition while flashing ROM, and (some of ROMs) flash latest TWRP to fota agian, and it fixes that
But if you mean difference between stock and custom ROM, well... it depends on your using. The most obvious ones are the improved security and more space for apps and tons of customizable and useful features, etc.
(And also sorry if I had mistakes in English!)

Kungfu73 said:
Well, the version of twrp that recovery installer app flashes, is 2.7 or something like that (not 3.0.2) and it may fail to flash MM or N ROMs (it's mentioned in some official custom ROMs download page to use latest TWRP).
Click to expand...
Click to collapse
The installer app lets you choose the version to flash. You can very well flash any version (of twrp.img) downloaded on your phone.

Holmes.Sherlock said:
The installer app lets you choose the version to flash. You can very well flash any version (of twrp.img) downloaded on your phone.
Click to expand...
Click to collapse
Oh this is what that makes difference!
On stock ROM, you can only use old TWRP's that are compatible with stock ROMs that don't support fota !
And also you should use the recovery that the app gives to you

Kungfu73 said:
On stock ROM, you can only use old TWRP's that are compatible with stock ROMs that don't support fota !
And also you should use the recovery that the app gives to you
Click to expand...
Click to collapse
The app gives a list of all recovery versions available on the official website for category `taoshan`. Are you sure that there is some TWRP version that does not support FOTA and works with stock ROM?

Holmes.Sherlock said:
The app gives a list of all recovery versions available on the official website for category `taoshan`. Are you sure that there is some TWRP version that does not support FOTA and works with stock ROM?
Click to expand...
Click to collapse
Well, if you check the official twrp website, there is no version before 2.8 for XL , and lol those removed ones are compatible!

Kungfu73 said:
Well, if you check the official twrp website, there is no version before 2.8 for XL , and lol those removed ones are compatible!
Click to expand...
Click to collapse
I am curious to know how come any TWRP version be compatible with stock ROM unless the recovery ramdisk is integrated with the boot image than being written onto FOTAkernel.

Holmes.Sherlock said:
I am curious to know how come any TWRP version be compatible with stock ROM unless the recovery ramdisk is integrated with the boot image than being written onto FOTAkernel.
Click to expand...
Click to collapse
I don't have much detailed information about that.
You can get help from experts
And could you finally flash and boot any version of twrp using that 3 methods?

Kungfu73 said:
And could you finally flash and boot any version of twrp using that 3 methods?
Click to expand...
Click to collapse
I tried method #2 and #3. Both works

Related

Droid Turbo XT1254 5.1 Rooted Images (+Xposed, other extras) UPDATED 10/10

This is only for devices currently on 4.4 or rooted 5.1 w/ moforoot. This upgrade path allows moforoot to continue to work, and retains the ability to downgrade to 4.4.
Note 12/2/2015:
Development on this has been discontinued with the release of the SunShine bootloader unlock.
To use SunShine without having to deal with KingRoot, you can flash the Rooted v3 system img and then use SunShine to unlock. This is the most stable method if you can use mofo.
After unlocking using SunShine, please flash the latest bootloader/radio images from here. This will bring your phone completely up to date and provide a more stable experience with custom ROMs.
These images are still flashable after unlocking your bootloader if you'd like a stable, closest-to-stock ROM possible.
Instead of using mofo to flash the system image, you can just use
Code:
fastboot flash system filename-goes-here.img
You can then flash your own tweaks like Xposed.
I'd recommend making a back up of the stock ROM in TWRP so you have a stable base to go back to if anything goes wrong.
Note 10/10/2015:
Updated all images to the latest OTA update (SU4TL-44) and included the latest official Xposed version (v75) in extras v5.
Follow the instructions with 5.1_images_v4.zip to flash the updated firmware images.
Note 9/5/2015:
Updated extras (v4) to include the latest official Xposed version (v73). Read the previous note for more information.
Note 8/31/2015:
Updated extras to the latest official Xposed version (v72). Reflashing all of the images is not required, only the extras system.img using mofo.
You can download the full extras image (1.5gb), or if you already have the rooted v2 image, use the extras v3 patch (8mb) with the instructions below.
Using the rooted v2 image + patch will allow you to update in the future without redownloading the entire image (as long as you keep the original after patching).
Note 7/23/2015:
Updated to the latest OTA (23.11.39). Make sure to follow instructions and reflash all images from the latest zip.
Unfortunately, I couldn't provide a patch to go from rooted image v1->v2, so a redownload is needed.
When applying the latest extras, make sure you're applying it to the rooted image v2.
Files (updated 10/10/2015 w/ latest OTA & extras v5)
5.1 firmware images (v4)
SHA1: 8be8a19664e6ba5aa556838bb3f744cdbf41f2ef
Stock 5.1 system image (v3)
SHA1: 1e67fc22331f035e9f3bd6c28d81fb173dd86a3e
Rooted 5.1 system image (v3)
SHA1: b8ff04d7f6ad9de31292cf62da94a3d80d3e373c
Extras 5.1 system image (rooted v3 + extras v5) (see below for details)
SHA1: 126744919f86132c05d15e79373ea759f74e37cf
Instructions
A data wipe is not required, but please back up any important data beforehand in case something goes wrong.
After extracting 5.1_images_v4.zip, reboot into bootloader and run the following commands to prepare your phone for the latest 5.1 system image:
Code:
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash modem modem.img
fastboot flash mdm1m9kefs3 fsg.mbn
fastboot erase mdm1m9kefs1
fastboot erase mdm1m9kefs2
fastboot flash recovery recovery.img
fastboot erase ddr
fastboot reboot-bootloader
Then use mofo to flash the system image of your choice and reboot.
After flashing a system image, the first boot will stay on the Motorola logo for an extra 30 seconds to 1 minute. This is rebuilding the cache partition (erased by moforoot after every flash).
If your phone doesn't boot after 5 minutes (and isn't showing the "Upgrading apps" dialog), try formatting the cache in recovery by doing the following:
While phone is off, hold the volume down button and turn it on to boot into bootloader. Use the volume keys to find the recovery option and press power to confirm.
Once you see the dead Android (it may also say "No Command", this is normal), pull up the recovery menu by holding power and pressing volume up (5.1 recovery is different than 4.4) and use the wipe cache option.
If the screen is blank in recovery with a periodically flashing Android icon, try booting the phone normally and trying again. This happened to me a few times, and I theorize it's because of the cache partition not being formatted after erased.
Extras (updated 10/10/2015 w/ latest OTA & Xposed official v75)
Download patch (v5)
SHA1: 451be2eef3df509facf16b807c6fc665c8fac090
If you don't want to deal with patching the image using xdelta3, you can download the full extras image in the Files section above.
This will prevent you from updating without redownloading the whole image in the future, but is easier for less experienced users.
Current extras:
Xposed official v75 (download APK from here)
(optional) ad blocking
busybox/sqlite3
tethering enabled
To apply the patch, use the rooted v3 image (not an already patched image) as a base, and follow the patching instructions (using xdelta3) in this post.
After patching the system.img with the extras, you'll use mofo to flash the patched image.
To use ad blocking, download AdAway (available in F-Droid) and enable it. Make sure the "Target hosts file" is set to "/data/hosts" in settings.
shouldnt we also be updating the radio?
diabl0w said:
shouldnt we also be updating the radio?
Click to expand...
Click to collapse
I haven't personally tested upgrading the radio, and whether that affects downgrading at all. If someone confirms it's without risk, I'll add the radio.img to the zip and instructions.
firstEncounter said:
I haven't personally tested upgrading the radio, and whether that affects downgrading at all. If someone confirms it's without risk, I'll add the radio.img to the zip and instructions.
Click to expand...
Click to collapse
ive downgraded radio from 4.4 to 4.2 in the past, but it messed up wifi somehow... isnt wifi part of the modem image? anyways, nothing else bad happened so idk if this is useful info
edit: when i did the downgrade (4.4.4 to 4.4.2 radio) it disabled the ability to turn on wifi and log messages gave the error wifistatemachine: failed to load wifi driver
diabl0w said:
ive downgraded radio from 4.4 to 4.2 in the past, but it messed up wifi somehow... isnt wifi part of the modem image? anyways, nothing else bad happened so idk if this is useful info
Click to expand...
Click to collapse
It looks like radio is just a collection of the modem images, so that should eliminate some of the commands. I'll update the OP.
firstEncounter said:
It looks like radio is just a collection of the modem images, so that should eliminate some of the commands. I'll update the OP.
Click to expand...
Click to collapse
check my edit
diabl0w said:
check my edit
Click to expand...
Click to collapse
Radios won't be compatible across ROM versions. You would flash the 4.4.4 radio if downgrading to a 4.4.4 image, not while running 5.1.
Ummmmm. Is this a dream? Someone pinch me...... There's no one around....... Can this really be true!? I'm afraid to try it and bork everything.
firstEncounter said:
This is only for devices currently on 4.4, requires moforoot. This upgrade path allows moforoot to continue to work, and retains the ability to downgrade to 4.4.
Files:
5.1 upgrade images
Stock 5.1 system image
Rooted 5.1 system image
After extracting the 5.1_images_v2.zip, run the following commands to prepare your phone for a 5.1 system image:
Code:
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash radio radio.img
fastboot erase ddr
(Commands based on this post. Thanks @mikeoswego and @JulesJam!)
Then use mofo to flash the system image of your choice.
Xposed and Adblock images coming soon.
Click to expand...
Click to collapse
Why aren't you flashing 5.1 recovery?
JulesJam said:
Why aren't you flashing 5.1 recovery?
Click to expand...
Click to collapse
Missed that command in the OP. Thanks!
Is the rooted image debloated
Sent from my XT1254 using Tapatalk
JulesJam said:
Why aren't you flashing 5.1 recovery?
Click to expand...
Click to collapse
So we should do that command as well?
janitorjohnson said:
So we should do that command as well?
Click to expand...
Click to collapse
I had trouble when I tried to stay on 5.0 recovery after I flashed 5.1 system image on my MX14.
JulesJam said:
I has trouble when I tried to stay on 5.0 recovery after I flashed 5.1 system image on my MX14.
Click to expand...
Click to collapse
Is that the final command?
trikotret said:
Is the rooted image debloated
Sent from my XT1254 using Tapatalk
Click to expand...
Click to collapse
No, it's completely stock with SuperSU installed.
janitorjohnson said:
Is that the final command?
Click to expand...
Click to collapse
I do
logo
boot
recovery
radios
But I do that b/c that is the way they are usually written in the scripts that come with the images. I think the only 2 where the order really matters is the bootloader and partition table and you aren't flashing those.
---------- Post added at 05:18 AM ---------- Previous post was at 05:16 AM ----------
firstEncounter said:
No, it's completely stock with SuperSU installed.
Click to expand...
Click to collapse
I went ahead and made one too just in case there were any issues with FirstEncounter's since I already have a device set up to do this anyhow.
https://www.dropbox.com/s/rmuev8agm5wl2lh/XT1254_5.1_root_system_ext4.zip?dl=0
PLMK if there are any issues with my image. I will take it down once people have started to modify the images, test them and are sure there are no issues.
It should be easy for someone to modify the buildprop so you can have free tether.
works like a charm
firstEncounter said:
This is only for devices currently on 4.4, requires moforoot. This upgrade path allows moforoot to continue to work, and retains the ability to downgrade to 4.4.
Files:
5.1 upgrade images
Stock 5.1 system image
Rooted 5.1 system image
After extracting the 5.1_images_v2.zip, run the following commands to prepare your phone for a 5.1 system image:
Code:
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash radio radio.img
fastboot flash recovery recovery.img
fastboot erase ddr
Then use mofo to flash the system image of your choice.
Xposed and Adblock images coming soon.
Click to expand...
Click to collapse
Followed instructions to a T and used OP's files... Everything works like a charm and is buttery smooth: http://imgur.com/ZwIRB8X
Bootloader acted a little weird, got a couple screen flickers... not sure if related or not. It worked itself out after one or two reboots. Thanks for the awesome instructions!
Just updated the OP with a patch for Xposed, ad blocking, busybox and tethering. Let me know if it works for everyone.
firstEncounter said:
Just updated the OP with a patch for Xposed, ad blocking, busybox and tethering. Let me know if it works for everyone.
Click to expand...
Click to collapse
Thank you! You are working mighty quickly I must say. We all really appreciate it!
I can not seem to boot it to recovery after doing the steps in OP. Little man blinks and says "no command" under him. Wanted to do a factory reset after the steps in OP. Any ideas? I am letting it boot into LP for the first time and then will try to get into recovery to do the reset.
After I let LP boot up, I could enter into recovery and factory reset without a problem.

How do I update rooted shield tablet to marshmallow?

OK, so I have a shield tablet that is running a rooted stock android version 5.1.1 and I want to update it too marshmallow and retain root. I have TWRP as my recovery. What's the easiest way to update? I found a thread for updating to marshmallow and it said it had the auto update file removed (which is good) but the downloadable files were removed from the thread by the OP... I should mention that this tablet is the newer recall replacement tablet that I'm trying to update, and that I still have the old recalled tablet with the auto update file removed so it never got killed. I'm not updating the old one though, just the new one.
You have to take care, not to overwrite the recovery partition. At least for the K1 there is an MM stock ROM on the official website. The version for linux simply contains partition images and a script, which fastboot flashes those. Commenting out the line which flashes the recovery would do the trick.
I'm not sure though if there is a similar ROM for the original.
Ah... no, with a locked bootloader it's slightly more complicated, since a 5.x twrp won't start on with a 6.0 staging blob.
Ok. Assume you've got the partition images. You have to (fastboot) flash everything but the blob and recovery first. Then boot into TWRP (the rom does not boot now) and flash your favorite SU tool. Then fastboot flash the blob. Now the rom should boot and give you root access. Finally update Twrp to 3.x.
njhuiz said:
You have to take care, not to overwrite the recovery partition. At least for the K1 there is an MM stock ROM on the official website. The version for linux simply contains partition images and a script, which fastboot flashes those. Commenting out the line which flashes the recovery would do the trick.
I'm not sure though if there is a similar ROM for the original.
Ah... no, with a locked bootloader it's slightly more complicated, since a 5.x twrp won't start on with a 6.0 staging blob.
Ok. Assume you've got the partition images. You have to (fastboot) flash everything but the blob and recovery first. Then boot into TWRP (the rom does not boot now) and flash your favorite SU tool. Then fastboot flash the blob. Now the rom should boot and give you root access. Finally update Twrp to 3.x.
Click to expand...
Click to collapse
Oh OK, thanks. I think I'll just wait. I'd rather flash a community stock/rooted rom. I don't want to flash an official ROM and have to re-root and flash recovery and all that... That's all just too much work right now just for marshmallow lol. My 5.1.1 is working fantastic so I'll just leave it for now. I'm curious why its so complicated now though with MM? I don't ever remember any previous build jumps requiring so much work to update to... My nexus 5 wasn't difficult at all. I just downloaded the full rom zip (MM Cataclysm cause I was on Lollipop Cataclysm), booted into TWRP, dirty flashed the zip, and it was good to go. I'm looking for THAT kind of update for my shield tablet.
If you unlock your bootloader (which is recomended for using custom roms), then getting root is simple, since you can fastboot flash any partition image.
Independend of your currently installed rom you can always get root by
1. (fastboot) flash the correct (2.7.x for Android 5.x, 3.x for Android 6.x) TWRP recovery
2. boot into TWRP an install a current SuperSU zip.
On the shield tablet you need to flash a new staging blob for MM in any case.
Been awhile
njhuiz said:
If you unlock your bootloader (which is recomended for using custom roms), then getting root is simple, since you can fastboot flash any partition image.
Independend of your currently installed rom you can always get root by
1. (fastboot) flash the correct (2.7.x for Android 5.x, 3.x for Android 6.x) TWRP recovery
2. boot into TWRP an install a current SuperSU zip.
On the shield tablet you need to flash a new staging blob for MM in any case.
Click to expand...
Click to collapse
I am attempting to update to marshmallow as well so i can install kali nethunter 3. but i am unfamiliar with rooting i havent done it since 2010. where would i acquire these files that i need to flash to the shield?

[DEV-ABOOT-ONLY/PF4/PD1/PG2/PJ2/PL1/QA1] Safestrap Recovery v4.05 B01 [2017-03-23]

VERIZON SAMSUNG GALAXY S5 (KLTEVZW)
PLEASE READ READ READENTIRE OP
"ALL MAJOR WORK DONE BY HASHCODE SO GO GIVE HIM SOM THANKS.DO NOT POST ANY BUG OR ISSUE COUSED BY THIS RECOVERY IN ORIGINAL THREAD BY HASHCODE, POST HERE AND I WILL HELP YOU."
CURRENT PROJECT STATUS:
BETA v4.05-B01 (DEV-ABOOT-ONLY/PF4/PD1/PG2/PJ2/PL1/QA1/6.0.1)
WHAT IS SAFESTRAP?
Safestrap is a Bootstrap / Recovery for locked bootloader phones. The goal is to avoid touching your primary system (I'll call this "stock" system) and only flash or make large changes to another place on your phone that Safestrap treats as a "2nd system" (in this case, it's a series of virtual ROM slots located on the internal emmc area: "/sdcard"). Once installed, you will see a "Splashscreen" giving you the option to hit "menu" to enter recovery. The recovery portion of Safestrap is now based on TWRP 2.6.1.0 (a touch based recovery) and you can perform .zip installs, backups and restores here. The additional features I've added to TWRP are mostly located under the "Boot Options" menu:
Here you can create virtual ROM-slots (3-4 on the S5 due to partition size and internal space) for flashing ROMs. NOTE: The bigger you make the /data partition the less room you will have to make other ROM-slots.
You can activate a new ROM-slot by choosing the slot you wish to make active and then selecting the "Activate" button. Once active, you will see the "rom-slot#" up in the top of the screen shown in green. If you make the "stock" ROM active, then you can see it in the top shown in red.
Once a ROM-slot is active, all actions you would normally perform using TWRP are directed to that ROM-slot. For example, "Install" to flash a .zip, backup and restore.
HOW DO I INSTALL SAFESTRAP?
Requirement: Root (systemless SuperSU)
[v4.03 Safestrap zip file]: Flash via TWRP/FlashFire.
HOW DO I ENTER RECOVERY?
During each reboot a splashscreen will be displayed showing whether the device is running a rom-slot or on the "Stock ROM".
Press the button shown on the screen to either enter "RECOVERY" or "CONTINUE" booting (or the hard button underneath each option).
KNOWN ISSUES:
- Not WORKING NON ROOTED DEVICES (DEV-ABOOT)
- NOT WORKING ON ANDROID 4.4.X
- NOT WORKING ON ANDROID 5.0
- NOT WORKING ON SYSTEM ROOT
DOWNLOADS:
CONFIRM THAT YOU ARE USING A VERIZON WIRELESS SAMSUNG GALAXY S5 (kltevzw) (DEV-ABOOT-ONLY/PF4/PD1/PG2/PJ2/PL1/QA1/6.0.1)
LATEST FILE: Safestrap-4.05-B01-KLTEVZW-6.0.1.zip
WARNING: Safestrap is heavily modified to be "Safe" for your device. Do not download TWRP from their website and expect it to work the same way. Also TWRP does not support Safestrap, tho some issues that may come up will be TWRP dependant, please try and contact myself or look on the forums for your device for answers before hunting down TWRP people. They won't be able to help w/ Safestrap specific questions.
Special Thanks To
@Hashcode
DeesTroy & TeamWin for all their hard work making TWRP such a fantastic recovery. If you are considering a donation, then please have a look at the Team WIN website: http://teamw.in/project/twrp2
@jrkruse for zip template
CHANGES:
4.05-B01 [2017-03-32]
- Update to latest TWRP 3.1.0.
- Major safestrap specific updates (https://github.com/mohammad92/recovery-safestrap/commits/safe3.1.0)
4.03-B01 [2017-02-26]
- Initial support.
This will work on android stock 6.0.1 only, maybe on cutom AOSP roms that included MM kernel headers.
APK version coming soon when it ready
stock 5.0 not tested since I'm on 6.0.1 QA1 but will try to compile it soon.
Nice job as always!
Really cool tool to use
Safestrap 4.05-B01 is up
Can I use safestrap to install lineage OS?
bereket said:
Can I use safestrap to install lineage OS?
Click to expand...
Click to collapse
No.
Why would this get used instead of twrp flashed to recovery?
mattnin said:
Why would this get used instead of twrp flashed to recovery?
Click to expand...
Click to collapse
kltevzw is locked! But some devices with CID start with 15 can be unlocked and flash twrp.
And they still need safestrap for upgarde bootloader and unlock their devices.
This version of safestrap does not need kitkat kernel to show up the boot menu, so you can use it with MM kernel.
mohammad.afaneh said:
kltevzw is locked! But some devices with CID start with 15 can be unlocked and flash twrp.
And they still need safestrap for upgarde bootloader and unlock their devices.
This version of safestrap does not need kitkat kernel to show up the boot menu, so you can use it with MM kernel.
Click to expand...
Click to collapse
Oh yeah! I forgot about that. I just have four CID 15 phones and just used to flashing TWRP into recovery. Thanks!
Hi Guys,
My phone is cid11 and when I flashed freedom ROM, I lost safestrap. It says that it's installed buy when I boot into recovery, the phone just restarts. What do I need to do to get it back?
I was referred to this thread through another.
d8n0g said:
Hi Guys,
My phone is cid11 and when I flashed freedom ROM, I lost safestrap. It says that it's installed buy when I boot into recovery, the phone just restarts. What do I need to do to get it back?
I was referred to this thread through another.
Click to expand...
Click to collapse
you are on 5.0 ROM and safestrap not support your kernel
use this https://forum.xda-developers.com/ve.../ncg-ne9-nha-ni2-nk2-4-4-x-safestrap-t3577599
flash kitkat kernel to boot safestrap and restore your 5.0 kernel after that
or simply use this https://forum.xda-developers.com/verizon-galaxy-s5/development/safestrap-5-0-lollipop-t3313800
Much appreciated!!

Is there a latest stock ROM I can flash instead of the custom ROM I'm using now?

I'm TWRP'd and Magisk'd running a custom ROM (Havoc}, but it's a little buggy. I'm looking to flash a stock ROM with the latest OxygenOS, and then maybe use a Magisk module over that.
Can I? And if so, can you point me to the correct custom ROM thread? I see a couple, but not sure which one is flashable, and which one is for restoring the phone to completely stock (removing TWRP, etc.).
I suggest using this: https://forum.xda-developers.com/oneplus-7-pro/how-to/rom-stock-fastboot-roms-oneplus-7-pro-t3931424
-BoneZ- said:
I see a couple, but not sure which one is flashable, and which one is for restoring the phone to completely stock (removing TWRP, etc.).
Click to expand...
Click to collapse
I don't think you can flash a stock ROM, and keep TWRP without flashing TWRP again. TWRP will always be removed when flashing a stock ROM, since recovery doesn't reside on it's own partition for this device, but rather is on boot.img, which by definition needs to be flashed with the ROM (contains the kernel).
AFAIK, you will need to flash the stock ROM then flash TWRP and Magisk again. To do that, fastboot flash the above linked stock ROM, then fastboot boot TWRP.img, then in TWRP flash TWRP installer zip and flash Magisk. Wouldn't take long to do, just have the TWRP zip and Magisk zip on the phone ready to go, before you flash the stock ROM.
redpoint73 said:
I suggest using this: https://forum.xda-developers.com/oneplus-7-pro/how-to/rom-stock-fastboot-roms-oneplus-7-pro-t3931424
I don't think you can flash a stock ROM, and keep TWRP without flashing TWRP again. TWRP will always be removed when flashing a stock ROM, since recovery doesn't reside on it's own partition for this device, but rather is on boot.img, which by definition needs to be flashed with the ROM (contains the kernel).
AFAIK, you will need to flash the stock ROM then flash TWRP and Magisk again. To do that, fastboot flash the above linked stock ROM, then fastboot boot TWRP.img, then in TWRP flash TWRP installer zip and flash Magisk. Wouldn't take long to do, just have the TWRP zip and Magisk zip on the phone ready to go, before you flash the stock ROM.
Click to expand...
Click to collapse
I want to flash havoc OS and want to know if I can go back to OOS if I download the full OTA zip and flash it like you normally would (twrp and magisk)
D.Va said:
I want to flash havoc OS and want to know if I can go back to OOS if I download the full OTA zip and flash it like you normally would (twrp and magisk)
Click to expand...
Click to collapse
I have the same question. I'm on Havoc now and unencrypted and would like to back up Havoc and go back to OOS for now due to WiFi calling not working. With out having to reflash Twrp etc
The_Keeper86 said:
I have the same question. I'm on Havoc now and unencrypted and would like to back up Havoc and go back to OOS for now due to WiFi calling not working. With out having to reflash Twrp etc
Click to expand...
Click to collapse
Anyone?

Question Going from lineage 20 to pixel extended. What do I do about recovery?

Sorry, I couldn't find the answer. I installed lineage 20 on my one plus 9. I also installed the custom recovery required by lineage. I want to try out the pixel rom but what do I do about the custom lineage recovery? Do i use msm tools to restore it first? or can i install the unofficial twrp i saw on this forum instead or is there a stock recovery I can easily find to change it back? Thanks for any help.
gisted said:
Sorry, I couldn't find the answer. I installed lineage 20 on my one plus 9. I also installed the custom recovery required by lineage. I want to try out the pixel rom but what do I do about the custom lineage recovery? Do i use msm tools to restore it first? or can i install the unofficial twrp i saw on this forum instead or is there a stock recovery I can easily find to change it back? Thanks for any help.
Click to expand...
Click to collapse
I just made this same switch now back on stock waiting for 13.1 Download dtbo,vendor_boot,boot from pixel extended. Flash all 3 In fastboot. Reboot recovery wipe data sideload Pe
Thanks for the help!
gisted said:
Sorry, I couldn't find the answer. I installed lineage 20 on my one plus 9. I also installed the custom recovery required by lineage. I want to try out the pixel rom but what do I do about the custom lineage recovery? Do i use msm tools to restore it first? or can i install the unofficial twrp i saw on this forum instead or is there a stock recovery I can easily find to change it back? Thanks for any help.
Click to expand...
Click to collapse
OnePlus 9 does not have a dedicated recovery partition anymore (most modern phones don't have anymore). Instead, recovery now resides inside boot, meaning they share the same kernel. That's the reason every ROM instruction says to flash the provided boot, vendor_boot and dtbo images. Note that these 3 images are the same found in that particular ROM zip. Anyway, the point is that when you flash boot, the recovery is flashed too.
So, in your case, even if you are on LineageOS 20, and you can access LineageOS recovery, you can just go ahead and do a factory reset and flash the Pixel ROM through adb sideload. After that, boot, vendor_boot and dtbo will be automatically flashed/updated to Pixel's. But the recommended way is still to make sure you first flash those given 3 images before going to recovery and proceeding with factory reset and flashing.

Categories

Resources