Use external SD card for /data - LG K8 Guides, News, & Discussion

The what:
Use an ext4 partition on the external SD card as /data instead of the internal userdata partition.
Warning:
This method does not require root permissions, but does involve boot image modification and, as such, bootloader unlocking.
I only tested this successfully with the firmware K350n10e_00_0630.kdz (Android 6.0.x Marshmallow, Vodafone Hungary) from 2016-07-27.
Doing this on a newer firmware could brick your device!
If you are not willing to take the risk and/or you don't mind moving some apps by hand, you can use the the following guide instead: [GUIDE] Configure SD card as internal storage in Marshmallow on LG Spirit [H440n] by SteSko.
Slowdowns on bootup and app startup have been observed!
The why:
The LG K8 (K350n) has only 8 GB of internal storage space, which gets filled up very fast, resulting in not being to install/update apps or update the OS.
Some applications don't permit being moved to the SD card.
I only found about about SteSko's method after discovering this one, even though I have search a lot.
The how:
Obtain adb and fastboot by downloading android platform-tools.
Obtain [TOOL] KDZ and TOT Extractor from the thread by bullghost
Obtain your firmware, for example by perusing the thread [STOCK][KDZ][FIRMWARE] All models of the device LG K8 (code name: M1V) by ze7zez.
Obtain or port yourself a TWRP, for example by perusing the thread "Portable" TWRP porter [MTK] [TWRP 3.0.2 - 3.1.1] by gottlasz.
Obtain [TOOL][UTILITY] Carliv Image Kitchen for Android - unpack/repack boot-recovery by bluefirebird from the repository. Don't forget to change to the branch supporting your operating system.
Unlock your bootloader:
Open Settings -> General -> About phone -> Software info.
Keep tapping Build number until you become a developer!
Open Settings -> General -> Developer options.
Turn on USB debugging and Enable OEM unlock.
Run adb and enable access on the phone if asked:
Code:
adb devices
Reboot to bootloader/fastboot mode:
Code:
adb reboot bootloader
Check if fastboot can see your phone:
Code:
fastboot devices
Note: It's okay if the phone's name is unreadable letter soup.
Unlock your bootloader, agree on your phone when asked:
Code:
fastboot oem unlock
Warning: This will wipe your data!
Modify the boot image:
Enable USB debugging, Enable OEM unlock, reboot into bootloader just like before.
Boot the TWRP image you downloaded or ported earlier:
Code:
fastboot boot yourTWRP.img
Press Cancel when asked about the decyption key. You can allow modifications to System.
Tap Advanced -> Partition SD Card.
Select your SD card, tap OK.
Set the size for the new partition (what remains will be usable as the external SD card), switch the File System to ext4, swipe to partition.
Go back to the main menu, select Advanced -> Terminal.
List your block devices, the device we are looking for will only have two partitions. We need the second one, take note of its path.
Code:
ls /dev/block
On my phone, the new partition was located at /dev/block/mmcblk1p2.
Go back to the main menu, select Reboot -> System.
Use the KDZ extractor obtained earlier to unpack the DZ file from your KDZ file obtained earlier.
Use the KDZ extractor obtained earlier to unpack the boot image from the DZ file. (This tool can also be used to extract the recovery image for porting TWRP.)
Unpack Carliv Image Kitchen.
Copy your boot image into the boot-resources directory, change the extension from bin to img.
Use Carliv Image Kitchen to unpack the boot image. The unpacked data will appear in the boot directory.
Modify boot/ramdisk/fstab.mm1v:
Find the line dealing with /data. On my phone it was:
Code:
/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/userdata /data ext4 noatime,nosuid,nodev,noauto_da_alloc,discard wait,check,resize,forceencrypt=/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/encrypt
Change the partition to the one we just created. On my phone this resulted in:
Code:
/dev/block/mmcblk1p2 /data ext4 noatime,nosuid,nodev,noauto_da_alloc,discard wait,check,resize,forceencrypt=/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/encrypt
Save the file, then repack the boot image. You will find your modified boot image in the output directory.
Copy the image file to your SD card, we will need it.
Flash the boot image:
Reboot into bootloader just like before, boot TWRP, Cancel decryption, allow System modification.
In the main menu, tap Install.
Tap Select Storage and select your SD card.
Tap Install Image, because that's what we are going to do.
Select your boot image file.
Select the Boot partition, swipe to flash.
Wipe data and restart:
Go back to the main menu, tap Wipe.
Swipe to complete the wipe, then Reboot.
Notes:
Tested with the firmware K350n10e_00_0630.kdz (Android 6.0.x Marshmallow, Vodafone Hungary) from 2016-07-27.
Warning: Doing this on a newer firmware could brick your device! (Although it can be unbricked by flashing a new firmware in download mode using LGUP.)
This is my first thread, criticism is welcome.

hi, i just wonder, is it possible to change and make it permanent the stock recovery into twrp recovery as we all knew that the only chance we can boot into twrp into this LG K8 k350n model is by boot into fastboot mode and do fastboot boot twrp.img (recovery).
I did successfully flash the twrp recovery with the same size and proper with the stock recovery. But when i tries to boot into twrp by pressing Vol Down + Power Button and klik release Power Button when the logo appears it did just entering the stock recovery..
thanks..

Related

[How-to]: OTA updates with (Magisk) rooted devices

Hi,
I present here my last guide for OTA upgrades with rooted devices, in this case with Magisk.
Previous similar work:
http://forum.xda-developers.com/g5-plus/how-to/guide-simple-ota-update-rooted-unlocked-t3610895
http://forum.xda-developers.com/moto-g4/how-to/guide-simple-ota-update-rooted-unlocked-t3510126
This guide is tested by me for an upgrade from NPNS25.137-33-5 to NPNS25.137-33-11 using the incremental OTA (the official upgrade you get in the smartphone). Please, note that this guide is for advanced users!
Starting point:
- STOCK ROM with an untouched SYSTEM partition.
- Flashed custom TWRP as recovery.
- Flashed custom kernel with disabled Data encryption enforcement.
- MagiskSU installed, and any other changes that you like (i.e. Xposed) but all Systemless.
- USB Debug mode enabled in Developer Options and access granted from your PC.
- One SD card with almost 16GB of size.
Warning: If you use PIN or any other lock procedure, I recommend to disable it before backups and enable after restore!
PROCEDURE:
Step 1:
Backup your SD-Internal (to PC or SD-CARD). This is required because the TWRP backup doesn't backup this data.
Step 2:
Reboot to TWRP, Make backup of "Data", "Logo" & "Boot" (you will restore them after the upgrade).
Step 3:
Reboot to Bootloader and flash ORIGINAL partitions "Recovery", "Logo" & "Boot" using a PC:
Code:
# fastboot flash logo logo.bin
# fastboot flash boot boot.img
# fastboot flash recovery recovery.img
Or if you have a TWRP backup of these patitions, then you could restore them from TWRP (instead of using a PC).
Note: If you have modified SYSTEM and/or OEM partitions, then also flash them (or restore them from a TWRP backup):
Code:
# fastboot flash system system.img
# fastboot flash oem oem.img
Step 4:
Reboot.
Note: from this point your "Data" partition is now fully encrypted, so not execute any relevant command as you will lose any update when restore the "Data" after the OTA update. At this point you have the smartphone in "pure" Stock mode.
Step 5:
Go to check "System Updates", download the update & install the OTA (the device reboots).
Step 6:
After rebooting the OTA file is executed. If it ends with an "ERROR" message, then something is erroneous (check your partitions!).
If the device reboots without an error check your new firmware. The upgrade is completed!
Step 7:
From this point you would like to restore your previous state: data, root, Magisk, etc.
If you like to save a TWRP backup of current partitions (for the next OTA upgrade) then do this:
- Reboot to bootloader mode and boot a non-flashable TWRP (like then Multi-ROM version: "fastboot boot mr-twrp-3.1.1-potter-20170521.img") and complete a backup of the new "Recovery", "Boot", "Logo", "System" & "Oem" partitions to the SDCard.
NOTE: The Multi-ROM TWRP can't backup/mount the OEM partition! Use another method or complete the backup after (you can backup SYSTEM and OEM after).
ALTERNATIVE: Open Terminal and do a manual dump of "Recovery", "Boot", "Logo" and/or "System", "OEM":
Code:
# dd if=/dev/block/bootdevice/by-name/recovery of=/external_sd/recovery.img
# dd if=/dev/block/bootdevice/by-name/boot of=/external_sd/boot.img
# dd if=/dev/block/bootdevice/by-name/logo of=/external_sd/logo.img
Code:
# dd if=/dev/block/bootdevice/by-name/system of=/external_sd/system.img
# dd if=/dev/block/bootdevice/by-name/oem of=/external_sd/oem.img
Step 8:
a) Restore or Flash a recent version of TWRP: "fastboot flash recovery twrp-3.1.1-4-GtrCraft.img" (this version has support for backup/restore OEM!)
b) Reboot to the TWRP recovery and inside it...
c) I recommend first to make now a backup of SYSTEM and OEM paritions (for the next OTA).
d) Format your "Data" partion with "f2fs".
e) Restore your "Data" (and "Logo" & "Cache") from the backup at step #2.
f) Install the ZIP of your custom kernel (or as alternative apply "disable dm-verity").
g) Install the ZIP of Magisk for root.
Step 9:
Re-boot an enjoy your upgraded system!
Remeber to restore your Internal SD card data (from the step #1).
Enable your preferable security option.
:victory:
Nice guide!
One question: How do we flash original items (e.g. OEM, system, boot) if we are on a version with no official firmware? For example, I'm on NPN25.137-83. As far as I know, there is no full firmware for that version; it's only offered as an OTA. If I'm offered an OTA, how can I restore an unmodified system, boot, recovery, etc?
Jrhotrod said:
Nice guide!
One question: How do we flash original items (e.g. OEM, system, boot) if we are on a version with no official firmware? For example, I'm on NPN25.137-83. As far as I know, there is no full firmware for that version; it's only offered as an OTA. If I'm offered an OTA, how can I restore an unmodified system, boot, recovery, etc?
Click to expand...
Click to collapse
If you lost your original SYSTEM, OEM and BOOT partitions, then you need to flash from another place.
For example, you can use download from this post
http://forum.xda-developers.com/g5-plus/how-to/firmwares-moto-g5-plus-t3593160
In any case, I recommend to:
- Use OTAs for upgrading, as it's safe for update your modem and other device stuff (IMEI, etc.) in sync.
- If you like to go from Custom ROM to Stock ROM then restore the last Stock version in your device and apply OTAs from this point.
Regards!
Hi,
More than a week with this GUIDE and only one user puts feedback?
Which TWRP?
manos78 said:
Hi,
More than a week with this GUIDE and only one user puts feedback?
Click to expand...
Click to collapse
This is because we are all still stunned by this cool guide!
However, before I give it a try: in Step 7, why does it have to be
"fastboot boot mr-twrp-3.1.1-potter-20170521.img"?
Can't I use
"fastboot boot twrp-3.1.1-4-GtrCraft.img" here, already? What is it, the craft TWRP cannot do? At least I am able to boot it that way.
Thanks in advance,
Nick.
G5 Plus Mate said:
This is because we are all still stunned by this cool guide!
However, before I give it a try: in Step 7, why does it have to be
"fastboot boot mr-twrp-3.1.1-potter-20170521.img"?
Can't I use
"fastboot boot twrp-3.1.1-4-GtrCraft.img" here, already? What is it, the craft TWRP cannot do? At least I am able to boot it that way.
Thanks in advance,
Nick.
Click to expand...
Click to collapse
Yes, the Fastboot boot command will work for any TWRP image for this phone.
Jrhotrod said:
Yes, the Fastboot boot command will work for any TWRP image for this phone.
Click to expand...
Click to collapse
Cool, so as it seems, we now only need two tools for rooting, unrooting and OTA updates. The Craft TWRP and Magisk v14.0 (or higher). Well, or SuperSU. Booth seem to remove "force encryption" and the "dm-verify-test".
So, we also do not need any further custom kernel or anything else anymore(?)
Well, my XT1687 (which will replace my XT1685, I need a compass!) is supposed to arrive tomorrow. :fingers-crossed:
I'll give it all a try and some comments, too...
G5 Plus Mate said:
Cool, so as it seems, we now only need two tools for rooting, unrooting and OTA updates. The Craft TWRP and Magisk v14.0 (or higher). Well, or SuperSU. Booth seem to remove "force encryption" and the "dm-verify-test".
So, we also do not need any further custom kernel or anything else anymore(?)
Well, my XT1687 (which will replace my XT1685, I need a compass!) is supposed to arrive tomorrow. :fingers-crossed:
I'll give it all a try and some comments, too...
Click to expand...
Click to collapse
Most people with this phone use custom kernels in order to be able to use magisk modules. The stock kernel does not allow for neither passing safetynet nor installing modules. If you would like to use something like systemless Xposed Framework, I'd recommend flashing ElementalX.
Jrhotrod said:
Yes, the Fastboot boot command will work for any TWRP image for this phone.
Click to expand...
Click to collapse
OK, thank you for confirm it!
G5 Plus Mate said:
Cool, so as it seems, we now only need two tools for rooting, unrooting and OTA updates. The Craft TWRP and Magisk v14.0 (or higher). Well, or SuperSU. Booth seem to remove "force encryption" and the "dm-verify-test".
So, we also do not need any further custom kernel or anything else anymore(?)
Click to expand...
Click to collapse
Hi,
If you save a full dump of the SYSTEM partition, then you can use "dm-verity" disable. However, I don't recomment it. Use MagiskSU with a custom kernel (like ElementalX). A custom kernel que provide: Magisk loop mount, non forced encryption, and SafetyNet pass with Magisk running.
Summarizing, you need: custom kernel, Magisk and TWRP.
Slightly modified
Hi.
first of all, thanks again, Manos 78, for the wonderful guide. Playing around with it for several days, I have come up with a slightly modified solution that might be easier to handle. However, it's based on your guide.
So, this guide is for people who (like me) want
- a rooted Moto G5 Plus (might work on other phones, too)
- an unencrypted data partition (e.g. to be able to backup it)
- a relatively easy way to do a system upgrade.
Also, this guide goes for categories of people who start from here with a phone
Cat-1
- with an unencrypted data partition (rooted)
Cat-2
- which is a blank new phone
Cat-3
- with an encrypted data partition
Instead of Magisk, you can probably use SuperSU as well. Also, it doesn't matter if you flash or load TWRP with fastboot. I would recommend flashing it like described below. I have tested it once with XT1687 only, and then with transferring images from my XT1685. Both worked.
So, first you should find yourself a stock-rom suitable for your phone. As for now (let's hope that this won't change) you need to download it once and then use it again for all upcoming future updates as we do the OTA-update.
I used for
XT1687 : POTTER_NPNS25.137-35-5_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC
XT1685: POTTER_NPN25.137-35_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC
After transferring from XT1685 to XT1687, the Dual-SIM handling app froze automatically and I am now on software channel reteu. However, as we update as described below, it doesn't matter.
Let's start with
Cat-1:
01. Disable PIN or any other lock procedure and TWRP-Backup of all partitions (precaution, but you will definitely need data, boot and logo!). Also backup all data of your internal SD-card as it will be wiped. External SD-card will stay untouched.
02. Flash latest elementalX Kernel (optional) and Magisk (14.0 or later) to be on the same version before and after the update (precaution).
Either
03a. Flash any valid old(er) Stock-Rom, fitting to the update channel of your phone. If one works, use it again each time you update.
03b. Perform OTA update (after reboot wait for the message saying it's done!)
or
04. Download and install latest Stock-Rom and install
05. Flash TWRP "twrp-3.1.1-4-GtrCraft.img"
06. Flash latest elementalX Kernel(optional, but recommended) and then MAGISK (14.0 or later)
07. Reboot to TWRP
08. Format data
09. Reboot to TWRP
10. Restore data, boot und logo
11. Reboot
12. In Developer Options disable automatic update
13. Install / upgrade Magisk Manager app
14. Flash logo.bin (optional to get rid of the ugly initial warning screen)
done.
Cat-2
Perform steps 03a/b, 5,6,7,8,9,12,13,14. Boot-loader needs to be unlocked, of course.
Cat-3
As you cannot backup an unencrypted partition (for now) you will have to backup your data conventionally. Titanium Backup and app's own functionalities might help. However, this needs to be done only once as you will be unencrypted afterwards.
After this, re-flash Stock-Rom and proceed like for Cat-2.
Note:
Once again: this is a system-less variant, so it doesn't touch the system partition. If you want to keep it that way, then in TWRP never swipe to allow modifications! Choose system partition read only.
The following might need to be confirmed, but I believe, that if you do it once, the device will recognize it and when you go into boot loader the device will from now on display the system to be modified. I haven't found a way to get rid of that again.
If you leave it untouched, then this message will not come up and after locking the boot loader again you will have a device like new again. I think you will not get into any warranty trouble once something is broken.
Maybe some one can comment on this to be right or wrong…
And, just in case you have similar problems:
On windows I was not able to unlock my boot-loader.. I got the message that the boot-loader cannot be unlocked. On Mint Linux it just worked fine. Also flashing logo.bin did not work on windows but on Linux.
On Linux again flashing the stock-rom does not work, but on windows. I am not sure if I want a comment on that.
Stuck in Your device will boot in 5 seconds screen
Hi,
At step 3, I didnt have the original partitions. So I used the partitions from the firmware POTTER_AMZ_7.0_NPNS25.137-35-5_cid18_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip.
After rebooting it, my phone is stuck in the screen. At one point it showed error.
What should I do??
Help
Why data partition format to f2fs
Is it important to format data partition to f2fs? Can I just wipe data partition and restore from the backup without formatting?
manos78 said:
Hi,
I present here my last guide for OTA upgrades with rooted devices, in this case with Magisk.
Previous similar work:
http://forum.xda-developers.com/g5-plus/how-to/guide-simple-ota-update-rooted-unlocked-t3610895
http://forum.xda-developers.com/moto-g4/how-to/guide-simple-ota-update-rooted-unlocked-t3510126
This guide is tested by me for an upgrade from NPNS25.137-33-5 to NPNS25.137-33-11 using the incremental OTA (the official upgrade you get in the smartphone). Please, note that this guide is for advanced users!
Starting point:
- STOCK ROM with an untouched SYSTEM partition.
- Flashed custom TWRP as recovery.
- Flashed custom kernel with disabled Data encryption enforcement.
- MagiskSU installed, and any other changes that you like (i.e. Xposed) but all Systemless.
- USB Debug mode enabled in Developer Options and access granted from your PC.
- One SD card with almost 16GB of size.
Warning: If you use PIN or any other lock procedure, I recommend to disable it before backups and enable after restore!
PROCEDURE:
Step 1:
Backup your SD-Internal (to PC or SD-CARD). This is required because the TWRP backup doesn't backup this data.
Step 2:
Reboot to TWRP, Make backup of "Data", "Logo" & "Boot" (you will restore them after the upgrade).
Step 3:
Reboot to Bootloader and flash ORIGINAL partitions "Recovery", "Logo" & "Boot" using a PC:
Code:
# fastboot flash logo logo.bin
# fastboot flash boot boot.img
# fastboot flash recovery recovery.img
Or if you have a TWRP backup of these patitions, then you could restore them from TWRP (instead of using a PC).
Note: If you have modified SYSTEM and/or OEM partitions, then also flash them (or restore them from a TWRP backup):
Code:
# fastboot flash system system.img
# fastboot flash oem oem.img
Step 4:
Reboot.
Note: from this point your "Data" partition is now fully encrypted, so not execute any relevant command as you will lose any update when restore the "Data" after the OTA update. At this point you have the smartphone in "pure" Stock mode.
Step 5:
Go to check "System Updates", download the update & install the OTA (the device reboots).
Step 6:
After rebooting the OTA file is executed. If it ends with an "ERROR" message, then something is erroneous (check your partitions!).
If the device reboots without an error check your new firmware. The upgrade is completed!
Step 7:
From this point you would like to restore your previous state: data, root, Magisk, etc.
If you like to save a TWRP backup of current partitions (for the next OTA upgrade) then do this:
- Reboot to bootloader mode and boot a non-flashable TWRP (like then Multi-ROM version: "fastboot boot mr-twrp-3.1.1-potter-20170521.img") and complete a backup of the new "Recovery", "Boot", "Logo", "System" & "Oem" partitions to the SDCard.
NOTE: The Multi-ROM TWRP can't backup/mount the OEM partition! Use another method or complete the backup after (you can backup SYSTEM and OEM after).
ALTERNATIVE: Open Terminal and do a manual dump of "Recovery", "Boot", "Logo" and/or "System", "OEM":
Code:
# dd if=/dev/block/bootdevice/by-name/recovery of=/external_sd/recovery.img
# dd if=/dev/block/bootdevice/by-name/boot of=/external_sd/boot.img
# dd if=/dev/block/bootdevice/by-name/logo of=/external_sd/logo.img
Code:
# dd if=/dev/block/bootdevice/by-name/system of=/external_sd/system.img
# dd if=/dev/block/bootdevice/by-name/oem of=/external_sd/oem.img
Step 8:
a) Restore or Flash a recent version of TWRP: "fastboot flash recovery twrp-3.1.1-4-GtrCraft.img" (this version has support for backup/restore OEM!)
b) Reboot to the TWRP recovery and inside it...
c) I recommend first to make now a backup of SYSTEM and OEM paritions (for the next OTA).
d) Format your "Data" partion with "f2fs".
e) Restore your "Data" (and "Logo" & "Cache") from the backup at step #2.
f) Install the ZIP of your custom kernel (or as alternative apply "disable dm-verity").
g) Install the ZIP of Magisk for root.
Step 9:
Re-boot an enjoy your upgraded system!
Remeber to restore your Internal SD card data (from the step #1).
Enable your preferable security option.
:victory:
Click to expand...
Click to collapse
androidgeek121 said:
Is it important to format data partition to f2fs? Can I just wipe data partition and restore from the backup without formatting?
Click to expand...
Click to collapse
Hi,
- The "f2fs" is the default format in Stock ROM. If you don't select it in TWRP it will be formated as "ext4".
- The "f2fs" filesystem it's better than "ext4" for the internal eMMC storage (faster writes and more robust).
- If you format as "ext4" it will continue working. So, if you restore without forcing the format perhaps you don't care that the filesystem it's changed.
Regards!
Are OTA updates possible 1. without TWRP and 2. with preserved encryption?
I have a Samsung Galaxy S7 edge, international version, Android 6, unlocked bootloader, first rooted with CF-auto-root, now installed Magisk via modified boot.img, pure stock rom.
Forgive me for sounding dense but this method could work on a Moto G4 Plus (athene) correct? ?
G5 Plus Mate said:
Hi.
first of all, thanks again, Manos 78, for the wonderful guide. Playing around with it for several days, I have come up with a slightly modified solution that might be easier to handle. However, it's based on your guide.
So, this guide is for people who (like me) want
- a rooted Moto G5 Plus (might work on other phones, too)
- an unencrypted data partition (e.g. to be able to backup it)
- a relatively easy way to do a system upgrade.
Also, this guide goes for categories of people who start from here with a phone
Cat-1
- with an unencrypted data partition (rooted)
Cat-2
- which is a blank new phone
Cat-3
- with an encrypted data partition
Instead of Magisk, you can probably use SuperSU as well. Also, it doesn't matter if you flash or load TWRP with fastboot. I would recommend flashing it like described below. I have tested it once with XT1687 only, and then with transferring images from my XT1685. Both worked.
So, first you should find yourself a stock-rom suitable for your phone. As for now (let's hope that this won't change) you need to download it once and then use it again for all upcoming future updates as we do the OTA-update.
I used for
XT1687 : POTTER_NPNS25.137-35-5_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC
XT1685: POTTER_NPN25.137-35_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC
After transferring from XT1685 to XT1687, the Dual-SIM handling app froze automatically and I am now on software channel reteu. However, as we update as described below, it doesn't matter.
Let's start with
Cat-1:
01. Disable PIN or any other lock procedure and TWRP-Backup of all partitions (precaution, but you will definitely need data, boot and logo!). Also backup all data of your internal SD-card as it will be wiped. External SD-card will stay untouched.
02. Flash latest elementalX Kernel (optional) and Magisk (14.0 or later) to be on the same version before and after the update (precaution).
Either
03a. Flash any valid old(er) Stock-Rom, fitting to the update channel of your phone. If one works, use it again each time you update.
03b. Perform OTA update (after reboot wait for the message saying it's done!)
or
04. Download and install latest Stock-Rom and install
05. Flash TWRP "twrp-3.1.1-4-GtrCraft.img"
06. Flash latest elementalX Kernel(optional, but recommended) and then MAGISK (14.0 or later)
07. Reboot to TWRP
08. Format data
09. Reboot to TWRP
10. Restore data, boot und logo
11. Reboot
12. In Developer Options disable automatic update
13. Install / upgrade Magisk Manager app
14. Flash logo.bin (optional to get rid of the ugly initial warning screen)
done.
Cat-2
Perform steps 03a/b, 5,6,7,8,9,12,13,14. Boot-loader needs to be unlocked, of course.
Cat-3
As you cannot backup an unencrypted partition (for now) you will have to backup your data conventionally. Titanium Backup and app's own functionalities might help. However, this needs to be done only once as you will be unencrypted afterwards.
After this, re-flash Stock-Rom and proceed like for Cat-2.
Note:
Once again: this is a system-less variant, so it doesn't touch the system partition. If you want to keep it that way, then in TWRP never swipe to allow modifications! Choose system partition read only.
The following might need to be confirmed, but I believe, that if you do it once, the device will recognize it and when you go into boot loader the device will from now on display the system to be modified. I haven't found a way to get rid of that again.
If you leave it untouched, then this message will not come up and after locking the boot loader again you will have a device like new again. I think you will not get into any warranty trouble once something is broken.
Maybe some one can comment on this to be right or wrong…
And, just in case you have similar problems:
On windows I was not able to unlock my boot-loader.. I got the message that the boot-loader cannot be unlocked. On Mint Linux it just worked fine. Also flashing logo.bin did not work on windows but on Linux.
On Linux again flashing the stock-rom does not work, but on windows. I am not sure if I want a comment on that.
Click to expand...
Click to collapse
Many thanks for this method. I used Cat -1 today and ran into a little problem with repeated com.android.phone has stopped working errors after just flashing the partitions listed here. So I just did a complete Stock reflash and that resolved that error. Then was able to proceed with the rest of the steps without any issues!
I am on RETUS and applied the November 1st update. Surprised on how well it worked!
manos78 said:
Hi,
I present here my last guide for OTA upgrades with rooted devices, in this case with Magisk.
Previous similar work:
http://forum.xda-developers.com/g5-plus/how-to/guide-simple-ota-update-rooted-unlocked-t3610895
http://forum.xda-developers.com/moto-g4/how-to/guide-simple-ota-update-rooted-unlocked-t3510126
This guide is tested by me for an upgrade from NPNS25.137-33-5 to NPNS25.137-33-11 using the incremental OTA (the official upgrade you get in the smartphone). Please, note that this guide is for advanced users!
Starting point:
- STOCK ROM with an untouched SYSTEM partition.
- Flashed custom TWRP as recovery.
- Flashed custom kernel with disabled Data encryption enforcement.
- MagiskSU installed, and any other changes that you like (i.e. Xposed) but all Systemless.
- USB Debug mode enabled in Developer Options and access granted from your PC.
- One SD card with almost 16GB of size.
Warning: If you use PIN or any other lock procedure, I recommend to disable it before backups and enable after restore!
PROCEDURE:
Step 1:
Backup your SD-Internal (to PC or SD-CARD). This is required because the TWRP backup doesn't backup this data.
Step 2:
Reboot to TWRP, Make backup of "Data", "Logo" & "Boot" (you will restore them after the upgrade).
Step 3:
Reboot to Bootloader and flash ORIGINAL partitions "Recovery", "Logo" & "Boot" using a PC:
Code:
# fastboot flash logo logo.bin
# fastboot flash boot boot.img
# fastboot flash recovery recovery.img
Or if you have a TWRP backup of these patitions, then you could restore them from TWRP (instead of using a PC).
Note: If you have modified SYSTEM and/or OEM partitions, then also flash them (or restore them from a TWRP backup):
Code:
# fastboot flash system system.img
# fastboot flash oem oem.img
Step 4:
Reboot.
Note: from this point your "Data" partition is now fully encrypted, so not execute any relevant command as you will lose any update when restore the "Data" after the OTA update. At this point you have the smartphone in "pure" Stock mode.
Step 5:
Go to check "System Updates", download the update & install the OTA (the device reboots).
Step 6:
After rebooting the OTA file is executed. If it ends with an "ERROR" message, then something is erroneous (check your partitions!).
If the device reboots without an error check your new firmware. The upgrade is completed!
Step 7:
From this point you would like to restore your previous state: data, root, Magisk, etc.
If you like to save a TWRP backup of current partitions (for the next OTA upgrade) then do this:
- Reboot to bootloader mode and boot a non-flashable TWRP (like then Multi-ROM version: "fastboot boot mr-twrp-3.1.1-potter-20170521.img") and complete a backup of the new "Recovery", "Boot", "Logo", "System" & "Oem" partitions to the SDCard.
NOTE: The Multi-ROM TWRP can't backup/mount the OEM partition! Use another method or complete the backup after (you can backup SYSTEM and OEM after).
ALTERNATIVE: Open Terminal and do a manual dump of "Recovery", "Boot", "Logo" and/or "System", "OEM":
Code:
# dd if=/dev/block/bootdevice/by-name/recovery of=/external_sd/recovery.img
# dd if=/dev/block/bootdevice/by-name/boot of=/external_sd/boot.img
# dd if=/dev/block/bootdevice/by-name/logo of=/external_sd/logo.img
Code:
# dd if=/dev/block/bootdevice/by-name/system of=/external_sd/system.img
# dd if=/dev/block/bootdevice/by-name/oem of=/external_sd/oem.img
Step 8:
a) Restore or Flash a recent version of TWRP: "fastboot flash recovery twrp-3.1.1-4-GtrCraft.img" (this version has support for backup/restore OEM!)
b) Reboot to the TWRP recovery and inside it...
c) I recommend first to make now a backup of SYSTEM and OEM paritions (for the next OTA).
d) Format your "Data" partion with "f2fs".
e) Restore your "Data" (and "Logo" & "Cache") from the backup at step #2.
f) Install the ZIP of your custom kernel (or as alternative apply "disable dm-verity").
g) Install the ZIP of Magisk for root.
Step 9:
Re-boot an enjoy your upgraded system!
Remeber to restore your Internal SD card data (from the step #1).
Enable your preferable security option.
:victory:
Click to expand...
Click to collapse
Thank you so much you wonderful person. Successfully upgraded to NPNS25. 137-93-4 and security patch January, 1 2018 with an unlocked bootloader. I had to flash recovery, logo, boot, system.parts & oem for it succeed. I won't forget this anytime soon.
Just a little hint:
In step 8 you say
e) Restore your "Data" (and "Logo" & "Cache") from the backup at step #2.
Click to expand...
Click to collapse
It should be "Boot" instead of "Cache" as we made a backup of "Data", "Logo" & "Boot" in step 2.
manos78 said:
Hi,
I present here my last guide for OTA upgrades with rooted devices, in this case with Magisk.
Previous similar work:
http://forum.xda-developers.com/g5-plus/how-to/guide-simple-ota-update-rooted-unlocked-t3610895
http://forum.xda-developers.com/moto-g4/how-to/guide-simple-ota-update-rooted-unlocked-t3510126
This guide is tested by me for an upgrade from NPNS25.137-33-5 to NPNS25.137-33-11 using the incremental OTA (the official upgrade you get in the smartphone). Please, note that this guide is for advanced users!
Starting point:
- STOCK ROM with an untouched SYSTEM partition.
- Flashed custom TWRP as recovery.
- Flashed custom kernel with disabled Data encryption enforcement.
- MagiskSU installed, and any other changes that you like (i.e. Xposed) but all Systemless.
- USB Debug mode enabled in Developer Options and access granted from your PC.
- One SD card with almost 16GB of size.
Warning: If you use PIN or any other lock procedure, I recommend to disable it before backups and enable after restore!
PROCEDURE:
Step 1:
Backup your SD-Internal (to PC or SD-CARD). This is required because the TWRP backup doesn't backup this data.
Step 2:
Reboot to TWRP, Make backup of "Data", "Logo" & "Boot" (you will restore them after the upgrade).
Step 3:
Reboot to Bootloader and flash ORIGINAL partitions "Recovery", "Logo" & "Boot" using a PC:
Code:
# fastboot flash logo logo.bin
# fastboot flash boot boot.img
# fastboot flash recovery recovery.img
Or if you have a TWRP backup of these patitions, then you could restore them from TWRP (instead of using a PC).
Note: If you have modified SYSTEM and/or OEM partitions, then also flash them (or restore them from a TWRP backup):
Code:
# fastboot flash system system.img
# fastboot flash oem oem.img
Step 4:
Reboot.
Note: from this point your "Data" partition is now fully encrypted, so not execute any relevant command as you will lose any update when restore the "Data" after the OTA update. At this point you have the smartphone in "pure" Stock mode.
Step 5:
Go to check "System Updates", download the update & install the OTA (the device reboots).
Step 6:
After rebooting the OTA file is executed. If it ends with an "ERROR" message, then something is erroneous (check your partitions!).
If the device reboots without an error check your new firmware. The upgrade is completed!
Step 7:
From this point you would like to restore your previous state: data, root, Magisk, etc.
If you like to save a TWRP backup of current partitions (for the next OTA upgrade) then do this:
- Reboot to bootloader mode and boot a non-flashable TWRP (like then Multi-ROM version: "fastboot boot mr-twrp-3.1.1-potter-20170521.img") and complete a backup of the new "Recovery", "Boot", "Logo", "System" & "Oem" partitions to the SDCard.
NOTE: The Multi-ROM TWRP can't backup/mount the OEM partition! Use another method or complete the backup after (you can backup SYSTEM and OEM after).
ALTERNATIVE: Open Terminal and do a manual dump of "Recovery", "Boot", "Logo" and/or "System", "OEM":
Code:
# dd if=/dev/block/bootdevice/by-name/recovery of=/external_sd/recovery.img
# dd if=/dev/block/bootdevice/by-name/boot of=/external_sd/boot.img
# dd if=/dev/block/bootdevice/by-name/logo of=/external_sd/logo.img
Code:
# dd if=/dev/block/bootdevice/by-name/system of=/external_sd/system.img
# dd if=/dev/block/bootdevice/by-name/oem of=/external_sd/oem.img
Step 8:
a) Restore or Flash a recent version of TWRP: "fastboot flash recovery twrp-3.1.1-4-GtrCraft.img" (this version has support for backup/restore OEM!)
b) Reboot to the TWRP recovery and inside it...
c) I recommend first to make now a backup of SYSTEM and OEM paritions (for the next OTA).
d) Format your "Data" partion with "f2fs".
e) Restore your "Data" (and "Logo" & "Cache") from the backup at step #2.
f) Install the ZIP of your custom kernel (or as alternative apply "disable dm-verity").
g) Install the ZIP of Magisk for root.
Step 9:
Re-boot an enjoy your upgraded system!
Remember to restore your Internal SD card data (from the step #1).
Enable your preferable security option.
:victory:
Click to expand...
Click to collapse
I am kind'a novice at this - also it's my first time installing the latest RETUS OTA update 93-10. Would someone please clarify the questions below?
I do not recall if I modified SYSTEM and/or OEM partitions when I rooted the phone, is it OK to go ahead and flash? :
Code:
# fastboot flash system system.img
# fastboot flash oem oem.img
In Step 7 - do I restore "Data", "Logo" & "Boot" with TWRP from back-up in Step 2?
Everything else from Step 8 down is optional?

Help me understand the whole A/B partitioning format

Can anyone help me understand the whole procedure now that we have A/B partitions? I'm coming from a Nexus 5 and this A/B partition thing kinda complicates things, but I'm sure I have got 80% the gist of it. That being said, I don't have my Pixel XL YET, but I want to be prepared.
1)Enable Developer Options
2)Enable OEM Unlock Bootloader and USB Debugging
3)Boot into bootloader
4)Flash latest factory image downloaded from Google(Android 8.1, January as of this post)
5)Boot into the system and re-enable Developer Options and USB debugging. (I guess OEM Unlock Bootloader will BE enabled by default now)
6)Use a PC with fastboot.exe and type "fastboot boot twrp_name_goes_here.IMG" (this ONLY boots TWRP)
7)Boot into TWRP and wipe /system, /data, /cache and ART.
8)Flash the custom ROM of my choice.
9)Flash the GApps of my choice(I use Aroma OpenGapps)
10)Flash Kernel of my choice.
11)Flash Magisk 15.2 (15.2 as of this post)
12Flash TWRP_name_goes_here.ZIP (So I won't lose TWRP)
13)??????
14)Profit
Do tell me if I made a mistake in the whole process and suggest what I should do instead. The whole A/B partitioning system kinda scares me. xD
I've also come across this kernel https://forum.xda-developers.com/pixel-xl/development/kernel-oreo-8-0-exnoshadez-eas-stable-t3709035 that states it doesn't support TWRP. Does it mean that I won't have a custom recovery due to the size of the kernel and I will have to, instead, use a PC every time I want to flash a different ROM and/or Kernel by using the "fastboot boot TWRP_name_goes_here.IMG" command?
Thanks a lot for your time and sorry for this TL;DR post. =D
1)Enable Developer Options
2)Enable OEM Unlock Bootloader and USB Debugging
3)Boot into bootloader
4)unlock boot loader (use command “fastboot flashing unlock) and it's permanent
5)Download latest factory image downloaded from Google and unzip it into your adb platform-tool path
6)Boot into bootloader>use command “fastboot --set-active=b”>now click on “flash-all.bat” in your adb platform-tool path>let it reboot.
6) Do not set your device, just reboot it back to bootloader> use command “fastboot --set-active=a”>now click on “flash-all.bat” in your adb platform-tool path>let it reboot.
5)To flash TWRP download “twrp-3.2.0-0-marlin.img” and “twrp-pixel-installer-marlin-3.2.0-0.zip” because as far as I know, twrp 3.2.1 has some decrypting issue. Download them and put “twrp-3.2.0-0-marlin.img” into your pc adb platform-tool path and move “twrp-pixel-installer-marlin-3.2.0-0.zip” to internal memory on your phone
6)Boot into bootloader>use command “fastboot boot twrp-3.2.0-0-marlin.img” (this ONLY boots TWRP). In TWRP locate and flash “twrp-pixel-installer-marlin-3.2.0-0.zip”
7)Boot in to system and remove your screen lock if you have set up any
8)Download the custom ROM of your choice and compatible GApps and move them in to internal memory on your phone.
9)Boot in to recovery and do a “factory reset” via TWRP> flash custom ROM>flash “twrp-pixel-installer-marlin-3.2.0-0.zip”>boot in to system (do not set up screen lock)
10)Boot in to recovery and flash GApps and Magisk 15.2 via TWRP>boot in to system
Please be noted this is for stock based ROMs only. If you to flash AOSP based rom follow this guide after step 9.Please be noted below guide taken from this ROM thread https://forum.xda-developers.com/pixel-xl/development/rom-lineageos-15-1-pixel-xl-marlin-t3725985 and credits goes to "razorloves"
Download latest vender.img (same one in latest factory images).
Flashing Lineage Rom:
a - Go to `Wipe` and swipe to `Factory Reset`
b - Go to `Install` and select the lineage zip file on the device. Swipe to install
c - Go to `Install` and select the TWRP zip file on the device. Swipe to install
d - Go to `Reboot` and take note of the current slot. Then select `Recovery` to reboot into the installed TWRP
Note: after performing the previous step, you may get a "No OS is installed" warning from TWRP. That's normal. It is ok to swipe to proceed.
e - After rebooting, go to `Reboot` and note the current slot. It should be in the opposite slot from what you were in during the previous step. That switch automatically happens after you flash a custom rom. If you're still in the same slot then something went wrong and you should start over. If you are in the opposite slot, then go back to TWRP home and continue with the next step.
f - Go to `Install` and select `Install Image` and select the stock vendor img, then select `Vendor` partition.
g - Go to `Mount` and select to mount `Vendor`. Go back to TWRP home
h - Go to `Advanced` - > `File Manager`. Navigate to /vendor/overlay/, then click the checkmark in the bottom right. Select `Delete`. Then go back to TWRP home
i - Go to `Install` and select the Opengapps zip file. Swipe to install (This step is optional. Only needed if you want google apps.)
j - After installation completes, select `Reboot System`
k - You should now see the LineageOS boot animation. The initial boot may take several minutes
Flashing Magisk: (Optional)
Note: If you want root you can flash magisk at any time in the future, but not during the initial install. You must boot into lineage rom at least once.
a - Reboot into twrp and go to 'Reboot' and make sure you're in the same slot you were in at step 3.e
b - Go to `Install` and select the Magisk zip file. Swipe to install
c - After installation completes, select `Reboot System`
Why do I have to flash the vendor.img? When do I flash the vendor.img? And why do I need to delete the /vendor/overlay/ folder?

How To Guide How to flash ROM and TWRP on POCO F3 / k40 / mi11x. And an explanation. A very important guide

Mandatory instructions for beginners (and not only beginners) to install ROM and other on poco f3​Prerequisite, unlocking the bootloader​For questions, if something is not clear, please write to "Conversations", I will try to correct it in a post with a simpler explanation. And I will answer the question (I am not a 24/7 support service, so duplicate your question in the ROM discussion thread in order to give an answer if I'm busy)​
This is your last chance. After this, there is no turning back. You take the blue pill - the story ends, you wake up in your bed and believe whatever you want to believe. You take the red pill - you stay in Wonderland and I show you how deep the rabbit-hole goes
Click to expand...
Click to collapse
!!! The spoiler below is a must-read before doing anything with your device. !!!​
Spoiler: Let's discuss several points at once
Spoiler: 1. Drivers and utilities - download immediately and install so that there are no further questions
1. Fastboot and adb - Tools_r31.0.3
2. Miflash or Mi Flash Tool
3. USBDrivers - QDloader
Spoiler: 2. Features and disadvantages of our device
2.1 We have a so-called A/B partition structure - this is when two spaces are used for system partitions (read more in google) the essence is that there are "Firmware" partitions
Spoiler: code
Code:
"dsp.img", "/dev/block/bootdevice/by-name/dsp_a"
"dsp.img", "/dev/block/bootdevice/by-name/dsp_b"
"xbl_config.img", "/dev/block/bootdevice/by-name/xbl_config_a"
"xbl_config.img", "/dev/block/bootdevice/by-name/xbl_config_b"
"modem.img", "/dev/block/bootdevice/by-name/modem_a"
"modem.img", "/dev/block/bootdevice/by-name/modem_b"
"tz.img", "/dev/block/bootdevice/by-name/tz_a"
"tz.img", "/dev/block/bootdevice/by-name/tz_b"
"bluetooth.img", "/dev/block/bootdevice/by-name/bluetooth_a"
"bluetooth.img", "/dev/block/bootdevice/by-name/bluetooth_b"
"abl.img", "/dev/block/bootdevice/by-name/abl_a"
"abl.img", "/dev/block/bootdevice/by-name/abl_b"
"featenabler.img", "/dev/block/bootdevice/by-name/featenabler_a"
"featenabler.img", "/dev/block/bootdevice/by-name/featenabler_b"
"keymaster.img", "/dev/block/bootdevice/by-name/keymaster_a"
"keymaster.img", "/dev/block/bootdevice/by-name/keymaster_b"
"uefisecapp.img", "/dev/block/bootdevice/by-name/uefisecapp_a"
"uefisecapp.img", "/dev/block/bootdevice/by-name/uefisecapp_b"
"qupfw.img", "/dev/block/bootdevice/by-name/qupfw_a"
"qupfw.img", "/dev/block/bootdevice/by-name/qupfw_b"
"xbl.img", "/dev/block/bootdevice/by-name/xbl_a"
"xbl.img", "/dev/block/bootdevice/by-name/xbl_b"
"cmnlib.img", "/dev/block/bootdevice/by-name/cmnlib_a"
"cmnlib.img", "/dev/block/bootdevice/by-name/cmnlib_b"
"cmnlib64.img", "/dev/block/bootdevice/by-name/cmnlib64_a"
"cmnlib64.img", "/dev/block/bootdevice/by-name/cmnlib64_b"
"devcfg.img", "/dev/block/bootdevice/by-name/devcfg_a"
"devcfg.img", "/dev/block/bootdevice/by-name/devcfg_b"
"hyp.img", "/dev/block/bootdevice/by-name/hyp_a"
"hyp.img", "/dev/block/bootdevice/by-name/hyp_b"
"imagefv.img", "/dev/block/bootdevice/by-name/imagefv_a"
"imagefv.img", "/dev/block/bootdevice/by-name/imagefv_b"
"aop.img", "/dev/block/bootdevice/by-name/aop_a"
"aop.img", "/dev/block/bootdevice/by-name/aop_b"
and there are partitions directly ROM /data, /system /system_ext, /vendor, /product, /odm, /vendor_boot, /boot
2.2 miui based ROMs update all of these sections. In the case of firmware, they are put in both slots at once. Although this is not necessary in essence.
ROMs of a custom type, those based on a "pure" android are often flashed for only partitions of the ROM, but not in 100% case
2.3 For our device, there are 3 types of ROM installation files, 2 of which are divided into two types of installation methods
2.3.1 Let's start simple, Official miui image for fastboot - installation is recommended via miflash, has all partitions inside the archive. There are also 3 files inside - for easy installation of all partitions, for installing all partitions and formatting the memory, as well as for installing all partitions and locking the bootloader (the memory is formatted automatically), the name of the .bat files speaks for themselves
2.3.2 Next - the installation .zip archive of unofficial MIUI for TWRP. Not all partitions, but the main ones (always stitched into section A), including firmware (stitched into both slots A and B)
2.3.3 Sideload type firmware (99% of all custom ROMs) are divided into two installation methods.
Inside the archive there is a payload.bin file in which the rom and sometimes firmware sections are packed
Installation always goes to the adjacent NOT active memory slot, and after completion, makes the adjacent slot active to load the firmware
Installation via PC, via ADB (on the phone, AOSP recovery adb sideload/twrp adb sideload mode) or installation via TWRP directly from the device
2.4 Custom ROMs for fastboot, usually used for a clean installation, which implies cleaning and data from memory (pictures, etc.) inside sometimes have firmware sections and always rom sections. Inside, as the author saw fit, there are .bat launchers for updating (does not erase all data) and for a clean installation (erases all data)
2.5 Another very important feature of the AB structure in our case is two types of fastboot mod. It is called bootloader - official miui is completely flashed through it, and there is a fastbootD mode that is built into the boot sector in aosp recovery or in twrp, it is also needed for flashing img images. Ask what are the differences if this and that fastboot?
The answer is idiotic
Bootloader can flash all main partitions only in both A and B sections at the same time command type - "fastboot flash system_ab system.img"
He knows how to essentially flash a couple of partitions into a certain slot, we only need in this case vendor_boot and boot command type "fastboot flash boot_a boot.img" or instead of A you need to write B
FastbootD, on the other hand, can flash img images separately into the desired slot A or B
2.6 Poco f3/k40/mi11x does not have a separate partition for recovery/twrp,the whole thing is stored in the boot sector in the ramdisk, and the kernel is also stored there. Several factors follow from this knowledge.
2.6.1 To install TWRP, you must first boot into a temporary TWRP, the command type is "fastboot boot twrp.img". Inside TWRP, in the Advanced tab, click install recovery ramdisk, and select the img twrp image on the phone
2.6.3 To install aosp recvoery, you need to flash boot "fastboot boot boot.img"
2.6.4 After installing magisk, as it is stored in the RAMDISK. If you install TWRP again in ramdisk, the magisk will be deleted
2.6.5 When installing the magisk, TWRP does not crash
2.6.6 When installing kernel.zip via TWRP, TWRPis not deleted.
2.6.7 After updating the ROM, or changing the ROM, the TWRPis deleted, since the boot sector is bundled with all the ROMs as a whole and mainly with aosp recovery included, some romodels can immediately push TWRP into it. But it's better to play it safe and flash it yourself
2.6.8 When entering TWRP, it writes the installation .zip archives to the active slot, and always works with the active slot A or B, the exception concerns firmware, wrote above in paragraph 2.3
2.6.9 install recovery ramdis on surveillance writes TWRP to both slots
Spoiler: 3. Regarding TWRP and AOSP recovery
3.1 There are currently only 2 TWRPs from Nebrassy and from vasishath. What is the difference? God knows. In fact, they are bugged equally strongly, so I will write instructions using the example of Nebrassy, from experience there are no problems with it.
3.2 AOSP recovery is like it was 10 years ago cwm recovery if anyone remembers. Serves only for switching to fastbootD and ADB sideload mode, updating the firmware over the air, and sometimes cleaning the data. Supplied by many ROM developers as a necessary component (in fact, not so)
Now, based on the knowledge above, we have an understanding of how and what works. Now we need to disassemble the installation procedure. Here, too, not everything is so simple. There are two options for each installation. And in addition, we have 10 ways to install firmware. Why 10? And all due to the fact that I was unaware and had to write a small script called DFE. Isn't there a ready-made one on the Internet? According to my tests, they simply don't work.
Spoiler: Briefly about DFE
Somewhere 90% of ROM Developers out of the box have such a function as data encryption, DFE removes "flags" from one file in the /vendor section so that the system encrypts the data "Entire /data section" at startup therefore, just like with TWRP, after changing or updating the firmware, you need to flash it through TWRP.
- Why should I remove encryption? - ask a question
I will answer, in fact, there is no need, if only you are ready to always back up all data to a flash drive or PC from the internal memory of the phone when changing the firmware, because not all firmware have the same encryption keys, and you can install the firmware, but it is simply will not start at best, at worst everything will be encrypted over a new one and all files will be lost.
But literally all the instructions from the developers of the ROM are written precisely taking into account the fact that you will format the date when installing their firmware. Also, if encryption is disabled, TWRP will not ask for a password to see the memory, and therefore your data is at risk when the phone is stolen, since it will not be difficult to pull them out.
For all cases, you cannot do format data before installing the firmware, otherwise the PC will not see the memory, format data is done only at the end of the installation.
Spoiler: Installing temporary TWRP
Method 1:
1. We drop twrp.img into the folder with adb
2. In windows, hold down shift + right mouse button in an empty space in the folder, open a shell or cmd
3. The console will open, in the case of win10 / 11, if this is a shell, you need to register cmd
4. Reboot the phone into fastboot mode / bootloader (volume down + power button) and connect it to the computer via the wire
5. We write to the command "fastboot boot twrp.img"
6. TWRP will start by itself
Method 2:
1.Download TWRP Autoruner https://drive.google.com/file/d/1HsA1XAEzFgEo0n7K1Vf0QqPlyEICzkpd/view?usp=sharing
2. Unpack anywhere
3. Boot into FastBoot
4. Run the batch file in the folder
Spoiler: Setting TWRP to "permanent" - within the same ROM (Before the first ROM update, or before the first ROM change)
Method 1: Works ALWAYS
1. Go to the advanced tab and select install recvoery ramdisk
2. Find the twrp.img file on your phone and select it
3. If TWRP shows "Error opening: No such file or directory"
then you need to change the active slot in the Reboot contribution, then back and flash TWRP into the ramdisk again
Method 2: For TWRP from Nebrassy does not work 100% of the time
In the same place, in the advanced tab, click flash current TWRP
Method 3: For TWRP from Vasishath. does not work 100%
In the same place, in the advanced tab, click Inject TWRP
Before flashing custom, it is recommended to install a miui stock or a custom miui. It is advisable to drain through a fastboot by analogy with the spoiler instruction, from point 1 to point 9
This is done in order to update all sections in memory, remove tails from other ROMs. Refresh the markup of the sections. Otherwise, there may be errors, not working conditional nfc, lags, whatever. In the best case, the ROM simply won't be installed. At worst, there will be a bad opinion about the ROM because of your own wrong actions and an extra day for flashing and configuring another or the same ROM.
All files are additional here​
Spoiler: If the memory in TWRP is not visible
1. You saw that the PC does not see the memory on the device, or the TWRP is empty (this already means that all the data has been erased)
2. Download one of these TWRO to your computer
recovery_vasishath_nonflags.img or recovery_nebrassy_nonflags.img
3. Through that TWRP where everything is empty, we do format data (yes)
4. Reboot bootloader
5. On the PC we prescribe "fastboot boot twrp.img" any of the post
6. TWRP is loaded (the computer and TWRP sees the memory, but this is not all, nothing will work)
7. In the advanced tab, click fix context
8. In the mounts tab, remove the checkbox from the date and put it back.
9. Now you can upload files from your computer
10. You flash the ROM, you can not do the date format again, when the system boots, it will erase everything from memory, and if you did not set dfe, then the date itself will be encrypted, if you set the data in the same way, it will be erased, but there will be no encryption.
Note:
These TWRPs will not see the date (files in memory) if the data is encrypted, usually TWRP asks for a password when entering it, or you can see it in the security tab.
This TWRP works fine with the already decrypted date, if you use the DFE patch, everything works normally
In this TWRP, the encryption flags are simply removed, so that after the date format when entering TWRP, the date is not encrypted with keys from TWRP and does not break from this
Spoiler: Installation using DFE patch (HentaiOS and Proton AOSP excluded)
When using DFE, you should not use internal methods of updating in ROM, when the firmware is updated in the background, and when you reboot it is already updated, as I wrote earlier, the sections are updated, and therefore the DFE stops working, and it is rather difficult to predict when the system has updated itself, and if DFE will stop working, all data will be deleted, and the ROM simply will not start, so it's better to manually set everything.​
Spoiler: ROM Type Official MIUI Fastboot
1. Download zip with fastboot image MIUI
2. Unpack it to a convenient place
3. You need to go to the folder, and look for the flash_all_except_storage.bat file there
4. You need to open it with a text editor and delete the last line with the text "fastboot reboot"
5. Now, through miflash, we look for the directory with this file
6. We transfer the phone to fastboot mode (Hold the power button + volume rocker down)
7. We connect the device with a wire to the computer and, in the program, select the bottom right flash_all_except_storage.bat, press flash
8. After the end of the process, you need to boot into TWRP
9. In TWRP, if you did everything correctly, then the memory is not erased.
10. We transfer DFE from the computer to the phone, or if you did it in advance, then we flash it. in 99% of cases, an inscription will come out that you need to pre-flash SystemRW_1.32. Then we do it.
11. In the case of SystemRW, you need to reboot into TWRP, then either put it in RamDisk and just reboot, or click reboot bootloader and boot from the computer back to TWRP.
12. Repeat step 10.
13. If you have not used DFE before, then you need to do format DATA (yes). If you have updated the firmware in this way, then you do not need to do Format data. If you have changed the firmware, it is recommended to do wipe data, otherwise either the firmware will not boot, or it will not work correctly
Spoiler: ROM type Pyaload.bin for TWRP
1. Install TWRP in ramdisk and / or go into it
2. Flash .zip ROM file
3. Install TWRP in ramdisk
4. Reboot into TWRP
5. Flash DFE.zip
6. If you have not used DFE before, then you need to do format DATA (yes). If you have updated the firmware in this way, then you do not need to do Format data. If you have changed the firmware, it is recommended to do wipe data, otherwise either the firmware will not boot, or it will not work correctly
Spoiler: ROM type Payload.bin for ADB sideload via PC
1. Download the .zip ROM to your PC. Upload the archive to the adb folder
2. Then, according to the instructions from the developer, you can flash the vendor and vendor_boot ROM provided by the developer, or load into the temporary TWRP from nebrassy "fastboot flash boot twrp.img", or through the autoinstall script
3. Further, in the case of AOSP recovery fastboot --set-active = a and fastboot reboot recovery
5. In twrp, select the advanced section and click adb sideload. in AOSP recovery select Install update through ADB
6. In the console from the adb folder in which the archive from the ROM is located, write "adb sideload name_file_PZU.zip"
7. Flash DFE.zip
8. If you have not used DFE before, then you need to do format DATA (yes). If you have updated the firmware in this way, then you do not need to do Format data. If you have changed the firmware, it is recommended to do wipe data, otherwise either the firmware will not boot, or it will not work correctly
Spoiler: ROM Type Custom MIUI (For example Xiaomi.eu)
1. Download CustomMIUI.zip
2. Install TWRP in ramdisk and / or go into it
3. Flash CustomMIUI.zip ROM file
4. Install TWRP in ramdisk
5. Reboot into TWRP
6. Flash DFE.zip
7. If you have not used DFE before, then you need to do format DATA (yes). If you have updated the firmware in this way, then you do not need to do Format data. If you have changed the firmware, it is recommended to do wipe data, otherwise either the firmware will not boot, or it will not work correctly
Spoiler: ROM type Custom fastboot image.
1. Download fastboot ROM on PC
2. Unzip to a convenient place, and go to the folder, find the update.bat file there, you need to open it with a text editor and delete the last line with the text "fastboot reboot"
3. We transfer the phone to fastboot mode (Hold the power button + volume down)
4. Run update.bat and wait for the end of the procedure
5. After the end of the process, you need to boot into TWRP
9. In TWRP, if you did everything right, then the memory is not erased. Otherwise, I recommend using this method so that the memory appears.
10. We transfer DFE from the computer to the phone, or if you did it in advance, then we flash it.
11. If you have not used DFE before, then you need to do format DATA (yes). If you have updated the firmware in this way, then you do not need to do Format data. If you have changed the firmware, it is recommended to do wipe data, otherwise either the firmware will not boot, or it will not work correctly
Spoiler: Standard installation methods
Spoiler: ROM Type Official MIUI Fastboot
1. Download zip with fastboot image MIUI
2. Unpack it to a convenient place
3. Now, through miflash, we look for the directory with this file
4. We transfer the phone to fastboot mode (Hold the power button + volume ring down)
5. We connect with a wire to the PC and first select in the program at the bottom right flash_all_except_storage.bat (For updating), flash_all.bat (For Clean installation) flash_all_lock.bat (for clean installation and locking the bootloader) or press flash
6. The system will reboot itself. Ready
7. Additionally (Magisk, gapps and other zip) after a clean install with all files removed:
7.1 After loading into the system, we go through the device configuration, and we must put a pin or a graphic key
7.2 Flash temporary TWRP
7.3 If you need a TWRP on an ongoing basis, then we flash it into a ramdisk (Imstall recvoery ramdisk), the img image of the TWRP must be on the device
7.4 Flash the zip archives you need
7.5 You can make Wipe data to set up your phone again
8. If you updated your phone, you can do steps 7.2-7.4 Immediately after installing the update
Spoiler: ROM type Pyaload.bin for TWRP
1. Install TWRP in ramdisk and / or go into it
2. Flash .zip ROM file
3. Install TWRP in ramdisk
4. Make Format Data as indicated in the instructions of the firmware developer, or wipe date if you change it from custom to custom (does not always work), or just boot into the system (Risky !!)
5.Additional (Magisk, gapps and other zip):
5.1 If you have updated the ROM, you can flash additional files
5.2 If you have made format data, you need to boot into the system, go through the setup, put the lock key and reboot into TWRP, after that you can put an additional zip. and make wipe data to configure it again
Spoiler: ROM type Payload.bin for ADB sideload via PC
1. Download the .zip ROM to your PC. Upload the archive to the adb folder
2. Further, you can follow the instructions either from the developer, flash the vendor and vendor_boot provided by the developer, or boot into the temporary TWRP from nebrassy "fastboot flash boot twrp.img", or through the autoinstall script
3. Further, in the case of AOSP recovery fastboot --set-active = a and fastboot reboot recovery
5. In twrp, select the advanced section and click adb sideload. in aosp recovery select Install update through ADB
6. In the console, from the adb folder in which the archive with the firmware is located, write adb sideload_file_name.zip
7. At the end of the process, make Format Data as indicated in the developer's instructions, or wipe the date, if you change it from custom to custom (it does not always work), or just boot into the system
8.Additional (Magisk, gapps and other zip):
8.1 After loading into the system, we go through the device configuration, and we must put a pin or a graphic key
8.2 Reboot the phone into fastboot mode (volume down and hold down the power button) connect the computer, flash the temporary TWRP
8.3 If you need a TWRP for a constant, then we flash it into a ramdisk (Imstall recvoery ramdisk), the img image of a TWRP must be on the device
8.4 Flash the zip archives you need
9. If you updated your phone, you can do steps 8.2-8.4 Immediately after installing the update
Spoiler: ROM Type Custom MIUI (For example Xiaomi.eu)
1. Download CustomMIUI.zip
2. Install TWRP in ramdisk and / or go into it
3. Flash CustomMIUI.zip ROM file
4. Install TWRP to ramdisk
5. Reboot into TWRP
6. Make Format Data as indicated in the Developer's instructions, or wipe date, if you change miui to miui (does not always work), or just boot into the system
7.Additional (Magisk, gapps and other zip):
7.1 In case you have updated the ROM, you can flash additional files
7.2 If you have made format data, you need to boot into the system, go through the setup, put the lock key and reboot into TWRP, after that you can put an additional zip. and make wipe data to configure it again
Spoiler: ROM type Custom fastboot image.
1. Download fastboot ROM on PC
2. Unzip to a convenient place, and go to the folder, find the update.bat file and installformat.bat there FirestInstall.bat
3. Go into fastboot mode, connect the device to the PC and select the desired installer, or update, to update, or for a clean install installformat.bat or FirestInstall.bat (all data will be erased, including memory
4. Additionally (Magisk, gapps and other zip) after a clean install with all files removed:
4.1 After loading into the system, we go through the device configuration, and we must put a pin or a graphic key
4.2 Reboot the phone into fastboot mode (volume down and hold down the power button) connect the computer, flash the temporary TWRP
4.3 If you need TWRP for Permanent then we do it
4.4 Flash the zip archives you need
4.5 You can make Wipe data to set up your phone again
5. If you updated your phone, you can do steps 4.2-4.4 Immediately after installing the update
Thank you VERY much for the fantastic guide.
Just one question: what are the differences between the two available TWRP for Alioth: Nebrassi and Vasishath ?
Thanks man
michelD said:
Thank you VERY much for the fantastic guide.
Just one question: what are the differences between the two available TWRP for Alioth: Nebrassi and Vasishath ?
Click to expand...
Click to collapse
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
please read the entire section of the paragraph
LeeGarChat said:
Mandatory instructions for beginners (and not only beginners) to install ROM and other on poco f3​Prerequisite, unlocking the bootloader​For questions, if something is not clear, please write to "Conversations", I will try to correct it in a post with a simpler explanation. And I will answer the question (I am not a 24/7 support service, so duplicate your question in the ROM discussion thread in order to give an answer if I'm busy)​
!!! The spoiler below is a must-read before doing anything with your device. !!!​
Spoiler: Let's discuss several points at once
Spoiler: 1. Drivers and utilities - download immediately and install so that there are no further questions
1. Fastboot and adb - Tools_r31.0.3
2. Miflash
3. USBDrivers - QDloader
Spoiler: 2. Features and disadvantages of our device
2.1 We have a so-called A/B partition structure - this is when two spaces are used for system partitions (read more in google) the essence is that there are "Firmware" partitions
Spoiler: code
Code:
"dsp.img", "/dev/block/bootdevice/by-name/dsp_a"
"dsp.img", "/dev/block/bootdevice/by-name/dsp_b"
"xbl_config.img", "/dev/block/bootdevice/by-name/xbl_config_a"
"xbl_config.img", "/dev/block/bootdevice/by-name/xbl_config_b"
"modem.img", "/dev/block/bootdevice/by-name/modem_a"
"modem.img", "/dev/block/bootdevice/by-name/modem_b"
"tz.img", "/dev/block/bootdevice/by-name/tz_a"
"tz.img", "/dev/block/bootdevice/by-name/tz_b"
"bluetooth.img", "/dev/block/bootdevice/by-name/bluetooth_a"
"bluetooth.img", "/dev/block/bootdevice/by-name/bluetooth_b"
"abl.img", "/dev/block/bootdevice/by-name/abl_a"
"abl.img", "/dev/block/bootdevice/by-name/abl_b"
"featenabler.img", "/dev/block/bootdevice/by-name/featenabler_a"
"featenabler.img", "/dev/block/bootdevice/by-name/featenabler_b"
"keymaster.img", "/dev/block/bootdevice/by-name/keymaster_a"
"keymaster.img", "/dev/block/bootdevice/by-name/keymaster_b"
"uefisecapp.img", "/dev/block/bootdevice/by-name/uefisecapp_a"
"uefisecapp.img", "/dev/block/bootdevice/by-name/uefisecapp_b"
"qupfw.img", "/dev/block/bootdevice/by-name/qupfw_a"
"qupfw.img", "/dev/block/bootdevice/by-name/qupfw_b"
"xbl.img", "/dev/block/bootdevice/by-name/xbl_a"
"xbl.img", "/dev/block/bootdevice/by-name/xbl_b"
"cmnlib.img", "/dev/block/bootdevice/by-name/cmnlib_a"
"cmnlib.img", "/dev/block/bootdevice/by-name/cmnlib_b"
"cmnlib64.img", "/dev/block/bootdevice/by-name/cmnlib64_a"
"cmnlib64.img", "/dev/block/bootdevice/by-name/cmnlib64_b"
"devcfg.img", "/dev/block/bootdevice/by-name/devcfg_a"
"devcfg.img", "/dev/block/bootdevice/by-name/devcfg_b"
"hyp.img", "/dev/block/bootdevice/by-name/hyp_a"
"hyp.img", "/dev/block/bootdevice/by-name/hyp_b"
"imagefv.img", "/dev/block/bootdevice/by-name/imagefv_a"
"imagefv.img", "/dev/block/bootdevice/by-name/imagefv_b"
"aop.img", "/dev/block/bootdevice/by-name/aop_a"
"aop.img", "/dev/block/bootdevice/by-name/aop_b"
and there are partitions directly ROM /data, /system /system_ext, /vendor, /product, /odm, /vendor_boot, /boot
2.2 miui based ROMs update all of these sections. In the case of firmware, they are put in both slots at once. Although this is not necessary in essence.
ROMs of a custom type, those based on a "pure" android are often flashed for only partitions of the ROM, but not in 100% case
2.3 For our device, there are 3 types of ROM installation files, 2 of which are divided into two types of installation methods
2.3.1 Let's start simple, Official miui image for fastboot - installation is recommended via miflash, has all partitions inside the archive. There are also 3 files inside - for easy installation of all partitions, for installing all partitions and formatting the memory, as well as for installing all partitions and locking the bootloader (the memory is formatted automatically), the name of the .bat files speaks for themselves
2.3.2 Next - the installation .zip archive of unofficial MIUI for TWRP. Not all partitions, but the main ones (always stitched into section A), including firmware (stitched into both slots A and B)
2.3.3 Sideload type firmware (99% of all custom ROMs) are divided into two installation methods.
Inside the archive there is a payload.bin file in which the rom and sometimes firmware sections are packed
Installation always goes to the adjacent NOT active memory slot, and after completion, makes the adjacent slot active to load the firmware
Installation via PC, via ADB (on the phone, AOSP recovery adb sideload/twrp adb sideload mode) or installation via TWRP directly from the device
2.4 Custom ROMs for fastboot, usually used for a clean installation, which implies cleaning and data from memory (pictures, etc.) inside sometimes have firmware sections and always rom sections. Inside, as the author saw fit, there are .bat launchers for updating (does not erase all data) and for a clean installation (erases all data)
2.5 Another very important feature of the AB structure in our case is two types of fastboot mod. It is called bootloader - official miui is completely flashed through it, and there is a fastbootD mode that is built into the boot sector in aosp recovery or in twrp, it is also needed for flashing img images. Ask what are the differences if this and that fastboot?
The answer is idiotic
Bootloader can flash all main partitions only in both A and B sections at the same time command type - "fastboot flash system_ab system.img"
He knows how to essentially flash a couple of partitions into a certain slot, we only need in this case vendor_boot and boot command type "fastboot flash boot_a boot.img" or instead of A you need to write B
FastbootD, on the other hand, can flash img images separately into the desired slot A or B
2.6 Poco f3/k40/mi11x does not have a separate partition for recovery/twrp,the whole thing is stored in the boot sector in the ramdisk, and the kernel is also stored there. Several factors follow from this knowledge.
2.6.1 To install TWRP, you must first boot into a temporary tvrp, the command type is "fastboot boot twrp.img". Inside TWRP, in the Advanced tab, click install recovery ramdisk, and select the img twrp image on the phone
2.6.3 To install aosp recvoery, you need to flash boot "fastboot boot boot.img"
2.6.4 After installing magisk, as it is stored in the RAMDISK. If you install tvrp again in ramdisk, the magisk will be deleted
2.6.5 When installing the magisk, tvrp does not crash
2.6.6 When installing kernel.zip via TWRP, TWRPis not deleted.
2.6.7 After updating the ROM, or changing the ROM, the TWRPis deleted, since the boot sector is bundled with all the ROMs as a whole and mainly with aosp recovery included, some romodels can immediately push TWRP into it. But it's better to play it safe and flash it yourself
2.6.8 When entering TWRP, it writes the installation .zip archives to the active slot, and always works with the active slot A or B, the exception concerns firmware, wrote above in paragraph 2.3
2.6.9 install recovery ramdis on surveillance writes TWRP to both slots
Spoiler: 3. Regarding TWRP and AOSP recovery
3.1 There are currently only 2 TWRPs from Nebrassy and from vasishath. What is the difference? God knows. In fact, they are bugged equally strongly, so I will write instructions using the example of Nebrassy, from experience there are no problems with it.
3.2 AOSP recovery is like it was 10 years ago cwm recovery if anyone remembers. Serves only for switching to fastbootD and ADB sideload mode, updating the firmware over the air, and sometimes cleaning the data. Supplied by many ROM developers as a necessary component (in fact, not so)
Now, based on the knowledge above, we have an understanding of how and what works. Now we need to disassemble the installation procedure. Here, too, not everything is so simple. There are two options for each installation. And in addition, we have 10 ways to install firmware. Why 10? And all due to the fact that I was unaware and had to write a small script called DFE. Isn't there a ready-made one on the Internet? According to my tests, they simply don't work.
Spoiler: Briefly about DFE
Somewhere 90% of ROM Developers out of the box have such a function as data encryption, DFE removes "flags" from one file in the /vendor section so that the system encrypts the data "Entire /data section" at startup therefore, just like with TWRP, after changing or updating the firmware, you need to flash it through TWRP.
- Why should I remove encryption? - ask a question
I will answer, in fact, there is no need, if only you are ready to always back up all data to a flash drive or PC from the internal memory of the phone when changing the firmware, because not all firmware have the same encryption keys, and you can install the firmware, but it is simply will not start at best, at worst everything will be encrypted over a new one and all files will be lost.
But literally all the instructions from the developers of the ROM are written precisely taking into account the fact that you will format the date when installing their firmware. Also, if encryption is disabled, TvRP will not ask for a password to see the memory, and therefore your data is at risk when the phone is stolen, since it will not be difficult to pull them out.
For all cases, you cannot do format data before installing the firmware, otherwise the PC will not see the memory, format data is done only at the end of the installation.
Spoiler: Installing temporary TWRP
Method 1:
1. We drop twrp.img into the folder with adb
2. In windows, hold down shift + right mouse button in an empty space in the folder, open a shell or cmd
3. The console will open, in the case of win10 / 11, if this is a shell, you need to register cmd
4. Reboot the phone into fastboot mode / bootloader (volume down + power button) and connect it to the computer via the wire
5. We write to the command "fastboot boot twrp.img"
6. TWRP will start by itself
Method 2:
1.Download TWRP Autoruner https://drive.google.com/file/d/1HsA1XAEzFgEo0n7K1Vf0QqPlyEICzkpd/view?usp=sharing
2. Unpack anywhere
3. Boot into FastBoot
4. Run the batch file in the folder
Spoiler: Setting TWRP to "permanent" - within the same ROM (Before the first ROM update, or before the first ROM change)
Method 1: Works ALWAYS
1. Go to the advanced tab and select install recvoery ramdisk
2. Find the twrp.img file on your phone and select it
3. If TWRP shows "Error opening: No such file or directory"
then you need to change the active slot in the Reboot contribution, then back and flash TWRP into the ramdisk again
Method 2: For TWRP from Nebrassy does not work 100% of the time
In the same place, in the advanced tab, click flash current TWRP
Method 3: For TWRP from Vasishath. does not work 100%
In the same place, in the advanced tab, click Inject TWRP
Before flashing custom, it is recommended to install a miui stock or a custom miui. It is advisable to drain through a fastboot by analogy with the spoiler instruction, from point 1 to point 9
This is done in order to update all sections in memory, remove tails from other ROMs. Refresh the markup of the sections. Otherwise, there may be errors, not working conditional nfc, lags, whatever. In the best case, the ROM simply won't be installed. At worst, there will be a bad opinion about the ROM because of your own wrong actions and an extra day for flashing and configuring another or the same ROM.
All files are additional here​
Spoiler: If the memory in TWRP is not visible
1. You saw that the PC does not see the memory on the device, or the tvrp is empty (this already means that all the data has been erased)
2. Download one of these TVRPs to your computer
recovery_vasishath_nonflags.img or recovery_nebrassy_nonflags.img
3. Through that TWRP where everything is empty, we do format data (yes)
4. Reboot bootloader
5. On the PC we prescribe "fastboot boot twrp.img" any of the post
6. TvRP is loaded (the computer and TWRP sees the memory, but this is not all, nothing will work)
7. In the advanced tab, click fix context
8. In the mounts tab, remove the checkbox from the date and put it back.
9. Now you can upload files from your computer
10. You flash the ROM, you can not do the date format again, when the system boots, it will erase everything from memory, and if you did not set dfe, then the date itself will be encrypted, if you set the data in the same way, it will be erased, but there will be no encryption.
Note:
These TWRPs will not see the date (files in memory) if the data is encrypted, usually TWRP asks for a password when entering it, or you can see it in the security tab.
This TWRP works fine with the already decrypted date, if you use the DFE patch, everything works normally
In this TWRP, the encryption flags are simply removed, so that after the date format when entering TVRP, the date is not encrypted with keys from TWRP and does not break from this
Spoiler: Installation using DFE patch (HentaiOS and Proton AOSP excluded)
When using DFE, you should not use internal methods of updating in ROM, when the firmware is updated in the background, and when you reboot it is already updated, as I wrote earlier, the sections are updated, and therefore the DFE stops working, and it is rather difficult to predict when the system has updated itself, and if DFE will stop working, all data will be deleted, and the ROM simply will not start, so it's better to manually set everything.​
Spoiler: ROM Type Official MIUI Fastboot
1. Download zip with fastboot image MIUI
2. Unpack it to a convenient place
3. You need to go to the folder, and look for the flash_all_except_storage.bat file there
4. You need to open it with a text editor and delete the last line with the text "fastboot reboot"
5. Now, through miflash, we look for the directory with this file
6. We transfer the phone to fastboot mode (Hold the power button + volume rocker down)
7. We connect the device with a wire to the computer and, in the program, select the bottom right flash_all_except_storage.bat, press flash
8. After the end of the process, you need to boot into TWRP
9. In TVRP, if you did everything correctly, then the memory is not erased.
10. We transfer DFE from the computer to the phone, or if you did it in advance, then we flash it. in 99% of cases, an inscription will come out that you need to pre-flash SystemRW_1.32. Then we do it.
11. In the case of SystemRW, you need to reboot into TWRP, then either put it in RamDisk and just reboot, or click reboot bootloader and boot from the computer back to TWRP.
12. Repeat step 10.
13. If you have not used DFE before, then you need to do format DATA (yes). If you have updated the firmware in this way, then you do not need to do Format data. If you have changed the firmware, it is recommended to do wipe data, otherwise either the firmware will not boot, or it will not work correctly
Spoiler: ROM type Pyaload.bin for TWRP
1. Install TWRP in ramdisk and / or go into it
2. Flash .zip ROM file
3. Install TWRP in ramdisk
4. Reboot into TWRP
5. Flash DFE.zip
6. If you have not used DFE before, then you need to do format DATA (yes). If you have updated the firmware in this way, then you do not need to do Format data. If you have changed the firmware, it is recommended to do wipe data, otherwise either the firmware will not boot, or it will not work correctly
Spoiler: ROM type Payload.bin for ADB sideload via PC
1. Download the .zip ROM to your PC. Upload the archive to the adb folder
2. Then, according to the instructions from the developer, you can flash the vendor and vendor_boot ROM provided by the developer, or load into the temporary TVRP from nebrassy "fastboot flash boot twrp.img", or through the autoinstall script
3. Further, in the case of AOSP recovery fastboot --set-active = a and fastboot reboot recovery
5. In twrp, select the advanced section and click adb sideload. in AOSP recovery select Install update through ADB
6. In the console from the adb folder in which the archive from the ROM is located, write "adb sideload name_file_PZU.zip"
7. Flash DFE.zip
8. If you have not used DFE before, then you need to do format DATA (yes). If you have updated the firmware in this way, then you do not need to do Format data. If you have changed the firmware, it is recommended to do wipe data, otherwise either the firmware will not boot, or it will not work correctly
Spoiler: ROM Type Custom MIUI (For example Xiaomi.eu)
1. Download CustomMIUI.zip
2. Install TWRP in ramdisk and / or go into it
3. Flash CustomMIUI.zip ROM file
4. Install TWRP in ramdisk
5. Reboot into TWRP
6. Flash DFE.zip
7. If you have not used DFE before, then you need to do format DATA (yes). If you have updated the firmware in this way, then you do not need to do Format data. If you have changed the firmware, it is recommended to do wipe data, otherwise either the firmware will not boot, or it will not work correctly
Spoiler: ROM type Custom fastboot image.
1. Download fastboot ROM on PC
2. Unzip to a convenient place, and go to the folder, find the update.bat file there, you need to open it with a text editor and delete the last line with the text "fastboot reboot"
3. We transfer the phone to fastboot mode (Hold the power button + volume down)
4. Run update.bat and wait for the end of the procedure
5. After the end of the process, you need to boot into TWRP
9. In TWRP, if you did everything right, then the memory is not erased. Otherwise, I recommend using this method so that the memory appears.
10. We transfer DFE from the computer to the phone, or if you did it in advance, then we flash it.
11. If you have not used DFE before, then you need to do format DATA (yes). If you have updated the firmware in this way, then you do not need to do Format data. If you have changed the firmware, it is recommended to do wipe data, otherwise either the firmware will not boot, or it will not work correctly
Spoiler: Standard installation methods
Spoiler: ROM Type Official MIUI Fastboot
1. Download zip with fastboot image MIUI
2. Unpack it to a convenient place
3. Now, through miflash, we look for the directory with this file
4. We transfer the phone to fastboot mode (Hold the power button + volume ring down)
5. We connect with a wire to the PC and first select in the program at the bottom right flash_all_except_storage.bat (For updating), flash_all.bat (For Clean installation) flash_all_lock.bat (for clean installation and locking the bootloader) or press flash
6. The system will reboot itself. Ready
7. Additionally (Magisk, gapps and other zip) after a clean install with all files removed:
7.1 After loading into the system, we go through the device configuration, and we must put a pin or a graphic key
7.2 Flash temporary TWRP
7.3 If you need a TVRP on an ongoing basis, then we flash it into a ramdisk (Imstall recvoery ramdisk), the img image of the TVRP must be on the device
7.4 Flash the zip archives you need
7.5 You can make Wipe data to set up your phone again
8. If you updated your phone, you can do steps 7.2-7.4 Immediately after installing the update
Spoiler: ROM type Pyaload.bin for TWRP
1. Install TWRP in ramdisk and / or go into it
2. Flash .zip ROM file
3. Install TWRP in ramdisk
4. Make Format Data as indicated in the instructions of the firmware developer, or wipe date if you change it from custom to custom (does not always work), or just boot into the system (Risky !!)
5.Additional (Magisk, gapps and other zip):
5.1 If you have updated the ROM, you can flash additional files
5.2 If you have made format data, you need to boot into the system, go through the setup, put the lock key and reboot into tvrp, after that you can put an additional zip. and make wipe data to configure it again
Spoiler: ROM type Payload.bin for ADB sideload via PC
1. Download the .zip ROM to your PC. Upload the archive to the adb folder
2. Further, you can follow the instructions either from the developer, flash the vendor and vendor_boot provided by the developer, or boot into the temporary TWRP from nebrassy "fastboot flash boot twrp.img", or through the autoinstall script
3. Further, in the case of AOSP recovery fastboot --set-active = a and fastboot reboot recovery
5. In twrp, select the advanced section and click adb sideload. in aosp recovery select Install update through ADB
6. In the console, from the adb folder in which the archive with the firmware is located, write adb sideload_file_name.zip
7. At the end of the process, make Format Data as indicated in the developer's instructions, or wipe the date, if you change it from custom to custom (it does not always work), or just boot into the system
8.Additional (Magisk, gapps and other zip):
8.1 After loading into the system, we go through the device configuration, and we must put a pin or a graphic key
8.2 Reboot the phone into fastboot mode (volume down and hold down the power button) connect the computer, flash the temporary TWRP
8.3 If you need a TVRP for a constant, then we flash it into a ramdisk (Imstall recvoery ramdisk), the img image of a tvrp must be on the device
8.4 Flash the zip archives you need
9. If you updated your phone, you can do steps 8.2-8.4 Immediately after installing the update
Spoiler: ROM Type Custom MIUI (For example Xiaomi.eu)
1. Download CustomMIUI.zip
2. Install TWRP in ramdisk and / or go into it
3. Flash CustomMIUI.zip ROM file
4. Install TWRP to ramdisk
5. Reboot into TWRP
6. Make Format Data as indicated in the Developer's instructions, or wipe date, if you change miui to miui (does not always work), or just boot into the system
7.Additional (Magisk, gapps and other zip):
7.1 In case you have updated the ROM, you can flash additional files
7.2 If you have made format data, you need to boot into the system, go through the setup, put the lock key and reboot into tvrp, after that you can put an additional zip. and make wipe data to configure it again
Spoiler: ROM type Custom fastboot image.
1. Download fastboot ROM on PC
2. Unzip to a convenient place, and go to the folder, find the update.bat file and installformat.bat there FirestInstall.bat
3. Go into fastboot mode, connect the device to the PC and select the desired installer, or update, to update, or for a clean install installformat.bat or FirestInstall.bat (all data will be erased, including memory
4. Additionally (Magisk, gapps and other zip) after a clean install with all files removed:
4.1 After loading into the system, we go through the device configuration, and we must put a pin or a graphic key
4.2 Reboot the phone into fastboot mode (volume down and hold down the power button) connect the computer, flash the temporary TWRP
4.3 If you need TWRP for Permanent then we do it
4.4 Flash the zip archives you need
4.5 You can make Wipe data to set up your phone again
5. If you updated your phone, you can do steps 4.2-4.4 Immediately after installing the update
Click to expand...
Click to collapse
Many thanks for making this complete and detailed guide.
It was really needed!
Good job!
LeeGarChat said:
Mandatory instructions for beginners (and not only beginners) to install ROM and other on poco f3​Prerequisite, unlocking the bootloader​For questions, if something is not clear, please write to "Conversations", I will try to correct it in a post with a simpler explanation. And I will answer the question (I am not a 24/7 support service, so duplicate your question in the ROM discussion thread in order to give an answer if I'm busy)​
!!! The spoiler below is a must-read before doing anything with your device. !!!​
Spoiler: Let's discuss several points at once
Spoiler: 1. Drivers and utilities - download immediately and install so that there are no further questions
1. Fastboot and adb - Tools_r31.0.3
2. Miflash
3. USBDrivers - QDloader
Spoiler: 2. Features and disadvantages of our device
2.1 We have a so-called A/B partition structure - this is when two spaces are used for system partitions (read more in google) the essence is that there are "Firmware" partitions
Spoiler: code
Code:
"dsp.img", "/dev/block/bootdevice/by-name/dsp_a"
"dsp.img", "/dev/block/bootdevice/by-name/dsp_b"
"xbl_config.img", "/dev/block/bootdevice/by-name/xbl_config_a"
"xbl_config.img", "/dev/block/bootdevice/by-name/xbl_config_b"
"modem.img", "/dev/block/bootdevice/by-name/modem_a"
"modem.img", "/dev/block/bootdevice/by-name/modem_b"
"tz.img", "/dev/block/bootdevice/by-name/tz_a"
"tz.img", "/dev/block/bootdevice/by-name/tz_b"
"bluetooth.img", "/dev/block/bootdevice/by-name/bluetooth_a"
"bluetooth.img", "/dev/block/bootdevice/by-name/bluetooth_b"
"abl.img", "/dev/block/bootdevice/by-name/abl_a"
"abl.img", "/dev/block/bootdevice/by-name/abl_b"
"featenabler.img", "/dev/block/bootdevice/by-name/featenabler_a"
"featenabler.img", "/dev/block/bootdevice/by-name/featenabler_b"
"keymaster.img", "/dev/block/bootdevice/by-name/keymaster_a"
"keymaster.img", "/dev/block/bootdevice/by-name/keymaster_b"
"uefisecapp.img", "/dev/block/bootdevice/by-name/uefisecapp_a"
"uefisecapp.img", "/dev/block/bootdevice/by-name/uefisecapp_b"
"qupfw.img", "/dev/block/bootdevice/by-name/qupfw_a"
"qupfw.img", "/dev/block/bootdevice/by-name/qupfw_b"
"xbl.img", "/dev/block/bootdevice/by-name/xbl_a"
"xbl.img", "/dev/block/bootdevice/by-name/xbl_b"
"cmnlib.img", "/dev/block/bootdevice/by-name/cmnlib_a"
"cmnlib.img", "/dev/block/bootdevice/by-name/cmnlib_b"
"cmnlib64.img", "/dev/block/bootdevice/by-name/cmnlib64_a"
"cmnlib64.img", "/dev/block/bootdevice/by-name/cmnlib64_b"
"devcfg.img", "/dev/block/bootdevice/by-name/devcfg_a"
"devcfg.img", "/dev/block/bootdevice/by-name/devcfg_b"
"hyp.img", "/dev/block/bootdevice/by-name/hyp_a"
"hyp.img", "/dev/block/bootdevice/by-name/hyp_b"
"imagefv.img", "/dev/block/bootdevice/by-name/imagefv_a"
"imagefv.img", "/dev/block/bootdevice/by-name/imagefv_b"
"aop.img", "/dev/block/bootdevice/by-name/aop_a"
"aop.img", "/dev/block/bootdevice/by-name/aop_b"
and there are partitions directly ROM /data, /system /system_ext, /vendor, /product, /odm, /vendor_boot, /boot
2.2 miui based ROMs update all of these sections. In the case of firmware, they are put in both slots at once. Although this is not necessary in essence.
ROMs of a custom type, those based on a "pure" android are often flashed for only partitions of the ROM, but not in 100% case
2.3 For our device, there are 3 types of ROM installation files, 2 of which are divided into two types of installation methods
2.3.1 Let's start simple, Official miui image for fastboot - installation is recommended via miflash, has all partitions inside the archive. There are also 3 files inside - for easy installation of all partitions, for installing all partitions and formatting the memory, as well as for installing all partitions and locking the bootloader (the memory is formatted automatically), the name of the .bat files speaks for themselves
2.3.2 Next - the installation .zip archive of unofficial MIUI for TWRP. Not all partitions, but the main ones (always stitched into section A), including firmware (stitched into both slots A and B)
2.3.3 Sideload type firmware (99% of all custom ROMs) are divided into two installation methods.
Inside the archive there is a payload.bin file in which the rom and sometimes firmware sections are packed
Installation always goes to the adjacent NOT active memory slot, and after completion, makes the adjacent slot active to load the firmware
Installation via PC, via ADB (on the phone, AOSP recovery adb sideload/twrp adb sideload mode) or installation via TWRP directly from the device
2.4 Custom ROMs for fastboot, usually used for a clean installation, which implies cleaning and data from memory (pictures, etc.) inside sometimes have firmware sections and always rom sections. Inside, as the author saw fit, there are .bat launchers for updating (does not erase all data) and for a clean installation (erases all data)
2.5 Another very important feature of the AB structure in our case is two types of fastboot mod. It is called bootloader - official miui is completely flashed through it, and there is a fastbootD mode that is built into the boot sector in aosp recovery or in twrp, it is also needed for flashing img images. Ask what are the differences if this and that fastboot?
The answer is idiotic
Bootloader can flash all main partitions only in both A and B sections at the same time command type - "fastboot flash system_ab system.img"
He knows how to essentially flash a couple of partitions into a certain slot, we only need in this case vendor_boot and boot command type "fastboot flash boot_a boot.img" or instead of A you need to write B
FastbootD, on the other hand, can flash img images separately into the desired slot A or B
2.6 Poco f3/k40/mi11x does not have a separate partition for recovery/twrp,the whole thing is stored in the boot sector in the ramdisk, and the kernel is also stored there. Several factors follow from this knowledge.
2.6.1 To install TWRP, you must first boot into a temporary tvrp, the command type is "fastboot boot twrp.img". Inside TWRP, in the Advanced tab, click install recovery ramdisk, and select the img twrp image on the phone
2.6.3 To install aosp recvoery, you need to flash boot "fastboot boot boot.img"
2.6.4 After installing magisk, as it is stored in the RAMDISK. If you install tvrp again in ramdisk, the magisk will be deleted
2.6.5 When installing the magisk, tvrp does not crash
2.6.6 When installing kernel.zip via TWRP, TWRPis not deleted.
2.6.7 After updating the ROM, or changing the ROM, the TWRPis deleted, since the boot sector is bundled with all the ROMs as a whole and mainly with aosp recovery included, some romodels can immediately push TWRP into it. But it's better to play it safe and flash it yourself
2.6.8 When entering TWRP, it writes the installation .zip archives to the active slot, and always works with the active slot A or B, the exception concerns firmware, wrote above in paragraph 2.3
2.6.9 install recovery ramdis on surveillance writes TWRP to both slots
Spoiler: 3. Regarding TWRP and AOSP recovery
3.1 There are currently only 2 TWRPs from Nebrassy and from vasishath. What is the difference? God knows. In fact, they are bugged equally strongly, so I will write instructions using the example of Nebrassy, from experience there are no problems with it.
3.2 AOSP recovery is like it was 10 years ago cwm recovery if anyone remembers. Serves only for switching to fastbootD and ADB sideload mode, updating the firmware over the air, and sometimes cleaning the data. Supplied by many ROM developers as a necessary component (in fact, not so)
Now, based on the knowledge above, we have an understanding of how and what works. Now we need to disassemble the installation procedure. Here, too, not everything is so simple. There are two options for each installation. And in addition, we have 10 ways to install firmware. Why 10? And all due to the fact that I was unaware and had to write a small script called DFE. Isn't there a ready-made one on the Internet? According to my tests, they simply don't work.
Spoiler: Briefly about DFE
Somewhere 90% of ROM Developers out of the box have such a function as data encryption, DFE removes "flags" from one file in the /vendor section so that the system encrypts the data "Entire /data section" at startup therefore, just like with TWRP, after changing or updating the firmware, you need to flash it through TWRP.
- Why should I remove encryption? - ask a question
I will answer, in fact, there is no need, if only you are ready to always back up all data to a flash drive or PC from the internal memory of the phone when changing the firmware, because not all firmware have the same encryption keys, and you can install the firmware, but it is simply will not start at best, at worst everything will be encrypted over a new one and all files will be lost.
But literally all the instructions from the developers of the ROM are written precisely taking into account the fact that you will format the date when installing their firmware. Also, if encryption is disabled, TvRP will not ask for a password to see the memory, and therefore your data is at risk when the phone is stolen, since it will not be difficult to pull them out.
For all cases, you cannot do format data before installing the firmware, otherwise the PC will not see the memory, format data is done only at the end of the installation.
Spoiler: Installing temporary TWRP
Method 1:
1. We drop twrp.img into the folder with adb
2. In windows, hold down shift + right mouse button in an empty space in the folder, open a shell or cmd
3. The console will open, in the case of win10 / 11, if this is a shell, you need to register cmd
4. Reboot the phone into fastboot mode / bootloader (volume down + power button) and connect it to the computer via the wire
5. We write to the command "fastboot boot twrp.img"
6. TWRP will start by itself
Method 2:
1.Download TWRP Autoruner https://drive.google.com/file/d/1HsA1XAEzFgEo0n7K1Vf0QqPlyEICzkpd/view?usp=sharing
2. Unpack anywhere
3. Boot into FastBoot
4. Run the batch file in the folder
Spoiler: Setting TWRP to "permanent" - within the same ROM (Before the first ROM update, or before the first ROM change)
Method 1: Works ALWAYS
1. Go to the advanced tab and select install recvoery ramdisk
2. Find the twrp.img file on your phone and select it
3. If TWRP shows "Error opening: No such file or directory"
then you need to change the active slot in the Reboot contribution, then back and flash TWRP into the ramdisk again
Method 2: For TWRP from Nebrassy does not work 100% of the time
In the same place, in the advanced tab, click flash current TWRP
Method 3: For TWRP from Vasishath. does not work 100%
In the same place, in the advanced tab, click Inject TWRP
Before flashing custom, it is recommended to install a miui stock or a custom miui. It is advisable to drain through a fastboot by analogy with the spoiler instruction, from point 1 to point 9
This is done in order to update all sections in memory, remove tails from other ROMs. Refresh the markup of the sections. Otherwise, there may be errors, not working conditional nfc, lags, whatever. In the best case, the ROM simply won't be installed. At worst, there will be a bad opinion about the ROM because of your own wrong actions and an extra day for flashing and configuring another or the same ROM.
All files are additional here​
Spoiler: If the memory in TWRP is not visible
1. You saw that the PC does not see the memory on the device, or the tvrp is empty (this already means that all the data has been erased)
2. Download one of these TVRPs to your computer
recovery_vasishath_nonflags.img or recovery_nebrassy_nonflags.img
3. Through that TWRP where everything is empty, we do format data (yes)
4. Reboot bootloader
5. On the PC we prescribe "fastboot boot twrp.img" any of the post
6. TvRP is loaded (the computer and TWRP sees the memory, but this is not all, nothing will work)
7. In the advanced tab, click fix context
8. In the mounts tab, remove the checkbox from the date and put it back.
9. Now you can upload files from your computer
10. You flash the ROM, you can not do the date format again, when the system boots, it will erase everything from memory, and if you did not set dfe, then the date itself will be encrypted, if you set the data in the same way, it will be erased, but there will be no encryption.
Note:
These TWRPs will not see the date (files in memory) if the data is encrypted, usually TWRP asks for a password when entering it, or you can see it in the security tab.
This TWRP works fine with the already decrypted date, if you use the DFE patch, everything works normally
In this TWRP, the encryption flags are simply removed, so that after the date format when entering TVRP, the date is not encrypted with keys from TWRP and does not break from this
Spoiler: Installation using DFE patch (HentaiOS and Proton AOSP excluded)
When using DFE, you should not use internal methods of updating in ROM, when the firmware is updated in the background, and when you reboot it is already updated, as I wrote earlier, the sections are updated, and therefore the DFE stops working, and it is rather difficult to predict when the system has updated itself, and if DFE will stop working, all data will be deleted, and the ROM simply will not start, so it's better to manually set everything.​
Spoiler: ROM Type Official MIUI Fastboot
1. Download zip with fastboot image MIUI
2. Unpack it to a convenient place
3. You need to go to the folder, and look for the flash_all_except_storage.bat file there
4. You need to open it with a text editor and delete the last line with the text "fastboot reboot"
5. Now, through miflash, we look for the directory with this file
6. We transfer the phone to fastboot mode (Hold the power button + volume rocker down)
7. We connect the device with a wire to the computer and, in the program, select the bottom right flash_all_except_storage.bat, press flash
8. After the end of the process, you need to boot into TWRP
9. In TVRP, if you did everything correctly, then the memory is not erased.
10. We transfer DFE from the computer to the phone, or if you did it in advance, then we flash it. in 99% of cases, an inscription will come out that you need to pre-flash SystemRW_1.32. Then we do it.
11. In the case of SystemRW, you need to reboot into TWRP, then either put it in RamDisk and just reboot, or click reboot bootloader and boot from the computer back to TWRP.
12. Repeat step 10.
13. If you have not used DFE before, then you need to do format DATA (yes). If you have updated the firmware in this way, then you do not need to do Format data. If you have changed the firmware, it is recommended to do wipe data, otherwise either the firmware will not boot, or it will not work correctly
Spoiler: ROM type Pyaload.bin for TWRP
1. Install TWRP in ramdisk and / or go into it
2. Flash .zip ROM file
3. Install TWRP in ramdisk
4. Reboot into TWRP
5. Flash DFE.zip
6. If you have not used DFE before, then you need to do format DATA (yes). If you have updated the firmware in this way, then you do not need to do Format data. If you have changed the firmware, it is recommended to do wipe data, otherwise either the firmware will not boot, or it will not work correctly
Spoiler: ROM type Payload.bin for ADB sideload via PC
1. Download the .zip ROM to your PC. Upload the archive to the adb folder
2. Then, according to the instructions from the developer, you can flash the vendor and vendor_boot ROM provided by the developer, or load into the temporary TVRP from nebrassy "fastboot flash boot twrp.img", or through the autoinstall script
3. Further, in the case of AOSP recovery fastboot --set-active = a and fastboot reboot recovery
5. In twrp, select the advanced section and click adb sideload. in AOSP recovery select Install update through ADB
6. In the console from the adb folder in which the archive from the ROM is located, write "adb sideload name_file_PZU.zip"
7. Flash DFE.zip
8. If you have not used DFE before, then you need to do format DATA (yes). If you have updated the firmware in this way, then you do not need to do Format data. If you have changed the firmware, it is recommended to do wipe data, otherwise either the firmware will not boot, or it will not work correctly
Spoiler: ROM Type Custom MIUI (For example Xiaomi.eu)
1. Download CustomMIUI.zip
2. Install TWRP in ramdisk and / or go into it
3. Flash CustomMIUI.zip ROM file
4. Install TWRP in ramdisk
5. Reboot into TWRP
6. Flash DFE.zip
7. If you have not used DFE before, then you need to do format DATA (yes). If you have updated the firmware in this way, then you do not need to do Format data. If you have changed the firmware, it is recommended to do wipe data, otherwise either the firmware will not boot, or it will not work correctly
Spoiler: ROM type Custom fastboot image.
1. Download fastboot ROM on PC
2. Unzip to a convenient place, and go to the folder, find the update.bat file there, you need to open it with a text editor and delete the last line with the text "fastboot reboot"
3. We transfer the phone to fastboot mode (Hold the power button + volume down)
4. Run update.bat and wait for the end of the procedure
5. After the end of the process, you need to boot into TWRP
9. In TWRP, if you did everything right, then the memory is not erased. Otherwise, I recommend using this method so that the memory appears.
10. We transfer DFE from the computer to the phone, or if you did it in advance, then we flash it.
11. If you have not used DFE before, then you need to do format DATA (yes). If you have updated the firmware in this way, then you do not need to do Format data. If you have changed the firmware, it is recommended to do wipe data, otherwise either the firmware will not boot, or it will not work correctly
Spoiler: Standard installation methods
Spoiler: ROM Type Official MIUI Fastboot
1. Download zip with fastboot image MIUI
2. Unpack it to a convenient place
3. Now, through miflash, we look for the directory with this file
4. We transfer the phone to fastboot mode (Hold the power button + volume ring down)
5. We connect with a wire to the PC and first select in the program at the bottom right flash_all_except_storage.bat (For updating), flash_all.bat (For Clean installation) flash_all_lock.bat (for clean installation and locking the bootloader) or press flash
6. The system will reboot itself. Ready
7. Additionally (Magisk, gapps and other zip) after a clean install with all files removed:
7.1 After loading into the system, we go through the device configuration, and we must put a pin or a graphic key
7.2 Flash temporary TWRP
7.3 If you need a TVRP on an ongoing basis, then we flash it into a ramdisk (Imstall recvoery ramdisk), the img image of the TVRP must be on the device
7.4 Flash the zip archives you need
7.5 You can make Wipe data to set up your phone again
8. If you updated your phone, you can do steps 7.2-7.4 Immediately after installing the update
Spoiler: ROM type Pyaload.bin for TWRP
1. Install TWRP in ramdisk and / or go into it
2. Flash .zip ROM file
3. Install TWRP in ramdisk
4. Make Format Data as indicated in the instructions of the firmware developer, or wipe date if you change it from custom to custom (does not always work), or just boot into the system (Risky !!)
5.Additional (Magisk, gapps and other zip):
5.1 If you have updated the ROM, you can flash additional files
5.2 If you have made format data, you need to boot into the system, go through the setup, put the lock key and reboot into tvrp, after that you can put an additional zip. and make wipe data to configure it again
Spoiler: ROM type Payload.bin for ADB sideload via PC
1. Download the .zip ROM to your PC. Upload the archive to the adb folder
2. Further, you can follow the instructions either from the developer, flash the vendor and vendor_boot provided by the developer, or boot into the temporary TWRP from nebrassy "fastboot flash boot twrp.img", or through the autoinstall script
3. Further, in the case of AOSP recovery fastboot --set-active = a and fastboot reboot recovery
5. In twrp, select the advanced section and click adb sideload. in aosp recovery select Install update through ADB
6. In the console, from the adb folder in which the archive with the firmware is located, write adb sideload_file_name.zip
7. At the end of the process, make Format Data as indicated in the developer's instructions, or wipe the date, if you change it from custom to custom (it does not always work), or just boot into the system
8.Additional (Magisk, gapps and other zip):
8.1 After loading into the system, we go through the device configuration, and we must put a pin or a graphic key
8.2 Reboot the phone into fastboot mode (volume down and hold down the power button) connect the computer, flash the temporary TWRP
8.3 If you need a TVRP for a constant, then we flash it into a ramdisk (Imstall recvoery ramdisk), the img image of a tvrp must be on the device
8.4 Flash the zip archives you need
9. If you updated your phone, you can do steps 8.2-8.4 Immediately after installing the update
Spoiler: ROM Type Custom MIUI (For example Xiaomi.eu)
1. Download CustomMIUI.zip
2. Install TWRP in ramdisk and / or go into it
3. Flash CustomMIUI.zip ROM file
4. Install TWRP to ramdisk
5. Reboot into TWRP
6. Make Format Data as indicated in the Developer's instructions, or wipe date, if you change miui to miui (does not always work), or just boot into the system
7.Additional (Magisk, gapps and other zip):
7.1 In case you have updated the ROM, you can flash additional files
7.2 If you have made format data, you need to boot into the system, go through the setup, put the lock key and reboot into tvrp, after that you can put an additional zip. and make wipe data to configure it again
Spoiler: ROM type Custom fastboot image.
1. Download fastboot ROM on PC
2. Unzip to a convenient place, and go to the folder, find the update.bat file and installformat.bat there FirestInstall.bat
3. Go into fastboot mode, connect the device to the PC and select the desired installer, or update, to update, or for a clean install installformat.bat or FirestInstall.bat (all data will be erased, including memory
4. Additionally (Magisk, gapps and other zip) after a clean install with all files removed:
4.1 After loading into the system, we go through the device configuration, and we must put a pin or a graphic key
4.2 Reboot the phone into fastboot mode (volume down and hold down the power button) connect the computer, flash the temporary TWRP
4.3 If you need TWRP for Permanent then we do it
4.4 Flash the zip archives you need
4.5 You can make Wipe data to set up your phone again
5. If you updated your phone, you can do steps 4.2-4.4 Immediately after installing the update
Click to expand...
Click to collapse
I would propose to add and / or replace in the 1st spoiler "diriver and utilities" the link to this site
to download "miflashtool"
Xiaomi Flash Tool - Official Mi Flash Tool
Download the latest and Official Xiaomi Flash Tool from the Official Xiaomi Flash Tool Website.
xiaomiflashtool.com
where the latest version of the software is present.
RollDload said:
I would propose to add and / or replace in the 1st spoiler "diriver and utilities" the link to this site
to download "miflashtool"
Xiaomi Flash Tool - Official Mi Flash Tool
Download the latest and Official Xiaomi Flash Tool from the Official Xiaomi Flash Tool Website.
xiaomiflashtool.com
where the latest version of the software is present.
Click to expand...
Click to collapse
Okey, I'll do it later
I hope everything in this guide is clear. I just used Google translator. I do not speak English myself ideally
LeeGarChat said:
I hope everything in this guide is clear. I just used Google translator. I do not speak English myself ideally
Click to expand...
Click to collapse
Apparently yes, although I don't speak fluent English either. I can understand it while reading, but not everything, so I use the translator too and I was able to read and understand your guide without any problems. Some native speakers will probably disagree with me .
Very Informative Guide ! A must read for everyone
LeeGarChat said:
in 99% of cases, an inscription will come out that you need to pre-flash SystemRW_1.32. Then we do it.
11. In the case of SystemRW, you need to reboot into TWRP, then either put it in RamDisk and just reboot, or click reboot bootloader and boot from the computer back to TWRP.
Click to expand...
Click to collapse
Hi @LeeGarChat thanks for your interest in my SystemRW / SuperRW feat. MakeRW script
Does it work well on your Poco F3 device? You never sent me your log files...
If you're going to use my SystemRW / SuperRW feat. MakeRW project (or parts thereof) in your thread and make a video about it could you please at least have the decency to include a visible link (not hidden inside of spoiler tags!) to
the official SystemRW / SuperRW feat. MakeRW by lebigmac project thread​in the first post of this thread as well as in your video description? Thanks
And please keep in mind that unauthorized, unverified re-uploads of my SystemRW project files are not allowed!
The official download links in the official SystemRW / SuperRW feat. MakeRW by lebigmac thread work just fine!
I can't offer any customer support for old, unofficial, deprecated, unverified versions of my script which were reuploaded by 3rd parties but I can only offer support for the latest official version of my script downloaded directly from the official SystemRW / SuperRW feat. MakeRW by lebigmac project thread
Thank you!
Good news! New version of © SystemRW / SuperRW feat. MakeRW™ by lebigmac ® coming soon! Stay tuned!​
Hey Guys i need your help, i followed all the steps in that post but i could not find the " Onekey injection" so i ignored that step and installed the xiaomi eu rom. Everything went well, now when i want to boot in recovery mode it shows up the stock recovery
So my question is when i want to update my phone in the future, i have to install it through TWRP and if my data will be lost or no?
Kaddy2727 said:
Hey Guys i need your help, i followed all the steps in that post but i could not find the " Onekey injection" so i ignored that step and installed the xiaomi eu rom. Everything went well, now when i want to boot in recovery mode it shows up the stock recovery
So my question is when i want to update my phone in the future, i have to install it through TWRP and if my data will be lost or no?
Click to expand...
Click to collapse
which version did you flash of xiaomi eu, the weekly or the stable?
The latest versions should flash twrp as well. However, if you only upgrade there is no need to format data, so you do not lose your data, I always recommend that you do a backup before any modding operation because you never know what can happen.
To flash twrp download the image from here:
[RECOVERY] [12] [OFFICIAL] TeamWin Recovery Project
Introduction: Team Win Recovery Project or TWRP for short, is a custom recovery built with ease of use and customization in mind. We started from the ground up by taking AOSP recovery and loading it with the standard recovery options, then added...
forum.xda-developers.com
put the image filenametwrp.img in the folder where there is adb and fastboot
go to the folder where there is adb and fastboot, rename the filenametwrp.img to twrp.img then go to the address bar and type cmd and press enter, (a prompt window should open)
(In the phone) make sure you have enabled usb debug in developer settings and have authorized the pc.
now turn off the phone and start it in fastboot, then connect it to the pc via the usb cable
in the cmd you opened before type this
Code:
fastboot deviced
to check if it is recognized
if the phone code appears you can boot twrp by typing this
Code:
fastboot boot twrp.img
hit enter and the phone should boot into twrp
now in twrp go to advanced and search "install current twrp" in the options at the bottom below and flash.
you should now have twrp.
lebigmac said:
Hi @LeeGarChat thanks for your interest in my SystemRW script.
Does it work well on your Poco F3 device? You never sent me your log files...
Could you please include a link to my project in first post of this thread? Thank you!
Click to expand...
Click to collapse
I'll reply in his stead ....
As of now - latest Xiaomi betas for global 12.5.4 it does not work correctly doing it the way he described ( flashing 1.32rw inside twrp has to be done twice lol ) After flashing it twice you have to flash his patch then reboot the phone and format data.
Now phone will say decrypted but for who knows what reason everything is broken. Lots of silent crashes from the systemui and overall slowdown of the system/several apps refusing to work.
Fast charging is gone as well....
Strangely much less stuff appears to be broken in EEA version of the miui , still needs flashing twice the main script but at least fast charging works afterwards. System is slightly more stable but still overall suffering from slowdown.
I personally found that manual method of creating image from booted android does work somewhat. You only need to do it once by executing systemrw.sh then flashing the super.img .
What's the catch? You can't flash super.img through "fastboot flash super" command , it mangles partitions to the point where /vendor and /odm can't mount inside twrp.
I am curious tho maybe I don't need to enter twrp after flashing super image via fastboot? Maybe his fix is not necessary then and I just need to wipe and boot system to fix /vendor and /odm not being able to mount.... Hmmm
I'll try this when I'm free sometime , but for now I'm not using this due to performance issues mainly.
His script does let you at least get that decrypted status but for who knows what reason lots of stuff is broken... Could be magisk being flashed onto phone before partitions are extracted or overall twrp not being anywhere close to stable enough to handle all of this?
@Rstment ^m^
I can nowhere read sth. about this rw Script . Where does it play a role ? I just wanna flash a xiaomi.eu Rom. Are you talking about the official weekly/stable ?
Eclipse1991 said:
@Rstment ^m^
I can nowhere read sth. about this rw Script . Where does it play a role ? I just wanna flash a xiaomi.eu Rom. Are you talking about the official weekly/stable ?
Click to expand...
Click to collapse
Nah , it's related to decrypting rom. Not something you should worry about...
@Kaddy2727 @RollDload @Rstment ^m^ @Eclipse1991 @__halvar__
I wrote my SystemRW/SuperRW feat. MakeRW script for all Android power users out there that wish to make their stock read-only Android 10+ device read/write-able again to remove annoying bloatware and make more thorough customizations to their device.
If you like my SystemRW / SuperRW feat. MakeRW script and want to share your feedback with me (the original developer of SystemRW / SuperRW feat. MakeRW) or have any questions related to my script then please feel free to ask me in
the official SystemRW / SuperRW feat. MakeRW by lebigmac project thread ​
Rstment ^m^ said:
As of now - latest Xiaomi betas for global 12.5.4 it does not work correctly doing it the way he described ( flashing 1.32rw inside twrp has to be done twice lol ) After flashing it twice you have to flash his patch then reboot the phone and format data.
Click to expand...
Click to collapse
@Rstment ^m^
I do NOT recommend formatting /data after running my SystemRW / SuperRW feat. MakeRW script in recovery! You will lose all your personal files if you do this!
You just have to make sure that /data partition is properly decrypted and mounted in your custom recovery before running my SystemRW / SuperRW feat. MakeRW script. That's all.
im on miui global 12.5.6 do i need to flash the stock rom before flashing custom rom?
I tried the Custom MIUI Process with OneOS and when flashing ROM and after Recovery to Ramdisk and reboot, the internal storage contents disappear. What is the reason ? Caused both on 3.5.2 TWRP and 3.6.0 Official one.
Can be used as reference for xiaomi 11t pro? Cause I didn't see any custom rom for this device

[GUIDE] [EMUI9] P20 Lite Basics

Spoiler: Quick Links
Official LineageOS 16.0 (15.02.2021)
.401 Stock Images (C432)
Stock Recovery
Stock E-recovery
Official TWRP (3.7.0)
Official TWRP (3.4.0-1)
Modified TWRP (3.4.0)
Heavily Modified TWRP (3.4.0)
Magisk Patched Recovery (25.2)
Magisk-Delta Patched Recovery (25.2-delta)
Stock Kernel (4.9.148)
Phenix Kernel (4.9.319 by Turex)
Phenix Permissive Kernel (4.9.319 by Iceows)
Phenix Permissive Kernel (4.9.235 by Abdelhay.ali)
Phenix Enforcing and Permissive Kernel for Android 13 (4.9.319 by Abdelhay.ali)
Selinux Rules for Android 13 (by Abdelhay.ali)
Everything Else (47GB)
Special key combos:​
Power + Vol+ = Recovery Mode
While USB connected, Power + Vol+ = Erecovery Mode
While USB connected, Vol- = Fastboot
Plug USB while holding down Vol+ + Vol- = Download Mode
Power + Vol+ + Vol- = Force Dload
Flashing Any GSI​Note:​Phh is "retiring". Community of builders created trebledroid initiative to keep his work alive. Don't expect same level of quality for a while.
Use vndklite variants.
At no point you need to wipe /data or any other partition. Just do factory reset.
If you want to backup via twrp you need to have encryption disabled.
Almost all chromium based browsers including chrome freeze after few minute of use. That is caused by DRM not working as intended in gsis. To fix it flash DRM fix.
Permissive kernel shouldn't be used daily. Please only use it for debugging purposes.
Prerequisites:​
ADB and Fastboot Installed (1)
Any Arm64 AB GSI image (1) (2) (3) (4) (5)
Google apps package (Optional) (1) (2) (3) (4)
TWRP
Unlocked Bootloader
Spoiler: Android 12 and Below
Spoiler: GSI with GAPPS
Tick "Enable OEM Unlock" from developer options
Boot into fastboot: Hold vol- while usb connected and phone rebooting
Flash gsi image: fastboot flash system drag & drop img file to console
Flash Stock Recovery: fastboot flash recovery_ramdisk and drag & drop img file to console
Boot into recovery: power + vol+ while NOT connected to pc
Factory reset: Factory Reset > Type yes > Press power
Boot into system
Spoiler: Vanilla GSI + Gapps + Zips
Tick "Enable OEM Unlock" from developer options
Boot into fastboot: Hold vol- while usb connected and phone rebooting
Flash gsi image: fastboot flash system drag & drop img file to console
Flash Phenix Kernel (Optional): fastboot flash kernel and drag & drop img file to console
Flash this TWRP: fastboot flash recovery_ramdisk and drag & drop img file to console
Boot into recovery: power + vol+ while NOT connected to pc
Factory reset: Wipe > Swipe Factory Reset
Resize system: Wipe > Advanced Wipe > Tick System > Repair or Change File System > Swipe Resize File System
if it fails issue these commands from your computer:
adb shell "/sbin/e2fsck -fp /dev/block/platform/hi_mci.0/by-name/system"
adb shell "/sbin/resize2fs /dev/block/platform/hi_mci.0/by-name/system"
Encrypt or Decrypt /Data (Optional): Mount > Tick Vendor > adb push drag & drop fstab file to console /vendor/etc
Flash DRM fix (Optional): ''
Flash NFC fix (Optional / Might not Work): ''
Flash Gapps Zip (Optional): ''
Boot into system: Reboot > System
Spoiler: Android 13 and Beyond(?)
Tick "Enable OEM Unlock" from developer options
Boot into fastboot: Hold vol- while usb connected and phone rebooting
Flash gsi image: fastboot flash system drag & drop img file to console
Flash one of these kernel (Optional): fastboot flash kernel and drag & drop img file to console
Flash this TWRP: fastboot flash recovery_ramdisk and drag & drop img file to console
Boot into recovery: power + vol+ while NOT connected to pc
Factory reset: Wipe > Swipe Factory Reset
Flash this AIO fix : Advanced > ADB Sideload > Swipe to Start Sideload > Write adb sideload and drag & drop zip file to console
Flash Gapps Zip (Optional): ''
Boot into system: Reboot > System
Spoiler: Tweaks
Spoiler: TWRP on Erecovery, Magisk on Recovery Setup
Flash over to erecovery:
Boot into fastboot: Hold vol- while usb connected and phone rebooting
Flash one of these (1) (2) twrp images: fastboot flash recovery_ramdisk and drag & drop img file to console
Boot into twrp: power + vol+ while NOT connected to pc
Push twrp to /cache: adb push drag & drop img file to console /cache
Flash twrp to erecovery: Install > Install Image > Select twrp image from /cache folder > Pick erecovery_ramdisk partition > Swipe
After you set up your phone and made sure you don't need stock recovery, flash magisk:
Boot into fastboot: Hold vol- while usb connected and phone rebooting
Flash magisk patched image: fastboot flash recovery_ramdisk and drag & drop img file to console
From now on this is how you boot:
No keypress: System (Long yellow warning)
Power & Vol+ before Yellow Warning : System with magisk (Short yellow warning)
Vol+ on Yellow Warning : TWRP
If you want to return to stock erecovery, do these:
Boot into twrp
Push erecovery image to /cache: adb push drag & drop img file to console /cache
Flash erecovery to erecovery: Install > Install Image > Select erecovery image from /cache folder > Pick erecovery_ramdisk partition > Swipe
Spoiler: Passing Safetynet (For Android 12 and Below
Keep in mind that Safetynet is deprecated and Google is encouraging developers to switch to Play Integrity API. To pass safetynet you need to have 3 checkmarks, as such you'll need to follow all 3 instructions I'm about to give you.
Spoiler: Evaluation Type Basic
Disable "Spoof Pixel 5" & Enable Safetynet in phh options then reboot.
Download YASNAC from play store and check for "Evaluation Type" from result.
If it says Basic and others fail you can skip this part.
If test fails or doesn't finish do these:
Install Magisk
Enable Zygisk & Enforce denylist
Install Universal SafetyNet Fix module by kdrag0n
Now check YASNAC again. It should finish test and say Basic in evaluation type.
Spoiler: Basic Integrity Fail
This happens because root is detected most of the time.
If your GSI has Dynamic Root, uncheck root from phh settings.
If your GSI has SU, securize from phh settings.
If you had to flash magisk because of evaluation type, tick google play and google play services in denylist.
If those didn't fix, contact GSI maintainer.
Spoiler: CTS Profile Match Fail
This happens because build fingerprint is not play certified.
Make sure you have safetynet option ticked in phh settings and do these:
Edit /data/adb/phh/secure
Add these 2 lines to bottom:
resetprop_phh ro.build.fingerprint HUAWEI/ANE-LX1/HWANE:9/HUAWEIANE-L01/9.1.0.368C432:user/release-keys
resetprop_phh ro.build.version.security_patch 2020-08-01
Reboot and test again.
Everytime you untick safetynet you have to edit this file again. You can also pick any other fingerprint from here should you choose to. You need both fingerprint and patch date. If you want to simulate other devices add following lines:
resetprop_phh ro.product.brand HUAWEI
resetprop_phh ro.product.device HWANE
resetprop_phh ro.product.manufacturer HUAWEI
resetprop_phh ro.product.model ANE-LX1
resetprop_phh ro.product.name ANE-LX1
Spoiler: Passing Play Integrity (For Android 13 and Beyond)
If you want to pass it you're going to have to read this wall of text. I can't shorten it.
What is Play Integrity:
Google enforces Play Inregrity once your api level is set to 33 (android 13). I currently don't have enough information about it other than apps can decide which checks to perform on your device. One of those checks is called strong integrity. We can't pass strong integrity because it requires hardware backed checks which our device lack. However you can still fool some apps that don't enforce strong integrity.
How you can fool it:
Ever since magisk retired magiskhide, some forks have been made to keep it maintained and improved. One of those forks is Magisk Delta. Before you head over to it's github and install it, you still need to install a valid CTS fingerprint. Then you can install Magisk Delta.
Steps:
Disable Spoof Pixel 5 & Enable Safetynet from phh settings if they exist.
Add these 2 lines to bottom of /data/adb/phh/secure (create if it doesnt exist) & Reboot
resetprop_phh ro.build.fingerprint HUAWEI/ANE-LX1/HWANE:9/HUAWEIANE-L01/9.1.0.368C432:user/release-keys
resetprop_phh ro.build.version.security_patch 2020-08-01
If you have magisk :
- Download Magisk Delta apk
- Change .apk to .zip
- Install it as magisk module
If you don't have magisk :
- Download & install Magisk Delta apk
- Patch recovery_ramdisk & flash it via fastboot
Enable Zygisk and MagiskHide from Magisk Delta App
Install this module : https://github.com/HuskyDG/safetynet-integrity-fix/releases
MAKE SURE GMS IS NOT IN HIDELIST
Reboot and test safetynet. (Feel free to link any app that tests for Play Integrity)
Spoiler: I went back to EMUI, why it looks like aosp?
That happens because EMUI stores it's themes and few stock apps in /data/hw_init folder. When you factory reset with stock recovery, they are preserved. But when you use twrp to factory reset they are removed. Doing factory reset once from twrp is enough to make EMUI think it's corrupted, in acuality it isn't. To fix it you can either let EMUI update from system settings or you can download this, extract hw_init folder and push folder to /data from twrp with this command :
adb push drag & drop hw_init folder to console /data
Flashing LineageOS 16.0​Note:​Stock kernel from EMUI .300> have trouble with wifi. Use Phenix 4.9.319 or above to fix it.
Prerequisites:​
ADB and Fastboot Installed (1)
Google apps package (Pick Pie or 9.0 editions) (1) (2) (3) (4)
LineageOS Zip (From Archive or From Mega)
Phenix Kernel (Else you won't have wi-fi)
TWRP (3.4.0 is needed for factory reset functionality)
Unlocked Bootloader
Spoiler: Steps
Tick "Enable OEM Unlock" from developer options
Boot into fastboot: Hold vol- while usb connected and phone rebooting
Flash this TWRP: fastboot flash recovery_ramdisk and drag & drop img file to console
Flash Phenix Kernel (Required for Wi-Fi): fastboot flash kernel and drag & drop img file to console
Boot into twrp: power + vol+ while NOT connected to pc
Flash lineage zip: Advanced > ADB Sideload > Swipe to Start Sideload > Write adb sideload and drag & drop zip file to console
Factory reset: Wipe > Swipe Factory Reset
Boot into Vanilla LineageOS or Keep following to flash gapps
Encrypt or Decrypt /Data (Optional): Mount > Tick Vendor > adb push drag & drop fstab file to console /vendor/etc
Flash gapps zip: Advanced > ADB Sideload > Swipe to Start Sideload > Write adb sideload and drag & drop zip file to console
Boot into system: Reboot > System
Getting Stock Firmware Files And Downgrading​Sources:​
A certain russian site (linking is prohibited)
EMUI's System Updater (via root)
Firmware Finder (Revived)
HiSuite
Huawei Update Extractor
HuRUpdater Guide / HuRUpdater Download (For older builds)
HwOTA8 (For Emui 8)
Spoiler: Getting Individual Images
Firmware finder has been revived and you can use that to get your prefered cust or build.
If you need only one image not the whole build, I uploaded each one you'd typically need below.
CUST.img
DTS.img
ERECOVERY_KERNE.img
ERECOVERY_RAMDI.img
ERECOVERY_VBMET.img
ERECOVERY_VENDO.img
FASTBOOT.img
KERNEL.img
ODM.img
PRODUCT.img
RECOVERY_RAMDIS.img
RECOVERY_VBMETA.img
RECOVERY_VENDOR.img
SYSTEM.img
VBMETA.img
VENDOR.img
XLOADER.img
They are from .401 c432.
If you wiped /data once you probably won't have emui themes etc if you go back to emui. To fix that you can push hw_init folder (in data.7z) to /data. Not the contents of it, just put the folder in root of /data. It should be like this: /data/hw_init
Spoiler: Hisuite
Connect your phone to pc and open up hisuite. Check for updates and if it finds one it'll download following files update_full_base.zip, update_full_ANE-L01_hw_eu.zip and update_full_cust_ANE-L01_hw_eu.zip to your documents folder. update_full_base.zip file contains main UPDATE.APP. You can extract images from it with Huawei Update Extractor
Spoiler: EMUI's System Updater
Flash magisk patched image from quick links. After you get root in EMUI allow system updater to do its job and update. It'll ask to reboot, allow it. It will throw you back to system after reboot because recovery is not stock. Get a file manager that allows root access. Allow system updater to download again. But this time do not allow it to reboot. First one downloaded OTA, second one downloaded FullOTA. Which is better for archival purposes. After download is done go to /data/update with a root file explorer. Copy HwOUC folder to internal storage and from there to your pc. There should be 3 folders with numbers. You can find our main update_full_base.zip in one of them.
Spoiler: Downgrading
Spoiler: From EMUI 9 to EMUI 9
Spoiler: Using just the SYSTEM.IMG
Get files of your prefered build. I recommend build .278. Extract SYSTEM.IMG from UPDATE.APP via huawei update extractor and flash it with fastboot flash system . Factory reset with stock recovery then flash any TWRP except for the official ones. Official TWRPs freezes when wiping /data which is what we need to do. After wiping /data boot into system. You should have aosp background with square app icons if you did correctly. Check for system updates and it should find your current build. Download and install.
Spoiler: Using dload from Certain Russian Site
BOOTLOADER WILL RELOCK, DON'T DO THIS IF YOU DON't HAVE YOUR BL CODE
For this you need to have a sd card that is formated as exfat. Fat32 doesn't allow >4gb files so exfat is required. Download your prefered build from Androidhost.ru or mega link above. Inside the zip file you'll find a folder named dload. Extract this folder to somewhere and transfer it to your sd card. Folder structure should look like below. Hw_eu and L01/L21 will depend on your region and single/dual sim status. After this unplug your phone and shut it down. Start pressing vol- vol+ and power all at the same time. Different kind of yellow warning will appear and a screen with blue progress bar over black background will appear. If you downloaded correct variant for your phone it'll start progressing. After process is done you'll boot into stock emui with NO yellow warning. This is because your bootloader is locked. Do whatever you want at this point but remember, unlocking bootloader again will low level factory reset your phone.
-/storage/AAAA-BBBB/dload
---/update_sd
---/ANE-L01_hw_eu
---/ANE-L21_hw_eu
Spoiler: From EMUI 9 to EMUI 8
If I recall correctly there is only one way to do this. You can't dload between emui versions. You also need to be on stock emui for hisuite to function. Some people say a specific hisuite version is required but it wasn't the case for me. Plug your phone to pc, hisuite should show up beside your phone in drives section. Install it and open it. Do whatever it instructs you to function correctly. After you see your phone in app click Update button. Then click on "Earlier Versions". It'll show version 8.0.0.167 along with some warnings. Rest it pretty straightforward. Follow along and it'll return you back to emui 8. But if you're doing this to unlock your bootloader, build .167 is not enough. Exploit that dc-unlocker uses is patched in this version. So you have to roll back further. I had success with .125 build but up until .150 could work. Link to .125 build.
edit ? : Revised guide
Frax3r said:
Hello there! Alive parts of this forum is still filled with simple help requests so I decided to put together a simple all-in-one thread that basically covers most stuff. I don't wanna get into bootloader unlocking because right now only free way to do so is with potatoNV which I do not know how to use. Dc-unlocker is an option too but it is 4€ so pick your poison.​​Special key combos:​
Power + Vol+ = Recovery Mode​
While USB connected, Power + Vol+ = Erecovery Mode​
While USB connected, Vol- = Fastboot​
Plug USB while holding down Vol+ + Vol- = Download Mode​
Power + Vol+ + Vol- = Force Dload​
Flashing LineageOS 16.0​Prerequisites:​
Emui Version below 9.1.0.300
Unlocked Bootloader and FRP
adb and fastboot installed on pc
Los16 zip
Official TWRP
Stock recovery_ramdis.img
Your choice of gapps zip
Steps:​
Get the Prerequisites
I recommend sending los 16 zip, recovery_ramdis.img and gapps zip to sd card if possible
On current rom/gsi go to developer options and enable usb debug while you're at it enable "Enable OEM Unlock"
Connect phone to PC and allow debugging from phone
Send adb reboot bootloader command from console
After restart write fastboot flash recovery_ramdisk to console and drag twrp-3.5.2_9-0-anne.img over to console and press enter
After flash is complete unplug phone and shut it down by long pressing power button
Press and hold power + vol+ buttons until short yellow warning shows up
Allow modifications
Press Install and select los 16 zip file
If you want to disable encryption do it now
Press Install and press Install Image
Select and flash stock recovery_ramdis.img to recovery_ramdisk partition
Press Reboot and select shut down
Press and hold power + vol+ buttons until short yellow warning shows up
Select factory reset and type yes, while it is doing that plug the phone to pc
After factory reset is complete select reboot option and hold down vol- until you're at fastboot
Repeat step 6-7-8
Los 16 don't need to be resized so go to install and select gapps zip
Reboot to system
Flashing Any GSI​Prerequisites:​
Unlocked Bootloader and FRP
adb and fastboot installed on pc
GSI image (1) (2)
Official TWRP
Stock recovery_ramdis.img
Your choice of gapps zip (Optional)
Notes:​If you're gonna use Phh's AOSP11 and anything that based on it (with the exception of @eremitein's stuff), use arm64-ab-vndklite variant. For anything else use full vndk version. Full vndk version of Phh's AOSP11 does not allow you to resize system on any twrp.
Steps for gapps versions:​
Get the Prerequisites
On current rom/gsi go to developer options and enable usb debug while you're at it enable "Enable OEM Unlock"
Connect phone to PC and allow debugging from phone
Send adb reboot bootloader command from console
After restart write fastboot flash system to console and drag gsi .img over to console and press enter
After flash is complete unplug phone and shut it down by long pressing power button
Press and hold power + vol+ buttons until short yellow warning shows up
You should be at stock recovery_ramdisk, do a factory reset
You're good to boot up the system
Steps for vanilla versions with custom gapps:​
Get the Prerequisites
On current rom/gsi go to developer options and enable usb debug while you're at it enable "Enable OEM Unlock"
Connect phone to PC and allow debugging from phone
If you want to disable encryption do it now
Send adb reboot bootloader command from console
After restart write fastboot flash system to console and drag gsi .img over to console and press enter
After flash is complete unplug phone and shut it down by long pressing power button
Press and hold power + vol+ buttons until short yellow warning shows up
You should be at stock recovery_ramdisk, do a factory reset
Plug your phone back and press reboot from screen
While booting press and hold vol- button until you're at fastboot
Write fastboot flash recovery_ramdisk to console and drag twrp-3.5.2_9-0-anne.img over to console and press enter
After flash is complete unplug phone and shut it down by long pressing power button
Press and hold power + vol+ buttons until short yellow warning shows up
Allow modifications
Press Wipe, press Advanced Wipe, select System, press Repair or Change File System, press Resize File System, swipe to resize
Press Install, select and flash gapps zip
Reboot to system
Disable Encryption​Prerequisites:​
Unlocked Bootloader and FRP
adb and fastboot installed on pc
Official TWRP
Stock recovery_ramdis.img
Notes:​You can disable encryption at any step, even after booting, but in order to disable it you have to do a factory reset from stock recovery_ramdis. Because of this I recommend doing between flashing gsi and flashing gapps.
Steps:​
Get the Prerequisites
Boot to TWRP (power + vol+ after shutting down)
Allow modifications
Press Mount, select Vendor
Connect phone to PC
You can do next part 2 ways, if you're good with command line interface use steps 7 through 11, if not skip to step 12
Type adb shell and press enter
Type nano /vendor/etc/fstab.hi6250 and press enter
Remove fileencryption=aes-256-xts:aes-256-cts part from 16th line, make sure there's only one comma between check and reservedsize
Press Ctrl + X then Y and press enter
Go to step 18
Type adb pull /vendor/etc/fstab.hi6250 and press enter
If you have adb in your $PATH go to your user profile folder, if not go to folder where adb.exe resides
Open fstab.hi6250 via a text editor (please use notepad++)
Remove fileencryption=aes-256-xts:aes-256-cts part from 16th line, make sure there's only one comma between check and reservedsize
Save file and open a command prompt
Send this command adb push ./fstab.hi6250 /vendor/etc/fstab.hi6250
View attachment 5422531
Now you need to do a factory reset with stock recovery_ramdis.img, if you have it installed go to step 21 if not do 19 or 20 first
If you have TWRP installed, press Install and press Install Image then select and flash stock recovery_ramdis.img to recovery_ramdisk partition
If not shut down phone, connect it to pc and hold down vol- until you're at fastboot, then write this command fastboot flash recovery_ramdisk and drag recovery_ramdis.img over to console then press enter
Shut down phone and unplug it from pc
Press and hold power+ vol+ until you see short yellow warning
Press Factory Reset and type yes
You've successfully decrypted your phone and you're good to boot up or flash gapps
Getting Stock Firmware Files And Downgrading​Prerequisites:​
Unlocked Bootloader and FRP
adb and fastboot installed on pc
Huawei Update Extractor
Firmware Zip (EMUI8 and EMUI9)
HiSuite
Erecovery
EMUI's System Updater (via root)
HuRUpdater Guide / HuRUpdater Download
HwOTA
Getting stock files are problematic because of huawei. Least shadiest way to get them are the hardest so bear with me.
Androidhost.ru : Click the EMUI9 from prerequisites and search p20 lite. You should get a wide variety of versions to pick from. Make sure to match the Cust in the file to yours if you don't know what you're doing. C432 for Europe for example. After you download the zip file open it up and find the dload folder. You can either get this folder and paste it right into your sd card to force dload or you can open this folder and extract update_sd.zip. Inside update_sd.zip you'll find a file named UPDATE.APP. Use Huawei Update Extractor to open this file and there you'll see all the partitions you need. If HUE gives error while opening it, go to settings and untick "Verify file checksum". You can extract .img files by right clicking and selecting extract option on each partition. Normally you can't open these .img files but after pushing them through simg2img you'll be able to explore them too. But lets be real if you need guides for this, all you need is recovery_ramdis.img.
Using Dload Folder : Your sd card can't be FAT32 for this. FAT32 by nature don't allow files larger than 4gb so you can't get this folder to your sd card. Format it to ExFat via any guide on the internet then copy the dload folder to your sd card's root. It can't be inside any folders. Then shut your phone and press Power + Vol+ + Vol- all at the same time. It'll boot to erecovery which'll check the integrity of files then install them regardless of your EMUI version. So it is a good way to downgrade. Keep in mind tho you can't dload back to emui 8 from emui 9. And any successful dload will lock your bootloader back.
Hisuite : You can actually get firmware files pretty easily with hisuite but it requires real work. You see, hisuite downloads firmware files right into your documents folder. Connect your phone to pc and open up hisuite. Check for updates and if it finds one it'll download following files update_full_base.zip, update_full_ANE-L01_hw_eu.zip and update_full_cust_ANE-L01_hw_eu.zip. It might not get all 3 files most of the time so you have to copy each of them and update a few versions consecutively to get them. Keep in mind, it deletes each update file after it is successful so make sure to make a copy of them some place else. I recommend reverting back to EMUI8 through hisuite and then updating it to latest one to get all files. It is tidious but you need to do this once. It doesnt update you to .370 from .132. It'll send you .132 then .200 then .368 then latest whatever. You can actually use these files with HuRu updater or HwOTA to manually update. Or you can get the UPDATE.APP inside them and extract images with Huawei Update Extractor.
Erecovery : This one requires some network knowledge and it'll only get you the latest version so I don't think it worth the hassle. You need a router that allows you to change dns address for DHCP clients. Which most of them do these days. Now you need to create and run a dns server on your pc. I recommend adguard home. Pihole works too. Use Windows Subsystem For Linux or Docker to install either of them. Once you get them up and working set them to log dns requests. I believe you know where this is going. Open your router's interface and enter adguard home/pihole ip address which maps back to your pc's local address. Check if it works or not by opening up few sites on your phone which should be connected to your wifi and isn't set up to use a different dns server. If all is good open up erecovery on your phone and connect to your wifi. If you set it up correctly it should get the latest version from huawei which will show up on your log. Use that url to download it to your pc and extract it same as others. There was a paid service that used this method to send specific versions to your erecovery.
EMUI's System Updater : This is tricky and my favorite. Get the official TWRP .img and patch it with magisk manager. Then flash it via fastboot. I know, "twrp and magisk? wtf?" just do it. It takes a long time to boot but it works don't question me right now. After you get root in EMUI allow system updater to do its job and update. It'll ask to reboot, allow it. It will throw you back to system after reboot cuz recovery is hijacked. duh. Get a file manager that allows root access. Allow system updater to download again. But this time do not allow it to reboot. First one downloaded OTA, second one downloaded FullOTA. Which is better for archival purposes. After download is done search for a folder named HwOUC in /system. Copy it to internal storage and from there to your pc. You can find our main UPDATE.APP inside update_full_base.zip. Other zips include cust and all that which HuRu and HwOTA requires.
Magisk​Prerequisites:​
Unlocked Bootloader and FRP
adb and fastboot installed on pc
Stock recovery_ramdis.img
Notes:​Officially speaking magisk support for our device is dead. Magisk decided to retire magisk-in-recovery method which our phone uses. But hey it is still working without modifications unlike a-only devices so that's a win. As a foot note, you CAN use twrp image instead of stock recovery_ramdis.img but it'll take longer to boot. Using .380's recovery_ramdis.img on .278 build will not work. Make sure to match your EMUI build with ramdisk you're flashing. Ask me how I know.
Steps to install older version:​
Get the Prerequisites
No, I mean literally just get the Prerequisites and thats it
Open up your browser and find a bin service (pastebin will suffice)
Create a paste with following
Code:
{
"app": {
"version": "8.0.7",
"versionCode": "4834",
"link": "https://github.com/topjohnwu/Magisk/releases/download/manager-v8.0.7/MagiskManager-v8.0.7.apk",
"note": "https://cdn.jsdelivr.net/gh/topjohnwu/[email protected]/app/src/main/res/raw/changelog.md"
},
"stub": {
"versionCode": "18",
"link": "https://github.com/topjohnwu/Magisk/releases/download/manager-v8.0.7/stub-release.apk"
},
"uninstaller": {
"link": "https://github.com/topjohnwu/Magisk/releases/download/v21.4/Magisk-uninstaller-20210117.zip"
},
"magisk": {
"version": "v21.4",
"versionCode": "21400",
"link": "https://github.com/topjohnwu/Magisk/releases/download/v21.4/Magisk-v21.4.zip",
"note": "https://topjohnwu.github.io/Magisk/releases/21400.md",
"md5": "ee6dd05579776e7de3a6077087846e53"
}
}
Get the paste's raw url
Take the recovery_ramdis.img to internal storage
Install magisk manager 8.0.7
Open it's settings and select custom channel
Write the raw url you just created
Allow it to check for updates and it'll find that 21.4 is the latest version
Click install and select recovery_ramdis.img
After it finishes patching get the magisk_patched.img to your pc
Get your phone to fastboot mode
After connecting to pc, write this fastboot flash recovery_ramdisk to console and drag magisk_patched.img over to console and press enter
Now if you enter recovery it'll boot to android with magisk but if you boot normally it will not detect magisk so each time you restart you have to use Power + Vol+ combo in order to get magisk
Remember to switch custom channel to stable channel if you want to receive updates.
I know that you can pretty much reduce the amount of flashing and restarting by flashing twrp to erecovery but since erecovery is a lifeline for most people here I decided not to get into that. But for those who are interested check this thread.​
Edit: Grammar
Click to expand...
Click to collapse
I wish good luck to those who will use your guide .
Among other things, the HwOTA and HuRupdater methods have not worked since February (unless someone has the necessary files stored on the disk). Huawei changed servers and Firmware Finder is dead.
EMUI 8 firmware download doesn't work for the same reasons .
avenger.forsyth said:
I wish good luck to those who will use your guide .
Click to expand...
Click to collapse
Everyone has the right to write a guide, but the author must know what he is writing about. Guide made by the "copy/paste" method will not help anyone very much...
Frax3r said:
Hello there! Alive parts of this forum is still filled with simple help requests so I decided to put together a simple all-in-one thread that basically covers most stuff. I don't wanna get into bootloader unlocking because right now only free way to do so is with potatoNV which I do not know how to use. Dc-unlocker is an option too but it is 4€ so pick your poison.​​Special key combos:​
Power + Vol+ = Recovery Mode​
While USB connected, Power + Vol+ = Erecovery Mode​
While USB connected, Vol- = Fastboot​
Plug USB while holding down Vol+ + Vol- = Download Mode​
Power + Vol+ + Vol- = Force Dload​
Flashing LineageOS 16.0​Prerequisites:​
Emui Version below 9.1.0.300
Unlocked Bootloader and FRP
adb and fastboot installed on pc
Los16 zip
Official TWRP
Stock recovery_ramdis.img
Your choice of gapps zip
Steps:​
Get the Prerequisites
I recommend sending los 16 zip, recovery_ramdis.img and gapps zip to sd card if possible
On current rom/gsi go to developer options and enable usb debug while you're at it enable "Enable OEM Unlock"
Connect phone to PC and allow debugging from phone
Send adb reboot bootloader command from console
After restart write fastboot flash recovery_ramdisk to console and drag twrp-3.5.2_9-0-anne.img over to console and press enter
After flash is complete unplug phone and shut it down by long pressing power button
Press and hold power + vol+ buttons until short yellow warning shows up
Allow modifications
Press Install and select los 16 zip file
If you want to disable encryption do it now
Press Install and press Install Image
Select and flash stock recovery_ramdis.img to recovery_ramdisk partition
Press Reboot and select shut down
Press and hold power + vol+ buttons until short yellow warning shows up
Select factory reset and type yes, while it is doing that plug the phone to pc
After factory reset is complete select reboot option and hold down vol- until you're at fastboot
Repeat step 6-7-8
Los 16 don't need to be resized so go to install and select gapps zip
Reboot to system
Flashing Any GSI​Prerequisites:​
Unlocked Bootloader and FRP
adb and fastboot installed on pc
GSI image (1) (2)
Official TWRP
Stock recovery_ramdis.img
Your choice of gapps zip (Optional)
Notes:​If you're gonna use Phh's AOSP11 and anything that based on it (with the exception of @eremitein's stuff), use arm64-ab-vndklite variant. For anything else use full vndk version. Full vndk version of Phh's AOSP11 does not allow you to resize system on any twrp.
Steps for gapps versions:​
Get the Prerequisites
On current rom/gsi go to developer options and enable usb debug while you're at it enable "Enable OEM Unlock"
Connect phone to PC and allow debugging from phone
Send adb reboot bootloader command from console
After restart write fastboot flash system to console and drag gsi .img over to console and press enter
After flash is complete unplug phone and shut it down by long pressing power button
Press and hold power + vol+ buttons until short yellow warning shows up
You should be at stock recovery_ramdisk, do a factory reset
You're good to boot up the system
Steps for vanilla versions with custom gapps:​
Get the Prerequisites
On current rom/gsi go to developer options and enable usb debug while you're at it enable "Enable OEM Unlock"
Connect phone to PC and allow debugging from phone
Send adb reboot bootloader command from console
After restart write fastboot flash system to console and drag gsi .img over to console and press enter
If you want to disable encryption do it now
After flash is complete unplug phone and shut it down by long pressing power button
Press and hold power + vol+ buttons until short yellow warning shows up
You should be at stock recovery_ramdisk, do a factory reset
Plug your phone back and press reboot from screen
While booting press and hold vol- button until you're at fastboot
Write fastboot flash recovery_ramdisk to console and drag twrp-3.5.2_9-0-anne.img over to console and press enter
After flash is complete unplug phone and shut it down by long pressing power button
Press and hold power + vol+ buttons until short yellow warning shows up
Allow modifications
Press Wipe, press Advanced Wipe, select System, press Repair or Change File System, press Resize File System, swipe to resize
Press Install, select and flash gapps zip
Reboot to system
Disable Encryption​Prerequisites:​
Unlocked Bootloader and FRP
adb and fastboot installed on pc
Official TWRP
Stock recovery_ramdis.img
Notes:​You can disable encryption at any step, even after booting, but in order to disable it you have to do a factory reset from stock recovery_ramdis. Because of this I recommend doing between flashing gsi and flashing gapps.
Steps:​
Get the Prerequisites
Boot to TWRP (power + vol+ after shutting down)
Allow modifications
Press Mount, select Vendor
Connect phone to PC
You can do next part 2 ways, if you're good with command line interface use steps 7 through 11, if not skip to step 12
Type adb shell and press enter
Type nano /vendor/etc/fstab.hi6250 and press enter
Remove fileencryption=aes-256-xts:aes-256-cts part from 16th line, make sure there's only one comma between check and reservedsize
Press Ctrl + X then Y and press enter
Go to step 18
Type adb pull /vendor/etc/fstab.hi6250 and press enter
If you have adb in your $PATH go to your user profile folder, if not go to folder where adb.exe resides
Open fstab.hi6250 via a text editor (please use notepad++)
Remove fileencryption=aes-256-xts:aes-256-cts part from 16th line, make sure there's only one comma between check and reservedsize
Save file and open a command prompt
Send this command adb push ./fstab.hi6250 /vendor/etc/fstab.hi6250
View attachment 5422531
Now you need to do a factory reset with stock recovery_ramdis.img, if you have it installed go to step 21 if not do 19 or 20 first
If you have recovery_ramdis.img in your sd card, press Install and press Install Image then select and flash stock recovery_ramdis.img to recovery_ramdisk partition
If not shut down phone, connect it to pc and hold down vol- until you're at fastboot, then write this command fastboot flash recovery_ramdisk and drag recovery_ramdis.img over to console then press enter
Shut down phone and unplug it from pc
Press and hold power+ vol+ until you see short yellow warning
Press Factory Reset and type yes
You've successfully decrypted your phone and you're good to boot up or flash gapps
Getting Stock Firmware Files And Downgrading​Prerequisites:​
Unlocked Bootloader and FRP
adb and fastboot installed on pc
Huawei Update Extractor
Firmware Zips
HiSuite
Erecovery
EMUI's System Updater (via root)
HuRUpdater Guide / HuRUpdater Download (don't work anymore)
HwOTA (don't work anymore)
Getting stock files are problematic because of huawei. Least shadiest way to get them are the hardest so bear with me.
Androidhost.ru : Click the "Firmware Zips" from prerequisites and search p20 lite. You should get a wide variety of versions to pick from. Make sure to match the Cust in the file to yours. C432 for Europe for example. After you download the zip file open it up and find a folder named "dload". You can either get this folder and paste it right into your sd card to force dload or you can open this folder and extract update_sd.zip. Inside update_sd.zip you'll find a file named UPDATE.APP. Use Huawei Update Extractor to open this file and there you'll see all the partitions you need. If HUE gives error while opening it, go to settings and untick "Verify file checksum". You can extract .img files by right clicking and selecting extract option on each partition. Normally you can't open these .img files but after pushing them through simg2img you'll be able to explore them too. But lets be real if you need guides for this, all you need is recovery_ramdis.img.
Using Dload Folder : Your sd card can't be FAT32 for this. FAT32 by nature don't allow files larger than 4gb so you can't get this folder to your sd card. Format it to ExFat via any guide on the internet then copy the dload folder to your sd card's root. It can't be inside any folders. Then shut your phone and press Power + Vol+ + Vol- all at the same time. It'll boot to erecovery which'll check the integrity of files then install them regardless of your EMUI version. So it is a good way to downgrade. Keep in mind tho you can't dload back to emui 8 from emui 9. And any successful dload will lock your bootloader back.
Hisuite : You can actually get firmware files pretty easily with hisuite but it requires real work. You see, hisuite downloads firmware files right into your documents folder. Connect your phone to pc and open up hisuite. Check for updates and if it finds one it'll download following files update_full_base.zip, update_full_ANE-L01_hw_eu.zip and update_full_cust_ANE-L01_hw_eu.zip. You only need update_full_base.zip file, others are used to work on HuRUpdater and HwOTA but they are deprecated since February. Inside update_full_base.zip you'll find UPDATE.APP which you can extract images from with Huawei Update Extractor.
Erecovery : This one requires some network knowledge and it'll only get you the latest version so I don't think it worth the hassle. You need a router that allows you to change dns address for DHCP clients. Which most of them do these days. Now you need to create and run a dns server on your pc. I recommend adguard home. Pihole works too. Use Windows Subsystem For Linux or Docker to install either of them. Once you get them up and working set them to log dns requests. I believe you know where this is going. Open your router's interface and enter adguard home/pihole ip address which maps back to your pc's local address. Check if it works or not by opening up few sites on your phone which should be connected to your wifi and isn't set up to use a different dns server. If all is good open up erecovery on your phone and connect to your wifi. If you set it up correctly it should get the latest version from huawei which will show up on your log. Use that url to download it to your pc and extract it same as others. There was a paid service that used this method to send specific versions to your erecovery.
EMUI's System Updater : This is tricky and my favorite. Get the official TWRP .img and patch it with magisk manager. Then flash it via fastboot. I know, "twrp and magisk? wtf?" just do it. It takes a long time to boot but it works don't question me right now. After you get root in EMUI allow system updater to do its job and update. It'll ask to reboot, allow it. It will throw you back to system after reboot cuz recovery is hijacked. duh. Get a file manager that allows root access. Allow system updater to download again. But this time do not allow it to reboot. First one downloaded OTA, second one downloaded FullOTA. Which is better for archival purposes. After download is done search for a folder named HwOUC in /system. Copy it to internal storage and from there to your pc. You can find our main UPDATE.APP inside update_full_base.zip. Other zips include cust and all that which HuRu and HwOTA used to require.
Magisk​Prerequisites:​
Unlocked Bootloader and FRP
adb and fastboot installed on pc
Stock recovery_ramdis.img
Notes:​Officially speaking magisk support for our device is dead. Magisk decided to retire magisk-in-recovery method which our phone uses. But hey it is still working without modifications unlike a-only devices so that's a win. As a foot note, you CAN use twrp image instead of stock recovery_ramdis.img but it'll take longer to boot. Using .380's recovery_ramdis.img on .278 build will not work. Make sure to match your EMUI build with ramdisk you're flashing. Ask me how I know.
Steps to install older version:​
Get the Prerequisites
No, I mean literally just get the Prerequisites and thats it
Open up your browser and find a bin service (pastebin will suffice)
Create a paste with following
Code:
{
"app": {
"version": "8.0.7",
"versionCode": "4834",
"link": "https://github.com/topjohnwu/Magisk/releases/download/manager-v8.0.7/MagiskManager-v8.0.7.apk",
"note": "https://cdn.jsdelivr.net/gh/topjohnwu/[email protected]/app/src/main/res/raw/changelog.md"
},
"stub": {
"versionCode": "18",
"link": "https://github.com/topjohnwu/Magisk/releases/download/manager-v8.0.7/stub-release.apk"
},
"uninstaller": {
"link": "https://github.com/topjohnwu/Magisk/releases/download/v21.4/Magisk-uninstaller-20210117.zip"
},
"magisk": {
"version": "v21.4",
"versionCode": "21400",
"link": "https://github.com/topjohnwu/Magisk/releases/download/v21.4/Magisk-v21.4.zip",
"note": "https://topjohnwu.github.io/Magisk/releases/21400.md",
"md5": "ee6dd05579776e7de3a6077087846e53"
}
}
Get the paste's raw url
Take the recovery_ramdis.img to internal storage
Install magisk manager 8.0.7
Open it's settings and select custom channel
Write the raw url you just created
Allow it to check for updates and it'll find that 21.4 is the latest version
Click install and select recovery_ramdis.img
After it finishes patching get the magisk_patched.img to your pc
Get your phone to fastboot mode
After connecting to pc, write this fastboot flash recovery_ramdisk to console and drag magisk_patched.img over to console and press enter
Now if you enter recovery it'll boot to android with magisk but if you boot normally it will not detect magisk so each time you restart you have to use Power + Vol+ combo in order to get magisk
Remember to switch custom channel to stable channel if you want to receive updates.
I know that you can pretty much reduce the amount of flashing and restarting by flashing twrp to erecovery but since erecovery is a lifeline for most people here I decided not to get into that. But for those who are interested check this thread.​
Edit: Grammar
Edit 2: Update about HwOTA and HuRUpdate
Click to expand...
Click to collapse
Oh, man! Are you serious?
I don't know what anyone expects from a guide... Is it better to just repeat the same thing over and over again? "Flash system with fastboot, factory reset with stock recovery, flash and boot twrp, resize system, flash gapps" is literally the summary of this. That summary is what you'll get as an answer if you ask for help on any telegram group. Instead of saying flash twrp, I wrote how you can flash twrp. Thats why it's so long. This guide is for "how" not "what".
Frax3r said:
I don't know what anyone expects from a guide... Is it better to just repeat the same thing over and over again? "Flash system with fastboot, factory reset with stock recovery, flash and boot twrp, resize system, flash gapps" is literally the summary of this. That summary is what you'll get as an answer if you ask for help on any telegram group. Instead of saying flash twrp, I wrote how you can flash twrp. Thats why it's so long. This guide is for "how" not "what".
Click to expand...
Click to collapse
I would say that even so far, people have managed to install GSI, Magisk, etc. .
Btw, Recovery and eRecovery are the same for all models and build numbers . They are even compatible with LLD and BND models.
Frax3r said:
Thats why it's so long
Click to expand...
Click to collapse
It is long because because of procedures that are too complicated, e.g. chapter "Disable Encryption" .
It is long because of duplicate procedures, e.g. chapter "Flashing Any GSI".
Sorry but Chapter "Magisk" is useless. Nowadays nobody needs to install the old Magisk. Rather focus on some of the nuances of installing Magisk on EMUI 9.1 that would be helpful.
Frax3r said:
Officially speaking magisk support for our device is dead. Magisk decided to retire magisk-in-recovery method which our phone uses.
Click to expand...
Click to collapse
No comment...
Frax3r said:
Get the official TWRP .img and patch it with magisk manager
Click to expand...
Click to collapse
No comment...
Have a good day!
Frax3r said:
Hello there! Alive parts of this forum is still filled with simple help requests so I decided to put together a simple all-in-one thread that basically covers most stuff. I don't wanna get into bootloader unlocking because right now only free way to do so is with potatoNV which I do not know how to use. Dc-unlocker is an option too but it is 4€ so pick your poison.
I have uploaded all my resources for this device to here. Inside EMUI folder you'll find some of the versions that I archived with the methods I explained on getting firmwares section. You can find recovery_ramdis.img from each of these version inside RECOVERY_RAMDISK folder as well.​​Special key combos:​
Power + Vol+ = Recovery Mode​
While USB connected, Power + Vol+ = Erecovery Mode​
While USB connected, Vol- = Fastboot​
Plug USB while holding down Vol+ + Vol- = Download Mode​
Power + Vol+ + Vol- = Force Dload​
Flashing LineageOS 16.0​Prerequisites:​
Emui Version below 9.1.0.300
Unlocked Bootloader and FRP
adb and fastboot installed on pc
Los16 zip
Official TWRP
Stock recovery_ramdis.img
Your choice of gapps zip
Steps:​
Get the Prerequisites
I recommend sending los 16 zip, recovery_ramdis.img and gapps zip to sd card if possible
On current rom/gsi go to developer options and enable usb debug while you're at it enable "Enable OEM Unlock"
Connect phone to PC and allow debugging from phone
Send this command from pc : adb reboot bootloader
When you're at fastboot write fastboot flash recovery_ramdisk to console and drag & drop twrp-3.5.2_9-0-anne.img over to console and press enter
After flash is complete unplug phone and shut it down by long pressing power button
Press and hold power + vol+ buttons until short yellow warning shows up
Allow modifications
Press Install and select los 16 zip file
If you want to disable encryption do it now
Press Install and press Install Image
Select and flash stock recovery_ramdis.img to recovery_ramdisk partition
Press Reboot and select Recovery
Press Factory Reset and type yes, while it is doing that plug the phone to pc
Press Reboot and when screen is off start holding down vol- until you're at fastboot
Repeat step 6-7-8
Los 16 don't need to be resized so press Install and select gapps zip
Press Reboot System
Flashing Any GSI​Prerequisites:​
Unlocked Bootloader and FRP
adb and fastboot installed on pc
GSI image (1) (2)
Official TWRP
Stock recovery_ramdis.img in recovery_ramdisk partition
Your choice of gapps zip (Optional)
Notes:​If you're gonna use Phh's AOSP11 and anything that based on it (with the exception of @eremitein's stuff), use arm64-ab-vndklite variant. For anything else use full vndk version. Full vndk version of Phh's AOSP11 does not allow you to resize system on any twrp.
Steps for gapps versions:​
Get the Prerequisites
On current rom/gsi go to developer options and enable usb debug while you're at it enable "Enable OEM Unlock"
Connect phone to PC and allow debugging from phone
Send this command from pc : adb reboot bootloader
When you're at fastboot write fastboot flash system to console and drag & drop gsi .img over to console and press enter
After flash is complete unplug phone and shut it down by long pressing power button
Press and hold power + vol+ buttons until short yellow warning shows up
Press Factory Reset and type yes
When it is done press Reboot
Steps for vanilla versions with custom gapps:​
Get the Prerequisites
On current rom/gsi go to developer options and enable usb debug while you're at it enable "Enable OEM Unlock"
Connect phone to PC and allow debugging from phone
Send this command from pc : adb reboot bootloader
When you're at fastboot write fastboot flash system to console and drag & drop gsi .img over to console and press enter
If you want to disable encryption do it now
After flash is complete unplug phone and shut it down by long pressing power button
Press and hold power + vol+ buttons until short yellow warning shows up
Press Factory Reset and type yes, while it is doing that plug the phone to pc
Press Reboot and when screen is off start holding down vol- until you're at fastboot
Write fastboot flash recovery_ramdisk to console and drag & drop twrp-3.5.2_9-0-anne.img over to console and press enter
After flash is complete unplug phone and shut it down by long pressing power button
Press and hold power + vol+ buttons until short yellow warning shows up
Allow modifications
Press Wipe, press Advanced Wipe, select System, press Repair or Change File System, press Resize File System, swipe to resize then go back to main screen
Press Install, select and flash gapps zip
Press Reboot System
Disable Encryption​Prerequisites:​
Unlocked Bootloader and FRP
adb and fastboot installed on pc
Official TWRP
Stock recovery_ramdis.img
Notes:​You can disable encryption at any step, even after booting, but in order to disable it you have to do a factory reset from stock recovery_ramdis. Because of this I recommend doing between flashing gsi and flashing gapps.
Steps:​
Get the Prerequisites
Flash and boot TWRP
Allow modifications
Press Mount, select Vendor
Connect phone to PC
You can do next part 2 ways, if you're good with command line interface use steps 7 through 11, if not skip to step 12
Type adb shell and press enter
Type nano /vendor/etc/fstab.hi6250 and press enter
Remove fileencryption=aes-256-xts:aes-256-cts from 16th line, make sure there's only one comma between check and reservedsize
Press Ctrl + X then Y and press enter
Go to step 18
Type adb pull /vendor/etc/fstab.hi6250 and press enter
If you have adb in your $PATH go to your user profile folder, if not go to folder where adb.exe is
Open fstab.hi6250 via a text editor (please use notepad++)
Remove fileencryption=aes-256-xts:aes-256-cts from 16th line, make sure there's only one comma between check and reservedsize
Save file and open a command prompt
Send this command adb push ./fstab.hi6250 /vendor/etc/fstab.hi6250
View attachment 5422531
Now you need to do a factory reset with stock recovery_ramdis.img
If you have recovery_ramdis.img in your sd card, press Install and press Install Image then select recovery_ramdis.img and pick recovery_ramdisk partition
If you don't have recovery_ramdis.img in your sd card, shut down phone, connect it to pc and hold down vol- until you're at fastboot, then write this command fastboot flash recovery_ramdisk and drag recovery_ramdis.img over to console then press enter
Shut down your phone and unplug it from pc
Press and hold power+ vol+ until you see short yellow warning
Press Factory Reset and type yes
You've successfully decrypted your phone and you're good to boot up or flash gapps
Getting Stock Firmware Files And Downgrading​Prerequisites:​
Unlocked Bootloader and FRP
adb and fastboot installed on pc
Huawei Update Extractor
Firmware Zips
HiSuite
Erecovery
EMUI's System Updater (via root)
HuRUpdater Guide / HuRUpdater Download (don't work anymore)
HwOTA (don't work anymore)
Getting stock files are problematic because of huawei. Least shadiest way to get them are the hardest so bear with me.
Androidhost.ru : Click the "Firmware Zips" from prerequisites and search p20 lite. You should get a wide variety of versions to pick from. Make sure to match the Cust in the file to yours. C432 for Europe for example. After you download the zip file open it up and find a folder named "dload". You can either get this folder and paste it right into your sd card to force dload or you can open this folder and extract update_sd.zip. Inside update_sd.zip you'll find a file named UPDATE.APP. Use Huawei Update Extractor to open this file and there you'll see all the partitions you need. If HUE gives error while opening it, go to settings and untick "Verify file checksum". You can extract .img files by right clicking and selecting extract option on each partition. Normally you can't open these .img files but after pushing them through simg2img you'll be able to explore them too. But lets be real if you need guides for this, all you need is recovery_ramdis.img.
Using Dload Folder : Your sd card can't be FAT32 for this. FAT32 by nature don't allow files larger than 4gb so you can't get this folder to your sd card. Format it to ExFat via any guide on the internet then copy the dload folder to your sd card's root. It can't be inside any folders. Then shut your phone and press Power + Vol+ + Vol- all at the same time. It'll boot to erecovery which'll check the integrity of files then install them regardless of your EMUI version. So it is a good way to downgrade. Keep in mind tho you can't dload back to emui 8 from emui 9. And any successful dload will lock your bootloader back.
Hisuite : You can actually get firmware files pretty easily with hisuite but it requires real work. You see, hisuite downloads firmware files right into your documents folder. Connect your phone to pc and open up hisuite. Check for updates and if it finds one it'll download following files update_full_base.zip, update_full_ANE-L01_hw_eu.zip and update_full_cust_ANE-L01_hw_eu.zip. You only need update_full_base.zip file, others are used to work on HuRUpdater and HwOTA but they are deprecated since February. Inside update_full_base.zip you'll find UPDATE.APP which you can extract images from with Huawei Update Extractor.
Erecovery : This one requires some network knowledge and it'll only get you the latest version so I don't think it worth the hassle. You need a router that allows you to change dns address for DHCP clients. Which most of them do these days. Now you need to create and run a dns server on your pc. I recommend adguard home. Pihole works too. Use Windows Subsystem For Linux or Docker to install either of them. Once you get them up and working set them to log dns requests. I believe you know where this is going. Open your router's interface and enter adguard home/pihole ip address which maps back to your pc's local address. Check if it works or not by opening up few sites on your phone which should be connected to your wifi and isn't set up to use a different dns server. If all is good open up erecovery on your phone and connect to your wifi. If you set it up correctly it should get the latest version from huawei which will show up on your log. Use that url to download it to your pc and extract it same as others. There was a paid service that used this method to send specific versions to your erecovery.
EMUI's System Updater : This is tricky and my favorite. Get the official TWRP .img and patch it with magisk manager. Then flash it via fastboot. I know, "twrp and magisk? wtf?" just do it. It takes a long time to boot but it works don't question me right now. After you get root in EMUI allow system updater to do its job and update. It'll ask to reboot, allow it. It will throw you back to system after reboot cuz recovery is hijacked. duh. Get a file manager that allows root access. Allow system updater to download again. But this time do not allow it to reboot. First one downloaded OTA, second one downloaded FullOTA. Which is better for archival purposes. After download is done search for a folder named HwOUC in /system. Copy it to internal storage and from there to your pc. You can find our main UPDATE.APP inside update_full_base.zip. Other zips include cust and all that which HuRu and HwOTA used to require.
Magisk​Prerequisites:​
Unlocked Bootloader and FRP
adb and fastboot installed on pc
Stock recovery_ramdis.img
Notes:​Officially speaking magisk support for our device is dead. Magisk decided to retire magisk-in-recovery method which our phone uses. But hey it is still working without modifications unlike a-only devices so that's a win. New installer for magisk kinda broken for our device, because of that I recommend installing and booting an older version. It's safe to update it afterwards from magisk manager. As a foot note, you CAN use twrp image instead of stock recovery_ramdis.img but it'll take longer to boot. Using .380's recovery_ramdis.img on .278 build will not work. Make sure to match your EMUI build with ramdisk you're flashing. Ask me how I know.
Steps to install older version:​
Get the Prerequisites
No, I mean literally just get the Prerequisites and thats it
Open up your browser and find a bin service (pastebin will suffice)
Create a paste with following
Code:
{
"app": {
"version": "8.0.7",
"versionCode": "4834",
"link": "https://github.com/topjohnwu/Magisk/releases/download/manager-v8.0.7/MagiskManager-v8.0.7.apk",
"note": "https://cdn.jsdelivr.net/gh/topjohnwu/[email protected]/app/src/main/res/raw/changelog.md"
},
"stub": {
"versionCode": "18",
"link": "https://github.com/topjohnwu/Magisk/releases/download/manager-v8.0.7/stub-release.apk"
},
"uninstaller": {
"link": "https://github.com/topjohnwu/Magisk/releases/download/v21.4/Magisk-uninstaller-20210117.zip"
},
"magisk": {
"version": "v21.4",
"versionCode": "21400",
"link": "https://github.com/topjohnwu/Magisk/releases/download/v21.4/Magisk-v21.4.zip",
"note": "https://topjohnwu.github.io/Magisk/releases/21400.md",
"md5": "ee6dd05579776e7de3a6077087846e53"
}
}
Get the paste's raw url
Take the recovery_ramdis.img to internal storage
Install magisk manager 8.0.7
Open it's settings and select custom channel
Write the raw url you just created
Allow it to check for updates and it'll find that 21.4 is the latest version
Click install and select recovery_ramdis.img
After it finishes patching get the magisk_patched.img to your pc
Get your phone to fastboot mode
After connecting to pc, write this fastboot flash recovery_ramdisk to console and drag magisk_patched.img over to console and press enter
Now if you enter recovery it'll boot to android with magisk but if you boot normally it will not detect magisk so each time you restart you have to use Power + Vol+ combo in order to get magisk
Remember to switch custom channel to stable channel if you want to receive updates.
I know that you can pretty much reduce the amount of flashing and restarting by flashing twrp to erecovery but since erecovery is a lifeline for most people here I decided not to get into that. But for those who are interested check this thread.​
Edit: Grammar
Edit 2: Update about HwOTA and HuRUpdate
Edit 3: Simplify some steps and add my own mega.nz archive
Click to expand...
Click to collapse
Only now I have time to read your instructions carefully, what is this nonsense ???
Frax3r said:
Officially speaking magisk support for our device is dead. Magisk decided to retire magisk-in-recovery method which our phone uses. But hey it is still working without modifications unlike a-only devices so that's a win. New installer for magisk kinda broken for our device, because of that I recommend installing and booting an older version.
Click to expand...
Click to collapse
I'll give you some advice if I may - don't write about things you don't understand! And this applies not only to Magisk.
avenger.forsyth said:
It is long because because of procedures that are too complicated, e.g. chapter "Disable Encryption" .
Click to expand...
Click to collapse
Is it better to just link decryption zip or write what that decryption zip does?
avenger.forsyth said:
It is long because of duplicate procedures, e.g. chapter "Flashing Any GSI".
Click to expand...
Click to collapse
People use gapps versions because they don't want to waste time by flashing zips. That's why it's 2 part. Gapps one is shorter.
Frax3r said:
Officially speaking magisk support for our device is dead. Magisk decided to retire magisk-in-recovery method which our phone uses.
Click to expand...
Click to collapse
Magisk-in-recovery as in "magisk hijacking recovery" not "installing magisk using recovery". You can't even find huawei section in it's installation instructions. Look here and here. As for the nuance you asked, installing magisk in EMUI is literally same as installing it in GSI or LOS. You patch the image, flash the image, boot the image.
Frax3r said:
As a foot note, you CAN use twrp image instead of stock recovery_ramdis.img but it'll take longer to boot. Using .380's recovery_ramdis.img on .278 build will not work. Make sure to match your EMUI build with ramdisk you're flashing. Ask me how I know.​
Click to expand...
Click to collapse
I added "ask me how I know" part for a reason. I tried. You CAN patch official twrp with magisk and it WILL boot. If a person unlocks their bootloader for the first time how is he supposed to get stock recovery_ramdis.img? Get the mmcblock of recovery_ramdisk? How is he supposed to do that if he flashes twrp over to recovery_ramdisk partition? We can't use "fastboot boot" so that's out of option. Use a different recovery_ramdis.img you might say. I TRIED. .380's recovery_ramdis.img patched with latest magisk won't boot if you're at .278. I created a folder where I patched .380 recovery with each different version of magisk starting from 20.4 up to latest version and none of them booted on los 16 which was installed upon .278. It is not universal as you might think.
-Alf- said:
Only now I have time to read your instructions carefully, what is this nonsense ???
I'll give you some advice if I may - don't write about things you don't understand! And this applies not only to Magisk.
Click to expand...
Click to collapse
Care to elaborate? I am open to constructive criticism. As for what I know, I do know that you won't find yourself bootlooping if you follow these steps by the letter. I saw your instructions on los 16 and other threads too. Here's a criticism for you, do not tell people to wipe /data or factory reset with twrps and especially do not expect them to flash twrp over to erecovery. Wiping /data or factory reset from twrp always resulted in phone freezing for me. I guess twrp in erecovery could fix freezing but there's a reason why they are asking for help and you expect them to overwrite their only lifeline. 1-2 extra rebooting and flashing won't hurt anyone. When you wipe /data or factory reset with most twrps, including official one, some folders that needs to be untouched (huawei am i right) gets deleted. So you have to use stock recovery_ramdis.img or an advanced twrp which compansates it. Check the tishserg's twrp for example. I use that not the official twrp for these things. And it can write to erecovery which is exactly why I didn't advocate on using it in this guide. Have a good day...
Frax3r said:
Here's a criticism for you, do not tell people to wipe /data or factory reset with twrps and especially do not expect them to flash twrp over to erecovery. Wiping /data or factory reset from twrp always resulted in phone freezing for me.
Click to expand...
Click to collapse
Use recommended TWRP, not 3.4.0. and above, which is not fully compatible with hi6250 devices (including official one). Did you know?
Btw, I never advised anyone to do a factory reset in TWRP, on the contrary
https://forum.xda-developers.com/t/...twrp-3-2-1-0-12-05-2018.3789306/post-85472227
Frax3r said:
New installer for magisk kinda broken for our device, because of that I recommend installing and booting an older version.
Click to expand...
Click to collapse
Everyone knows that it is possible to install the latest version right away...
-Alf- said:
Use recommended TWRP, not 3.4.0. and above, which is not fully compatible with hi6250 devices (including official one). Did you know?
Btw, I never advised anyone to do a factory reset in TWRP, on the contrary
https://forum.xda-developers.com/t/...twrp-3-2-1-0-12-05-2018.3789306/post-85472227
Everyone knows that it is possible to install the latest version right away...
Click to expand...
Click to collapse
Yes you said that here. However my own experience says otherwise. Before my current los 16 installation I used official 3.5.2. Flashed los, flashed stock recovery, flashed phenix kernel, flashed gapps all from it. I even used nano from adb shell to edit fstab.hi6250. I used backup and restore only on kernel partition but it was successful anyway. What that incompatibility be? Is it boot override thing? If you have twrp in recovery and send reboot to recovery from android it just keeps booting to twrp in each reboot even tho you select otherwise from twrp's reboot menu. BTW tishserg's twrp have an option to remove that override if you find yourself in that loop. As for factory reset part, you said format /data here. We had a discussion here because of that. My bad on reading wrong. While writing this I realised incompatibility is probably about formating /data on twrp 3.4.0 and above. If that is the case I'll update the post. Good thing I didn't tell people to format /data from twrp. My steps might be long but they are correct. It is wrong to call all this a nonsense.
Everyone might know it is possible to install latest magisk but not everyone knows how to install an older version now that magisk's future is uncertain. After magisk removes magiskhide from its code people are gonna wanna go back to latest version that worked while waiting for module version of it. Patching twrp image with magisk is highlight of this post but it is literally what flashing magisk.zip (.apk to .zip) from twrp does with the latest version. If patching twrp is bad then why is my guide to installing an older version, which allows you to select which image to patch, is the target? + With that .json, you can make magisk manager patch the image with your own modified version of magisk should you upload it somewhere and change the links.
Hi,
I'm building trying to port Ubuntu Touch to this device and I'm running into a few challenges. I have already reverted to stock 2 times and re-unlocked the bootloader (starting from EMUI 9). So far I have only flashed recovery_ramdisk with twrp as I was worried I might not be able to revert to stock if I flashed erecovery.
Question 1: Is this correct or a misunderstanding?
Installing Ubuntu Touch requires the data partition to be formatted to ext4. I can do that from twrp, but someone (maybe you) wrote that wiping the data partition with twrp was liable to create trouble.
Q2: Same question as above.
I understand Huawei requires the kernel and ramdisk to reside in separate images on separate partitions. So I have used this guide (https://wiki.postmarketos.org/wiki/Huawei_P10_Lite_(huawei-warsaw)) to separate the boot.img produced in my build, and then flashed these two image files to the kernel and recovery_ramdisk partitions respectively. However, examining the LOS 16.0 rom that can be installed, I see that it contains a "boot.img".
Q3: Can I flash my boot.img without separating into kernel and ramdisk first, and if so, which partition should I flash?
Q4: After flashing the image files I built (kernel.img and ramdisk.img along with system.img), do I need to reboot to a recovery (if so, which?) and wipe something (if so, what?) before rebooting?
aribk said:
Hi,
Question 1: Is this correct or a misunderstanding?
Q2: Same question as above.
Q3: Can I flash my boot.img without separating into kernel and ramdisk first, and if so, which partition should I flash?
Q4: After flashing the image files I built (kernel.img and ramdisk.img along with system.img), do I need to reboot to a recovery (if so, which?) and wipe something (if so, what?) before rebooting?
Click to expand...
Click to collapse
Hello,
If I understood you correctly you're asking if you can flash stock erecovery after you've modified it. Answer is yes, you can flash twrp on it and when you're done you can flash stock erecovery image over it. Fastboot won't allow you to flash anything on erecovery partition tho. So you need to use certain twrps that are capable of flashing over erecovery. s_mak and tishserg twrps should allow that iirc. First flash any one of those twrps to recovery_ramdisk then boot into it afterwards flash same twrp image to erecovery partition from inside the twrp.
Yes, if you look at last few replies in this thread that was exactly the conversation. However that is only the case with official twrp. If you use s_mak or tishserg's twrps from the mega link in the thread you should be able to wipe without a problem.
Last 2 questions are beyond me I'm afraid. PostparketOS and Ubuntu Touch are inherently very different to android and they could require some stuff that are unique to them. However I would imagine you wouldn't need to wipe anything after flashing those images.
aribk said:
Hi,
I'm building trying to port Ubuntu Touch to this device and I'm running into a few challenges. I have already reverted to stock 2 times and re-unlocked the bootloader (starting from EMUI 9). So far I have only flashed recovery_ramdisk with twrp as I was worried I might not be able to revert to stock if I flashed erecovery.
Question 1: Is this correct or a misunderstanding?
Installing Ubuntu Touch requires the data partition to be formatted to ext4. I can do that from twrp, but someone (maybe you) wrote that wiping the data partition with twrp was liable to create trouble.
Q2: Same question as above.
I understand Huawei requires the kernel and ramdisk to reside in separate images on separate partitions. So I have used this guide (https://wiki.postmarketos.org/wiki/Huawei_P10_Lite_(huawei-warsaw)) to separate the boot.img produced in my build, and then flashed these two image files to the kernel and recovery_ramdisk partitions respectively. However, examining the LOS 16.0 rom that can be installed, I see that it contains a "boot.img".
Q3: Can I flash my boot.img without separating into kernel and ramdisk first, and if so, which partition should I flash?
Q4: After flashing the image files I built (kernel.img and ramdisk.img along with system.img), do I need to reboot to a recovery (if so, which?) and wipe something (if so, what?) before rebooting?
Click to expand...
Click to collapse
aribk said:
So far I have only flashed recovery_ramdisk with twrp as I was worried I might not be able to revert to stock if I flashed erecovery.
Question 1: Is this correct or a misunderstanding?
Click to expand...
Click to collapse
Misunderstanding. You can revert to stock via eRecovery & wi-fi.
Huawei has Recovery and eRecovery, each has different functions.
You can use the following combinations in your phone:
- Recovery + eRecovery (stock FW)
- TWRP instead of Recovery + eRecovery
- Recovery + TWRP instead of eRecovery
aribk said:
wiping the data partition with twrp was liable to create trouble.
Q2: Same question as above.
Click to expand...
Click to collapse
Same answer as above. Formatting (not wiping) data with TWRP 3.4+ is dangerous (running stock EMUI).
Q3: All this only works on EMUI 8 as far as I know.
Q4: follow the instructions, imo.
P.S.: as you can see, mobile Linux projects such as Ubuntu Touch, postmarketOS or Sailfish OS work only partially on Hua/Ho phones,but we already talked about that .
-Alf- said:
Same answer as above. Formatting (not wiping) data with TWRP 3.4+ is dangerous (running stock EMUI).
Click to expand...
Click to collapse
Re-reading your answer above, I see I'd like to double check: Is this dangerous only if you are running stock EMUI, or would it also be dangerous to use TWRP 3.4+ to format the data partition when you wish to run a different system on the device, as in my case?
aribk said:
aribk said:
or would it also be dangerous to use TWRP 3.4+ to format the data partition when you wish to run a different system on the device, as in my case?
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Hard to say, no one has experience with different system . But I don't think it matters - see Mr. Frax3r's post above (and read carefully bro ).
I'm bumping the thread, few improvements are made for android 13.
Thank you for the update.
I have modified Phenix_4.9.235-phenix-1.0 rebased on Harmonyos to make it permissive which make most A13 GSIs boot normally on my phone. I have attached the updated one.
Frax3r said:
After you set up your phone and made sure you don't need stock recovery, flash magisk:
Click to expand...
Click to collapse
magisk-patched stock recovery remains functional, available and usable.

Question Latest Twrp pros and cons

Today the unlock time for bootloader to unlock will complete and I Intend to install TWRP. I have found the latest officially supported twrp-3.6.1_11-0-alioth.img at https://eu.dl.twrp.me/alioth/. How does it compare to TWRP-3.5.1 https://forum.xda-developers.com/t/recovery-unofficial-twrp-3-5-1-20210702.4300189/.
Can anyone guide me what are the pros and cons of using twrp-3.6.1_11-0-alioth.img and its limitations as compared to TWRP-3.5.1 as I can not find any documentation on twrp-3.6.1_11-0-alioth.img. Any help will be appreciated.
Also does the following limitations of TWRP-3.5.1 also apply to twrp-3.6.1_11-0-alioth.img ?
KNOWN LIMITATIONS:
The following are some known limitations due to either the design nature of Virtual A/B or a problem with ROM themselves. Please read carefully :-
You cannot format data after flashing a ROM zip (Limitation of Virtual A/B). If you want to format, then reboot recovery after flashing ROM. Additionally, if you are encrypted, the newly flashed ROM must be able to decrypt your device. If not, then you have to format data before flashing the ROM It appears, you can actually format data after reboot even if the new ROM cannot decrypt.
You can flash only one ROM in one boot. If you wanna flash another ROM, you must boot to system once. This is again a limitation of Virtual A/B.
Once you have rebooted after flashing a ROM, you cannot write to the data partition until you boot successfully to the new ROM. Android seals the data partition after a ROM flash to prevent any accidental brick since the newly flashed ROM is actually stored in /data. Only data format is allowed in this case. Once you successfully boot to the new ROM, your storage becomes ready for writing again.
Ideally, after flashing a new ROM, you should only need to wipe your data rather than format. But, due to a problem in the device trees current ROMs are using, you will have to format data if you are currently on miui and want to switch to a custom ROM. Specifically, the roms need this commit and to set vendor security patch level to fix this issue. Switching between custom ROMs should not need format, except for hentai OS.
If you are currently on hentai OS, then before using TWRP, you must flash vendor_boot from the link provided in every hentai OS release. Otherwise, you will get black screen. This is only needed when you boot to TWRP for the first time. Do not repeat this step again. Also, do not try this with beta version of the ROM. Use it only with stable.
If you reboot to older slot after flashing new ROM, the new ROM will be cancelled and you will have to reflash again. This is because of how Virtual A/B works.
If you must flash magisk via recovery (it's not recommended now), please uncheck "Inject TWRP after install" else TWRP will remove magisk.
Do not flash magisk after flashing a ROM before reboot. Magisk's zip detects slot in a different way that will cause issues.
Backuptool (used to persist magisk and gapps across ROM updates) will also not work in recovery due to A/B. You will have to flash gapps (or any other zips) everytime after flashing a ROM.
you dont search enough...
this is latest A12 TWRP....
https://dl.akr-developers.com/?dir=skkk/TWRP
Installation:
activateUSB DEBUGGIN and OEM unlocked on Poco
(copy all files in Adb folder) rename the long TWRP file to twrp.img
Disable all security settings like PIN, pattern, fingerprint
start Poco in fastboot
fastboot boot twrp.img"
copy twrp.img to Poco or "adb push twrp.img /sdcard/"
TWRP Menü -> Advanced -> Flash Current TWRP or Install Recovery Ramdisk -> you must test it... both should work
TWRP Menü -> Reboot -> recovery
Magisk and safety net working great...
see also....
Xiaomi devices on Android 12 via Fastboot only:
- Download our ROM zip file
- Unpack downloaded zip file in the PC using WinRAR
- Reboot your device to fastboot mode (press volume down + power)
- Connect to PC via USB cable
- Run fastboot installation script from unpacked zip according your PC operating system:
--- For Windows OS - windows_fastboot_update_rom.bat
--- For Linux - linux_fastboot_update_rom.sh
--- For MacOS - macos_fastboot_update_rom.sh
greeting
hofi01 said:
you dont search enough...
this is latest A12 TWRP....
https://dl.akr-developers.com/?dir=skkk/TWRP
Installation:
activateUSB DEBUGGIN and OEM unlocked on Poco
(copy all files in Adb folder) rename the long TWRP file to twrp.img
Disable all security settings like PIN, pattern, fingerprint
start Poco in fastboot
fastboot boot twrp.img"
copy twrp.img to Poco or "adb push twrp.img /sdcard/"
TWRP Menü -> Advanced -> Flash Current TWRP or Install Recovery Ramdisk -> you must test it... both should work
TWRP Menü -> Reboot -> recovery
Magisk and safety net working great...
see also....
Xiaomi devices on Android 12 via Fastboot only:
- Download our ROM zip file
- Unpack downloaded zip file in the PC using WinRAR
- Reboot your device to fastboot mode (press volume down + power)
- Connect to PC via USB cable
- Run fastboot installation script from unpacked zip according your PC operating system:
--- For Windows OS - windows_fastboot_update_rom.bat
--- For Linux - linux_fastboot_update_rom.sh
--- For MacOS - macos_fastboot_update_rom.sh
greeting
Click to expand...
Click to collapse
I know where the lastest TWRP for Poco F3 is and how to install it as I have already installed it. That was not the question. The question was that "does limitations of TWRP-3.5.1 also apply to twrp-3.6.1_11-0'? Limitattions like being forced to reboot TWRP after flashing a every single zip file and other limitations like it as mentioned above. Thanks for your reply anyways.
so for me, TWRP does not start again, after installing a file.
I install TWRP, boot into TWRP again and install Magisk. after that I boot into the ROM.
TWRP does not restart itself
So, still no decryption on A12?
I wanted to test new custom roms but i dont want to have to reinstall everything from scratch if i go back to my current rom (.EU).
Can twrp make a full backup and restore it despite not having decryption?
If it cant, can I make a full back up of my phone from cmd in fastboot mode? (so i can just flash it from fastboot to restore everything as it is now)

Categories

Resources