Twrp 3.3.1-0 & root [updated] kane/troika

tys0n

Senior Member
Nov 29, 2010
3,110
2,042
253
Stockholm
Our old twrp have been great compared to nothing but it isn't exactly fully working and freezes a lot on splash screen.
Thanks to @Stricted and @deadman96385 we now have a more functional twrp.

Support for A/B slots.
ADB working.
No need to flash full firmware. Just flash the vbmeta_patch.img and boot twrp.

!!BOOTLOADER MUST BE UNLOCKED!!
YOUR DATA WILL BE WIPED!!​
Code:
fastboot flash vbmeta vbmeta_patch.img
fastboot boot twrp-3.3.1-test3.img
Now that we booted to TWRP it's time to format data.
Go to wipe -> format data -> type yes.

"Permanent" install of TWRP (optional):
Copy "twrp-3.3.1-test3.img" to your device.
Boot "twrp-3.3.1-test3.img" from fastboot and go to advanced settings.
Use the option to install recovery ramdisk. In the "file manager" you pick the "twrp-3.3.1-test3.img"
This will extract the twrp ramdisk and install it to your boot.img.
When it's done, tap the "fix recovery bootloop" in advanced settings so that it won't reboot to recovery instead of system..
Since this replaces the ramdisk in boot.img you'll have to reflash magisk afterwards if you want root.
This must be done every time you update your boot.img.


-------------------------------------------------------------------------------------------------------------------------------------------------------
# ROOT:
-----------
# First time:

# Method 1:
Root, forced encryption disabled. Full access to data from twrp:

Flash Magisk and Disable_Dm-Verity_ForceEncrypt.zip.

# Method 2: Root only. Device still encrypted and won't be able to decrypt / mount data in twrp.
Magisk modules through Magisk manager still works:

Flash only Magisk.
----------------------------------------------------------------------------------------------------

# Fastboot flash update without loosing root or data:
----------------------------------------------------------------------------------------
# Already rooted with encryption disabled:

Extract the firmware zip to your adb/fastboot folder.
You already have the patched vbmeta flashed so just remove the stock vbmeta.img from the folder after extraction to avoid flashing it by mistake.
Flash full firmware without wipe. (Use cmds from below. Save as .bat to make it more simple.)
Boot twrp and then install it, fix recovery bootloop.
Reboot recovery, flash Magisk and Disable_Dm-Verity_ForceEncrypt.zip.
Boot system.
Code:
echo off
echo - UPDATE AND PRESERV ROOT -
fastboot flash pit diskmap.pit 
fastboot flash fwbl1 fwbl1.img 
fastboot flash ldfw_a ldfw.img 
fastboot flash ldfw_b ldfw.img 
fastboot flash keystorage_a keystorage.img 
fastboot flash keystorage_b keystorage.img 
fastboot flash bootloader_a bootloader.img 
fastboot flash bootloader_b bootloader.img 
fastboot flash modem_a modem.bin 
fastboot flash oem_a oem.img 
fastboot flash oem_b oem_other.img 
fastboot flash logo_a logo.bin 
fastboot flash dtbo_a dtbo.img 
fastboot flash system_a system.img_sparsechunk.0 
fastboot flash system_a system.img_sparsechunk.1 
fastboot flash system_a system.img_sparsechunk.10 
fastboot flash system_a system.img_sparsechunk.2 
fastboot flash system_a system.img_sparsechunk.3 
fastboot flash system_a system.img_sparsechunk.4 
fastboot flash system_a system.img_sparsechunk.5 
fastboot flash system_a system.img_sparsechunk.6 
fastboot flash system_a system.img_sparsechunk.7 
fastboot flash system_a system.img_sparsechunk.8 
fastboot flash system_a system.img_sparsechunk.9 
fastboot flash system_b system_other.img_sparsechunk.0 
fastboot flash system_b system_other.img_sparsechunk.1 
fastboot flash system_b system_other.img_sparsechunk.2 
fastboot flash vendor_a vendor.img 
fastboot reboot bootloader
pause 10
fastboot boot twrp-3.3.1-test3.img
echo TWRP is booting..
echo - install recovery ramdisk, fix bootloop, flash magisk & dm-verity zip.
echo - alternatively flash only magisk and Disable_Dm-Verity_ForceEncrypt.zip if you want to keep stock recovery.
pause

# Already rooted with device still encrypted:

Flash firmware update, except vbmeta.
Boot twrp and flash Magisk with adb sideload.
(alternative method: boot twrp and flash magisk patched boot.img)

Download TWRP: https://images.stricted.net/test/troika/twrp-3.3.1-test3.img
Download Magisk: https://github.com/topjohnwu/Magisk/releases

Download vbmeta_patch.img & Disable_Dm-Verity_ForceEncrypt.zip attached below.

PLEASE, DON't QUOTE THE WHOLE OP.
 

Attachments

Last edited:

daekdroom

Senior Member
Oct 31, 2015
51
14
28
Code:
fastboot flash vbmeta vbmeta_patch.img
fastboot boot twrp-3.3.1-test3.img
My Vision is already unlocked and rooted by the old TWRP method. Should I just do this step so I can update to the new TWRP, and then I can follow "encryption disabled" steps to update to a new firmware?

I suppose I can't enable encryption anymore without resetting data.
 

tys0n

Senior Member
Nov 29, 2010
3,110
2,042
253
Stockholm
My Vision is already unlocked and rooted by the old TWRP method. Should I just do this step so I can update to the new TWRP, and then I can follow "encryption disabled" steps to update to a new firmware?

I suppose I can't enable encryption anymore without resetting data.
You're right. You can't switch between encrypted / non encrypted without a reset.
This update method have been working for me with the old twrp as well, but this new build is much better and more stable that I see no reason not to switch to the new one.
Actually, I think it may be better to first fastboot flash the new firmware (except vbmeta) so that you have a "clean" boot.img to start with if you're planning to use the install recovery ramdisk. At least if you have the old one installed already.
That's how I switched and I've had no problems.
 

gonzo1963

Senior Member
Mar 25, 2013
369
41
0
Good afternoon,
I'm trying to "patch" the TWRP as you indicate at the beginning of the first post.

When you say:
"For permanent install, use the" flash recovery ramdisk "option in twrp advanced settings"
What file do I have to flash?

Regards
 

tys0n

Senior Member
Nov 29, 2010
3,110
2,042
253
Stockholm
Good afternoon,
I'm trying to "patch" the TWRP as you indicate at the beginning of the first post.

When you say:
"For permanent install, use the" flash recovery ramdisk "option in twrp advanced settings"
What file do I have to flash?

Regards
Sorry, I could have been more clear about this step in the description.
Copy "twrp-3.3.1-test3.img" to your device.
Boot "twrp-3.3.1-test3.img" from fastboot, go to advanced settings.
There's an option to install recovery ramdisk. In the "file manager" you pick the "twrp-3.3.1-test3.img"
This will extract the twrp ramdisk and install it to your boot.img.
When it's done, tap the "fix recovery bootloop" in advanced settings.

Since this replaces the ramdisk in boot.img you'll have to reflash magisk afterwards if you want root.
 
  • Like
Reactions: gonzo1963

gonzo1963

Senior Member
Mar 25, 2013
369
41
0
Sorry, I could have been more clear about this step in the description.

Copy "twrp-3.3.1-test3.img" to your device.

Boot "twrp-3.3.1-test3.img" from fastboot, go to advanced settings.

There's an option to install recovery ramdisk. In the "file manager" you pick the "twrp-3.3.1-test3.img"

This will extract the twrp ramdisk and install it to your boot.img.

When it's done, tap the "fix recovery bootloop" in advanced settings.



Since this replaces the ramdisk in boot.img you'll have to reflash magisk afterwards if you want root.
Good evening,

One last question:
Currently I have permanently installed the TWRP.
Is it also necessary to do these last steps that you have added?

Regards

Enviado desde mi unknown mediante Tapatalk
 

gonzo1963

Senior Member
Mar 25, 2013
369
41
0
Good evening,

One last question:
Currently I have permanently installed the TWRP.
Is it also necessary to do these last steps that you have added?

Regards

Enviado desde mi unknown mediante Tapatalk
Good afternoon,
Any answer?

Regards

Enviado desde mi unknown mediante Tapatalk
 
Last edited:

Preceptor

Member
Dec 26, 2010
10
4
0
Bootloop

Dude, my phone was encrypted and unrooted. I flashed vbmeta then booted into twrp. Then I flashed twrp using the ramdisk method, then I clicked to patch the recovery loop, then I flashed Magisk then I flashed the Disable DM Verity. Now I'm stuck in a recovery loop. The phone turns on, then android one screen, then reboots then goes to twrp...
What did I do wrong / miss?
 

edi4yu

Senior Member
Feb 21, 2015
110
35
0
Belgrade
"Then I flashed twrp using the ramdisk method, then I clicked to patch the recovery loop."
Agter this restart the phone in recovery mode and then continue as explained.
Sorry in bad english
 
Last edited:

sennator

Member
Jan 13, 2012
43
6
0
First of all, @tys0n thank you very much for your work. I got this phone for work, but since an unrooted Android device is almost useless to me, this is very much appreciated. Just a few annotations from my side, maybe they help someone.

1. Permanent TWRP install didn't work for me. TWRP was installed sucessfully but just like the dude above me, it would not boot to system, even after appying the bootloop fix. I had to reflash to fix this, so better be careful here!
2. I didnt want to lose encryption, so i chose method 2 for rooting. This works fine, but still I had to wipe data in the first place. Otherwise it would again not boot to system, but at least this time it told me that wiping would possibly fix this. However, after wiping encryption IS active. Maybe I did something wrong here but I don't know... Chosing method 1 seems to be the more straightforward option here.
3. Despite these issues, flashing updates seems to work just fine as described described in the OP, preserving data and root. I have only tried this once, from QSA30.62-24-6 to QSA30.62-33, which is currently the most recent patchlevel for RETEU devices. I even got the "successfully updated" notification afterwards, as if it was an OTA update :)
 
Jul 22, 2012
28
1
0
Dude, my phone was encrypted and unrooted. I flashed vbmeta then booted into twrp. Then I flashed twrp using the ramdisk method, then I clicked to patch the recovery loop, then I flashed Magisk then I flashed the Disable DM Verity. Now I'm stuck in a recovery loop. The phone turns on, then android one screen, then reboots then goes to twrp...
What did I do wrong / miss?
same here !
 

tys0n

Senior Member
Nov 29, 2010
3,110
2,042
253
Stockholm
First of all, @tys0n thank you very much for your work. I got this phone for work, but since an unrooted Android device is almost useless to me, this is very much appreciated. Just a few annotations from my side, maybe they help someone.

1. Permanent TWRP install didn't work for me. TWRP was installed sucessfully but just like the dude above me, it would not boot to system, even after appying the bootloop fix. I had to reflash to fix this, so better be careful here!
2. I didnt want to lose encryption, so i chose method 2 for rooting. This works fine, but still I had to wipe data in the first place. Otherwise it would again not boot to system, but at least this time it told me that wiping would possibly fix this. However, after wiping encryption IS active. Maybe I did something wrong here but I don't know... Chosing method 1 seems to be the more straightforward option here.
3. Despite these issues, flashing updates seems to work just fine as described described in the OP, preserving data and root. I have only tried this once, from QSA30.62-24-6 to QSA30.62-33, which is currently the most recent patchlevel for RETEU devices. I even got the "successfully updated" notification afterwards, as if it was an OTA update :)
Hi. Yes, you're right. After flashing the patched vbmeta we need to format data. I've made it more clear in OP now.
Thanks for pointing it out.
same here !
Format data in twrp
 

gambiarraweb1

Senior Member
Dec 6, 2011
132
3
0
Itaquaquecetuba
It doesn't work for me (XT1970-1).
I did the process according to information method 2.
the system boots normally.
however magisk is not 'GREEN' like two pieces of information.

How is it going without ROOT, how do I put ROOT?
have another process after this information?

Thank you.
 
Last edited:

gambiarraweb1

Senior Member
Dec 6, 2011
132
3
0
Itaquaquecetuba
It worked. :eek:

I performed the process again.
and everything went well.

Thanks to everyone involved. :good:

It doesn't work for me (XT1970-1).
I did the process according to information method 2.
the system boots normally.
however magisk is not 'GREEN' like two pieces of information.

How is it going without ROOT, how do I put ROOT?
have another process after this information?

Thank you.
 

simije97

Member
Dec 19, 2015
45
1
0
Tvrdošín
Hello all. When I click on Internal storage, there are folders with names like "a16sgyx462" and so on, so I am not able to install TWRP permanently. Can somebody help me with this?
 

daekdroom

Senior Member
Oct 31, 2015
51
14
28
Has anyone used the official TWRP version? I've been thinking of transitioning from the older, unofficial, TWRP to that, but I haven't found any comment about it at all.