[SOLVED] Preventing Recovery Overwrite On System/normal Boot - Xiaomi Mi 6 Questions & Answers

After moving my Mi6 from EU ROM to Global Stable 8.2.2.0, I realised that MIUI has now programmed either the boot.img or system.img to overwrite recovery partition on every "normal"/system boot.
So much for unlocking the bootloader...
Although the source system.img has a recovery-from-boot.p file, but it appears to be different from the stock recovery.img file. Attempting to replace it with the TWRP image or removing it entirely (and flashing the rebuilt system.img) results in boot failure (see below for more information).
Does anyone know:
where the "protected" recovery image may be found? and/or
how to repack/rebuild a system.img which will not cause a boot hang?
Note that I have rebuilt it "correctly" (as "correct" as I know) using the properly extracted file_contexts (as extracted from the file_contexts.bin) from the initrd.img from inside the boot.img using the command:
Code:
make_ext4fs -s -T -1 -S file_contents -L system -l <size of partition> -a system system.img <mount point>
I have tried both a blind fastboot flash system system.img, and also a standard "clean" flash using the MiFlash tool (after ensuring that the correct MD5, CRC and sparse CRC strings are edited in the various files, of course).
Thanks!

fastboot flash recovery TWRP.img
That's the solution.
And if you flash a MIUI rom with TWRP simply flash twrp.img without Reboot under TWRP, after rom.zip flash. That's all

reb00tz said:
After moving my Mi6 from EU ROM to Global Stable 8.2.2.0, I realised that MIUI has now programmed either the boot.img or system.img to overwrite recovery partition on every "normal"/system boot.
Click to expand...
Click to collapse
dennis46419 said:
fastboot flash recovery TWRP.img
That's the solution.
And if you flash a MIUI rom with TWRP simply flash twrp.img without Reboot under TWRP, after rom.zip flash. That's all
Click to expand...
Click to collapse
Hi @dennis46419,
Thanks for replying. I have always done that upon forced reboot by the MiFlash tool (i.e. the moment it powers off for a reboot, I put it right back into fastboot mode to flash TWRP again, then directly boot with the TWRP.img).
As mentioned, I believe the new global stable ROM actually overwrites recovery on every boot.
Have you experienced this (i.e. when using the global stable ROM)?

OK, seems I missed the solution as already provided by @TheStrix:
https://forum.xda-developers.com/showpost.php?p=72620133&postcount=2
But the instruction (which I missed because I downloaded directly from the TWRP site) was already here: https://forum.xda-developers.com/showpost.php?p=72620133&postcount=2

Related

[q] htc one x restore - need help with fastboot commands

I am seeking your help to clear up some of my confusion in solving a problem with my HTC ONE X. I tried flashing a custom ROM on my HTC Android phone but all the files and partitions got messed up that every time it boots up, it is on a bootloop. I know the cause to this is due to a mixture of inconsistent (boot, recovery)partitions libraries that I have on the phone.
Therefore, I want to FULLY WIPE OF ALL the data on the phone's storage and reinstall a clean set of libraries and stock rom. However, before I wipe off all data and install the new stock rom, I want to know all the commands that I can issue to correct this problem but the problem I have is that the stock zip has a boot.img, hboot.img and recovery.img along with a set of folders (System and Meta-inf folders) and I don't know the command that I can issue to push the folders I mentioned in the right partition, "/system" partition. Moreover, I cannot boot into any recovery modes (CWM or TWRP) so everything has to be done via fastboot commands, I think.
I know I can execute the following commands if everything(all the partitions) were an .img file but for the folders I do not know how to push them onto my phones storage.
For example to push the boot content on the boot partition, I issue the following command to flash the device
fastboot erase boot
fastboot flash boot boot.img
and the following for the rest of the partitions:-
fastboot erase recovery
fastboot flash recovery recovery.img
and so on..
So what would be the solution to push those folders that are non img format related onto the right partitions? Flash it as a zip file?
Lastly, the phone is unlocked, CID: 11111111, Hboot: 1.09 and can only boot into fastboot mode for now. I also tried running the automatic RUU files via zip and exe formats but always fail due to signature or some other missing file error.
totti_09 said:
I am seeking your help to clear up some of my confusion in solving a problem with my HTC ONE X. I tried flashing a custom ROM on my HTC Android phone but all the files and partitions got messed up that every time it boots up, it is on a bootloop. I know the cause to this is due to a mixture of inconsistent (boot, recovery)partitions libraries that I have on the phone.
Therefore, I want to FULLY WIPE OF ALL the data on the phone's storage and reinstall a clean set of libraries and stock rom. However, before I wipe off all data and install the new stock rom, I want to know all the commands that I can issue to correct this problem but the problem I have is that the stock zip has a boot.img, hboot.img and recovery.img along with a set of folders (System and Meta-inf folders) and I don't know the command that I can issue to push the folders I mentioned in the right partition, "/system" partition. Moreover, I cannot boot into any recovery modes (CWM or TWRP) so everything has to be done via fastboot commands, I think.
I know I can execute the following commands if everything(all the partitions) were an .img file but for the folders I do not know how to push them onto my phones storage.
For example to push the boot content on the boot partition, I issue the following command to flash the device
fastboot erase boot
fastboot flash boot boot.img
and the following for the rest of the partitions:-
fastboot erase recovery
fastboot flash recovery recovery.img
and so on..
So what would be the solution to push those folders that are non img format related onto the right partitions? Flash it as a zip file?
Lastly, the phone is unlocked, CID: 11111111, Hboot: 1.09 and can only boot into fastboot mode for now. I also tried running the automatic RUU files via zip and exe formats but always fail due to signature or some other missing file error.
Click to expand...
Click to collapse
if you flash that recovery it will go back to stock lol you need to flash a firmware.zip...for more information please read the guides to how to flash it...all what you need to know and need to flash is stated in those guides
Hboot 1.09 that's not a endevour HTC one X ! .....what does the top of the bootloader say ?
And second.....questions do not belong in the general section !!!
And give the outcome of :
Fastboot getvar version-main

Stock rom

Can anyone pls tell me where I can download stock rom for (lenovo) p2 preferable in zip format . And is there any unbricking tutorial .
I want this too...? if anyone can help...
I have found the stock ROM, I bricked my device in the rooting process, and am unable to flash the complete stock image, because the device reports "unable to flash bootloader on unlocked device"
itsjustbilly said:
I have found the stock ROM, I bricked my device in the rooting process, and am unable to flash the complete stock image, because the device reports "unable to flash bootloader on unlocked device"
Click to expand...
Click to collapse
Hi, because you should not flash bootloader.
you can try those 2 solutions:
the fast one, it should work. The flashall command flash every.img files he find in the fastboot directory. So try to remove the bootlader.img and execute the flashall command.
the manual one (longer one):
Put only the recovery.img, boot.img, and the system.img files ( you should have something like 13 , named "systemchunk0/12.img") in your fastboot directory and flash with fastboot ( the command is always the same: fastboot flash recovery recovery.img, fastboot flash boot boot.img, and for every single part of system.img you should flash like "fastboot flash systemchunk0(until 12).img " so you flash flash 13 times the system with avery 13 parts .
Sorry for my english i hope you solved that
itsjustbilly said:
I have found the stock ROM, I bricked my device in the rooting process, and am unable to flash the complete stock image, because the device reports "unable to flash bootloader on unlocked device"
Click to expand...
Click to collapse
Then share it no
I'll post links when I get to my computer, but they're not Cwm flash able zips, they are fast boot files that you flash from DOS on a pc
---------- Post added at 09:39 AM ---------- Previous post was at 09:37 AM ----------
aleleo87 said:
Hi, because you should not flash bootloader.
you can try those 2 solutions:
the fast one, it should work. The flashall command flash every.img files he find in the fastboot directory. So try to remove the bootlader.img and execute the flashall command.
the manual one (longer one):
Put only the recovery.img, boot.img, and the system.img files ( you should have something like 13 , named "systemchunk0/12.img") in your fastboot directory and flash with fastboot ( the command is always the same: fastboot flash recovery recovery.img, fastboot flash boot boot.img, and for every single part of system.img you should flash like "fastboot flash systemchunk0(until 12).img " so you flash flash 13 times the system with avery 13 parts .
Sorry for my english i hope you solved that
Click to expand...
Click to collapse
I did try this, but I still have no signal because the modem file is part of the bootloader, and no modem means no mobile signal
itsjustbilly said:
I'll post links when I get to my computer, but they're not Cwm flash able zips, they are fast boot files that you flash from DOS on a pc
---------- Post added at 09:39 AM ---------- Previous post was at 09:37 AM ----------
I did try this, but I still have no signal because the modem file is part of the bootloader, and no modem means no mobile signal
Click to expand...
Click to collapse
Ah ok i didnt understand that you have this modem issue. I don't kno how to help you...you phone is bricked so you can test few solutions without more risks .
before flash the original recovery , boot and system by fastboot, you can try to install TWRP again and flash only the bootloader from TWRP (should support .zip and .img files). Then you turn the phone in fastboot mode and flash other stuff .
Taken from post 4 of the TWRP page on lenovo P2 forum
smaranramesh said:
Then share it no
Click to expand...
Click to collapse
Factory Images & Systemless Mode
Q: I messed up help me?!
So you screwed up and didn't follow Rule Number One in the IT-Handbook?
Which is: Always create a backup before working on a system?
Download the Factory State Images. Which are all flashable with fastboot: https://goo.gl/JTCwKj
Place the files you want replaced into the "Minimal ADB & Fastboot" installation directory and start it's shell:
If you want to flash back the stock image. Simply run:
Code:
Code:
fastboot flashall
You can also replace all partitions if required.
itsjustbilly said:
Download the Factory State Images. Which are all flashable with fastboot: https://goo.gl/JTCwKj
Click to expand...
Click to collapse
Thanks, I was on P2a42_S038...TMO (T-Mobile, checking OTA update = you are using latest software) flashed this P2a42_S048_ and got OTA info to download latest ROM P2a42_S062_170117_ROW (103MB) :good:
veimus said:
Thanks, I was on P2a42_S038...TMO (T-Mobile, checking OTA update = you are using latest software) flashed this P2a42_S048_ and got OTA info to download latest ROM P2a42_S062_170117_ROW (103MB) :good:
Click to expand...
Click to collapse
Witaj. Mozesz napisać jak wgrałeś czysty soft do Lenovo p2. Tez mam rom z t.mobile a nigdzie nie ma poradnika jak wgrać czysty soft.Pozdrawiam
itsjustbilly said:
Taken from post 4 of the TWRP page on lenovo P2 forum
Factory Images & Systemless Mode
Q: I messed up help me?!
So you screwed up and didn't follow Rule Number One in the IT-Handbook?
Which is: Always create a backup before working on a system?
Download the Factory State Images. Which are all flashable with fastboot: https://goo.gl/JTCwKj
Place the files you want replaced into the "Minimal ADB & Fastboot" installation directory and start it's shell:
If you want to flash back the stock image. Simply run:
Code:
Code:
fastboot flashall
You can also replace all partitions if required.
Click to expand...
Click to collapse
Is there an alternative download link? What is Mega? I want to avoid these third party download utility if I can...
I put the following into a BAT file and placed it into ADB / Fastboot directory:
Code:
fastboot flash partition gpt_both0.bin
fastboot flash bootloader bootloader.img
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash dsp adspso.bin
fastboot flash system systemchunk0.img
fastboot flash system systemchunk1.img
fastboot flash system systemchunk2.img
fastboot flash system systemchunk3.img
fastboot flash system systemchunk4.img
fastboot flash system systemchunk5.img
fastboot flash system systemchunk6.img
fastboot flash system systemchunk7.img
fastboot flash system systemchunk8.img
fastboot flash system systemchunk9.img
fastboot flash system systemchunk10.img
fastboot flash system systemchunk11.img
fastboot flash system systemchunk12.img
fastboot flash modem NON-HLOS.bin
fastboot erase modemst1
fastboot erase modemst2
fastboot flash fsg fsg.mbn
fastboot erase cache
fastboot erase userdata
fastboot erase customize
fastboot erase clogo
pause
Extract all the files listed in the BAT file or simply extract the entire archive to ADB / Fastboot and launch the BAT file.
Does this work?? @Undesirable
the above post
Oh yeah, it unbricked me and put me back to stock so I could get OTA updates for Nougat. You need the archive posted earlier in the thread though.
@Undesirable Nice and elegant solution man! Typing all this stuff was so annoying.
For those who need an alternative download source, I offer this magnet link:
Code:
magnet:?xt=urn:btih:ef05ea3af4da8a0cbb137c10621942f3ae16d46f&dn=P2a42_S048_161111_ROW_fastboot.7z
It's slow unless lots of people help to seed it.
Is it possible to flash this firmware 2a42_S048_161111_ROW_fastboot.7z on the P2c72 with firmware build number: V3.5_1652_5.1342.1_ST_p2c72 ???
I bought this phone 4GB Ram/64GB from china, but I want to put the international firmware on it.
Thanks!
itsjustbilly said:
Taken from post 4 of the TWRP page on lenovo P2 forum
Factory Images & Systemless Mode
Q: I messed up help me?!
So you screwed up and didn't follow Rule Number One in the IT-Handbook?
Which is: Always create a backup before working on a system?
Download the Factory State Images. Which are all flashable with fastboot: https://goo.gl/JTCwKj
Place the files you want replaced into the "Minimal ADB & Fastboot" installation directory and start it's shell:
If you want to flash back the stock image. Simply run:
Code:
Code:
fastboot flashall
You can also replace all partitions if required.
Click to expand...
Click to collapse
how can I replace my data partition? It's not getting formatted due to an encryption error
If fastboot erase userdata doesn't work, then use TWRP to change user data file system to EXT4 then change it back to F2FS again.
Need help...
I flashed back the stock ROM (due to encryption error in custom 7.0 ROM) using fastboot commands, but my SIGNAL WON'T WORK after I started d phone . I've tried reflashing the stock firmware (and also custom ROMs) but my phone won't detect the signal. "About phone" settings show unknown baseband and IMEI... how to get it back
---------- Post added at 08:58 AM ---------- Previous post was at 08:06 AM ----------
I've flashed 'ROW' variant of stock ROM. Is there a different version for Indian variant?

Help restoring to stock image, after trying to install copperhead os

Hi all,
I'm sorry to ask this question, but I'm really struggling to get my Nexus 5X to boot into stock rom. The install seems to go ok, but there was error when flashing.. See below...
archive does not contain 'boot.sig'
archive does not contain 'dtbo.img'
archive does not contain 'dt.img'
The phone now boots to the google boot logo, then loops back to either the "Unlocked Bootloader" or the Custom OS message. (depending on the locked state of the bootloader)
I cannot get into recovery, as the phone just loops back as described above when selecting it from the bootloader option.
Can anyone advise me on how to restore the phone back to stock os. I've tried flashing version 7.1.2 8.0.0 and 8.1.0, using either the flash-all.bat or manually typing the commands. I'm 110% sure this is not to do with over heating on CPU/RAM, I have another nexus 5x that has the bootloop of death and it's bootloop is very different from what I'm seeing on this Nexus 5x.
Thanks in advance
First, the .sig errors are normal so you can ignore those. I would make sure your booloader is unlocked then manually flash the bootloader.img. Then boot back into the bootloader. Then manually flash the remainder of the partitions. Use the 8.1.0 os.
Sent from my [device_name] using XDA-Developers Legacy app
Ok here's what I've done.
1) Downloaded bullhead-opm2.171019.029.zip from Google factory images.
2) Extracted the zip to a folder and extracted image-bullhead-opm2.171019.029.zip to the same folder to get the boot.img | system.img | vendor.img and recovery.img file. (there was no userdata.img nor cache.img within the zip, so I downloaded 7.1.1 version and extracted those files too)
3) Using SDK tools ADB /Fastboot version 1.0.38, I flashed the following:-
fastboot flash bootloader C:\bullhead\images\bootloader-bullhead-bullhead-xx.xx.img
fastboot reboot-bootloader
fastboot flash radio C:\bullhead\images\radio-bullhead-bullhead-xx.xx.img
fastboot reboot-bootloader
fastboot flash boot C:\bullhead\images\boot.img
fastboot erase cache
fastboot flash cache C:\bullhead\images\cache.img
fastboot flash recovery C:\bullhead\images\recovery.img
fastboot flash system C:\bullhead\images\system.img
fastboot flash vendor C:\bullhead\images\vendor.img
fastboot flash userdata C:\bullhead\images\userdata.img
fastboot oem lock
Everything flashed without a problem, no error. However the phone still does not boot into the OS nor can I get it to boot into recovery mode.
I cannot understand what I am doing wrong. I think it has something to do with the installation of copperhead I tried. Does anyone know whether copperhead os restricts going back to stock rom due to its additional security features?
I'm stuck!!!
Thanks in advance.
pinkstink said:
Ok here's what I've done.
1) Downloaded bullhead-opm2.171019.029.zip from Google factory images.
2) Extracted the zip to a folder and extracted image-bullhead-opm2.171019.029.zip to the same folder to get the boot.img | system.img | vendor.img and recovery.img file. (there was no userdata.img nor cache.img within the zip, so I downloaded 7.1.1 version and extracted those files too)
3) Using SDK tools ADB /Fastboot version 1.0.38, I flashed the following:-
fastboot flash bootloader C:\bullhead\images\bootloader-bullhead-bullhead-xx.xx.img
fastboot reboot-bootloader
fastboot flash radio C:\bullhead\images\radio-bullhead-bullhead-xx.xx.img
fastboot reboot-bootloader
fastboot flash boot C:\bullhead\images\boot.img
fastboot erase cache
fastboot flash cache C:\bullhead\images\cache.img
fastboot flash recovery C:\bullhead\images\recovery.img
fastboot flash system C:\bullhead\images\system.img
fastboot flash vendor C:\bullhead\images\vendor.img
fastboot flash userdata C:\bullhead\images\userdata.img
fastboot oem lock
Everything flashed without a problem, no error. However the phone still does not boot into the OS nor can I get it to boot into recovery mode.
I cannot understand what I am doing wrong. I think it has something to do with the installation of copperhead I tried. Does anyone know whether copperhead os restricts going back to stock rom due to its additional security features?
I'm stuck!!!
Thanks in advance.
Click to expand...
Click to collapse
Why don't you use the "flash-all.bat" file? I'm pretty sure you're not wiping your system partition in the process you use.
i.adrian said:
Why don't you use the "flash-all.bat" file? I'm pretty sure you're not wiping your system partition in the process you use.
Click to expand...
Click to collapse
Hiya,
I have also tried using the .bat script, it leads to the same place. A phone that does not boot.
thanks in advance.
Can you boot into twrp, fastboot boot twrp.img? If you can try formatting, not wiping, the data partition. It also gives you the option to repairing some other partitions, I don't remember which ones. You could try that.
Sent from my [device_name] using XDA-Developers Legacy app

Phone now boot into fastboot but not system

Hi
I was trying to install Lineage OS on my device, but I failed, now the phone does not have TWRP anymore, and when I power up, it goes into fast boot only.
I have done quite a lot of work to save my phone, and the last thing that I did was download the stock fastboot rom and run flash_all.bat from it.
(I can not get the Miflash tool working on my PC because when I startup the program, it asks me to download 5 drivers, but it failed to download and throw me an error)
luckyvictor said:
Hi
I was trying to install Lineage OS on my device, but I failed, now the phone does not have TWRP anymore, and when I power up, it goes into fast boot only.
I have done quite a lot of work to save my phone, and the last thing that I did was download the stock fastboot rom and run flash_all.bat from it.
(I can not get the Miflash tool working on my PC because when I startup the program, it asks me to download 5 drivers, but it failed to download and throw me an error)
Click to expand...
Click to collapse
First of all - if your phone boots to fastboot, there seems to be a problem with your bootloader or kernel.
To fix that, you need to reflash aboot.img and boot.img via fastboot.
Boot.img depends on the version, you want to install. Copy both files into your fastboot folder and
Code:
fastboot flash boot_a boot.img
Code:
fastboot flash boot_b boot.img
Code:
fastboot flash aboot_a aboot.img
Code:
fastboot flash aboot_b aboot.img
Now your phone shouldn´t stuck @ fastboot anymore.
Ok, to save your data, you could try to boot twrp:
Code:
fastboot boot twrp.img
If you´re lucky, it can decrypt your data - then you can backup data and internal storage...
If it´s not able to decrypt, you need to install twrp.
To install a fastboot rom without miflash look here
I suggest you to install caf-kernel via twrp. Sometimes your phone boots up with it - magic
Voodoojonny said:
First of all - if your phone boots to fastboot, there seems to be a problem with your bootloader or kernel.
To fix that, you need to reflash aboot.img and boot.img via fastboot.
Boot.img depends on the version, you want to install. Copy both files into your fastboot folder and
Code:
fastboot flash boot_a boot.img
Code:
fastboot flash boot_b boot.img
Code:
fastboot flash aboot_a aboot.img
Code:
fastboot flash aboot_b aboot.img
Now your phone shouldn´t stuck @ fastboot anymore.
Ok, to save your data, you could try to boot twrp:
Code:
fastboot boot twrp.img
If you´re lucky, it can decrypt your data - then you can backup data and internal storage...
If it´s not able to decrypt, you need to install twrp.
To install a fastboot rom without miflash look here
I suggest you to install caf-kernel via twrp. Sometimes your phone boots up with it - magic
Click to expand...
Click to collapse
Thanks, will give it a try.
Just for my knowledge, what are these boot_a and boot_b please? they relate to the two sim slot in this device?
luckyvictor said:
Thanks, will give it a try.
Just for my knowledge, what are these boot_a and boot_b please? they relate to the two sim slot in this device?
Click to expand...
Click to collapse
Boot.img from fastboot rom... To be flashed in partition boot_a and boot_b. Our device is a AB-device. That means all partitions are doubled (except of data). If your system breaks, you can switch to the other slot by "fastboot set_active a" or b if you are on a.... Btw perhaps that fixes your phone too! Boot twrp and you can see which slot is active (under reboot)

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

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.
Great guide @tys0n and thank you to @Stricted and @deadman96385 for his work !
tys0n said:
Code:
fastboot flash vbmeta vbmeta_patch.img
fastboot boot twrp-3.3.1-test3.img
Click to expand...
Click to collapse
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.
daekdroom said:
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.
Click to expand...
Click to collapse
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.
Worked to my, Thnx
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
gonzo1963 said:
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
Click to expand...
Click to collapse
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.
tys0n said:
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.
Click to expand...
Click to collapse
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 said:
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
Click to expand...
Click to collapse
Good afternoon,
Any answer?
Regards
Enviado desde mi unknown mediante Tapatalk
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?
"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
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
Preceptor said:
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?
Click to expand...
Click to collapse
same here !
sennator said:
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
Click to expand...
Click to collapse
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.
kArLiN_dRaKE_MX said:
same here !
Click to expand...
Click to collapse
Format data in twrp
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.
It worked.
I performed the process again.
and everything went well.
Thanks to everyone involved. :good:
gambiarraweb1 said:
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.
Click to expand...
Click to collapse
Just a quick question, when I have TWRP and root I can't pass the SafetyNet check, right?
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?
simije97 said:
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?
Click to expand...
Click to collapse
You probably have Data encrypted. You need to execute Format Data in TWRP.
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.

Categories

Resources