How To Guide ROOTING + CUSTOM ROM, YOUR BRAND NEW REDMI NOTE 9 T FOR THE NOOB - Redmi Note 9T

## first version , errors may still occur
Hi everybody, as a noob in the rooting world , here is my small contribution. A step by step how-to , to completely root + installing a custom.
DO NOT HESITATE TO COMMENT SO I CAN IMPROVE THE DOC:
=======================================================================
Read the complete procedure carefully before start: Beware you will loose all data you may have on the phone .and you will loose warranty .
## REQUIREMENTS :​a brand new redmi note 9T (direct from the store, no modifications), a pc with windows , the usb cable to link the pc to the phone.
A sdcard where you can store the rom and some zip to put in your phone
Make sure the pc is up ot date with latest android usb driver and adb available :
usb drivers here : https://developer.android.com/studio/run/win-usb
adb software : https://www.xda-developers.com/install-adb-windows-macos-linux/
we also need 7zip https://www.7-zip.org/
Also try to update your phone with the latest MIUI version you can get (at the the time I'm writing this it should be MIUI 12.5, based on android 11).
To upgrade go to system/about phone/ tap on the MIUI logo/ check for update .
If your phone is still stuck to a lower version, you may trick it by changing the region (I choose hong kong) in system/additional settings/region
then try to check for MIUI update again.
## FIRST STEP : unlock the booloader .​for this you need a xiaomi account (if you created one with your phone , use it)
You also need to enable developper mode in your phone , so you can access usb debuging . (see the video tutorial)
a video tutoriel here :
you will probably have to wait 168 hours before you can unlock the phone (Yes you're not alone to think it's annoying, do not hesitate to complain to xiaomi business department)
there is also this version of the unlocker (to bypass the wait time), but I have not tested it
Moreover the bypass works for devices not yet linked to mi account
Download MiUnlock_bypass_OTP.zip - Generic
Download file MiUnlock_bypass_OTP.zip - Generic - in MiFirm ✅ - Xiaomi MIUI Firmware - ROM - TWRP download free and max speed - The biggest Xiaomi Mi download
mifirm.net
Once your bootloader unlock you phone will be reseted and when you restart it you will be asked for the xiaomi account password again (and you need a network connection).
After completing the setup again, don't forget to reactivate usb debuging option .
### SECOND STEP download and save files​
In case your want to rollback, and also if your want to install magisk in some custom rom , you need to download the original MIUI rom here :
Xiaomi Firmware Updater
The ultimate script that provides firmware packages for Xiaomi devices.
xiaomifirmwareupdater.com
from the zip file , you need to extract the boot.img file and transfer the file on your phone
then the install on your phone the magisk apk file : https://magiskapp.com/#magisk-app-apk
run the magisk app , choose install magisk , select patch a file and choose the boot.img file then press the let's go button
Magisk will generate a patched_image_file in your download folder .
copy the patched image file to your sdcard.
on your phone you can install this : https://play.google.com/store/apps/details?id=tk.hack5.treblecheck
It will help you select the type of rom you need to download
Plug your phone to the computer , open a command shell in your adb fastboot directory and type :
adb devices
you should see something like :
List of devices attached
sceqxxxxxxxxxxk device
(if not check your phone screen ,if there is some grant access dialog)
download orangefox from here https://github.com/gsuzeda/twrp_cannon/releases/
put the vbmeta.zip and OrangeFox-R11.0-Unofficial-cannong.zip on the sdcard
put the recovery.img in the same directory than your adb fastboot program
download the latest magisk files release from here :
first the zip : https://magiskapp.com/zip/#download-now
and the apk file : https://magiskapp.com/#magisk-app-apk
and put them on the sdcard
download the latest of the custom rom you want to install. Based on this link (thank you @gsuzeda) https://docs.google.com/spreadsheets/d/1Nm1RAQ_kiSoSBgtzux8uKklLF9TF6-1QvIVCPzW3OCs/edit#gid=0
, I will try AOSP rom here : https://github.com/phhusson/treble_experimentations/releases/latest
but you can also try lineageOS here : https://sourceforge.net/projects/andyyan-gsi/files/
(if you choose AOSP , you can not install magisk , at least for now)
NOTE: If your choose another custom rom , remember you may also need to install google apps as a separate package .
Example for lineageOS , you can download the gapps (MindtheGapps for arm64 )here https://androidfilehost.com/?fid=2188818919693781601
and copy the file to your sdcard
The redmi note 9T code name is CANNONG . It uses ARM64 A/B IMAGES and we want vndklite (read/write on system)
This is important whatever the custom rom you choose to download and install
Now we prepare the image files from the custom ROM so we can choose between two install methods
METHOD ONE is flashing the system.img from the computer with the phone in fastboot mode plugged to the pc.
METHOD TWO is flashing a zip file with the phone in recovery mode (using the orangefox program or twrp)
I choose his method , because you can do all the operation from orangefox recovery
for method two we will use https://forum.xda-developers.com/attachments/gsi_flasher_sdcard-zip.5183639/
(thank you @gsuzeda for the complete method here https://forum.xda-developers.com/t/...ung-galaxy-a51-super-partition-image.4216083/ )
unzip the gsi flasher somewhere on your PC (for me Mydocument\gsiflasher)
exemple usage with AOSP rom:
uncompress the system-roar-arm64-ab-vndklite-gapps.img.xz
copy the img file in the gsi directory of the gsi flasher and rename it system.img (so for me cp system-roar-arm64-ab-vndklite-gapps.img to Mydocument\gsiflasher\gsi\system.img).
then create a zip file with the 3 directories (gsi, META-INF, scripts) in Mydocument\gsiflasher using 7 zip , for example system-roar-arm64-ab-vndklite-gapps.zip.
And finally copy this zip to the root of your sdcard .
## THIRD STEP : install orangefox​orangefox is a recovery program like twrp but with more option.
Check if you booloader is unlock in your phone by going to system\additonal settings\developper option\mi unlock status
If the booloader is unlock then you can install recovery orangefox .
Make sure than usb debugging and install via usb is checked in the developper option of your phone
power off your phone and restart your phone in fastboot mode (volume down + power )
plug it to your pc .
open a command shell in the directory were fastboot is installed
write the command :
fastboot devices
it should give you a list with your device
then write the command
fastboot flash recovery recovery.img
once the install complete reboot your phone in recovery mode with the command :
fastboot reboot recovery
once boot in recovery mode you should see the orangefox menu.
{
"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"
}
Use the "Files" at the bottom at the screen explore to go to the sdcard and tap on the orangefox zip files .
then swipe to install
Once the file installed , the phone should reboot in recovery.
Then use the file explorer to find the vbmeta.zip
ttap the file and swipe to install
after the install the phone should reboot.
a simple check step to see if everything went right
## FOURTH STEP , test and install custom OS​There is two method to install , via recovery or via fastboot
I choose to use orangefox recovery
via recovery
reboot in recovery mode (volume up +power)
Once booted in orangefox recovery
first format the DATA (using the wipe menu,and you need to type yes to confirm )
Then reboot to recovery (from the orangefox menu choose reboot then recovery)
once rebooted in recovery
wipe data cache and dalvik
then with the file menu of orangefox navigate to the root of your sdcard where you stored the system zip we created for example system-roar-arm64-ab-vndklite-gapps.zip.
tap the zip and swipe to install
(if your choose another rom , do the same thing to also intall the gapps zip file)
once the install complete
wipe data cache and dalvik
reboot the phone .
## FIFTH STEP check install​your phone should now start with AOSP version of android and start the setup program.
If you get a message like your device is not play protect certified :
connect your phone to your computer, in a command shell type :
adb root
adb shell
sqlite3 /data/data/com.google.android.gsf/databases/gservices.db
select * from main where name = "android_id";
then copy the id number printed and go there :
Sign in - Google Accounts
and enter the id in the text box and press register
wait 15 minutes and reboot your phone and finish the setup process and connect to google store with your gmail account
If your installation complain about the sd card, choose format as external. (you may have to transfer the files of step one in the card again)
## SIXTH STEP : install magisk​(DOES NOT WORK WITH AOSP ROM)
reboot in recovery.
in the orangefox file menu :
search your magisk.zip file on the sdcard , tap and swipe to install.
Then choose the patched_boot_img file and choose /boot to install
Then choose the vbmeta.zip and install
wipe cache and reboot
All you want to know about magisk is here : https://magiskapp.com/
### LAST STEP , secure back​now disable usb debugging
unchecked the option : install app from unknow sources
### ROLLBACK​In case you want to rollback to MIUI rom
go there : https://www.getdroidtips.com/guide-flash-miui-rom-xiaomi-devices/
and follow the chapter : the How to Flash Xiaomi Firmware via TWRP Recovery

## TO DO
improve the magisk part :
adding a list of apps for securing the phone
## TO DO: EXTRA STEP :
how to move back from custom to stock rom

Looks good.
The default PHH GSI Custom Rom has inbuilt root rather than Magisk, which is a bit annoying as you can't get SafetyNet working, so can't use Google Pay (and other apps that require SafetyNet).
You can uninstall the inbuilt root and replace it with Magisk, but it's a bit fiddly (like most things on this phone!), as the Magisk app has an issue finding the Magisk su binary.
You need to be using the vndklite build so you can get write access to the system partition. From a root shell (which will be using the inbuilt root to start with). You need to run this:
Code:
mount -o remount,rw /
echo 'export PATH /sbin:/product/bin:/apex/com.android.runtime/bin:/apex/com.android.art/bin:/system_ext/bin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin' >> init.environ.rc
mount -o remount,ro /
Reboot to OrangeFox, and in terminal run this (to remove the inbuilt su):
Code:
mount /system_root
mount -o remount,rw /system_root
touch /system_root/system/phh/secure
umount -l /system_root/system/xbin/su
rm /system_root/system/xbin/su
rm /system_root/system/bin/phh-su
rm /system_root/system/etc/init/su.rc
rm /system_root/system/bin/phh-securize.sh
rm -Rf /system_root/system/{app,priv-app}/me.phh.superuser/
rm -Rf /system_root/data/su
umount /system_root
Download the latest Magisk apk (v23 at time of writing) from https://github.com/topjohnwu/Magisk/releases/download/v23.0/Magisk-v23.0.apk and rename it to Magisk-v23.0.zip. Copy it over to your phone, and install it using OrangeFox (topjohnwu has stated in future Magisk versions the renaming to zip will stop working, but it's good for now).
From memory I think you now need to wipe the data partition again, but it's worth a try without, and see if you bootloop?
Once you're back into the regular system you'll need to install the Magisk app (if you haven't done so already), and then activate MagiskHide, and install the MagiskHide Props Config module. You can then use Google Pay again!

very good, Congratulations!
I added a link in my table that redirects to your post

dsclee1 said:
Looks good.
The default PHH GSI Custom Rom has inbuilt root rather than Magisk, which is a bit annoying as you can't get SafetyNet working, so can't use Google Pay (and other apps that require SafetyNet).
You can uninstall the inbuilt root and replace it with Magisk, but it's a bit fiddly (like most things on this phone!), as the Magisk app has an issue finding the Magisk su binary.
You need to be using the vndklite build so you can get write access to the system partition. From a root shell (which will be using the inbuilt root to start with). You need to run this:
Code:
mount -o remount,rw /
echo 'export PATH /sbin:/product/bin:/apex/com.android.runtime/bin:/apex/com.android.art/bin:/system_ext/bin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin' >> init.environ.rc
mount -o remount,ro /
Reboot to OrangeFox, and in terminal run this (to remove the inbuilt su):
Code:
mount /system_root
mount -o remount,rw /system_root
touch /system_root/system/phh/secure
umount -l /system_root/system/xbin/su
rm /system_root/system/xbin/su
rm /system_root/system/bin/phh-su
rm /system_root/system/etc/init/su.rc
rm /system_root/system/bin/phh-securize.sh
rm -Rf /system_root/system/{app,priv-app}/me.phh.superuser/
rm -Rf /system_root/data/su
umount /system_root
Download the latest Magisk apk (v23 at time of writing) from https://github.com/topjohnwu/Magisk/releases/download/v23.0/Magisk-v23.0.apk and rename it to Magisk-v23.0.zip. Copy it over to your phone, and install it using OrangeFox (topjohnwu has stated in future Magisk versions the renaming to zip will stop working, but it's good for now).
From memory I think you now need to wipe the data partition again, but it's worth a try without, and see if you bootloop?
Once you're back into the regular system you'll need to install the Magisk app (if you haven't done so already), and then activate MagiskHide, and install the MagiskHide Props Config module. You can then use Google Pay again!
Click to expand...
Click to collapse
oupps . Finally things did not as planned . After the running the commands , I was stuck in a loop , always going back to recovery (even if after wipe data). Finally I decided to reflash completely, but this time with lineage OS .
This time I did :
boot to recovery
format data
install lineageOS zip
I tried to install the gapps but the install crash (out of ressources)
so i reboot in system
then reboot back in recovery
flash the gapps file
flash the magisk.zip (the apk previously renammed ) and got an error.
reboot back to system , took the opportunity to declare the phone so google app store works.
then resynchronize with my google account.
once the update and sync completed boot to recovey
flash the magisk zip (the real one from here https://magiskapp.com/zip/#download-now
flash the vbmeta
then reboot to system
It boots fine But I have no root acces . Below are a few screenshot from magisk :

@gsuzeda , @dsclee1
trying to redo the al process all other again. Things are getting worse.
This time, I can flash the lineage rom but when I try to flash the gapps , I got a not enough space .
whatever I do , i got the error, I tried try wipe format everything :
Here is quick step
boot in recovery
format data,
wipe cache , dalvik, internal storage, data.
flashing lineage OS
flashing the gapps (there i get a not enough space)
What did I missed ??
Meanwhile I'l go back to AOSP without magisk
I also updated the doc . Can you check especially the flash ROM part and the magisk part ?
Thanks

chmick said:
@gsuzeda , @dsclee1
trying to redo the al process all other again. Things are getting worse.
This time, I can flash the lineage rom but when I try to flash the gapps , I got a not enough space .
whatever I do , i got the error, I tried try wipe format everything :
Here is quick step
boot in recovery
format data,
wipe cache , dalvik, internal storage, data.
flashing lineage OS
flashing the gapps (there i get a not enough space)
What did I missed ??
Meanwhile I'l go back to AOSP without magisk
I also updated the doc . Can you check especially the flash ROM part and the magisk part ?
Thanks
Click to expand...
Click to collapse
I think you can only install gapps if they are systemless like litegapps

chmick said:
## first version , errors may still occur
Hi everybody, as a noob in the rooting world , here is my small contribution. A step by step how-to , to completely root + installing a custom.
DO NOT HESITATE TO COMMENT SO I CAN IMPROVE THE DOC:
=======================================================================
Read the complete procedure carefully before start: Beware you will loose all data you may have on the phone .and you will loose warranty .
## REQUIREMENTS :​a brand new redmi note 9T (direct from the store, no modifications), a pc with windows , the usb cable to link the pc to the phone.
A sdcard where you can store the rom and some zip to put in your phone
Make sure the pc is up ot date with latest android usb driver and adb available :
usb drivers here : https://developer.android.com/studio/run/win-usb
adb software : https://www.xda-developers.com/install-adb-windows-macos-linux/
we also need 7zip https://www.7-zip.org/
Also try to update your phone with the latest MIUI version you can get (at the the time I'm writing this it should be MIUI 12.5, based on android 11).
To upgrade go to system/about phone/ tap on the MIUI logo/ check for update .
If your phone is still stuck to a lower version, you may trick it by changing the region (I choose hong kong) in system/additional settings/region
then try to check for MIUI update again.
## FIRST STEP : unlock the booloader .​for this you need a xiaomi account (if you created one with your phone , use it)
You also need to enable developper mode in your phone , so you can access usb debuging . (see the video tutorial)
a video tutoriel here :
you will probably have to wait 168 hours before you can unlock the phone (Yes you're not alone to think it's annoying, do not hesitate to complain to xiaomi business department)
there is also this version of the unlocker (to bypass the wait time), but I have not tested it
Moreover the bypass works for devices not yet linked to mi account
Download MiUnlock_bypass_OTP.zip - Generic
Download file MiUnlock_bypass_OTP.zip - Generic - in MiFirm ✅ - Xiaomi MIUI Firmware - ROM - TWRP download free and max speed - The biggest Xiaomi Mi download
mifirm.net
Once your bootloader unlock you phone will be reseted and when you restart it you will be asked for the xiaomi account password again (and you need a network connection).
After completing the setup again, don't forget to reactivate usb debuging option .
### SECOND STEP download and save files​
In case your want to rollback, and also if your want to install magisk in some custom rom , you need to download the original MIUI rom here :
Xiaomi Firmware Updater
The ultimate script that provides firmware packages for Xiaomi devices.
xiaomifirmwareupdater.com
from the zip file , you need to extract the boot.img file and transfer the file on your phone
then the install on your phone the magisk apk file : https://magiskapp.com/#magisk-app-apk
run the magisk app , choose install magisk , select patch a file and choose the boot.img file then press the let's go button
Magisk will generate a patched_image_file in your download folder .
copy the patched image file to your sdcard.
on your phone you can install this : https://play.google.com/store/apps/details?id=tk.hack5.treblecheck
It will help you select the type of rom you need to download
Plug your phone to the computer , open a command shell in your adb fastboot directory and type :
adb devices
you should see something like :
List of devices attached
sceqxxxxxxxxxxk device
(if not check your phone screen ,if there is some grant access dialog)
download orangefox from here https://github.com/gsuzeda/twrp_cannon/releases/
put the vbmeta.zip and OrangeFox-R11.0-Unofficial-cannong.zip on the sdcard
put the recovery.img in the same directory than your adb fastboot program
download the latest magisk files release from here :
first the zip : https://magiskapp.com/zip/#download-now
and the apk file : https://magiskapp.com/#magisk-app-apk
and put them on the sdcard
download the latest of the custom rom you want to install. Based on this link (thank you @gsuzeda) https://docs.google.com/spreadsheets/d/1Nm1RAQ_kiSoSBgtzux8uKklLF9TF6-1QvIVCPzW3OCs/edit#gid=0
, I will try AOSP rom here : https://github.com/phhusson/treble_experimentations/releases/latest
but you can also try lineageOS here : https://sourceforge.net/projects/andyyan-gsi/files/
(if you choose AOSP , you can not install magisk , at least for now)
NOTE: If your choose another custom rom , remember you may also need to install google apps as a separate package .
Example for lineageOS , you can download the gapps (MindtheGapps for arm64 )here https://androidfilehost.com/?fid=2188818919693781601
and copy the file to your sdcard
The redmi note 9T code name is CANNONG . It uses ARM64 A/B IMAGES and we want vndklite (read/write on system)
This is important whatever the custom rom you choose to download and install
Now we prepare the image files from the custom ROM so we can choose between two install methods
METHOD ONE is flashing the system.img from the computer with the phone in fastboot mode plugged to the pc.
METHOD TWO is flashing a zip file with the phone in recovery mode (using the orangefox program or twrp)
I choose his method , because you can do all the operation from orangefox recovery
for method two we will use https://forum.xda-developers.com/attachments/gsi_flasher_sdcard-zip.5183639/
(thank you @gsuzeda for the complete method here https://forum.xda-developers.com/t/...ung-galaxy-a51-super-partition-image.4216083/ )
unzip the gsi flasher somewhere on your PC (for me Mydocument\gsiflasher)
exemple usage with AOSP rom:
uncompress the system-roar-arm64-ab-vndklite-gapps.img.xz
copy the img file in the gsi directory of the gsi flasher and rename it system.img (so for me cp system-roar-arm64-ab-vndklite-gapps.img to Mydocument\gsiflasher\gsi\system.img).
then create a zip file with the 3 directories (gsi, META-INF, scripts) in Mydocument\gsiflasher using 7 zip , for example system-roar-arm64-ab-vndklite-gapps.zip.
And finally copy this zip to the root of your sdcard .
## THIRD STEP : install orangefox​orangefox is a recovery program like twrp but with more option.
Check if you booloader is unlock in your phone by going to system\additonal settings\developper option\mi unlock status
If the booloader is unlock then you can install recovery orangefox .
Make sure than usb debugging and install via usb is checked in the developper option of your phone
power off your phone and restart your phone in fastboot mode (volume down + power )
plug it to your pc .
open a command shell in the directory were fastboot is installed
write the command :
fastboot devices
it should give you a list with your device
then write the command
fastboot flash recovery recovery.img
once the install complete reboot your phone in recovery mode with the command :
fastboot reboot recovery
once boot in recovery mode you should see the orangefox menu.
View attachment 5349227
Use the "Files" at the bottom at the screen explore to go to the sdcard and tap on the orangefox zip files .
then swipe to install
Once the file installed , the phone should reboot in recovery.
Then use the file explorer to find the vbmeta.zip
ttap the file and swipe to install
after the install the phone should reboot.
a simple check step to see if everything went right
## FOURTH STEP , test and install custom OS​There is two method to install , via recovery or via fastboot
I choose to use orangefox recovery
via recovery
reboot in recovery mode (volume up +power)
Once booted in orangefox recovery
first format the DATA (using the wipe menu,and you need to type yes to confirm )
Then reboot to recovery (from the orangefox menu choose reboot then recovery)
once rebooted in recovery
wipe data cache and dalvik
then with the file menu of orangefox navigate to the root of your sdcard where you stored the system zip we created for example system-roar-arm64-ab-vndklite-gapps.zip.
tap the zip and swipe to install
(if your choose another rom , do the same thing to also intall the gapps zip file)
once the install complete
wipe data cache and dalvik
reboot the phone .
## FIFTH STEP check install​your phone should now start with AOSP version of android and start the setup program.
If you get a message like your device is not play protect certified :
connect your phone to your computer, in a command shell type :
adb root
adb shell
sqlite3 /data/data/com.google.android.gsf/databases/gservices.db
select * from main where name = "android_id";
then copy the id number printed and go there :
Sign in - Google Accounts
and enter the id in the text box and press register
wait 15 minutes and reboot your phone and finish the setup process and connect to google store with your gmail account
If your installation complain about the sd card, choose format as external. (you may have to transfer the files of step one in the card again)
## SIXTH STEP : install magisk​(DOES NOT WORK WITH AOSP ROM)
reboot in recovery.
in the orangefox file menu :
search your magisk.zip file on the sdcard , tap and swipe to install.
Then choose the patched_boot_img file and choose /boot to install
Then choose the vbmeta.zip and install
wipe cache and reboot
All you want to know about magisk is here : https://magiskapp.com/
### LAST STEP , secure back​now disable usb debugging
unchecked the option : install app from unknow sources
### ROLLBACK​In case you want to rollback to MIUI rom
go there : https://www.getdroidtips.com/guide-flash-miui-rom-xiaomi-devices/
and follow the chapter : the How to Flash Xiaomi Firmware via TWRP Recovery
Click to expand...
Click to collapse
I will try after thanks you and everybody who help to do this !

for those that may interest, I've not been able to make the fastboot cli tool work on windows in a virtualbox virtual machine (all my computers run on Debian), so unable to unlock from a VM (tried different versions of windows and Android fastboot USB drivers).
I had to find a windows machine for the unlock tool to work.
So don't waste your time fighting with VMs for this phone at least (it used to work just fine on my old redmi note 5 pro).

i can't flash system on my note 9t 5g
my flash system : octavi os

Hi, what is the difference between lineage-18.1-20210914-UNOFFICIAL-treble_arm64_bvS.img.xz and lineage-18.1-20210914-UNOFFICIAL-treble_arm64_bvS-vndklite.img.xz please ?

Please i follow steps but t's made a bootlop after flash rom (AOSP or lineage), only stock rom works...

chmick said:
## first version , errors may still occur
Hi everybody, as a noob in the rooting world , here is my small contribution. A step by step how-to , to completely root + installing a custom.
DO NOT HESITATE TO COMMENT SO I CAN IMPROVE THE DOC:
=======================================================================
Read the complete procedure carefully before start: Beware you will loose all data you may have on the phone .and you will loose warranty .
## REQUIREMENTS :​a brand new redmi note 9T (direct from the store, no modifications), a pc with windows , the usb cable to link the pc to the phone.
A sdcard where you can store the rom and some zip to put in your phone
Make sure the pc is up ot date with latest android usb driver and adb available :
usb drivers here : https://developer.android.com/studio/run/win-usb
adb software : https://www.xda-developers.com/install-adb-windows-macos-linux/
we also need 7zip https://www.7-zip.org/
Also try to update your phone with the latest MIUI version you can get (at the the time I'm writing this it should be MIUI 12.5, based on android 11).
To upgrade go to system/about phone/ tap on the MIUI logo/ check for update .
If your phone is still stuck to a lower version, you may trick it by changing the region (I choose hong kong) in system/additional settings/region
then try to check for MIUI update again.
## FIRST STEP : unlock the booloader .​for this you need a xiaomi account (if you created one with your phone , use it)
You also need to enable developper mode in your phone , so you can access usb debuging . (see the video tutorial)
a video tutoriel here :
you will probably have to wait 168 hours before you can unlock the phone (Yes you're not alone to think it's annoying, do not hesitate to complain to xiaomi business department)
there is also this version of the unlocker (to bypass the wait time), but I have not tested it
Moreover the bypass works for devices not yet linked to mi account
Download MiUnlock_bypass_OTP.zip - Generic
Download file MiUnlock_bypass_OTP.zip - Generic - in MiFirm ✅ - Xiaomi MIUI Firmware - ROM - TWRP download free and max speed - The biggest Xiaomi Mi download
mifirm.net
Once your bootloader unlock you phone will be reseted and when you restart it you will be asked for the xiaomi account password again (and you need a network connection).
After completing the setup again, don't forget to reactivate usb debuging option .
### SECOND STEP download and save files​
In case your want to rollback, and also if your want to install magisk in some custom rom , you need to download the original MIUI rom here :
Xiaomi Firmware Updater
The ultimate script that provides firmware packages for Xiaomi devices.
xiaomifirmwareupdater.com
from the zip file , you need to extract the boot.img file and transfer the file on your phone
then the install on your phone the magisk apk file : https://magiskapp.com/#magisk-app-apk
run the magisk app , choose install magisk , select patch a file and choose the boot.img file then press the let's go button
Magisk will generate a patched_image_file in your download folder .
copy the patched image file to your sdcard.
on your phone you can install this : https://play.google.com/store/apps/details?id=tk.hack5.treblecheck
It will help you select the type of rom you need to download
Plug your phone to the computer , open a command shell in your adb fastboot directory and type :
adb devices
you should see something like :
List of devices attached
sceqxxxxxxxxxxk device
(if not check your phone screen ,if there is some grant access dialog)
download orangefox from here https://github.com/gsuzeda/twrp_cannon/releases/
put the vbmeta.zip and OrangeFox-R11.0-Unofficial-cannong.zip on the sdcard
put the recovery.img in the same directory than your adb fastboot program
download the latest magisk files release from here :
first the zip : https://magiskapp.com/zip/#download-now
and the apk file : https://magiskapp.com/#magisk-app-apk
and put them on the sdcard
download the latest of the custom rom you want to install. Based on this link (thank you @gsuzeda) https://docs.google.com/spreadsheets/d/1Nm1RAQ_kiSoSBgtzux8uKklLF9TF6-1QvIVCPzW3OCs/edit#gid=0
, I will try AOSP rom here : https://github.com/phhusson/treble_experimentations/releases/latest
but you can also try lineageOS here : https://sourceforge.net/projects/andyyan-gsi/files/
(if you choose AOSP , you can not install magisk , at least for now)
NOTE: If your choose another custom rom , remember you may also need to install google apps as a separate package .
Example for lineageOS , you can download the gapps (MindtheGapps for arm64 )here https://androidfilehost.com/?fid=2188818919693781601
and copy the file to your sdcard
The redmi note 9T code name is CANNONG . It uses ARM64 A/B IMAGES and we want vndklite (read/write on system)
This is important whatever the custom rom you choose to download and install
Now we prepare the image files from the custom ROM so we can choose between two install methods
METHOD ONE is flashing the system.img from the computer with the phone in fastboot mode plugged to the pc.
METHOD TWO is flashing a zip file with the phone in recovery mode (using the orangefox program or twrp)
I choose his method , because you can do all the operation from orangefox recovery
for method two we will use https://forum.xda-developers.com/attachments/gsi_flasher_sdcard-zip.5183639/
(thank you @gsuzeda for the complete method here https://forum.xda-developers.com/t/...ung-galaxy-a51-super-partition-image.4216083/ )
unzip the gsi flasher somewhere on your PC (for me Mydocument\gsiflasher)
exemple usage with AOSP rom:
uncompress the system-roar-arm64-ab-vndklite-gapps.img.xz
copy the img file in the gsi directory of the gsi flasher and rename it system.img (so for me cp system-roar-arm64-ab-vndklite-gapps.img to Mydocument\gsiflasher\gsi\system.img).
then create a zip file with the 3 directories (gsi, META-INF, scripts) in Mydocument\gsiflasher using 7 zip , for example system-roar-arm64-ab-vndklite-gapps.zip.
And finally copy this zip to the root of your sdcard .
## THIRD STEP : install orangefox​orangefox is a recovery program like twrp but with more option.
Check if you booloader is unlock in your phone by going to system\additonal settings\developper option\mi unlock status
If the booloader is unlock then you can install recovery orangefox .
Make sure than usb debugging and install via usb is checked in the developper option of your phone
power off your phone and restart your phone in fastboot mode (volume down + power )
plug it to your pc .
open a command shell in the directory were fastboot is installed
write the command :
fastboot devices
it should give you a list with your device
then write the command
fastboot flash recovery recovery.img
once the install complete reboot your phone in recovery mode with the command :
fastboot reboot recovery
once boot in recovery mode you should see the orangefox menu.
View attachment 5349227
Use the "Files" at the bottom at the screen explore to go to the sdcard and tap on the orangefox zip files .
then swipe to install
Once the file installed , the phone should reboot in recovery.
Then use the file explorer to find the vbmeta.zip
ttap the file and swipe to install
after the install the phone should reboot.
a simple check step to see if everything went right
## FOURTH STEP , test and install custom OS​There is two method to install , via recovery or via fastboot
I choose to use orangefox recovery
via recovery
reboot in recovery mode (volume up +power)
Once booted in orangefox recovery
first format the DATA (using the wipe menu,and you need to type yes to confirm )
Then reboot to recovery (from the orangefox menu choose reboot then recovery)
once rebooted in recovery
wipe data cache and dalvik
then with the file menu of orangefox navigate to the root of your sdcard where you stored the system zip we created for example system-roar-arm64-ab-vndklite-gapps.zip.
tap the zip and swipe to install
(if your choose another rom , do the same thing to also intall the gapps zip file)
once the install complete
wipe data cache and dalvik
reboot the phone .
## FIFTH STEP check install​your phone should now start with AOSP version of android and start the setup program.
If you get a message like your device is not play protect certified :
connect your phone to your computer, in a command shell type :
adb root
adb shell
sqlite3 /data/data/com.google.android.gsf/databases/gservices.db
select * from main where name = "android_id";
then copy the id number printed and go there :
Sign in - Google Accounts
and enter the id in the text box and press register
wait 15 minutes and reboot your phone and finish the setup process and connect to google store with your gmail account
If your installation complain about the sd card, choose format as external. (you may have to transfer the files of step one in the card again)
## SIXTH STEP : install magisk​(DOES NOT WORK WITH AOSP ROM)
reboot in recovery.
in the orangefox file menu :
search your magisk.zip file on the sdcard , tap and swipe to install.
Then choose the patched_boot_img file and choose /boot to install
Then choose the vbmeta.zip and install
wipe cache and reboot
All you want to know about magisk is here : https://magiskapp.com/
### LAST STEP , secure back​now disable usb debugging
unchecked the option : install app from unknow sources
### ROLLBACK​In case you want to rollback to MIUI rom
go there : https://www.getdroidtips.com/guide-flash-miui-rom-xiaomi-devices/
and follow the chapter : the How to Flash Xiaomi Firmware via TWRP Recovery
Click to expand...
Click to collapse
please when I want install magisk i have a big issue:
E:unable to open block devices /dev/blocks/loop16: No such device or adress ! I have these lines a loop16 to loop62 !
Could you help to fix it please ?
My wife is angry that i stay too much times on this problem and me too !!! thanks you so much

dsclee1 said:
Looks good.
The default PHH GSI Custom Rom has inbuilt root rather than Magisk, which is a bit annoying as you can't get SafetyNet working, so can't use Google Pay (and other apps that require SafetyNet).
You can uninstall the inbuilt root and replace it with Magisk, but it's a bit fiddly (like most things on this phone!), as the Magisk app has an issue finding the Magisk su binary.
You need to be using the vndklite build so you can get write access to the system partition. From a root shell (which will be using the inbuilt root to start with). You need to run this:
Code:
mount -o remount,rw /
echo 'export PATH /sbin:/product/bin:/apex/com.android.runtime/bin:/apex/com.android.art/bin:/system_ext/bin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin' >> init.environ.rc
mount -o remount,ro /
Reboot to OrangeFox, and in terminal run this (to remove the inbuilt su):
Code:
mount /system_root
mount -o remount,rw /system_root
touch /system_root/system/phh/secure
umount -l /system_root/system/xbin/su
rm /system_root/system/xbin/su
rm /system_root/system/bin/phh-su
rm /system_root/system/etc/init/su.rc
rm /system_root/system/bin/phh-securize.sh
rm -Rf /system_root/system/{app,priv-app}/me.phh.superuser/
rm -Rf /system_root/data/su
umount /system_root
Download the latest Magisk apk (v23 at time of writing) from https://github.com/topjohnwu/Magisk/releases/download/v23.0/Magisk-v23.0.apk and rename it to Magisk-v23.0.zip. Copy it over to your phone, and install it using OrangeFox (topjohnwu has stated in future Magisk versions the renaming to zip will stop working, but it's good for now).
From memory I think you now need to wipe the data partition again, but it's worth a try without, and see if you bootloop?
Once you're back into the regular system you'll need to install the Magisk app (if you haven't done so already), and then activate MagiskHide, and install the MagiskHide Props Config module. You can then use Google Pay again!
Click to expand...
Click to collapse
Is it possible to somehow pack all this into a Zip archive for convenience? So that you can simply install through the recovery.

I recommend this rom.
https://sourceforge.net/projects/gsi-projects/files/v415-Aug/crDroid-8.8/crDroid-8.8-arm64_bgN-vndklite-Unofficial.img.xz/download

Related

Root - LG G4 H815 V20h-EUR-XX

Friend i got this version
Kernel - 3.10.84
Build - MRA58K
Software - V20h-EUR-XX
And i like to root to use a software to recovery video i delete.
Can you indicated the best root for my version
Thanks
I am on v20h EUR like you and I have successfully done the root by this: https://forum.xda-developers.com/g4/general/howto-complete-guide-to-unlock-twrp-t3370003
And unlocking the bootloader will erase all your data - just in case you don't know it
Steps to root
1. Unlock bootloader with
http://developer.lge.com/resource/mobile/RetrieveBootloader.dev?categoryId=CTULRS0702
2. Download
https://dl.twrp.me/h815/twrp-3.0.2-1-h815.img.html
3. Download and unzip -- android-studio-ide-145.3537739-windows.zip
https://developer.android.com/studio/index.html#downloads
4. Download
https://s3-us-west-2.amazonaws.com/supersu/download/zip/SuperSU-v2.79-201612051815.zip
put this on the root of sdcard of the phone
5. If you unzip on C:\
go to c:\android-studio\bin\ and run studio64.exe
skip the install, then pres configure in the right bottom - SDK Management
pres on- Android SDK Location
create an folder on c:\sdk and next
you have now c:\sdk\platform-tools\
6. Copy the twrp-3.0.2-1-h815.img to c:\sdk\platform-tools\
7. Opend an CMD and type
cd /d c:\sdk\platform-tools\
-Put your phone in download (fastboot) mode with ( you must have USB debugging on )
adb reboot bootloader
fastboot boot twrp-3.0.2-1-h815.img
8. on twrp
Install button, select storage and select internal on micro SDCARD (the location of the SuperSU-v2.79-201612051815.zip)
select SuperSU-v2.79-201612051815.zip install and then reboot
9. now you must have root
Thanks for all replay
So anyone now a program to recovery video files? And dont need root the mobile?
This video is very important
Thanks
If you still use that phone, and some apps write on SDCard or on location of the movie, you are with no luck.
The index of the file is deleted and the rest of the file is declared as free, and it well be used as such.
If you dot use that phone, you can try this
1. https://play.google.com/store/apps/details?id=fahrbot.apps.undelete
2. Wondershare Dr.Fone for Android – $49.95
3. MyJad Android Data Recovery
Big thanks to ghepardus!!! i finally succeeded to root my LG G4!! This root tutorial is working fine!
With twrp you can root with the fabulous SimpleGX kernel (previous version v2.0.3 with the classical superSU ) !!!
Best battery life +fiops scheduler(best balanced !) + westwood tcp manager
ghepardus said:
Steps to root
1. Unlock bootloader with
http://developer.lge.com/resource/mobile/RetrieveBootloader.dev?categoryId=CTULRS0702
2. Download
https://dl.twrp.me/h815/twrp-3.0.2-1-h815.img.html
3. Download and unzip -- android-studio-ide-145.3537739-windows.zip
https://developer.android.com/studio/index.html#downloads
4. Download
https://s3-us-west-2.amazonaws.com/supersu/download/zip/SuperSU-v2.79-201612051815.zip
put this on the root of sdcard of the phone
5. If you unzip on C:\
go to c:\android-studio\bin\ and run studio64.exe
skip the install, then pres configure in the right bottom - SDK Management
pres on- Android SDK Location
create an folder on c:\sdk and next
you have now c:\sdk\platform-tools\
6. Copy the twrp-3.0.2-1-h815.img to c:\sdk\platform-tools\
7. Opend an CMD and type
cd /d c:\sdk\platform-tools\
-Put your phone in download (fastboot) mode with ( you must have USB debugging on )
adb reboot bootloader
fastboot boot twrp-3.0.2-1-h815.img
8. on twrp
Install button, select storage and select internal on micro SDCARD (the location of the SuperSU-v2.79-201612051815.zip)
select SuperSU-v2.79-201612051815.zip install and then reboot
9. now you must have root
Click to expand...
Click to collapse
Hi same step for v20p version?
jurastefo said:
Hi same step for v20p version?
Click to expand...
Click to collapse
It is univeral way to root v20+ on phone with unlock bootloader

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