flashing stock factory image without -w flag - Google Pixel 2 XL Questions & Answers

Hi there. I wanted to go back to stock ROM, but with TWRP, caesium kernel and root/magisk. Right now I am on a custom ROM. So I wanted to backup with swift backup pro, TWRP. Then flash stock image to both slots / full wipe. Then boot to TWRP with fastboot, flash TWRP zip and kernel plus magisk, reboot TWRP and flash my debloater script. Then next month flash the factory image without the -w flag in the batch, and repeat the process above to have kernel and root. Am I missing something? Is the planned process proper? Or did I plan wrong steps?

I think you're fine, except an OTA will be more efficient the second time around.
Backup.
Connect P2XL to PC and Flash stock image to both slots.
Boot into TWRP using fastboot.
Install TWRP to the recovery ramdisk (as of TWRP 3.3.0-0).
Flash Magisk.
Flash your (unnecessary IMHO) debloater script.
Boot.
Enjoy the device until the next update, then...
Download a full OTA to the device.
Boot into TWRP.
Install the OTA.
Install TWRP to the recovery ramdisk (as of TWRP 3.3.0-0).
Flash Magisk.
Boot.
As of the release of TWRP 3.3.0-0 zip files are no longer available for installing TWRP to boot.img. TWRP will install itself into the boot.img by selecting "Install Image", then selecting "Install to recovery ramdisk".

Thanks, Sir.
OTA does not overwrite TWRP then?
Or flash OTA, boot to TWRP, flash TWRP as image, kernel & magisk? I guess I'll decrypt before flashing OTA?

An OTA will overwrite both TWRP and Magisk since it flashes a stock boot image. However, you are installing the OTA using TWRP and thus have TWRP resident in memory, so as long as you do not reboot you can flash TWRP to the ramdisk and then flash Magisk.

Strephon Alkhalikoi said:
An OTA will overwrite both TWRP and Magisk since it flashes a stock boot image. However, you are installing the OTA using TWRP and thus have TWRP resident in memory, so as long as you do not reboot you can flash TWRP to the ramdisk and then flash Magisk.
Click to expand...
Click to collapse
Thanks again, Sir.

Related

TWRP and Magisk

I was a root/rom aficionado back in the day, but laid off for a bit. Last device I messed with was an Essential phone, where you'd fastboot flash TWRP, reboot recovery, and then TWRP flash the stock boot image, then the Magisk zip. Is the process different for the Z2? In the guides I've read through, I don't see any mention of the stock boot image being flashed after the TWRP flash.
I realize flashing the stock boot image replaces TWRP, and I'm ok with that. I'm really only looking for the added Magisk functionality and not root.
For TWRP you would want to follow the guide on TWRP.me for this device.
In short, you want to fastboot boot (not flash) twrp, then install the twrp installer zip, reboot recovery, then install magisk.
After installing magisk, if you start boot looping, you need to go back in and format (not wipe) data.

magisk not working

I updated my phone to open beta 4 and installed twrp.
I flashed latest magisk zip file and no error occurred but the phone doesn't boot up.
Any help?
Thanks
How did you update? TWRP? Which one? Clean install?
What error?
Did you let it boot before install Magisk, or did you install Magisk right after OB4?
If its just dumping you back to TWRP generally a factory reset will make it boot again. (You backed up right?)
OhioYJ said:
How did you update? TWRP? Which one? Clean install?
What error?
Did you let it boot before install Magisk, or did you install Magisk right after OB4?
If its just dumping you back to TWRP generally a factory reset will make it boot again. (You backed up right?)
Click to expand...
Click to collapse
I updated via OTA.
Universal twrp by codeworkx
No. After installing OBA i flashed twrp and then magisk
I just flashed rom in twrp. Reboot to recovery. Flashed magisk and no verity and it booted.
Updated to Android 8.1.0 Oxygen OP5T_O2_Open_4 via OTA. Boots fine. Flashed Magisk-v16.0(1600).zip via TWRP. Bootloop.
Extracted stock kernel from OnePlus5TOxygen_43_OTA_007
Flashed stock kernel in fastboot. Boots fine. Flashed magisk via TWRP. Bootloop.
Flashed stock kernel in fastboot, immediately flashed magisk via TWRP. Bootloop.
Flashed stock kernel in fastboot. Boots fine. Patched stock kernel in magisk, flashed patched in fastboot. Bootloop.
Also tried variations with and without ElementalX, before and after Magisk, with and without cache wipes.
Currently I'm running:
Android 8.0.1
Oxygen OP5T_O2_Open_4
Kernel 4.4.74-ElementalX-OPt-3.00 (kernel extracted from 43_OTA_007 patched via TWRP flash tool)
Build A5010_43_180310
Magisk not installed
Runs fine except lack of root.
Found a fix. https://forum.xda-developers.com/apps/magisk/guide-magisk-official-version-including-t3577875
Flash Magisk in recovery, then flash the work around, do NOT wipe cache (that's where the fix lives).
I recommend keeping the fix on the phone, not just doing an adb sideload, that way you can recover without a computer if you wipe cache. And of course keeping a working backup of boot.
Same config as my earlier post, but now with working root through Magisk

Will I lose root if I accept the latest OTA?

Running stock image with root, is it usually safe to take ota's?
You will receive error when installing the OTA. Unroot and then update, or... since you already have the bootloader unlocked (for rooting) you can flash from a PC the latest factory image (with the -w removed form the flash-all.bat script).
If you use magisk, you can go into it and select uninstall and restore images. Do not reboot your phone. Install the OTA and once you're at step to, go into magisk and select install and select the OTA option. Wait for the update to finish and reboot. Afterwards you're rooted and updated.
severedsnake said:
Running stock image with root, is it usually safe to take ota's?
Click to expand...
Click to collapse
Magisk Uninstall never worked for me for some reason.
Download OTA to PC
Boot into TWRP
ADB Sideload OTA
reboot
powerdown
Boot into TWRP again
flash Magisk.zip
Done
You can even flash the OTA.zip in twrp as well. When done, just fastboot into twrp, flash the twrp installer zip, then kernel, then magisk, reboot, done :good:

Unable to encrypt after root

Hi everyone.
I had a issue and i really want help
I had unlock the OEM,and after installing the twrp and format data (to remove the forced encrypt), i had flash the Disable_Dm-Verity_ForceEncrypt zip file.
Okay, after that i have restarted the device and configure as my away to use, after that, booted on recovery again and flashed the magisk.
But i wanna encrypt my device, and when i go to configs->security and encrypt area, says that my device its not encrypted. Okay, i followed the steps and when i gonna try to encrypt the device, the process start and... some seconds after, the phone just restart and nothing has done.
The onlys changes that i have made on system is: root and flashed a splash.img(without that stupid warning of unlocked bootloader)
I really want to encrypt my device, so, if i get stolen, the thief wont get my user data.
Can anyone help me?
Flash the stock rom and and don't flash the encryption disabler next time. You don't need to install TWRP to flash Magisk either, you can just boot it and then flash Magisk. Also you don't even need TWRP, you can just follow the guide in the forum to install Magisk by booting the magisk patched boot.img for your version of the stock ROM and then install Magisk manually via Magisk Manager.
TL;DR : Flash stock ROM and do the same things except flashing dm-verity-disabler, you don't need that for Magisk or TWRP.
marstonpear said:
Flash the stock rom and and don't flash the encryption disabler next time. You don't need to install TWRP to flash Magisk either, you can just boot it and then flash Magisk. Also you don't even need TWRP, you can just follow the guide in the forum to install Magisk by booting the magisk patched boot.img for your version of the stock ROM and then install Magisk manually via Magisk Manager.
TL;DR : Flash stock ROM and do the same things except flashing dm-verity-disabler, you don't need that for Magisk or TWRP.
Click to expand...
Click to collapse
Thanks sir, i will try!
marstonpear said:
Flash the stock rom and and don't flash the encryption disabler next time. You don't need to install TWRP to flash Magisk either, you can just boot it and then flash Magisk. Also you don't even need TWRP, you can just follow the guide in the forum to install Magisk by booting the magisk patched boot.img for your version of the stock ROM and then install Magisk manually via Magisk Manager.
TL;DR : Flash stock ROM and do the same things except flashing dm-verity-disabler, you don't need that for Magisk or TWRP.
Click to expand...
Click to collapse
Sir, i really need twrp now, its there any way i can enable encrypt after rooting the device? (to sure that, if gets stolen, the data need to be wipped out or the password must be given on twrp)
Same issue, i tried to encrypt on security menu,reboot and nothing was done.
@edit
Better, without TWRP, i can flash other zips via magisk/stock recovery?
mrkeitsuke said:
Sir, i really need twrp now, its there any way i can enable encrypt after rooting the device? (to sure that, if gets stolen, the data need to be wipped out or the password must be given on twrp)
Same issue, i tried to encrypt on security menu,reboot and nothing was done.
@edit
Better, without TWRP, i can flash other zips via magisk/stock recovery?
Click to expand...
Click to collapse
I'm not sure what you're trying to do here, do you want to have TWRP + stock encryption?
If so you can just boot TWRP and flash the TWRP installer package (.zip) inside TWRP to do that. And you don't need to change anything, currently I have TWRP installed and encryption enabled on my Stock ROM.
But if you're trying to get TWRP's own encryption, sadly that doesn't work.
You can also use TWRP without flashing/installing it, just go to the directory TWRP is stored in, open a command line, connect your phone and boot it with this command :
Code:
fastboot boot twrp.img
then flash whatever you'd like.
DO NOT lock your bootloader after you flash something on TWRP, this will most probably brick the device.
marstonpear said:
I'm not sure what you're trying to do here, do you want to have TWRP + stock encryption?
If so you can just boot TWRP and flash the TWRP installer package (.zip) inside TWRP to do that. And you don't need to change anything, currently I have TWRP installed and encryption enabled on my Stock ROM.
But if you're trying to get TWRP's own encryption, sadly that doesn't work.
You can also use TWRP without flashing/installing it, just go to the directory TWRP is stored in, open a command line, connect your phone and boot it with this command :
Code:
fastboot boot twrp.img
then flash whatever you'd like.
DO NOT lock your bootloader after you flash something on TWRP, this will most probably brick the device.
Click to expand...
Click to collapse
I want to stick with the stock rom rooted, with the twrp installed and the user data encrypted
So i can flash things through TWRP even i have encrypt enabled?
@edit
dont worry about bootloader, i will keep unlocked
It's perfectly fine to have TWRP and/or Magisk and encryption using stock ROM.
Flash stock ROM (erase user data)
Install TWRP
install Magisk
Don't flash the encryption Disabler. As its name implies, it disables the automatic encryption of the userdata partition.
a1291762 said:
It's perfectly fine to have TWRP and/or Magisk and encryption using stock ROM.
Flash stock ROM (erase user data)
Install TWRP
install Magisk
Don't flash the encryption Disabler. As its name implies, it disables the automatic encryption of the userdata partition.
Click to expand...
Click to collapse
:highfive: i had done this and... i think its working!!! :crying::crying::crying:
(crying for emotion, almost thirty factory resets to get an good result :crying::crying::crying
Anyway, if anything bad occurs, i will update here, thanks a1291762 and marstonpear

Question Poco F3: Is it possible to root keeping stock MIUI and OTA updates?

Hi there!! Is it possible to root the Poco F3, keeping stock MIUI and still get OTA updates, without any problem (no data loss, no app auth removal, etc)
With rooted stock rom, you still get OTA updates. The smaller incremental OTA update will refuse to install, and the phone will download the full rom instead. Once the full update installed, you will have to apply root again (eg. flash the patched boot.img from the new update).
kurtschmeichel said:
With rooted stock rom, you still get OTA updates. The smaller incremental OTA update will refuse to install, and the phone will download the full rom instead. Once the full update installed, you will have to apply root again (eg. flash the patched boot.img from the new update).
Click to expand...
Click to collapse
In case you're using Magisk, would you flash the OTA update and magisk in TWRP?
What about internal data, and 2FA or banking apps? Do I need to re-authorize everything after OTA update?
I found this video
which shows that you could OTA update by "disabling magisk" for a moment. Is this procedure good?
As said, I let the phone update itself automatically. Since the smaller incremental update will not work, the phone will ask to download the bigger (±3 GB) updater. Once downloaded, it will overwrite the previously patched (rooted) boot.img.
So, when the update has finished and the phone has rebooted, you won't have root access anymore. In order to restore root access, you will have to flash a new patched boot.img.
There are different ways. I always use fastboot on my Mac. On a mac or pc, download the fastboot or recovery file of the new update that was just installed. Extract boot.img from that file. Send the file to the phone and patch it with Magisk. Send the patched boot.img back to the mac or pc and flash it to the phone (both a and b partitions) with fastboot.
Yeah, the only problem really is that, the boot-partition gets replaced with an update. So with every update you have to re-flash the patched boot.img
Magisk can patch TWRP Backups too, you can then restore the patched Boot-partition in TWRP!
So this is what I do to get Root again after an Update:
1. Boot into Fastboot Mode
2. Boot into TWRP SKKK
3. Backup Boot-partition
4. Boot Android
5. Open Magisk & patch /sdcard/TWRP/Backups/boot.emmc.win
6. Rename /Downloads/magisk_patched_xxx.img to "boot.emmc.win"
7. Move (and replace, when asked) to /sdcard/TWRP/Backups/boot.emmc.win
8. Boot TWRP SKKK and restore patched Boot
cyanGalaxy said:
Yeah, the only problem really is that, the boot-partition gets replaced with an update. So with every update you have to re-flash the patched boot.img
Magisk can patch TWRP Backups too, you can then restore the patched Boot-partition in TWRP!
So this is what I do to get Root again after an Update:
1. Boot into Fastboot Mode
2. Boot into TWRP SKKK
3. Backup Boot-partition
4. Boot Android
5. Open Magisk & patch /sdcard/TWRP/Backups/boot.emmc.win
6. Rename /Downloads/magisk_patched_xxx.img to "boot.emmc.win"
7. Move (and replace, when asked) to /sdcard/TWRP/Backups/boot.emmc.win
8. Boot TWRP SKKK and restore patched Boot
Click to expand...
Click to collapse
Thanks so much!
What about for the OTA procedure instead?
lillo9546 said:
Thanks so much!
What about for the OTA procedure instead?
Click to expand...
Click to collapse
Yup my instructions are for updates!
Unfortunately there is no "automatic way" to regain Root after an Update, at least AFAIK.
If you mean you want the small incremental updates to work, I'm not sure due to the altered Boot-partition. Might be best to use the Full Updates. ^^
You could also just flash Magisk.apk in TWRP or OrangeFox because it's also a Flashable ZIP-file, instead of manually having to patch Boot-partition.
I personally haven't done that in a long while, and the official FAQ-page of Magisk says, that that method is outdated and unsupported now, but apparently still works!
I forgot to mention OrangeFox in my previous post, but seems like a newer, better Custom Recovery than TWRP. You can also use that instead of TWRP. But make sure to use the latest Beta instead of Stable from the official Website because only the Beta can view /data (Android 12 Encryption Support). Stable TWRP also doesn't yet support A12 Encryption, only TWRP SKKK (Beta-version).
cyanGalaxy said:
Yeah, the only problem really is that, the boot-partition gets replaced with an update. So with every update you have to re-flash the patched boot.img
Magisk can patch TWRP Backups too, you can then restore the patched Boot-partition in TWRP!
So this is what I do to get Root again after an Update:
1. Boot into Fastboot Mode
2. Boot into TWRP SKKK
3. Backup Boot-partition
4. Boot Android
5. Open Magisk & patch /sdcard/TWRP/Backups/boot.emmc.win
6. Rename /Downloads/magisk_patched_xxx.img to "boot.emmc.win"
7. Move (and replace, when asked) to /sdcard/TWRP/Backups/boot.emmc.win
8. Boot TWRP SKKK and restore patched Boot
Click to expand...
Click to collapse
Can i do this procedure to dirty flash miui updates?
1. Boot twrp using Power button + Volume Up
2. Flash the ota update zip.
3. Reboot.
Can i do this?
gigavolthavoc07 said:
Can i do this procedure to dirty flash miui updates?
1. Boot twrp using Power button + Volume Up
2. Flash the ota update zip.
3. Reboot.
Can i do this?
Click to expand...
Click to collapse
Yes but make sure to use a Full OTA zip, not an incremental update zip. (the ZIP files in range of ~1-3 GB, not the ~300 MB incremental update-files)
cyanGalaxy said:
Yes but make sure to use a Full OTA zip, not an incremental update zip. (the ZIP files in range of ~1-3 GB, not the ~300 MB incremental update-files)
Click to expand...
Click to collapse
thanks man
Which custom recovery is MIUI OTA enabled?
I can't find it in Orangefox, show me!
Dirt.
orangefox version: [email protected] . 1_1_A12
user2332 said:
Which custom recovery is MIUI OTA enabled?....
Click to expand...
Click to collapse
Probably none. There is no point in trying to do that.
If you say so, I'll believe it. Thank you very much! I don't even bother with it anymore.
my way is to backup stock boot vendor_boot dtbo from twrp before flashing twrp and whenever i want to ota update i restore the backup and reboot
magisk will be gone
twrp will be gone
i start the ota update, it'll flash the small incremental update instead of using the entire 3gb rom

Categories

Resources