FORUMS
Remove All Ads from XDA

[GUIDE][MODDED FIRMWARE][9.0.5][OP3/T]The least annoying 9.0.x firmware

4,954 posts
Thanks Meter: 10,434
 
Post Reply Email Thread
9.0.x Firmware update without loosing data

First we've assumed his thread is for users wanting to avoid relocking the bootloader, reformating and reencrypting or suffering from selinux isn't enforcing anymore after updating. Since more and more issues with upgrading from 5.0.x firmware to 9.0.x firmware have shown up recently, you should consider this: https://forum.xda-developers.com/one...7#post79827007

Avoid relocking and/or reformating/reencrypting

For avoiding reformating all these three requirements have to be met:
  1. The device has a 5.0.x bootloader and keymaster (this is the case, if you run OxygenOS 5.0.x, if you use a custom rom and flashed some 5.0.x firmware yourself or if you use a previous version of the firmware package provided in this thrread.
  2. The 5.0.x bootloader is unlocked.
  3. The device is encrypted (meaning: the userdata partition is encrypted; always keep in mind OxygenOS forces encryption of userdata, no matter if you set a secured boot passphrase).

If only one single of these three prerequisites in not met, this thread is not for you! Every direction, flashable zip package and help in this thread relies on the above setup!

Before processing further we need to know and accept some basic information on the bootloader and the keymaster:
  • If you just update the firmware from 5.0.x to 9.0.x and boot the above defined setup, your data is gone. It doesn't matter if you boot to recovery or system: your data is gone.
  • If you just downgrade the firmware from 9.0.x to 5.0.x on a system formated and encrypted with 9.0.x and boot, your data is gone. It doesn't matter if you boot to recovery or system: your data is gone.

To avoid this (and to be able to change between 9.0.x and 5.0.x firwmares and roms on the fly without loosing data), I've created firmware packages, which contain the complete 9.0.x firmware, but bootloader and keymaster. These are taken from OxygenOS 5.0.8.

General note: for sdcard-slot-less devices like Oneplus 3 and 3T I highly recommend a type-c usb stick for keeping backups, firmwares, roms etc.

OxygenOS
  1. flash official twrp-3.3.1-0 and reboot to recovery (you can skip this, if you already use twtp-3.3.1-0, of course)
  2. take a nandroid
  3. (dirty) flash OxygenOS 9.0.x rom's flashable zip
  4. without rebooting(!) flash
  5. without rebooting(!) flash twrp-3.3.1-0 again
  6. wipe cache and dalvik
  7. reboot to system and enjoy OxygenOS 9.0.x!

Custom roms
(not containing firmware - to my knowledge: all custom roms)
  1. flash official twrp-3.3.1-0 and reboot to recovery (you can skip this, if you already use twtp-3.3.1-0, of course)
  2. take a nandroid
  3. flash
  4. reboot to recovery
  5. (dirty) flash your preferred, 9.0.x firmware needing custom rom (if your rom doesn't need 9.0.x firmware, stay with 5.0.8)
  6. wipe cache and dalvik
  7. reboot to system and enjoy your custom rom

Getting selinux enforcing again

Prerequisites:
  1. your device runs 9.0.x firmware
  2. your device shows selinux is running in permissive mode or selinux is disabled

Just take a nandroid and flash the modded fw and reboot. If you get a decryption failure, format (not wipe!) data and resetup (either clean or from a nandroid).

Sidenote: keeping the 5.0.8 bootloader and keymaster is less then ideal. It's working for now - nobody knows which nice surprises future builds will have. Perhaps the future bootloaders don't require to be locked on encrypted userdata partition, which would mean we wouldn't expirience the 9.0.x-5.0.x barrier any more. If Oneplus keeps it the way it is now, a clean flash (including format and reencryption) is the way to go.

None of the above is really new. None of the above can't be found across other threads. Since it's ask over and over again, I thought it's a good idea to put it in one thread.

Happy flashing!

Firmware archive
The Following 66 Users Say Thank You to nvertigo67 For This Useful Post: [ View ] Gift nvertigo67 Ad-Free
19th June 2019, 09:14 PM |#2  
Member
Flag Gdynia
Thanks Meter: 12
 
More
Great news. I am just right now backing up my device and will test it soon big thumb up

WORKS LIKE A CHARM
Android Pie is on board and no data lost
The Following User Says Thank You to Globus.gd For This Useful Post: [ View ] Gift Globus.gd Ad-Free
20th June 2019, 12:04 PM |#3  
Senior Member
Flag Indore
Thanks Meter: 121
 
More
The release of Oxygen OS 9.0 created so many posts regarding data loss when choosing custom ROM. You have done a great job in saving the future posts regarding the firmware and data loss. Thanks buddy.
The Following User Says Thank You to sandeep_kumar For This Useful Post: [ View ] Gift sandeep_kumar Ad-Free
20th June 2019, 06:39 PM |#4  
Member
Thanks Meter: 7
 
More
Many thanks for this tutorial, worked flawlessly !
(coming from stock 5.0.3 with unlocked bootloader).

Currently testing this Pie build, seems to work without any problem and smoothly.... have to wait few days to confirm about battery drainage

I have a question : if a new 9.0.4 build is provided, will we have to repeat this procedure with the new flashable zip ?

Thank you !
The Following User Says Thank You to dapezzz For This Useful Post: [ View ] Gift dapezzz Ad-Free
20th June 2019, 06:56 PM |#5  
OP Senior Member
Thanks Meter: 10,434
 
Donate to Me
More
Quote:
Originally Posted by dapezzz

I have a question : if a new 9.0.4 build is provided, will we have to repeat this procedure with the new flashable zip ?

Thank you !

Yes. You want to keep 5.0.8 bootloader and keymaster.

Sidenote #1: keeping the 5.0.8 bootloader and keymaster is less then ideal. It's working for 9.0.2 and 9.0.3 - nobody knows which nice surprises 9.0.4 will have. Perhaps the 9.0.4 bootloader doesn't require to be locked on encrypted userdata partition, which would mean we wouldn't expirience the 9.0.x-5.0.x barrier any more. If Oneplus keeps it the way it is now, a clean flash (including format and reencryption) is the way to go.

Sidenote #2: I'll add sidenote #1 to OP.
The Following 2 Users Say Thank You to nvertigo67 For This Useful Post: [ View ] Gift nvertigo67 Ad-Free
21st June 2019, 04:38 AM |#6  
Senior Member
Flag Mumbai
Thanks Meter: 69
 
More
I am on OOs 5.0.4 with BluSpark TWRP, unlocked bootloader, rooted with Magisk and encrypted.
If i follow your method, can i upgrade without losing data? Or is a clean flash recommended?
Will the root and encryption remain after upgrade?
In the 9.0.3 thread there are many issues with this version. Is it better to wait for the next version?

Sent from my ONEPLUS A3003 using Tapatalk
21st June 2019, 09:44 AM |#7  
OP Senior Member
Thanks Meter: 10,434
 
Donate to Me
More
Quote:
Originally Posted by jesrani

I am on OOs 5.0.4 with BluSpark TWRP, unlocked bootloader, rooted with Magisk and encrypted.
If i follow your method, can i upgrade without losing data? Or is a clean flash recommended?
Will the root and encryption remain after upgrade?

Reread the OP, please. All of the above questions has been already answered in OP.

Quote:
Originally Posted by jesrani

In the 9.0.3 thread there are many issues with this version. Is it better to wait for the next version?

Sent from my ONEPLUS A3003 using Tapatalk

Which issues are you refering to? Which version are you refering to - oos or this package?

For the first: As clearly stated in OP: I don't know.

If the latter: the derp in packaging oxygenos-9.0.3-bl-km-5.0.8-firmware-3T.zip has been fixed within <12h after the issue report.
The Following 2 Users Say Thank You to nvertigo67 For This Useful Post: [ View ] Gift nvertigo67 Ad-Free
21st June 2019, 02:20 PM |#8  
Senior Member
Flag Mumbai
Thanks Meter: 69
 
More
Quote:
Originally Posted by nvertigo67

Reread the OP, please. All of the above questions has been already answered in OP.







Which issues are you refering to? Which version are you refering to - oos or this package?



For the first: As clearly stated in OP: I don't know.



If the latter: the derp in packaging oxygenos-9.0.3-bl-km-5.0.8-firmware-3T.zip has been fixed within <12h after the issue report.

Maybe it's there in OP but i couldn't understand. I don't know what is keymaster. As per point 2, this solution is for 5.0.8 unlocked bootloader but I am on 5.0.4.
Hence I am asking. Hope you can answer my query since I am not so technical and don't understand in depth.
Also, as I understand, this procedure is for wanting to dirty flash from 5.0.x to 9.0.x. If I want to clean flash, then should I follow 9.0.3 thread?
By issues I meant the various problems reported by users in the 9.0.3 thread. Is that because of improper flashing and whether using the OP procedure ensures trouble free 9.0.3 or is 9.0.3 still work in progress in which case is it better to wait for next version?

Sent from my ONEPLUS A3003 using Tapatalk
The Following 2 Users Say Thank You to jesrani For This Useful Post: [ View ] Gift jesrani Ad-Free
21st June 2019, 04:17 PM |#9  
OP Senior Member
Thanks Meter: 10,434
 
Donate to Me
More
Quote:
Originally Posted by jesrani

Maybe it's there in OP but i couldn't understand. I don't know what is keymaster. As per point 2, this solution is for 5.0.8 unlocked bootloader but I am on 5.0.4.

Quote:
Originally Posted by jesrani

I am on OOs 5.0.4 with BluSpark TWRP, unlocked bootloader, rooted with Magisk and encrypted. If i follow your method, can i upgrade without losing data?

This is answered in the OP by the bold first line:

Quote:
Originally Posted by nvertigo67

9.0.x Firmware update without loosing data

Quote:
Originally Posted by jesrani

Or is a clean flash recommended?

This is answered in OP. The recommended procedure for using the fw package for OOS, is:

Quote:
Originally Posted by nvertigo67

OxygenOS

  1. flash official twrp-3.3.1-0 and reboot to recovery (you can skip this, if you already use twtp-3.3.1-0, of course)
  2. take a nandroid
  3. (dirty) flash OxygenOS 9.0.x rom's flashable zip
  4. without rebooting(!) flash
  5. without rebooting(!) flash twrp-3.3.1-0 again
  6. wipe cache and dalvik
  7. reboot to system and enjoy OxygenOS 9.0.x!

As you can see, dirty flashing is part of the recommended procedure.

Quote:
Originally Posted by jesrani

Will the root and encryption remain after upgrade?

You can always relash a root package (if root persists depwnds on the support of the rom for addon.d, not on this package). The OP clearly states, that data persists. Since the encryption is unrevertable (you can only format to get rid of the encryption, persisting data on an encrypted partition implies that the encryption persists.

Quote:
Originally Posted by jesrani

Also, as I understand, this procedure is for wanting to dirty flash from 5.0.x to 9.0.x. If I want to clean flash, then should I follow 9.0.3 thread?

This is not the purpose of this package, but you can clean flash, of course. If you want to cleanflash anyway, you may want to consider, formating the complete data partition. It's not much more effort. But as stated: it will work.

Quote:
Originally Posted by jesrani

By issues I meant the various problems reported by users in the 9.0.3 thread. Is that because of improper flashing and whether using the OP procedure ensures trouble free 9.0.3 or is 9.0.3 still work in progress in which case is it better to wait for next version?

If you mean OxygenOS (and not fw packages) when just mentioning 9.0.3.: I don't know. I'm not involved in Oneplus' development.

Most of the problems with the fw update is a lack of reading, a lack of thinking or a combination of both.

Keymaster is a part of the firmware uswd for (among other functions) for encryption.

I hope all your questions are answered now.
The Following 4 Users Say Thank You to nvertigo67 For This Useful Post: [ View ] Gift nvertigo67 Ad-Free
22nd June 2019, 05:35 AM |#10  
Senior Member
Flag Mumbai
Thanks Meter: 69
 
More
Quote:
Originally Posted by nvertigo67

This is answered in the OP by the bold first line:





This is answered in OP. The recommended procedure for using the fw package for OOS, is:



As you can see, dirty flashing is part of the recommended procedure.



You can always relash a root package (if root persists depwnds on the support of the rom for addon.d, not on this package). The OP clearly states, that data persists. Since the encryption is unrevertable (you can only format to get rid of the encryption, persisting data on an encrypted partition implies that the encryption persists.



This is not the purpose of this package, but you can clean flash, of course. If you want to cleanflash anyway, you may want to consider, formating the complete data partition. It's not much more effort. But as stated: it will work.



If you mean OxygenOS (and not fw packages) when just mentioning 9.0.3.: I don't know. I'm not involved in Oneplus' development.

Most of the problems with the fw update is a lack of reading, a lack of thinking or a combination of both.

Keymaster is a part of the firmware uswd for (among other functions) for encryption.

I hope all your questions are answered now.

Thank you so much for the detailed answers. It is very helpful.

Sent from my ONEPLUS A3003 using Tapatalk
22nd June 2019, 08:44 PM |#11  
ciarpame's Avatar
Senior Member
Thanks Meter: 102
 
More
Great workaround to this annoying firmware upgrade issue, for me is good to go until Android Q (provided the trick continues to work for future updates) so I can avoid clean flashing for a while longer (just changed car tires, by the way).
I just wonder about step 4 in "custom ROM" guide section: I followed the instruction to the letter (and now I'm running LOS16 latest build without issues) but usually I never reboot between firmware flashing and ROM flashing, should I?
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes