Fixing failed OTAs after execution of TWRP - Moto G5S Plus Guides, News, & Discussion

When booting TWRP using fastboot, without flashing it to the recovery partition, eg. "fastboot boot twrp-sanders-r20.img", only for the purpose of taking a partition backup, once done the device wont longer take OTA's!
That is IMHO a very unexpected behavior, as booting this way and keeping system read only should mean that nothing on the phone gets changed (well except the data partition if a backup is saved on these one).
One would expect this not to mess with the OTA process.
Now, this twrp at least: https://forum.xda-developers.com/moto-g5s-plus/development/recovery-twrp-3-1-1-r7-t3694910 does, after some investigation i found out that it is mounting the oem partition writable and modifying it adding a .twrp file to the root. Since the OTAs are checking and patching this partition of cause they will fail.
Luckily there is a way out, you can reflash the OEM partition for example from here: https://forum.xda-developers.com/moto-g5s-plus/how-to/tutorial-fhash-oreo-8-1-stock-global-t3852967
that is assuming that you are running the first Oreo 8.1 update, if you had an other version when the issue hit, you will need to find the right OEM partition image for you actual build.
IMHO this behavior of TWRP is unacceptable and should be fixed in a new release ASAP.

DavidXanatos said:
When booting TWRP using fastboot, without flashing it to the recovery partition, eg. "fastboot boot twrp-sanders-r20.img", only for the purpose of taking a partition backup, once done the device wont longer take OTA's!
That is IMHO a very unexpected behavior, as booting this way and keeping system read only should mean that nothing on the phone gets changed (well except the data partition if a backup is saved on these one).
One would expect this not to mess with the OTA process.
Now, this twrp at least: https://forum.xda-developers.com/moto-g5s-plus/development/recovery-twrp-3-1-1-r7-t3694910 does, after some investigation i found out that it is mounting the oem partition writable and modifying it adding a .twrp file to the root. Since the OTAs are checking and patching this partition of cause they will fail.
Luckily there is a way out, you can reflash the OEM partition for example from here: https://forum.xda-developers.com/moto-g5s-plus/how-to/tutorial-fhash-oreo-8-1-stock-global-t3852967
that is assuming that you are running the first Oreo 8.1 update, if you had an other version when the issue hit, you will need to find the right OEM partition image for you actual build.
IMHO this behavior of TWRP is unacceptable and should be fixed in a new release ASAP.
Click to expand...
Click to collapse
Agreed; received today a security update for my moto G5S plus (didn't root till i got the official 8.1 Oreo update) and every time i try to install takes me to TWRP and i keep it as READ ONLY (since TWRP itself says if u modify u won't b able to receive OTA updates) and... even without the modification i still can't get the update. this has to be fixed ASAP by TWRP

I did discover that if you keep the OTA files for older updates, you can re-run them to update the OEM partition. Unfortunately it only works one update generation.
I wonder if we just delete the .TWRP file if it can recover it. I'll test later this week. The OTA has a way to repair partitions

pizzaboy192 said:
I did discover that if you keep the OTA files for older updates, you can re-run them to update the OEM partition. Unfortunately it only works one update generation.
I wonder if we just delete the .TWRP file if it can recover it. I'll test later this week. The OTA has a way to repair partitions
Click to expand...
Click to collapse
keep us posted man

pizzaboy192 said:
I wonder if we just delete the .TWRP file if it can recover it. I'll test later this week. The OTA has a way to repair partitions
Click to expand...
Click to collapse
imho 99% sure, it still will fail, the partition does not just have to be semantically unchanged it must be 1:1 bit wise identical with what is expected.

I'll see what happens. I'm not a developer but I have pointed this out a few times to the developers of both TWRP threads, along with sharing these issues on the telegram group, but everyone else is focused on the latest custom ROM and doesn't care about stock, so the issues have fallen on deaf ears

in a nutshell how can i receive the last OTA security? do i revert to stock , install then root again? holy moly that's a lot of work

TheKicKer69 said:
in a nutshell how can i receive the last OTA security? do i revert to stock , install then root again? holy moly that's a lot of work
Click to expand...
Click to collapse
Unfortunately until they fix TWRP so it doesn't damage the OEM partition, you need a clean copy of the OEM partition to take the OTA.
However, there is a way you can prevent this, but it is a little hairy (you can't use any magisk modules). You can use the magisk app to patch the boot.img file that is from a slightly older Oreo firmware and flash that with fastboot, without using TWRP.
---------- Post added at 07:35 AM ---------- Previous post was at 07:30 AM ----------
DavidXanatos said:
imho 99% sure, it still will fail, the partition does not just have to be semantically unchanged it must be 1:1 bit wise identical with what is expected.
Click to expand...
Click to collapse
Yup. Just confirmed that deleting the .twrp file does not fix it.
I've reached out to Motorola to update their Lenovo Motorola Smart Assistant tool to support the official Oreo OTA which will allow us to download the latest full firmware file, which would give us the OEM partition to reflash before the next OTA.
I'll bother the TWRP devs again this week to get this unexpected behavior removed so we don't need to bother anyone in the future.

Update: none of the TWRP maintainers currently have replied to me about this issue.
@CheckYourScreen hasn't been active for a while but hasn't responded to a few different attempts to point this issue out (Been over a month since first notification with no acknowledgement)
@MasterAwesome has a custom TWRP that is latest, but they're still working on it. They're our best bet to possibly get it fixed since they're actively working on it. They've also been made aware, but no response yet (4 days since notifying and it was a weekend, so hopeful)
@GeneticEnginer was notified today. They developed the first unofficial TWRP (3.1.1) and might be able to help, but not holding my breath
I've also contacted a few people who do unofficial TWRP ports for some tips on unpacking one of our existing TWRP files and fixing it myself. It may be the way to go.

Hi guys. Final update. I've fixed TWRP temporarily. If we're not going to run custom ROMs, use this TWRP to backup. It does a bitwise backup of OEM and doesn't mount it as RW so it WILL work for restoring fully OTA capable stock ROM. It is NOT treble compatible as the treble compatible ones do weird things that I haven't documented.
https://forum.xda-developers.com/mo...-r20-stock-t3869192/post78205758#post78205758

Related

Not a noob, but still confused.

I have a nexus 6. I have been using custom ROMs from the days of xperia mini pro. Never had a Nexus before. I want to have root in my nexus 6 for ad blocking cereberus and more. But this time I don't want custom ROMs. I just need the OTA's. I know OTA's dont happen automatically after root. So please tell me should I root and put a custom recovery, Or just root for manually updating the OTA's. Where can I get all the OTA's ?? I know it's a lot of questions.. Please.
Quick answer: Isn't going to happen.
Reason: Lollipop wont install OTA if you modify /system, because it is now written as a block, unlike previous versions of android.
IF you root, you have modified /system.
Consequence: you will not update by OTA while rooted. It will fail.
Possible workaround: You can however AFAIK, unroot and then take an OTA, but I'll let others confirm this, please don't take me saying it as factual.
Factory image flash: always works, but you have to await the release after the updates.
mad_rulzzz said:
I have a nexus 6. I have been using custom ROMs from the days of xperia mini pro. Never had a Nexus before. I want to have root in my nexus 6 for ad blocking cereberus and more. But this time I don't want custom ROMs. I just need the OTA's. I know OTA's dont happen automatically after root. So please tell me should I root and put a custom recovery, Or just root for manually updating the OTA's. Where can I get all the OTA's ?? I know it's a lot of questions.. Please.
Click to expand...
Click to collapse
FWIW: I would recommend that you:
1) Unlock bootloader
2) Decide if you want uncrypted kernel, or not (since it wipes data, just like unlocking bootloader).
3) Fastboot flash TWRP recovery.
4) Download SuperSU .zip and flash it in recovery.
5) Now, when a new OTA comes out, they usually show up here > http://forum.xda-developers.com/nexus-6/general/ref-nexus-6-stock-ota-urls-t2906493
6) You can download your current factory image here > https://developers.google.com/android/nexus/images
7) Unzip your current factory image. Fastboot flash the system.img and that will unroot and restore the stock recovery.
8) Fastboot flash the stock boot.img if you have a custom kernel (or an unencrypted stock kernel).
9) Relax and wait for the OTA.
RW-1 said:
Quick answer: Isn't going to happen.
Reason: Lollipop wont install OTA if you modify /system, because it is now written as a block, unlike previous versions of android.
IF you root, you have modified /system.
Consequence: you will not update by OTA while rooted. It will fail.
Possible workaround: You can however AFAIK, unroot and then take an OTA, but I'll let others confirm this, please don't take me saying it as factual.
Factory image flash: always works, but you have to await the release after the updates.
Click to expand...
Click to collapse
I knew about the OTA failing due to the system partition getting changed while rooting. I think what I was looking for what cam30era just explained!!!
mad_rulzzz said:
I have a nexus 6. I have been using custom ROMs from the days of xperia mini pro. Never had a Nexus before. I want to have root in my nexus 6 for ad blocking cereberus and more. But this time I don't want custom ROMs. I just need the OTA's. I know OTA's dont happen automatically after root. So please tell me should I root and put a custom recovery, Or just root for manually updating the OTA's. Where can I get all the OTA's ?? I know it's a lot of questions.. Please.
Click to expand...
Click to collapse
You can just update in fastboot without an OTA. Just flash the new bootloader, system and possibly the new boot.img in fastboot and reroot. Erase and flash cache.img afterwards. Thats how i do it at least.
mad_rulzzz said:
I knew about the OTA failing due to the system partition getting changed while rooting. I think what I was looking for what cam30era just explained!!!
Click to expand...
Click to collapse
What he just explained is what I said, unroot and take the OTA.... He listed how as well.
RW-1 said:
What he just explained is what I said, unroot and take the OTA.... He listed how as well.
Click to expand...
Click to collapse
Yup.
@rw_1 @cam30era thanks guys
I would do what gee2012 said.
From what I have seen the OTA and the images are released pretty close together.
Instead of flashing images to get back to stock and waiting for the OTA. and then re-rooting
Just download the image files from Google. Manually flash all the files EXCEPT user data if you want to keep your data.
Re-root.
You are now updated and don't have to wait for OTA.
Either way works so it depends on which you are happier with.
mad_rulzzz said:
@rw_1 @cam30era thanks guys
Click to expand...
Click to collapse
Welcome. And BTW: there's a button for that.
gee2012 said:
You can just update in fastboot without an OTA. Just flash the new bootloader, system and possibly the new boot.img in fastboot and reroot. Erase and flash cache.img afterwards. Thats how i do it at least.
Click to expand...
Click to collapse
Just to be sure I understood right:
If I don't care about app data or settings ( I have titanium backup),
1)I can just unlock the boot loader
2)Flash the latest factory image from [developers.google.com/android/nexus/images]
3)Root using chain fire's tool
And repeat the process when the factory image of the next version is uploaded by google.
one last thing... Does Google upload factory images after each OTA happens?
cam30era said:
Welcome. And BTW: there's a button for that.
Click to expand...
Click to collapse
My BAd!!
mad_rulzzz said:
If I don't care about app data or settings ( I have titanium backup),
1)Can I just unlock the boot loader
2)Flash the latest factory image from [developers.google.com/android/nexus/images]
3)Root using chain fire's tool
And repeat the process when the factory image of the next version is uploaded by google.
Does Google upload factory images after each OTA happens? i.e; If Nexus 6 receives an OTA to 5.2, will they upload the 5.2 factory image soon?
Click to expand...
Click to collapse
When you unlock the bootloader it will wipe the contents of your SD card. Make sure it is backed up on your PC.
Unfortunately, not every OTA gets published as a factory image. Most, but not all. Case in point: LMY47M.
cam30era said:
Unfortunately, not every OTA gets published as a factory image. Most, but not all. Case in point: LMY47M.
Click to expand...
Click to collapse
I noticed that.... But that build is only for T-Mobile users, I guess...
Minor Differences, for example; If you take the android builds for Indian phones they are required by law to display the SAR rating. So I wouldn't worry about LMY47M, unless they have changed something to fix the memory leaks.
mad_rulzzz said:
I noticed that.... But that build is only for T-Mobile users, I guess...
Minor Differences, for example; If you take the android builds for Indian phones they are required by law to display the SAR rating. So I wouldn't worry about LMY47M, unless they have changed something to fix the memory leaks.
Click to expand...
Click to collapse
Correct. M is intended for T-Mobile. My point, though, is that Google doesn't always, 100% of the time publish a factory image for every OTA.

[SOLVED] New Nexus 6, but lot of problems with it - OTA fail

(sorry for my bad english I'm french )
Hi everybody,
I have received a new Nexus 6 32GB... No, sorry, a 64GB model (thanks to my resailer.. he make a mistake in the command, so I have won 32GB more! ).
But, I have few software problems with it...
At each OTA update, I get an error (at the robot opened screen). With almost all versions. This error get me a bootloop after update...
So I must to flash the official Google Image manually, partition by partition (else with NRT, I get an error at system writing step... I don't know why).
When I have fixed Android, finally, I have only.... 23.03 GB... With all versions.
So I must resize it in TWRP at each update (OTA or not).
For the last update, my bootloader have displayed at boot "Your device is corrupted. Blah blah blah..."
I actually make a new OTA update (6.1 I think). But I have an error one more time...
But I have no bootloop this time. The system reboot perfectly but in the old version. And few minutes later, the OTA is notified... Etc etc.
But, if a new system update is available, do you think I will get the same problems?
My system seems to be clean now... But during my multiple trys, my system has been clean too...
Without that, all is good and functionnal. Android, Wifi, LTE, screen, sound..... All!
This is very mysterious... Mostly for a new phone, non-rooted.
I did not want to root it while Google support it, but without root, my phone would still be blocked. That's not normal.
Should I be worried about it?
Thanks everyone!
1. Learn how to use ADB and Fastboot. Toolkits may get the job done, but you learn nothing in using them.
2. If flashing individual images from the system image, NEVER flash userdata.img as it resets your storage to 32GB. Formatting your internal storage using ADB, Fastboot, or in TWRP will restore the missing storage.
3. The system corruption message likely will disappear after you format internal storage and flash the stock images from Google. It will return however if you modify /system by adding files. To permanently remove it requires a custom kernel.
4. This a developer phone. You should be able to root it without losing the warranty.
Strephon Alkhalikoi said:
1. Learn how to use ADB and Fastboot. Toolkits may get the job done, but you learn nothing in using them.
2. If flashing individual images from the system image, NEVER flash userdata.img as it resets your storage to 32GB. Formatting your internal storage using ADB, Fastboot, or in TWRP will restore the missing storage.
3. The system corruption message likely will disappear after you format internal storage and flash the stock images from Google. It will return however if you modify /system by adding files. To permanently remove it requires a custom kernel.
4. This a developer phone. You should be able to root it without losing the warranty.
Click to expand...
Click to collapse
First thanks for your answer!
Oh yes for the 1 and the 4, my precedent phone is a Nexus 4, I know these phones and the steps to root/unroot/flash custom rom/recovery etc.. ^^ (I have made that a looooooot of times on my N4 without any problem, with and without NRT)
And this is for that I am surprised by the bad reaction of my Nexus 6 to this simple actions I request to it. (flashing image files)
I don't make anything I don't know, I am scared to brick my phone because I have made something that I master.
Yes I have forgot this point about userdata.img... But this is not a problem, I have resized my partition after flashing my phone with TWRP =)
The point that are interesting for me is the third point. I want to flash a stock image from Google. It's my goal. (I will flash custom ROM when Google will have stopped the update support)
In fact, my principal big problem is why the OTAs have been failed whereas I just start my phone, out of the box, with no modification and no root.
I'm not a specialist but for me, this is not normal when the phone is out of factory.
I will retry to flash another factory image from Google. This time with the flash-all script.
Thanks =)
Kermi78 said:
(sorry for my bad english I'm french )
Hi everybody,
I have received a new Nexus 6 32GB... No, sorry, a 64GB model (thanks to my resailer.. he make a mistake in the command, so I have won 32GB more! ).
But, I have few software problems with it...
At each OTA update, I get an error (at the robot opened screen). With almost all versions. This error get me a bootloop after update...
So I must to flash the official Google Image manually, partition by partition (else with NRT, I get an error at system writing step... I don't know why).
When I have fixed Android, finally, I have only.... 23.03 GB... With all versions.
So I must resize it in TWRP at each update (OTA or not).
For the last update, my bootloader have displayed at boot "Your device is corrupted. Blah blah blah..."
I actually make a new OTA update (6.1 I think). But I have an error one more time...
But I have no bootloop this time. The system reboot perfectly but in the old version. And few minutes later, the OTA is notified... Etc etc.
But, if a new system update is available, do you think I will get the same problems?
My system seems to be clean now... But during my multiple trys, my system has been clean too...
Without that, all is good and functionnal. Android, Wifi, LTE, screen, sound..... All!
This is very mysterious... Mostly for a new phone, non-rooted.
I did not want to root it while Google support it, but without root, my phone would still be blocked. That's not normal.
Should I be worried about it?
Thanks everyone!
Click to expand...
Click to collapse
Next time you flash and go into twrp make sure to select the "leave system read-only" option. Otherwise twrp will patch /system to survive a reboot and any modification to /system will break the next ota.
Kermi78 said:
...
But, if a new system update is available, do you think I will get the same problems?
Click to expand...
Click to collapse
Flash the latest TWRP 3.0 and the lite stock ROM of @Danvdh. This ROM has all you need, including root and OTA.
StykerB said:
Next time you flash and go into twrp make sure to select the "leave system read-only" option. Otherwise twrp will patch /system to survive a reboot and any modification to /system will break the next ota.
Click to expand...
Click to collapse
I have tried this. Thank you for this tip. I did not know Bootloader and OTAs fail depends of /system state. (I have never modified official google image. If I modify a device, it's with a custom rom like CM for example. Without my problem at the first start I would not have modify anything on my phone)
First, I don't have the bootloader message, that's a half good news
I download actually the MRA58N OTA update. Crossing fingers! =)
NLBeev said:
Flash the latest TWRP 3.0 and the lite stock ROM of @Danvdh. This ROM has all you need, including root and OTA.
Click to expand...
Click to collapse
My goal is to use the official Google Nexus Factory Images with official bootloader, etc.... Exactly the state of a normal Nexus out of the box.
But thank you. In last resort I will think of your tip.
StykerB said:
Next time you flash and go into twrp make sure to select the "leave system read-only" option. Otherwise twrp will patch /system to survive a reboot and any modification to /system will break the next ota.
Click to expand...
Click to collapse
So after my last try of OTA, 2 times, the update has been succeded!
Just thanks a lot! :good:
I notify this thread resolved
Kermi78 said:
My goal is to use the official Google Nexus Factory Images with official bootloader, etc....
Click to expand...
Click to collapse
Than you can't use layers. You have to live with the white Google ui, battery drain and hurting eyes.
NLBeev said:
Than you can't use layers. You have to live with the white Google ui, battery drain and hurting eyes.
Click to expand...
Click to collapse
Oh no that's good for me, I love Android Stock and I hate layers
For the battery... You see, my last phone was a Nexus 4. So the battery life of Nexus 6 is so wonderful for me!
In all cases, my phone is now stock and functionnal. Just that I want for the moment... I will see later for install other roms on it
I want to be simple things.
Kermi78 said:
(sorry for my bad english I'm french )
Hi everybody,
I have received a new Nexus 6 32GB... No, sorry, a 64GB model (thanks to my resailer.. he make a mistake in the command, so I have won 32GB more! ).
But, I have few software problems with it...
At each OTA update, I get an error (at the robot opened screen). With almost all versions. This error get me a bootloop after update...
So I must to flash the official Google Image manually, partition by partition (else with NRT, I get an error at system writing step... I don't know why).
When I have fixed Android, finally, I have only.... 23.03 GB... With all versions.
So I must resize it in TWRP at each update (OTA or not).
Click to expand...
Click to collapse
DON'T INSTALL THE userdata.img file and this won't happen.

Magisk and Bootloader

Hi,
I am very new to this android world so my queries might feel stupid. Actually i m here after 3 years and that is very long period in this world. I know about rooting(super Su), bootloader and recovery (stock,CM and TWRP) . Recently read about Magisk and got some queries. Hope you will help me out. These are not device specific but need to learn.
What i read/study i found these readings...
1. Magisk roots device systemlessly (does not touch system partition) so one can get OTA updates easily.
2.To install and run Magisk one needs to unlock the bootloader .
3.(Device Specific) My redmi MI Flash tool says,If you unlock the bootloader , you wont get OTA updates.
4.I have previously rooted my galaxy Y and uninstalled system apps. If i delete sys apps from magisk,still can we say that we are not touching system.
So all statements are true? or some? or none ?
Here my device is redmi 3s (6.0.1- MIUI 9.6.1.0 Global Stable).All these queries are just in relation to OTA system updates. Nothing related to warranty.
Thanking You
Yes.
Yes.
Don't know about Xiaomi, but I've never had issues with OTA on a device with an unlocked bootloader (I've mainly used different Google and Oneplus devices). Someone with a Xiaomi is gonna have to chime in on this one.
As long as you use Magisk's debloating feature of replacing files or directories with empty ones, you're good. The actual /system partition won't be touched. Use a module like the Debloater module by @veez21, or make a debloater module yourself.
Didgeridoohan said:
Don't know about Xiaomi, but I've never had issues with OTA on a device with an unlocked bootloader (I've mainly used different Google and Oneplus devices). Someone with a Xiaomi is gonna have to chime in on this one.
Click to expand...
Click to collapse
Ahh, Thank You.
You get OTA system updates for your STOCK ROM ?
inwell said:
Ahh, Thank You.
You get OTA system updates for your STOCK ROM ?
Click to expand...
Click to collapse
Yes. But, having both Magisk and a custom recovery (an OTA won't install with a modified boot image and a custom recovery installed) I always find it easier to download the update and flash it manually. But, like I said, I have no idea if this is true for Xiaomi.
1. Ok. i also heared that when you update your device,you lose root...not true ? Or you need to root again ?
2.In normal stock device,we get update notification and we downlaod then restart (as per convenience)device to update.
If i remove some system apps from my rooted device and unroot the device,manage to get stock recovery back ,will the OTA update system treat my device as Stock-untouched? And install updates just as stock device will do ?
3. Is boot.img and bootloader are same things? Coz i read that for re locking boot loader you need to flash boot.img from stock software. (But Some procedures just use fastboot and relock oem command-they wont use boot.img,dont know why )
I read that unrooting,restoring stock recovery and locking bootloader again is more difficult/complicated than the rooting procedure
Some one should come up with solution just like Windows Restore .If you want to go back to everything STOCK,just use that feature same as done to Restore Windows in its previous state.
Any update that also updates the boot image (which means pretty much all) will remove root. But, that's just a simple case of reflashing Magisk right after applying the update.
If you've touched /system in any way, removing system apps or even just mounting the /system partition read-write, an OTA will fail. To be able update with an OTA your /system and /vendor partitions need to be untouched and you need to have the stock boot image and stock recovery installed. If your device doesn't conform to this the OTA will fail.
Boot image and bootloader are not the same thing. That you can read up on all over the internet, so I won't go into details. If you have done any kind of modifications on your device, I suggest you leave your bootloader unlocked. It's to easy to mess things up otherwise.
Going back to full stock is usually just a matter of flashing a full factory image/firmware package/stock ROM. Quite easy... Of course, some manufacturers make it harder than others.
Didgeridoohan said:
Boot image and bootloader are not the same thing. That you can read up on all over the internet, so I won't go into details. If you have done any kind of modifications on your device, I suggest you leave your bootloader unlocked. It's to easy to mess things up otherwise.
Click to expand...
Click to collapse
Ok. As you say the two are different , but can you explain in simple words (terms) that how they both are related/linked/connected? Coz as i read some forums/posts i get to read
1. To relock/lock bootloader you need to flash boot.img which suggests these (terms) are linked/connected.
2. but same time some forums/post suggest no img file flashing but just a fastboot command(s) to relock bootloader. In this case it seems they are not linked/connected.
And if the above 2 statements are true and device specific then how the bootloader and boot image are linked and not linked in diff devices? what changes are made so that in some cases these are linked and in some not
Sorry for asking too much. But you were really very kind to help me out.Thank you once again
I'm not 100% accurate (and someone will hopefully come I'm and correct me if needed), but basically the bootloader checks that everything is alright and then starts up your device. After that the boot image (ramdisk and kernel) takes over. Ramdisk basically makes sure all the partitions are mounted, and the kernel is exactly what it sounds like. The core of the OS, making sure that everything is working as it should.
This is of course a huge over-simplification, so if you want more you'll have to search around (and there are tons of resources around the web).
The main reason I can think of right at the moment for wanting to flash a boot image before locking the bootloader is that it's generally a good idea to have your device fully stock and functional before doing so. After you've locked the bootloader there might not be any going back if things start acting up and you could end up with a nice paperweight.
Questions are good. That's how you learn. I do believe that you'd be much better of searching around the internet for your answers. They've been put out there many, many times.
Ok.Thank you very much.I will learn more ...

Question PIXEL 5a Stable Build Available

If you haven't already, you should be receiving a notification that the Stable Android 12 or "S" Build is lurking in the shadows of your Pixel 5a handset. If you're currently on the (only) beta version we received OTA, your update won't inconvenience you for too long, as it weighs in at <4 mb, all in.
Safe Journey's...evnStevn
The factory images are up on Google's developer site, and when I tickled the system update found the 12 upgrade. I'm downloading the factory image now (for rooting with Magisk) then will upgrade to 12. Then more to learn...
CarinaPDX said:
The factory images are up on Google's developer site, and when I tickled the system update found the 12 upgrade. I'm downloading the factory image now (for rooting with Magisk) then will upgrade to 12. Then more to learn...
Click to expand...
Click to collapse
Right-On, I'm not ready for that, the Big League's (yet) as I'm still down here playing T-ball !
CarinaPDX said:
The factory images are up on Google's developer site, and when I tickled the system update found the 12 upgrade. I'm downloading the factory image now (for rooting with Magisk) then will upgrade to 12. Then more to learn...
Click to expand...
Click to collapse
Attempted the upgrade last night, seems there's some new things required if you want to flash the modified boot image and successfully boot. I believe you need to wipe the data partition and also pass along a few flags during install. However, temp root is an option if you want to avoid that for now (I did) by simply booting the image in fastboot vs flashing it. Just FYI!
Edit. Sounds like SafetyNet won't pass yet if you do end up going the permanent route? I could be wrong but I believe that's what's I've read. I just checked on mine and the temporary boot image does seem to so that's good.
If you read this thread you will see how to do it, as done on beta releases. https://forum.xda-developers.com/t/guide-flash-magisk-on-android-12.4242959/ It is possible to achieve permanent root on 12 without wiping the personal data but it is a delicate dance. I have not tried it yet but as I understand it the process is to unroot 11 and at least remove Magisk modules, take the 12 update, boot into bootloader and use fastboot to remove boot verification and replace vbmeta.img, then flash patched boot.img, reboot and reinstall magisk. It seems there is a problem with just flashing the new factory image with the wipe option (-w) removed. Instead of fastboot flashing the patched boot.img it is also possible to directly patch the boot.img from Magisk while temporarily booted from the patched boot.img (via fastboot), again after removing the verification checks. It may be critical as to when the 5a is rebooted or not; it needs to have a normal reboot after the OTA upgrade in order to complete the upgrade, then boot to bootloader for fastboot operations. I am going to go back and make instructions for myself before proceeding, and will do a Titanium backup before doing anything else.
Edit: it appears that some have achieved permanent root and still passed the SafetyNet check. IIRC it was done through the OTA upgrade path but I need to check that. If you are willing to wipe your data then just installing the factory image and then doing the fastboot commands it might work but that is not clear. Too many attempts at root and SafetyNet failed while flailing so hard to know right now if there are good alternatives to OTA.
CarinaPDX said:
If you read this thread you will see how to do it, as done on beta releases. https://forum.xda-developers.com/t/guide-flash-magisk-on-android-12.4242959/ It is possible to achieve permanent root on 12 without wiping the personal data but it is a delicate dance. I have not tried it yet but as I understand it the process is to unroot 11 and at least remove Magisk modules, take the 12 update, boot into bootloader and use fastboot to remove boot verification and replace vbmeta.img, then flash patched boot.img, reboot and reinstall magisk. It seems there is a problem with just flashing the new factory image with the wipe option (-w) removed. Instead of fastboot flashing the patched boot.img it is also possible to directly patch the boot.img from Magisk while temporarily booted from the patched boot.img (via fastboot), again after removing the verification checks. It may be critical as to when the 5a is rebooted or not; it needs to have a normal reboot after the OTA upgrade in order to complete the upgrade, then boot to bootloader for fastboot operations. I am going to go back and make instructions for myself before proceeding, and will do a Titanium backup before doing anything else.
Edit: it appears that some have achieved permanent root and still passed the SafetyNet check. IIRC it was done through the OTA upgrade path but I need to check that. If you are willing to wipe your data then just installing the factory image and then doing the fastboot commands it might work but that is not clear. Too many attempts at root and SafetyNet failed while flailing so hard to know right now if there are good alternatives to OTA.
Click to expand...
Click to collapse
Thanks for the link. I downloaded the full Android 12 image, installed it, disabled verity and wiped my data via fastboot, then flashed the magisk-patched boot. Worked like a charm and safetynet passed after hiding Magisk and installing Riru and the universal-safetynet-fix.
michaelc5047 said:
Thanks for the link. I downloaded the full Android 12 image, installed it, disabled verity and wiped my data via fastboot, then flashed the magisk-patched boot. Worked like a charm and safetynet passed after hiding Magisk and installing Riru and the universal-safetynet-fix.
Click to expand...
Click to collapse
I am hoping to avoid wiping data by taking the OTA and then rooting - I just need to find the time to backup and write down the process first. I knew that the update could be done directly with the factory image, then rooted, but that requires the data wipe. If I encounter a problem that is the fallback approach - then restore data with Titanium.
I don't mind wiping data once. But if I have to wipe data for each update just to root, I'll stay on 11 for now until there's a better way to root
Exactly.... I'll wait for a better way to upgrade and keep my root on 12
You don't "keep your root" on 11 updates; you unroot, take the OTA, then root again with a newly patched boot.img. And the data isn't wiped when moving to 12 if done through the OTA, just like 11 updates. If flashing a factory image the data is always wiped. What is different with 12 is that there is a verification of the boot.img and this has to be turned off (because the boot.img is patched), with a single fastboot command. It does appear to be sensitive to some details, so best to have a detailed procedure written down before starting the process. But those that have done it do not report a long or difficult process - just a finicky one.
CarinaPDX said:
You don't "keep your root" on 11 updates; you unroot, take the OTA, then root again with a newly patched boot.img. And the data isn't wiped when moving to 12 if done through the OTA, just like 11 updates. If flashing a factory image the data is always wiped. What is different with 12 is that there is a verification of the boot.img and this has to be turned off (because the boot.img is patched), with a single fastboot command. It does appear to be sensitive to some details, so best to have a detailed procedure written down before starting the process. But those that have done it do not report a long or difficult process - just a finicky one.
Click to expand...
Click to collapse
Ok ...have you done it yet?....can you tell me your process or elaborate more to my understanding
CarinaPDX said:
You don't "keep your root" on 11 updates; you unroot, take the OTA, then root again with a newly patched boot.img. And the data isn't wiped when moving to 12 if done through the OTA, just like 11 updates. If flashing a factory image the data is always wiped. What is different with 12 is that there is a verification of the boot.img and this has to be turned off (because the boot.img is patched), with a single fastboot command. It does appear to be sensitive to some details, so best to have a detailed procedure written down before starting the process. But those that have done it do not report a long or difficult process - just a finicky one.
Click to expand...
Click to collapse
I want to upgrade ota....but what do i have to do to achieve root without loosing files, setup, etc
No, I have not done it yet - oddly enough I have other things needing doing. The information needed to do it is in this thread: https://forum.xda-developers.com/t/guide-flash-magisk-on-android-12.4242959/ Unfortunately since it started during the 12 beta program, and there was a lot of trial and error, it is necessary to work through the long thread and sort out the process - which appears to be fairly simple (if inflexible).
When updating or upgrading there are always two paths to take: 1) take the OTA that is offered (after unrooting), or 2) flashing the full factory image. Generally speaking, OTAs are designed to keep the user data untouched [edit: not untouched but just converted where needed for the new system] and the factory image is intended to put the phone to factory condition (i.e. no user data present - starts from scratch). Updates (i.e. not upgrades between Android major versions) over-the-air (OTA) are replacing blocks of the stored image, which is very efficient, but requires a pristine stored image (hence the need to unroot to pass the check). Upgrades (new Android versions) seem to download the entire image, IIUC, and then clean up any data (like config files) that are not compatible with the new system. Sometimes the result has been less than perfect, although it is mostly reliable. Ultimately a factory image is the guarantee of getting a known good system, which can then be set up to the user's taste. Backing up user data (e.g. with Titanium Backup) and restoring can make this easier but again, config files from the previous system if restored on the new system can cause problems. Some people prefer to flash the factory image and reinstall the apps as new to get the highest confidence in the result. Most of us just take the OTA and trust the process, prepared to wipe config files or even flash the full factory image if there is a problem. Your choice.
After I write a procedure for myself, and successfully upgrade, I will post it.
So those of us that never rooted can just skip the unroot process and do the rest I assume?
CarinaPDX said:
No, I have not done it yet - oddly enough I have other things needing doing. The information needed to do it is in this thread: https://forum.xda-developers.com/t/guide-flash-magisk-on-android-12.4242959/ Unfortunately since it started during the 12 beta program, and there was a lot of trial and error, it is necessary to work through the long thread and sort out the process - which appears to be fairly simple (if inflexible).
When updating or upgrading there are always two paths to take: 1) take the OTA that is offered (after unrooting), or 2) flashing the full factory image. Generally speaking, OTAs are designed to keep the user data untouched [edit: not untouched but just converted where needed for the new system] and the factory image is intended to put the phone to factory condition (i.e. no user data present - starts from scratch). Updates (i.e. not upgrades between Android major versions) over-the-air (OTA) are replacing blocks of the stored image, which is very efficient, but requires a pristine stored image (hence the need to unroot to pass the check). Upgrades (new Android versions) seem to download the entire image, IIUC, and then clean up any data (like config files) that are not compatible with the new system. Sometimes the result has been less than perfect, although it is mostly reliable. Ultimately a factory image is the guarantee of getting a known good system, which can then be set up to the user's taste. Backing up user data (e.g. with Titanium Backup) and restoring can make this easier but again, config files from the previous system if restored on the new system can cause problems. Some people prefer to flash the factory image and reinstall the apps as new to get the highest confidence in the result. Most of us just take the OTA and trust the process, prepared to wipe config files or even flash the full factory image if there is a problem. Your choice.
After I write a procedure for myself, and successfully upgrade, I will post it.
Click to expand...
Click to collapse
Ok cool and thanks....that was awesome info
anubis2k3 said:
So those of us that never rooted can just skip the unroot process and do the rest I assume?
Click to expand...
Click to collapse
That is the case. It seems that some with 12 beta got tripped up by not getting unrooting/removing Magisk and/or its modules right so that is one less thing to worry about. If you have never rooted then the OTA should work as expected. Rooting can be done in two ways, either by achieving a temporary root and using magisk to directly patch the boot.img, or by patching the boot.img and flashing it, right after removing verification and flashing the new vbmeta.img (in both cases). Of course you first have to unlock the bootloader and enable USB debug, install the Android tools on your computer (minimum version: you only need ADB and fastboot), and connect your computer to the phone with a USB cable. Again, refer to that thread or wait until I can write something up.
CarinaPDX said:
That is the case. It seems that some with 12 beta got tripped up by not getting unrooting/removing Magisk and/or its modules right so that is one less thing to worry about. If you have never rooted then the OTA should work as expected. Rooting can be done in two ways, either by achieving a temporary root and using magisk to directly patch the boot.img, or by patching the boot.img and flashing it, right after removing verification and flashing the new vbmeta.img (in both cases). Of course you first have to unlock the bootloader and enable USB debug, install the Android tools on your computer (minimum version: you only need ADB and fastboot), and connect your computer to the phone with a USB cable. Again, refer to that thread or wait until I can write something up.
Click to expand...
Click to collapse
How do one remove verification?
I haven't been able to permanently root android 12 without wiping my data. I'm not talking about upgrading from 11 to 12. I'm talking about after installing 12, I still have my data. Any attempt to permanently root 12 causes errors unless I wipe my data. This was detailed quite a bit in the link you posted. Have you tried permanently rooting 12 and keeping your data?
As I said before, I have not had time to try the upgrade. Also, that thread has multiple conflicting posts which is why I know it will take time to go through and parse out what works and what doesn't. There are posts IIRC where root was achieved with data retained - but exactly how that was accomplished is not clear (or even if that really did happen). Since we have not had our phones for long there shouldn't be too much in data to lose, and there is always Titanium, so I will give it a go when I have time.
One of the things that I would like cleared up is if the way to 12 and root is to stop the OTA upgrade process at some point and remove verification and/or root before continuing, or possibly root fails because it is attempted before the upgrade is complete. IIRC the OTA has at least one reboot involved, with some processing after the reboot (probably fixing the data to be 12-compatible). Clearly if the upgrade can be done while retaining data and then successfully rooted then it must be done in a precise way; the lack of precise explanations of successful roots is very disappointing.
Edit: If it does turn out that data must be wiped every time 12 is rooted then that means backing up and restoring will be needed for each update, as well as unroot/root, and possibly removing verification each time. That would be a huge PITA. Let's hope that isn't so.
BlvckSensei816 said:
How do one remove verification?
Click to expand...
Click to collapse
It is explained in the thread I linked. But at this point unless you are willing to wade through 14 [make that 16 and counting...] pages of posts it is better to wait until someone posts a good procedure. Anyone not familiar with flashing is liable to get into trouble and needing a factory flash. However good 12 is, it is not so good that we can't wait a bit.

Question Can't update to Dec OTA [SOLVED]

Hey, I followed this tutorial https://www.xda-developers.com/how-to-install-ota-updates-keep-root-google-pixel-phone/ (recommended method) and I'm not getting results. After flashing the original boot img, etc. my update screen says my device is updated so I'm not getting Dec. OTA.
I tried also with the Uninstall Magisk (restore images) method and I'm getting the same results, not OTA available.
I'm doing it with all modules disabled.
What am I missing?
alsansan said:
Hey, I followed this tutorial https://www.xda-developers.com/how-to-install-ota-updates-keep-root-google-pixel-phone/ (recommended method) and I'm not getting results. After flashing the original boot img, etc. my update screen says my device is updated so I'm not getting Dec. OTA.
I tried also with the Uninstall Magisk (restore images) method and I'm getting the same results, not OTA available.
I'm doing it with all modules disabled.
What am I missing?
Click to expand...
Click to collapse
You may have to wait for the update over the internet, then once it starts there's more waiting for the installation to complete, plus you could end up with a "problem" error after everything seemed fine during the first 20 minutes. OTA updates will be less frustrating and faster using adb to sideload over USB.
This guide for Pixel 6 is a good reference for most Pixel 7 situations (the main difference with 7 is to patch, flash or restore init_boot.img instead of boot.img).
alsansan said:
Hey, I followed this tutorial https://www.xda-developers.com/how-to-install-ota-updates-keep-root-google-pixel-phone/ (recommended method) and I'm not getting results. After flashing the original boot img, etc. my update screen says my device is updated so I'm not getting Dec. OTA.
I tried also with the Uninstall Magisk (restore images) method and I'm getting the same results, not OTA available.
I'm doing it with all modules disabled.
What am I missing?
Click to expand...
Click to collapse
If it helps..
I just happened to use my P7 as an example in a different thread.
[Discussion] Magisk - The Age of Zygisk - Post # 2,648​
Includes a Github link showing the modification to the flash-all script I use.
Includes a Pastbin link showing my update from Nov -> Dec.
Cheers.
PS.
Just to be clear, I (always) use full factory images for Pixel updates.
- Factory Images for Nexus and Pixel Devices
Not the incremental OTA(s).
- Full OTA Images for Nexus and Pixel Devices
manjaroid said:
You may have to wait for the update over the internet, then once it starts there's more waiting for the installation to complete, plus you could end up with a "problem" error after everything seemed fine during the first 20 minutes. OTA updates will be less frustrating and faster using adb to sideload over USB.
This guide for Pixel 6 is a good reference for most Pixel 7 situations (the main difference with 7 is to patch, flash or restore init_boot.img instead of boot.img).
Click to expand...
Click to collapse
Thanks, I want to try the adb to sideload method, but I have doubts. it is technically detrimental to update flashing factory image / ota over the previous factory image? It's been years since my last rooted phone and I remember people suggested not to do this (I think they recommended full wipe), but I don't know how it goes today.
ipdev said:
If it helps..
Click to expand...
Click to collapse
Helps me! Learned some new stuff and added it to my notes.
alsansan said:
Thanks, I want to try the adb to sideload method, but I have doubts. it is technically detrimental to update flashing factory image / ota over the previous factory image? It's been years since my last rooted phone and I remember people suggested not to do this (I think they recommended full wipe), but I don't know how it goes today.
Click to expand...
Click to collapse
Flashing the OTA doesn't wipe but factory will wipe if you run flash-all (.bat for Windows, .sh for Linux) without removing the -w argument on the fastboot line. i.e., Flashing the OTA will get you updated without losing anything but flashing factory is preferable for updates as long as wiping is disabled.
The factory zip is what PixelFlasher uses for non-destructive updates without having to uninstall Magisk. It's the easiest way to update a rooted Pixel, but mistakes still happen. Like its developer recommends, best to tackle command line methods before jumping into GUI methods.
As far as detrimental flashing goes, with Pixels and stock firmware you would have to stray far off the trail to break the phone.
manjaroid said:
Flashing the OTA doesn't wipe but factory will wipe if you run flash-all (.bat for Windows, .sh for Linux) without removing the -w argument on the fastboot line. i.e., Flashing the OTA will get you updated without losing anything but flashing factory is preferable for updates as long as wiping is disabled.
The factory zip is what PixelFlasher uses for non-destructive updates without having to uninstall Magisk. It's the easiest way to update a rooted Pixel, but mistakes still happen. Like its developer recommends, best to tackle command line methods before jumping into GUI methods.
As far as detrimental flashing goes, with Pixels and stock firmware you would have to stray far off the trail to break the phone.
Click to expand...
Click to collapse
Thank you manjaroid! Finally I updated flashing the Dec factory image with flash-all.bat script (-w removed) and rerooted with the new patched init_boot.img it's really easy but we have doubts the first time. You answered my question (flashing factory is preferable for updates), but why is that? I want to understand a little bit more. And whats the difference between an destructive/non-destructive update?
alsansan said:
...You answered my question (flashing factory is preferable for updates), but why is that? I want to understand a little bit more.
Click to expand...
Click to collapse
How I might explain it is OTA's are incremental updates that patch specific particular parts of the system. You might want to look at it like in an instance of laying a foundation/base, OTA's would be like replacing cracked/broken/weak sections with bricks. As time goes on and more OTA's are released and patched, more of the foundation is put together by more and more bricks -- which may be (quick and easy) or may not be (not a single solid base/structure) more detrimental as time progresses (cumulative patches may inadvertently cause glitches/bugs down the road vs. a full factory [non-patch] update). While holding up upon that patchworks of bricks among the "foundation" is perfectly serviceable and can well enough hold up whatever structure is placed on it, having a whole piece unpatched foundation (Full Factory image) is still preferable as a base/foundation because implementing that "foundation" (versus a foundation with various patchworks in it [OTA's]) would include in itself whatever fix/reinforcement the bricks patched(cracked/broken/weak sections) [what the OTA's did] while establishing a complete whole unseparated-in-any-place base/foundation.
So, in the end, it's preferable to have a solid, whole, almost from-scratch Full Factory image firmware update than a circumstance of patching upon patching the way OTA's implement their updates.
Also, unless you update the device by OTA's from the OS and it's as simple as that (although it can take pretty long; upwards to seemingly 20 minutes) -- because you have an locked bootloader -- the only other way to install an OTA is sideloading it which means you have to download it to a computer, boot up the device in a certain way, and run a command on the computer; which is very similar and not too much different than what you would do if updating using a Full Factory image anyway -- download image (Full Factory instead of OTA), load up device in a certain way (bootloader/fastboot mode instead of recovery) and run a command (flash-all.bat instead of adb sideload .zip); one major difference is you must edit the flash-all.bat script so it doesn't delete user data and factory reset the device.
Sorry for the long explanation, but that is why IMHO it is more preferable to update using the Full Factory image than OTA...
alsansan said:
whats the difference between an destructive/non-destructive update?
Click to expand...
Click to collapse
Not a good choice of words ("non-destructive updates"). That's kinda redundant since most of us don't intend to lose anything when updating. fastboot has to be told to wipe or not so calling it non-destructive flashing would have made better sense.

Categories

Resources