How to upgrade your Poco F1 without losing custom ROM or encrypting data - Xiaomi Poco F1 Guides, News, & Discussion

Hi,
I noticed the same question today at the miui forum, so I decided to help and share my experience with you.
To upgrade a Poco F1 running a custom ROM all you need first are two things: a fastboot ROM provided by Xiaomi
http://en.miui.com/a-234.html
and @CosmicDan's encryption disabler (twrp-3.2.3-beryllium-cosmic_FBE-Disable.zip) > https://github.com/cosmicdan/MIUI_Kitchen/releases
Having the latest fastboot ROM downloaded - no matter if dev oder stable - extract the .tgz and edit this file with your favorite editor:
flash_all_except_storage.sh (Linux/Unix/Mac)
or
flash_all_except_storage.cmd (Windows)
and comment out these 6 lines:
Code:
#fastboot $* -S 200M flash system `dirname $0`/images/system.img
#if [ $? -ne 0 ] ; then echo "Flash system error"; exit 1; fi
#fastboot $* flash recovery `dirname $0`/images/recovery.img
#if [ $? -ne 0 ] ; then echo "Flash recovery error"; exit 1; fi
....
#fastboot $* reboot
#if [ $? -ne 0 ] ; then echo "Reboot error"; exit 1; fi
so system.img and recovery.img won't get flashed and there's no reboot after flashing all partitions to prevent encryption.
save and close your edited script and execute it with your poco rebooted in fastboot mode. as soon as all new partitions are flashed you'll get a message:
for example finished. total time: 43.419s
then long press and hold power + vol up until you're back in twrp, or if you didn't install it before you'd have to reboot to fastboot (vol down + power) and boot it with
fastboot boot twrp-3.2.3-beryllium-cosmic-20180915.img
then flash CosmicDan's twrp-3.2.3-beryllium-cosmic_FBE-Disable.zip to keep encryption disabled.
optionally flash magisk to patch your kernel if you had installed it before or otherwise your custom ROM probably won't boot.
thanks a lot to @CosmicDan who did the community great jobs with his work, so many times!!
hope it helps + best regards

fastboot ROM by xiaomi means the normal stable MIUI 9. correct? If i am using MIUI 10 there is no problem no?

Essentially, by doing this you flash everything else (vendor, modem, dsp, cust, boot...) *except* system and recovery. Any chance that the updated partitions break something with the custom ROM? What if the custom ROM is Pie based?

eLeKtriK EyE said:
Essentially, by doing this you flash everything else (vendor, modem, dsp, cust, boot...) *except* system and recovery. Any chance that the updated partitions break something with the custom ROM? What if the custom ROM is Pie based?
Click to expand...
Click to collapse
I'm on pixel pie now and went back from dev to stable, no issues at all, vice versa, gcam works in 16:9 again.

Can I ? Install xposed using Stockrom and this twrp ?

Hope this works

thanks sir.. i hope this will solve my problem,, FAILED TO BOOT on LOS 16 .
coming from miui 10 v8.9.20 global beta..
ahm,, if i understand it correctly, i still need to flash my phone with a fastboot rom???

santiagoruel13 said:
thanks sir.. i hope this will solve my problem,, FAILED TO BOOT on LOS 16 .
coming from miui 10 v8.9.20 global beta..
ahm,, if i understand it correctly, i still need to flash my phone with a fastboot rom???
Click to expand...
Click to collapse
Yes, flash a stable fastboot image like explained above and LOS16 should boot but my guide is primary for upgrading or downgrading vendor ROM without a need to wipe an already installed custom ROM or encrypting the data partition. It seems v8.9.20 vendor (unsurprisingly) doesn't play nice with LOS16 kernel.

Nice guide. Thank you

OK, I need to get this straight
I am now still bone stock without TWRP or anything, not even unlocked (still need to wait 40 hours)
This guide is for anyone who wants to upgrade to MIUI 10 but still can flash custom ROM (LOS or AOSP based) without error, right?
So, what I need to do is unlocked my poco f1, then flash MIUI 10 eu for example via fastboot step by step according to this guide:
flash_all_except_storage.cmd (Windows)
and:
Code:
#fastboot $* -S 200M flash system `dirname $0`/images/system.img
#if [ $? -ne 0 ] ; then echo "Flash system error"; exit 1; fi
#fastboot $* flash recovery `dirname $0`/images/recovery.img
#if [ $? -ne 0 ] ; then echo "Flash recovery error"; exit 1; fi
....
#fastboot $* reboot
#if [ $? -ne 0 ] ; then echo "Reboot error"; exit 1; fi
and then, flash/boot with TWRP
fastboot boot twrp-3.2.3-beryllium-cosmic-20180915.img
then flash CosmicDan's twrp-3.2.3-beryllium-cosmic_FBE-Disable.zip to keep encryption disabled.
Are these steps correct?
Thanks for your answer.

simorangkir_dcs said:
OK, I need to get this straight
I am now still bone stock without TWRP or anything, not even unlocked (still need to wait 40 hours)
This guide is for anyone who wants to upgrade to MIUI 10 but still can flash custom ROM (LOS or AOSP based) without error, right?
So, what I need to do is unlocked my poco f1, then flash MIUI 10 eu for example via fastboot step by step according to this guide:
flash_all_except_storage.cmd (Windows)
and:
Code:
#fastboot $* -S 200M flash system `dirname $0`/images/system.img
#if [ $? -ne 0 ] ; then echo "Flash system error"; exit 1; fi
#fastboot $* flash recovery `dirname $0`/images/recovery.img
#if [ $? -ne 0 ] ; then echo "Flash recovery error"; exit 1; fi
....
#fastboot $* reboot
#if [ $? -ne 0 ] ; then echo "Reboot error"; exit 1; fi
and then, flash/boot with TWRP
fastboot boot twrp-3.2.3-beryllium-cosmic-20180915.img
then flash CosmicDan's twrp-3.2.3-beryllium-cosmic_FBE-Disable.zip to keep encryption disabled.
Are these steps correct?
Thanks for your answer.
Click to expand...
Click to collapse
yep, commenting out these lines with a hash (#) just prevents to overwrite or erase system, recovery and userdata ( < flash_all_except_storage) while all other partitions are upgraded.
thus it's crucial to flash @CosmicDan's twrp-3.2.3-beryllium-cosmic_FBE-Disable.zip afterwards to prevent encryption.
however, from my experience MIUI (10) developer ROM and custom ROMs (due to new vendor) don't interact nice.
on stock ROM your data is already encrypted, so it's better make sure to create a full backup of your important data before cause you'll have to format from twrp.

meltbanana said:
OK, I need to get this straight
I am now still bone stock without TWRP or anything, not even unlocked (still need to wait 40 hours)
This guide is for anyone who wants to upgrade to MIUI 10 but still can flash custom ROM (LOS or AOSP based) without error, right?
So, what I need to do is unlocked my poco f1, then flash MIUI 10 eu for example via fastboot step by step according to this guide:
flash_all_except_storage.cmd (Windows)
and:
yep, commenting out these lines with a hash (#) just prevents to overwrite or erase system, recovery and userdata ( < flash_all_except_storage) while all other partitions are upgraded.
thus it's crucial to flash @CosmicDan's twrp-3.2.3-beryllium-cosmic_FBE-Disable.zip afterwards to prevent encryption.
however, from my experience MIUI (10) developer ROM and custom ROMs (due to new vendor) don't interact nice.
on stock ROM your data is already encrypted, so it's better make sure to create a full backup of your important data before cause you'll have to format from twrp.
Click to expand...
Click to collapse
On Windows, use :: or REM as comment character. :: is neater but REM is required in loops.

Any direct link to twrp-3.2.3-beryllium-cosmic_FBE-Disable.zip ?

simorangkir_dcs said:
OK, I need to get this straight
I am now still bone stock without TWRP or anything, not even unlocked (still need to wait 40 hours)
This guide is for anyone who wants to upgrade to MIUI 10 but still can flash custom ROM (LOS or AOSP based) without error, right?
So, what I need to do is unlocked my poco f1, then flash MIUI 10 eu for example via fastboot step by step according to this guide:
flash_all_except_storage.cmd (Windows)
and:
Code:
#fastboot $* -S 200M flash system `dirname $0`/images/system.img
#if [ $? -ne 0 ] ; then echo "Flash system error"; exit 1; fi
#fastboot $* flash recovery `dirname $0`/images/recovery.img
#if [ $? -ne 0 ] ; then echo "Flash recovery error"; exit 1; fi
....
#fastboot $* reboot
#if [ $? -ne 0 ] ; then echo "Reboot error"; exit 1; fi
and then, flash/boot with TWRP
fastboot boot twrp-3.2.3-beryllium-cosmic-20180915.img
then flash CosmicDan's twrp-3.2.3-beryllium-cosmic_FBE-Disable.zip to keep encryption disabled.
Are these steps correct?
Thanks for your answer.
Click to expand...
Click to collapse
not sure if you can boot twrp straight after flashing the ROM, due to CRC checks, so better reboot straight into fastboot mode and then boot twrp

I followed all the steps and my phone has been booting for 20 minutes now...
Edit: Dirty flashing rom fixed it

Related

Mi A1 - WiFi broken after October update

Hello everyone,
I've been running into a strange issue since the october OTA update: the WiFi on my Mi A1 won't work anymore.
The toggle switch is set to "enabled", I can't switch it to "enabled" because it goes straight back to "disabled". What's weird is the phone seems
to search for available WiFi networks, at least according to the small progress bar at the top, even though it says WiFi is "disabled".
Anything I could try to fix this issue? I've tried reflashing the stock boot image, that doesn't change anything. WiFi seems to be broken
on both A and B partitions.
I'm attaching a screenshot, not sure if this helps.
Hey,
you need to reflash the modem and other partitions, had the same problem as you have.
Download newest image:
http://en.miui.com/download-333.html
Use this commands as a batch next to the fastboot.exe, change the image path to your folder with replacing. It won't wipe/delete anything!
fastboot flash modem_a C:\Users\YourName\Downloads\tissot_images_7.10.30_20171030.0000.00_7.1_82ffdfe70c\tissot_images_7.10.30_7.1\images\modem.img || @ECHO "Flash modem_a error" && exit /B 1
fastboot flash modem_b C:\Users\YourName\Downloads\tissot_images_7.10.30_20171030.0000.00_7.1_82ffdfe70c\tissot_images_7.10.30_7.1\images\modem.img || @ECHO "Flash modem_b error" && exit /B 1
fastboot flash sbl1 C:\Users\YourName\Downloads\tissot_images_7.10.30_20171030.0000.00_7.1_82ffdfe70c\tissot_images_7.10.30_7.1\images\sbl1.img || @ECHO "Flash sbl1 error" && exit /B 1
fastboot flash sbl1bak C:\Users\YourName\Downloads\tissot_images_7.10.30_20171030.0000.00_7.1_82ffdfe70c\tissot_images_7.10.30_7.1\images\sbl1.img || @ECHO "Flash sbl1bak error" && exit /B 1
fastboot flash rpm C:\Users\YourName\Downloads\tissot_images_7.10.30_20171030.0000.00_7.1_82ffdfe70c\tissot_images_7.10.30_7.1\images\rpm.img || @ECHO "Flash rpm error" && exit /B 1
fastboot flash rpmbak C:\Users\YourName\Downloads\tissot_images_7.10.30_20171030.0000.00_7.1_82ffdfe70c\tissot_images_7.10.30_7.1\images\rpm.img || @ECHO "Flash rpmbak error" && exit /B 1
fastboot flash tz C:\Users\YourName\Downloads\tissot_images_7.10.30_20171030.0000.00_7.1_82ffdfe70c\tissot_images_7.10.30_7.1\images\tz.img || @ECHO "Flash tz error" && exit /B 1
fastboot flash tzbak C:\Users\YourName\Downloads\tissot_images_7.10.30_20171030.0000.00_7.1_82ffdfe70c\tissot_images_7.10.30_7.1\images\tz.img || @ECHO "Flash tzbak error" && exit /B 1
fastboot flash devcfg C:\Users\YourName\Downloads\tissot_images_7.10.30_20171030.0000.00_7.1_82ffdfe70c\tissot_images_7.10.30_7.1\images\devcfg.img || @ECHO "Flash devcfg error" && exit /B 1
fastboot flash devcfgbak C:\Users\YourName\Downloads\tissot_images_7.10.30_20171030.0000.00_7.1_82ffdfe70c\tissot_images_7.10.30_7.1\images\devcfg.img || @ECHO "Flash devcfgbak error" && exit /B 1
fastboot flash dsp C:\Users\YourName\Downloads\tissot_images_7.10.30_20171030.0000.00_7.1_82ffdfe70c\tissot_images_7.10.30_7.1\images\adspso.bin || @ECHO "Flash dsp error" && exit /B 1
fastboot flash sec C:\Users\YourName\Downloads\tissot_images_7.10.30_20171030.0000.00_7.1_82ffdfe70c\tissot_images_7.10.30_7.1\images\sec.dat || @ECHO "Flash sec error" && exit /B 1
fastboot flash splash C:\Users\YourName\Downloads\tissot_images_7.10.30_20171030.0000.00_7.1_82ffdfe70c\tissot_images_7.10.30_7.1\images\splash.img || @ECHO "Flash splash error" && exit /B 1
fastboot flash misc C:\Users\YourName\Downloads\tissot_images_7.10.30_20171030.0000.00_7.1_82ffdfe70c\tissot_images_7.10.30_7.1\images\misc.img || @ECHO "Flash misc error" & exit /B 1
fastboot flash aboot C:\Users\YourName\Downloads\tissot_images_7.10.30_20171030.0000.00_7.1_82ffdfe70c\tissot_images_7.10.30_7.1\images\emmc_appsboot.mbn || @ECHO "Flash aboot error" && exit /B 1
fastboot flash abootbak C:\Users\YourName\Downloads\tissot_images_7.10.30_20171030.0000.00_7.1_82ffdfe70c\tissot_images_7.10.30_7.1\images\emmc_appsboot.mbn || @ECHO "Flash abootbak error" && exit /B 1
fastboot flash boot_a C:\Users\YourName\Downloads\tissot_images_7.10.30_20171030.0000.00_7.1_82ffdfe70c\tissot_images_7.10.30_7.1\images\boot.img || @ECHO "Flash boot_a error" && exit /B 1
fastboot flash boot_b C:\Users\YourName\Downloads\tissot_images_7.10.30_20171030.0000.00_7.1_82ffdfe70c\tissot_images_7.10.30_7.1\images\boot.img || @ECHO "Flash boot_b error" && exit /B 1
fastboot flash system_a C:\Users\YourName\Downloads\tissot_images_7.10.30_20171030.0000.00_7.1_82ffdfe70c\tissot_images_7.10.30_7.1\images\system.img || @ECHO "Flash system_a error" && exit /B 1
fastboot flash system_b C:\Users\YourName\Downloads\tissot_images_7.10.30_20171030.0000.00_7.1_82ffdfe70c\tissot_images_7.10.30_7.1\images\system.img || @ECHO "Flash system_a error" && exit /B 1
fastboot flash lksecapp C:\Users\YourName\Downloads\tissot_images_7.10.30_20171030.0000.00_7.1_82ffdfe70c\tissot_images_7.10.30_7.1\images\lksecapp.img || @ECHO "Flash lksecapp error" && exit /B 1
fastboot flash lksecappbak C:\Users\YourName\Downloads\tissot_images_7.10.30_20171030.0000.00_7.1_82ffdfe70c\tissot_images_7.10.30_7.1\images\lksecapp.img || @ECHO "Flash lksecappbak error" && exit /B 1
fastboot flash cmnlib C:\Users\YourName\Downloads\tissot_images_7.10.30_20171030.0000.00_7.1_82ffdfe70c\tissot_images_7.10.30_7.1\images\cmnlib.img || @ECHO "Flash cmnlib error" && exit /B 1
fastboot flash cmnlibbak C:\Users\YourName\Downloads\tissot_images_7.10.30_20171030.0000.00_7.1_82ffdfe70c\tissot_images_7.10.30_7.1\images\cmnlib.img || @ECHO "Flash cmnlibbak error" && exit /B 1
fastboot flash cmnlib64 C:\Users\YourName\Downloads\tissot_images_7.10.30_20171030.0000.00_7.1_82ffdfe70c\tissot_images_7.10.30_7.1\images\cmnlib64.img || @ECHO "Flash cmnlib64 error" && exit /B 1
fastboot flash cmnlib64bak C:\Users\YourName\Downloads\tissot_images_7.10.30_20171030.0000.00_7.1_82ffdfe70c\tissot_images_7.10.30_7.1\images\cmnlib64.img || @ECHO "Flash cmnlib64bak error" && exit /B 1
fastboot flash keymaster C:\Users\YourName\Downloads\tissot_images_7.10.30_20171030.0000.00_7.1_82ffdfe70c\tissot_images_7.10.30_7.1\images\keymaster.img || @ECHO "Flash keymaster error" && exit /B 1
fastboot flash keymasterbak C:\Users\YourName\Downloads\tissot_images_7.10.30_20171030.0000.00_7.1_82ffdfe70c\tissot_images_7.10.30_7.1\images\keymaster.img || @ECHO "Flash keymasterbak error" && exit /B 1
Aside from reflashing, have you tried a factory reset?
skroder said:
Aside from reflashing, have you tried a factory reset?
Click to expand...
Click to collapse
I really wanted to avoid a factory reset. Using t000x's method seems to have worked but I still have a weird issue with the phone: OTA updates on partition A seem to disappear (after a few reboots, partition A always goes back to august update.) I'll investigate further and will create another topic if needed.
Thanks agoin for your help. :good:
Cheers.
mrsmn said:
I really wanted to avoid a factory reset. Using t000x's method seems to have worked but I still have a weird issue with the phone: OTA updates on partition A seem to disappear (after a few reboots, partition A always goes back to august update.) I'll investigate further and will create another topic if needed.
Thanks agoin for your help. :good:
Cheers.
Click to expand...
Click to collapse
Glad I could help you! Maybe you need to set the active partition to B (or maybe A?).
Try set_active within fastboot.
i was having the same problem. but my wifi and hotspot could not be used after flashing twrp 3.1.1 and my phone is on bootloop cycle. i've try reflashing stock rom but still no luck
Lordzarilla said:
i was having the same problem. but my wifi and hotspot could not be used after flashing twrp 3.1.1 and my phone is on bootloop cycle. i've try reflashing stock rom but still no luck
Click to expand...
Click to collapse
Did you follow the instructions posted above?
yes i have
mrsmn said:
Did you follow the instructions posted above?
Click to expand...
Click to collapse
i've already tested to set active both a and b. still no luck. i've also tried to flash boot.img to both partition. still no luck. i don't know what went wrong. do i have to flash stock recovery? do someone has stock recovery for Mi A1?
mrsmn said:
Did you follow the instructions posted above?
Click to expand...
Click to collapse
my Mi A1 is still in bootloop after all these fastboot command. can't get past the android one logo and keep on restarting on and on. is this have to do with me unlocking my phone BL?
I was stock on same problem and I solved it
1. Flash lastest rom with mi flash tool
2. Copy persist.img at the lastest rom
3. Fastboot erase persist
4.. Fastboot flash persist persist.img
5. Reboot
I am not good at English Sorry
t000x said:
Hey,
you need to reflash the modem and other partitions, had the same problem as you have.
Download newest image:
http://en.miui.com/download-333.html
Use this commands as a batch next to the fastboot.exe, change the image path to your folder with replacing. It won't wipe/delete anything!
...
Click to expand...
Click to collapse
much thx.. it worked...
WiFI issues
vaibhav011286 said:
much thx.. it worked...
Click to expand...
Click to collapse
Hi
please can this solve wifi problem on Mi A1 with Oreo update 8.0.0
thank you
WIFI issues
t000x said:
Hey,
you need to reflash the modem and other partitions, had the same problem as you have.
Download newest image:
http://en.miui.com/download-333.html
Hi
please can this solve wifi problem on Mi A1 with Oreo update 8.0.0
thank you
Click to expand...
Click to collapse
Omarod said:
t000x said:
Hey,
you need to reflash the modem and other partitions, had the same problem as you have.
Download newest image:
http://en.miui.com/download-333.html
Hi
please can this solve wifi problem on Mi A1 with Oreo update 8.0.0
thank you
Click to expand...
Click to collapse
Hey, it should help. If after flashing it is not working, try a wipe.
Click to expand...
Click to collapse
wifi issues
t000x said:
Omarod said:
Hey, it should help. If after flashing it is not working, try a wipe.
Click to expand...
Click to collapse
i reflash everything but still same problem ??
Click to expand...
Click to collapse
Omarod said:
t000x said:
i reflash everything but still same problem ??
Click to expand...
Click to collapse
i still have the same problem :c
Click to expand...
Click to collapse
Nautilus99 said:
Omarod said:
i still have the same problem :c
Click to expand...
Click to collapse
Try to reflash firmware with the official tool. If that's not working, most likely your hardware is faulty.
Click to expand...
Click to collapse
t000x said:
Nautilus99 said:
Try to reflash firmware with the official tool. If that's not working, most likely your hardware is faulty.
Click to expand...
Click to collapse
Hello, i had custom rom Pixel experience, but after now i came back to stock, i cant use wifi.. it just says disabled, and cannot connect to any wifi networks. Is this solution what you described above with reflash?
Click to expand...
Click to collapse
saon371 said:
t000x said:
Hello, i had custom rom Pixel experience, but after now i came back to stock, i cant use wifi.. it just says disabled, and cannot connect to any wifi networks. Is this solution what you described above with reflash?
Click to expand...
Click to collapse
https://forum.xda-developers.com/mi-a1/how-to/easiest-quickest-to-fix-wifi-custom-t3779040
Right like next to this thread. Nice research lol.
Click to expand...
Click to collapse
This worked for me, using the April 2018 update with Magisk, and my WiFi works now. Thank you so much for this.

[RECOVERY] TWRP 3.5.2 | Unihertz Jelly 2

How to install:
Unlock bootloader:
Boot your device into the official OS.
Go to Settings > About phone, tap the "build number" several times to enable developer settings.
Go to Settings > System > Developer Settings, enable OEM unlocking and ADB debugging.
Connect your phone to your PC and open a terminal or a command line window.
Run adb reboot bootloader on your PC (there is no way to enter bootloader directly, only possible through adb).
Once your device has finished booting run fastboot flashing unlock and comfirm unlock on device (THIS WILL WIPE ALL DATA!).
Run fastboot reboot to reboot your device and now you should see an unlocked warning during boot screen.
Disable AVB:
Download vbmeta.img from the latest release page of your device.
Connect your phone to your PC and open a terminal or a command line window.
Run adb reboot bootloader on your PC to put your device in bootloader mode.
Once your device has finished booting run fastboot flash --disable-verification --disable-verity vbmeta vbmeta.img
Then run fastboot flash --disable-verification --disable-verity vbmeta_system vbmeta.img
Also run fastboot flash --disable-verification --disable-verity vbmeta_vendor vbmeta.img
Flash recovery image:
Connect your phone to your PC and open a terminal or a command line window.
Run adb reboot bootloader on your PC to put your device in bootloader mode.
Once your device has finished booting run fastboot erase recovery. For some reason, image may be not actually flashed, even if fastboot reported success (at least over the stock recovery image), so in order make sure that the custom image is always flashed it's better to always erase the partition before flashing. After the erasing run fastboot flash recovery recovery.img
Run fastboot reboot and after the screen goes dark press volume up until you see the TWRP logo. Also you can type fastboot reboot recovery to boot to recovery mode immediately.
Please note that booting in stock ROM will bring stock recovery back.
This recovery image is built using binaries from non-european (TEE) version of Jelly 2. Theoretically it should work on european (EEA). If it won't - contact me, I'll prepare an image based on EEA binaries.
Source code https://github.com/Meetoul/twrp_device_Unihertz_Jelly2
Thanks!
This fantastic!
its work on EEA!
Meetoul said:
Source code https://github.com/Meetoul/twrp_device_Unihertz_Jelly2
Click to expand...
Click to collapse
I just received my Jelly 2. It was on 2020 and I went straight through your files. Your TWRP does not respond on my European Jelly 2. Meaning, the touch screen does not respond. But I connected an USB trackball and switched in between adb sideloads. So I finally got it working.
For some reason during reboot TWRP warns me that there is no OS installed. But LoS 18.1 (yours) booted fine. Also flashed opengapps 2707 nano.
After a reboot (phone is still restoring apps) there is a "serial console is enabled" message "performance is impacted, check bootloader". Any instructions on how to get rid of that?.
I cannot seem to mount system as R/W with GSI image from https://github.com/phhusson/treble_experimentations/releases from within TWRP. I guess that's a more general problem, though
Any ideas?
kkazakov13 said:
I cannot seem to mount system as R/W with GSI image from https://github.com/phhusson/treble_experimentations/releases from within TWRP. I guess that's a more general problem, though
Any ideas?
Click to expand...
Click to collapse
Dave you tried the latest release a suggested by Meetoul?
[ROM] [UNOFFICIAL] Lineage OS 17.1 | Unihertz Jelly 2
https://drive.google.com/drive/u/0/folders/1VSmj_-a1PYNzFWtUfbsDGWg4uIh-Tgkd This ROM is built using binaries from non-european (TEE) version of Jelly 2. Theoretically it should work on european (EEA). If it won't - contact me, I'll prepare ROW...
forum.xda-developers.com
Release Fix gt1151qm touch in recovery · Meetoul/twrp_device_Unihertz_Jelly2_TEE
Recovery image based on new kernel image with patches for both gt1x and gt1151qm touch panel drivers.
github.com
Great Job!
I have Jelly2_JP.
I tried your recovery.img for Jelly2_TEE.
It can boot my Jelly2_JP, and it can enable adb shell, but it looped the splash screen.
But I execute following command in adb shell, twrp starts gui("Keep System Read only?" screen)
Jelly2_TEE:/ # mount -o ro /dev/block/mapper/system /
Touchscreen works fine.
Next, I tried to build twrp for Jelly2_JP using your device tree.
But it has same problem. (It looped the splash screen until I mount system partition.)
Do you have any advice?
Attachments
recovery_tee.log is pulled file from /tmp/recovery.log in your twrp for Jelly2_TEE. Line 1119 is after I mount system partition by adb shell.
recovery_jp.log is pulled file from /tmp/recovery.log in my twrp for Jelly2_JP. Line 1356 is after I mount system partition by adb shell.
My build instructions
$ cd ~/twrp
$ repo init -u https://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni.git -b twrp-10.0
$ vi .repo/local_manifests/roomservice.xml
$ repo sync --force-sync
$ cd device/Unihertz
$ cp -r Jelly2_TEE Jelly2_JP
$ cd Jelly2_JP
$ mv omni_Jelly2_TEE.mk omni_Jelly2_JP.mk
$ grep -l Jelly2_TEE * | xargs sed -i 's/Jelly2_TEE/Jelly2_JP/g'
$ grep -l g55v71c2k_dfl_tee * | xargs sed -i 's/g55v71c2k_dfl_tee/g55v71c2k_dfl_jp_felica/g'
$ ./extract-files.sh ~/stock_jp/extracted
$ unpack_bootimg --boot_img ~/stock_jp/recovery.img --out ~/stock_jp/recovery
$ cp ~/stock_jp/recovery/kernel prebuilt/Image.gz
$ cp ~/stock_jp/recovery/dtb prebuilt/dtb/mt6771.dtb
$ cp ~/stock_jp/recovery/recovery_dtbo prebuilt/dtbo.img
$ cd ~/twrp
$ source build/envsetup.sh
$ lunch omni_Jelly2_JP-eng
$ mka recoveryimage
$ ls out/target/product/Jelly2_JP/recovery/root/vendor
bin etc
$ cp -r vendor/Unihertz/Jelly2_JP/proprietary/reovery/root/vendor out/target/product/Jelly2_JP/recovery/root
$ mka recoveryimage
file upload again.
Sorry, I can't upload Attach files.
I clicked "Attach files" button and choose file.
I clicked "Save" button, but file link did not inserted.
I uploaded recovery.log to github.
How to get vbmeta.img
Three knife said:
How to get vbmeta.img
Click to expand...
Click to collapse
Direct Link
Google Drive: Sign-in
Access Google Drive with a Google account (for personal use) or Google Workspace account (for business use).
drive.google.com
See Also
Jelly 2 firmware made available by Unihertz
A post to let people interested in small Android phones know that the firmware of the Jelly 2 has been made available by Unihertz. Would be great if a LineageOS version of this could be made...
forum.xda-developers.com
Or
[HOWTO] Flash a blank vbmeta
Hey guys, As some of you know samsung made had a bunch of different changes since the release of Android 10. It took me a week to figure it out but it was really simple. I had to do two things: Repatch the the magisk boot image with Preserve AVB...
forum.xda-developers.com
I found the crash point in Jelly2_JP.
The crash point is CHECK() on line 772 of twrp/hardware/interfaces/keymaster/4.0/support/Keymaster.cpp.
C++:
CHECK(error == ErrorCode::OK)
<< "Failed to get HMAC parameters from " << *keymaster << " error " << error;
CHECK() is defined on line 495 of twrp/system/core/base/include/android-base/logging.h
C++:
#define CHECK(x) \
LIKELY((x)) || ABORT_AFTER_LOG_FATAL_EXPR(false) || \
::android::base::LogMessage(__FILE__, __LINE__, ::android::base::DEFAULT, \
::android::base::FATAL, _LOG_TAG_INTERNAL, -1) \
.stream() \
<< "Check failed: " #x << " "
I thought /system/bin/recovery was crashing due to a bug.
But it is not a bug.
/system/bin/recovery is programmed to abort if CHECK() fails.
Next, I compared the results of CHECK().
1. using your recovery.img for Jelly2_TEE.
Code:
$ adb shell
Jelly2_TEE:/ # uname -a
Linux localhost 4.14.141+ #15 SMP PREEMPT Wed May 19 11:04:10 CST 2021 aarch64
Jelly2_TEE:/ # mount -o ro /dev/block/mapper/vendor /vendor
Jelly2_TEE:/ # md5sum /vendor/lib64/libkeymaster4.so
17f162aedb3a9584e51d7f732ebbac7f /vendor/lib64/libkeymaster4.so
Jelly2_TEE:/ # umount /vendor
Jelly2_TEE:/ # md5sum /vendor/lib64/libkeymaster4.so
22ede18944c5f47daf04d699a72717b2 /vendor/lib64/libkeymaster4.so
Jelly2_TEE:/ # logcat -v brief -d -s /system/bin/recovery
E//system/bin/recovery( 324): Failed to get IAshmemDeviceService.
W//system/bin/recovery( 324): [libfs_mgr]Warning: unknown flag: resize
W//system/bin/recovery( 324): [libfs_mgr]Warning: unknown flag: resize
I//system/bin/recovery( 324): [libfs_mgr]Created logical partition product on device /dev/block/dm-0
I//system/bin/recovery( 324): [libfs_mgr]Created logical partition system on device /dev/block/dm-1
I//system/bin/recovery( 324): [libfs_mgr]Created logical partition vendor on device /dev/block/dm-2
W//system/bin/recovery( 324): DM_DEV_STATUS failed for system_image: No such device or address
W//system/bin/recovery( 324): DM_DEV_STATUS failed for vendor_image: No such device or address
W//system/bin/recovery( 324): DM_DEV_STATUS failed for product_image: No such device or address
I//system/bin/recovery( 324): fscrypt_initialize_systemwide_keys
I//system/bin/recovery( 324): List of Keymaster HALs found:
I//system/bin/recovery( 324): Keymaster HAL #1: HardwareKeymasterDevice from TrustKernel SecurityLevel: TRUSTED_ENVIRONMENT HAL: [email protected]::IKeymasterDevice/default
F//system/bin/recovery( 324): Keymaster.cpp:150] Check failed: error == ErrorCode::OK Failed to get HMAC parameters from HardwareKeymasterDevice from TrustKernel SecurityLevel: TRUSTED_ENVIRONMENT HAL: [email protected]::IKeymasterDevice/default error SECURE_HW_COMMUNICATION_FAILED
2. using my recovery.img for Jelly2_JP.
This is built with Jelly2_JP's kernel and /vendor/*.
Code:
$ adb shell
Jelly2_JP:/ # uname -a
Linux localhost 4.14.141+ #5 SMP PREEMPT Wed May 19 12:15:37 CST 2021 aarch64
Jelly2_JP:/ # mount -o ro /dev/block/mapper/vendor /vendor
Jelly2_JP:/ # md5sum /vendor/lib64/libkeymaster4.so
17f162aedb3a9584e51d7f732ebbac7f /vendor/lib64/libkeymaster4.so
Jelly2_JP:/ # umount /vendor
Jelly2_JP:/ # md5sum /vendor/lib64/libkeymaster4.so
17f162aedb3a9584e51d7f732ebbac7f /vendor/lib64/libkeymaster4.so
Jelly2_JP:/ # logcat -v brief -d -s /system/bin/recovery
E//system/bin/recovery( 327): Failed to get IAshmemDeviceService.
W//system/bin/recovery( 327): [libfs_mgr]Warning: unknown flag: resize
W//system/bin/recovery( 327): [libfs_mgr]Warning: unknown flag: resize
I//system/bin/recovery( 327): [libfs_mgr]Created logical partition product on device /dev/block/dm-0
I//system/bin/recovery( 327): [libfs_mgr]Created logical partition system on device /dev/block/dm-1
I//system/bin/recovery( 327): [libfs_mgr]Created logical partition vendor on device /dev/block/dm-2
W//system/bin/recovery( 327): DM_DEV_STATUS failed for system_image: No such device or address
W//system/bin/recovery( 327): DM_DEV_STATUS failed for vendor_image: No such device or address
W//system/bin/recovery( 327): DM_DEV_STATUS failed for product_image: No such device or address
I//system/bin/recovery( 327): fscrypt_initialize_systemwide_keys
I//system/bin/recovery( 327): List of Keymaster HALs found:
I//system/bin/recovery( 327): Keymaster HAL #1: HardwareKeymasterDevice from TrustKernel SecurityLevel: TRUSTED_ENVIRONMENT HAL: [email protected]::IKeymasterDevice/default
F//system/bin/recovery( 327): Keymaster.cpp:150] Check failed: error == ErrorCode::OK Failed to get HMAC parameters from HardwareKeymasterDevice from TrustKernel SecurityLevel: TRUSTED_ENVIRONMENT HAL: [email protected]::IKeymasterDevice/default error SECURE_HW_COMMUNICATION_FAILED
They are same Error code SECURE_HW_COMMUNICATION_FAILED.
Unfortunately, my recovery.img wasn't improved from your recovery.img when used with Jelly2_JP.
I'm sorry for the continuous posting.
I solved the decryption by modifying omni_Jelly2_JP.mk as follows.
Code:
PRODUCT_NAME := omni_Jelly2_JP
PRODUCT_DEVICE := Jelly2_JP
PRODUCT_MODEL := Jelly2_JP
PRODUCT_BOARD := g55v71c2k_dfl_jp_felica
BUILD_FINGERPRINT := "Unihertz/Jelly2_JP/Jelly2_JP:10/QP1A.190711.020/root.20210422.092852:user/release-keys"
PRODUCT_BUILD_PROP_OVERRIDES += \
TARGET_DEVICE=Jelly2_JP \
PRODUCT_NAME=Jelly2_JP \
PRIVATE_BUILD_DESC="Jelly2-user 10 QP1A.190711.020 root.20210422.092852 release-keys"
My mistake was that I only replaced "Jelly2_TEE" with "Jelly2_JP".
I had to replace "Jelly2" with "Jelly2_JP".
Anyway, now I can display the decryption screen.
Next, I tried HOW-TO-PATCH.md.
However, the touch screen does not respond on the patched kernel.
Code:
$ head -n 1 symbl_tee.txt
ffffff81dd680800 T do_undefinstr
$ grep get_boot_mode symbl_tee.txt
ffffff81ddda5b30 T get_boot_mode
$ zcat twrp/device/Unihertz/Jelly2_TEE/prebuilt/Image.gz > Image
$ aarch64-linux-android-objdump -D -b binary -m aarch64 --adjust-vma=0xffffff81dd680000 --start-address=0xffffff81ddda5b30 Image| head
ffffff81ddda5b30: d0009cc8 adrp x8, 0xffffff81df13f000
ffffff81ddda5b34: b947ad09 ldr w9, [x8,#1964]
ffffff81ddda5b38: 7100093f cmp w9, #0x2
I think you are using a different technique to enable the touch screen, because "cmp w9, #0x2" is not patched to "cmp w9, #0x0".
Please teach me your technique after you are not busy with work.
谢谢你,我用的是中国的没有Google Play的版本,按照你的步骤成功了,不过在安装完recovery.img之后,内部存储有可能无法写入,需要在recovery里删除data分区,然后就可以了
Thanks for this!
I flashed this TWRP, then installed AOSP 11, v313 of this GSI: https://github.com/phhusson/treble_experimentations/releases/tag/v313
Things seem good, except:
the battery seems to drain a little quickly
no IR blaster (ZaZa remote does not recognize it)
TWRP cannot decrypt the phone's contents, so I cannot flash gapps.
Is TWRP not able to decrypt because I'm using Android 11 and the TWRP was built for 10?
@karoooo
Sorry for not responding to you, for some reason email notifications from XDA were stopped. Please tell me if you still need patched kernel, I will try to patch it explain you the technique.
zxczxc4 said:
Thanks for this!
I flashed this TWRP, then installed AOSP 11, v313 of this GSI: https://github.com/phhusson/treble_experimentations/releases/tag/v313
Things seem good, except:
the battery seems to drain a little quickly
no IR blaster (ZaZa remote does not recognize it)
TWRP cannot decrypt the phone's contents, so I cannot flash gapps.
Is TWRP not able to decrypt because I'm using Android 11 and the TWRP was built for 10?
Click to expand...
Click to collapse
Actually, data decryption on MTK SoCs is very painful thing. I'm still waiting for stable release of Android 11 from Unihertz, but they are in no hurry...
I know that beta 11 available. Unfortunately, I was not able to update using the official way. The bootloader was locked and the moment of updating, but probably the reason is that it was unlocked before (it possible to relock bootloader using SP Flash Tool). But I manager to fetch zip update package and install it via TWRP After that I even managed to make package for SP Flash Tool based on this package, so I can to flash pure FW without updating and have locked bootloader!
UPD. I see that Unihertz have published Android 11 SW package for SP Flash Tool on their Google Drive! Soon I will try to make recovery based on this package.
@Meetoul
Thank you for your response.
Yes, yes, yes!
I want to know your technique.
Best Regards.
HI.
Summary: FRONT CAMERA not working after Bootloader Unlock
I am using Jelly2_JP (on latest Android 10) and I was wondering,
has anyone has experinced the Front Camera not working after Bootloader Unlock, and possibly the three " --disable-verification --disable-verity" commands?
The stock camera app won't recognize the front camera (not front/back switch button where there should be one), and other apps cant use the front camera either.
I can confirm that the front camera worked before unlocking the bootloader.
Reflashing stock image using SP Flash Tool and relocking Bootlader did not fix the issue.
Is anyone else experiencing the same issue?
karoooo said:
@Meetoul
Thank you for your response.
Yes, yes, yes!
I want to know your technique.
Best Regards.
Click to expand...
Click to collapse
Since Unihertz has released Android 11, I think that there is no sense to work on patching the old kernel.
Btw, now I'm working on TWRP based on Android 11 binaries from the latest FW, but no luck so far, it seems that kernel doesn't even start to boot...
@Meetoul
I wanted to learn your technique so that I could work on my own when Android 11 was released.
If Android 11 is formidable, prioritize working with Android 11.
Unfortunately, Android 11 for Jelly2_JP has not been released yet.
@kendzhi
I unlocked the bootloader with Jelly2_JP, but the front camera is still working.
@karoooo
Thank you for the reply!
May I ask, was your Jelly2_JP shipped before the latest Andorid 10 update (2021051912_g55v71c2k_dfl_jp_felica), meaning did your phone come with the previous Firmware (2020101915_g55v71c2k_dfl_jp_felica)?
I have two Jelly2_JP from Japan which came preshipped with the latest andorid Andorid 10 update (there was no need for OTA update). And in both phones, upon executing "fastboot flashing unlock" (without disableling AVB & without Rooting), the the front camera stopped working (not recognized by the system).
I even went into the Debug/Diagnostic? mode that was in Chinese (Booting by Vol down + Connecting to PC via USB), and peformed a hardware test for the Front Camera and the test froze the phone.
So I'm suspecting that Jelly2_JP that was shipped to Japan with the latest Firmware has some issues with Bootloader Unlocking breaking the Front Cam...

OS deleted itself when I rebooted the phone to update, now I´m scared to ever reboot again, what should do?

I soft bricked my friends phone (Mi 10 5g global variant) and I revived it by flashing stock rom but I did a couple of things to the "flash_all.bat" files that might have something to do:
I removed these lines as per this video :
Code:
::check anti_version
if exist %~dp0images\anti_version.txt (for /f "delims==" %%a in (%~dp0images\anti_version.txt) do (set CURRENT_ANTI_VER=%%a))
if [%CURRENT_ANTI_VER%] EQU [] set CURRENT_ANTI_VER=0
for /f "tokens=2 delims=: " %%i in ('fastboot %* getvar anti 2^>^&1 ^| findstr /r /c:"anti:"') do (set version=%%i)
if [%version%] EQU [] set version=0
set anticheck="antirollback check pass"
if %version% GTR %CURRENT_ANTI_VER% set anticheck="Current device antirollback version is greater than this pakcage"
echo %anticheck% | findstr /r /c:"pass" || @echo "Antirollback check error" && exit /B 1
And wrote "rem" in front of these as per this video :
Code:
rem fastboot %* flash crclist %~dp0images\crclist.txt || @echo "Flash crclist error" && exit /B 1
rem fastboot %* flash sparsecrclist %~dp0images\sparsecrclist.txt || @echo "Flash sparsecrclist error" && exit /B 1
Note: my problem isnt necessarily caused by this as I havent heard anyone else with these problems in the tutorials.
I ended up reflashing the rom with no problems and it works fine, but Im scared to reboot phone.
juan libertario said:
I soft bricked my friends phone (Mi 10 5g global variant) and I revived it by flashing stock rom but I did a couple of things to the "flash_all.bat" files that might have something to do:
I removed these lines as per this video :
Code:
::check anti_version
if exist %~dp0images\anti_version.txt (for /f "delims==" %%a in (%~dp0images\anti_version.txt) do (set CURRENT_ANTI_VER=%%a))
if [%CURRENT_ANTI_VER%] EQU [] set CURRENT_ANTI_VER=0
for /f "tokens=2 delims=: " %%i in ('fastboot %* getvar anti 2^>^&1 ^| findstr /r /c:"anti:"') do (set version=%%i)
if [%version%] EQU [] set version=0
set anticheck="antirollback check pass"
if %version% GTR %CURRENT_ANTI_VER% set anticheck="Current device antirollback version is greater than this pakcage"
echo %anticheck% | findstr /r /c:"pass" || @echo "Antirollback check error" && exit /B 1
And wrote "rem" in front of these as per this video :
Code:
rem fastboot %* flash crclist %~dp0images\crclist.txt || @echo "Flash crclist error" && exit /B 1
rem fastboot %* flash sparsecrclist %~dp0images\sparsecrclist.txt || @echo "Flash sparsecrclist error" && exit /B 1
Note: my problem isnt necessarily caused by this as I havent heard anyone else with these problems in the tutorials.
I ended up reflashing the rom with no problems and it works fine, but Im scared to reboot phone.
Click to expand...
Click to collapse
Code:
fastboot oem device-info
Check if it's still unlocked. Like showing one line as:
Code:
(bootloader) Device unlocked: true
If bootloader is still unlocked, don't worry too much. It can still have chance to be revived. So you can reboot.
If the phone is still under warranty, unlocked bootloader of Xiaomi phones generally will not void warranty, so you can still find Xiaomi to fix it.
pl1992aw said:
Code:
fastboot oem device-info
Check if it's still unlocked. Like showing one line as:
Code:
(bootloader) Device unlocked: true
If bootloader is still unlocked, don't worry too much. It can still have chance to be revived. So you can reboot.
If the phone is still under warranty, unlocked bootloader of Xiaomi phones generally will not void warranty, so you can still find Xiaomi to fix it.
Click to expand...
Click to collapse
Ok I will try again, but if the operating system is lost again, the problem still exists and I cant find how to solve it
juan libertario said:
Ok I will try again, but if the operating system is lost again, the problem still exists and I cant find how to solve it
Click to expand...
Click to collapse
Manually flash updates via Mi-flash.

Installing G930FXXU8EUE1_DevBase_v7.4

(I didn't get a response in the thread for this ROM, I hope I'll have more luck here.)
I'm currently running crDroid 11, but the camera is almost unusable. Thus I'm now trying to install G930FXXU8EUE1_DevBase_v7.4.zip using TWRP 3.7.0_9-0 from https://forum.xda-developers.com/t/...laxy-s7-herolte.3333770/page-83#post-87570457.
However, I get the following error:
Code:
Installing zip file '/external_sd/G930FXXU8EUE1_DevBase_v7.4.zip'
Unmounting System...
Failed! Can't unzip 7za package!
Aborting, no changes have been made
I've tried this with the rooted and unrooted boot image from crDroid installed.
How can I troubleshoot this?
I managed to install it:
Installed twrp-3.6.2_9-0-herolte.img
Installed BL_G930FXXU8EUE1.zip from https://androidfilehost.com/?w=files&flid=287434
Extract G930FXXU8EUE1_DevBase_v7.4.zip
in ./META-INF/com/google/android/update-binary, make the following change:
# Check device using bootloader prefix
getprop ro.bootloader | grep "^$BLPREFIX" >/dev/null
if [ $? -ne 0 ] ; then
ui_print "This ROM is designed for $BLPREFIX, but not aborting!"
ui_print " "
# abort
fi
cd G930FXXU8EUE1_DevBase_v7.4
zip -r -9 G930FXXU2xxxx_DevBase.zip META-INF options.prop ALEXNDR

LineageOS 19.1 + Magisk. Script to help automate rooting after LOS OTA.

After setting up Magisk root and MagiskHide Props, I was a bit disappointed to learn that you loose root after a LOS OTA update (which comes out every week). So, I decided to make a bash script to help me automate restoring root. This script still needs to run on your computer rather than on the phone, but it is still a major improvement to the manual process. I am sure smart people can adapt this script to be a BAT script that will work on Windows.
Prerequisites
USB Debugging enabled on your OnePlus 6.
ADB/Fastboot installed on your computer.
It is assumed that you already have root, you just temporarily lost it after an OTA update.
You will need python 3. You will also need to install at least re and requests packages using pip.
Python script for extracting boot.img from the payload.bin provided here https://wiki.lineageos.org/extracti...ing-proprietary-blobs-from-payload-based-otas
It is expected that you put it into `scripts` folder within your current working directory (from where you run the script).
Python script to download the latest LOS zip from the website created by me. Here are the contents of that downloadLOS.py script which is expected to be in your working directory.
Python:
import re
import requests
# Get HTML text of the downloads webpage
webpage = requests.get("https://download.lineageos.org/enchilada").text
# Get the firmware urls
pattern = r"(https:.*nightly.*signed\.zip)\""
matches = re.findall(pattern, webpage, flags=0)
matches.sort(reverse=True)
# Get the latest firmware URL
latestOSURL = matches[0]
# Extract firmware name
name = latestOSURL.split('/')[-1]
print("Latest firmware: " + name)
print("Download link: " + latestOSURL)
# Download the latest firmware
print("Downloading...")
with open(name, "wb") as f:
f.write(requests.get(latestOSURL).content)
print("Done!")
Magisk Root Automation Script
Before running the script, install the latest OTA update through the updater app and reboot once that is done.
The script is quite self explanatory. The steps are:
Download the latest LOS zip using downloadLOS.py script.
Extract boot.img and vbmeta.img from the zip using unzip and update-payload-extractor. These are needed for rooting.
Copy boot.img to phone's Download folder.
Here the script pauses, waiting for you to go into Magisk app to patch the boot.img that was just copied. Hit any key once you are done.
The patched boot image is copied to your computer and both boot images are removed from the phone.
The phone now reboots into bootloader. The script pauses. Hit any key once your phone is in bootloader.
Both boot_a and boot_b are flashed with patched boot image. vbmeta partition is also flashed.
The phone reboots.
Firmware files are cleaned from your folder.
flash.sh
Bash:
#!/bin/bash
echo "Launching python script to download latest firmware ..."
python3 ./downloadLOS.py
echo ""
echo "Extracting boot.img ..."
echo "----"
unzip lineage*.zip 'payload.bin'
python3 ./scripts/update-payload-extractor/extract.py payload.bin --output_dir ./ --partitions boot vbmeta
echo "----"
echo ""
echo "Copying boot.img to phone... "
echo "----"
adb push ./boot.img /storage/emulated/0/Download
echo "----"
echo ""
read -t 1 -n 1
echo "Press any key after done patching boot... "
while [ true ] ; do
read -t 3 -n 1
if [ $? = 0 ] ; then
break ;
else
continue ;
fi
done
echo "Copying patched boot.img to PC... "
echo "----"
adb shell mv /storage/emulated/0/Download/magisk_patched* /storage/emulated/0/Download/magisk_patched.img
adb pull /storage/emulated/0/Download/magisk_patched.img magisk_patched.img
echo "----"
echo ""
echo "Removing boot images from phone... "
echo "----"
adb shell rm /storage/emulated/0/Download/boot.img
adb shell rm /storage/emulated/0/Download/magisk_patched.img
echo ""
echo "Rebooting to bootloader... "
echo "----"
adb reboot bootloader
read -t 1 -n 1
echo "Press any key when in bootloader... "
while [ true ] ; do
read -t 3 -n 1
if [ $? = 0 ] ; then
break ;
else
continue ;
fi
done
echo "----"
echo "Flashing both boots... "
echo "----"
fastboot flash boot_a magisk_patched.img
fastboot flash boot_b magisk_patched.img
echo "----"
echo ""
echo "Flashing vbmeta... "
echo "----"
fastboot flash vbmeta --disable-verity --disable-verification vbmeta.img
echo "----"
echo ""
fastboot reboot
echo ""
echo "Done rooting!"
echo "Cleaning up local files ..."
rm *.img
rm *.bin
rm *.zip
echo "Complete!"
Notes
If you have slow internet and do not want to download the update twice. You could remove the whole downloadLOS.py section and use a separate script pullLOS.sh to pull the LOS update from your phone BEFORE YOU REBOOT after installing the update. After you reboot you loose root and cannot access it. For this you will need to enable rooted debugging in developer options.
Bash:
#!/bin/bash
adb root
echo "Copying update zip from the phone ..."
adb shell mv /data/lineageos_updates/lineage* /data/lineageos_updates/lineage.zip
adb pull /data/lineageos_updates/lineage.zip lineage.zip
adb shell rm /data/lineageos_updates/lineage.zip
echo "----"
echo ""
Attachment
Attachments contains:
scripts folder for your convenience containing LOS extractor scripts. Feel free to remove and re-download from source.
downloadLOS.py python script to download the latest LOS zip from the website.
flash.sh the main script
pullLOS.sh optional script for those who want to avoid re-downloading OTA update.
I hope you guys find it helpful! Let me know if you encounter any problems.
Doesn’t your device factory reset afterwards?
Will it copy your data over to your device again?
I think you are misunderstanding something. This is only if you already have LineageOS 19.1 and Magisk root.
LineageOS has over the air (OTA) updates. They release them every week. They do not touch your data. You just install through Settings -> System -> Updater, reboot and you are good to go. The same way OTAs work in OOS.
The problem is that you loose your Magisk root. In order to bring it back you need to patch and flash a boot partition again (and also vbmeta). Flashing boot partition does not do anything to your data. The script just automates what you would have to do by hand.
Isn't it the same outcome as with Magisk "Install on inactive partition after OTA" option?
I always install OTAs and select that option on Magisk and reboot.
jfromeo said:
Isn't it the same outcome as with Magisk "Install on inactive partition after OTA" option?
I always install OTAs and select that option on Magisk and reboot.
Click to expand...
Click to collapse
You could be right, but I have never seen / not been able to find this option. Maybe it is only available right after an OTA, don't know.

Categories

Resources