Pixel 3a (Sargo) Treble Experimentations - Google Pixel 3a Guides, News, & Discussion

I wanted to create a discussion for flashing GSI's and experimentations with Treble on our Pixel 3a. If you're unfamiliar with GSI's and Treble, please check out the wiki and FAQ here. Not all GSI's run flawless on our device, as to be expected, there WILL BE bugs here and there. These methods will wipe userdata, so backup all of your important data before attempting to flash a GSI. Make damn sure you have a way to recover your device in case something goes wrong!
What you'll need:
Fastboot and ADB installed correctly.
Factory image for Sargo - get it here.
An unlocked bootloader.
A GSI to install.
(vbmeta.img / vendor.img can be extracted from our factory image.)
Auto install a GSI:
The Universal Auto GSI Installer by @zedomax works for our device with all the GSI's I have tried from XDA. His instructions and video tutorial is included in the thread. The script is very easy to set up and use to install a GSI.
Manually install a GSI:
Code:
From stock Android 10 or 11
Boot into fastboot, then to fastbootd:
$ fastboot reboot fastboot
Disable verify boot (AVB) by flashing vbmeta.img:
$ fastboot --disable-verification flash --slot all vbmeta vbmeta.img
Find your current slot:
$ fastboot getvar current-slot
Delete the product partition to free up space for the system partition (Current slot):
$ fastboot delete-logical-partition product_a
The postfix _a should match the slot ID from our last command.
Erase the system partition:
$ fastboot erase system
Flash the GSI:
$ fastboot flash system system.img
This will take a bit.
Now wipe userdata and reboot:
$ fastboot -w reboot
Other resources regarding flashing GSI's:
Google's instructions.
Known issues and releases.
Android 11 Installation and info, translate to read.

Reserved

Related

Going back to Stock

Hi!
I'm trying to go back to stock+locked rom.
I have seen instructions with a lot of steps, but when I downloaded the rom from googe developers page, i noticed there is a flash-all.sh file that seems to do all the process...
Is this safe?
Code:
fastboot flash bootloader bootloader-mako-makoz10o.img
fastboot reboot-bootloader
sleep 5
fastboot flash radio radio-mako-m9615a-cefwmazm-2.0.1700.48.img
fastboot reboot-bootloader
sleep 5
fastboot -w update image-occam-jdq39.zip
I don't want to brick the phone
Guide by efrant:
D. Type in the commands into the command prompt
1) Make sure your computer recognizes your device by typing: fastboot devices
2) Unlock your bootloader (if you have not already done so): fastboot oem unlock
3) You will see a prompt on your device. This will wipe your entire device (including the /sdcard folder). Accept. Note: you use the volume keys to change the option and the power button to accept. You cannot use the touch screen.
4) Reboot by typing: fastboot reboot-bootloader
5) Flash the bootloader: fastboot flash bootloader bootloader-mako-makoz10l.img (or whatever the name of the bootloader image that you downloaded).
6) Reboot: fastboot reboot-bootloader
7) Flash the radio: fastboot flash radio radio-mako-m9615a-cefwmazm-2.0.1700.33.img (or whatever the name is of the radio image that you downloaded).
8) Reboot: fastboot reboot-bootloader
9) Flash the system partition: fastboot flash system system.img
10) Optional (NOT optional for n00bs) -- Flash the data partition: fastboot flash userdata userdata.img Note: this command will wipe your device (including /sdcard), EVEN if your bootloader is already unlocked. See note 2 below.
11) Flash the kernel/ramdisk: fastboot flash boot boot.img
12) Optional (NOT optional for n00bs) -- Flash the recovery partition: fastboot flash recovery recovery.img
13) Erase the cache partition: fastboot erase cache
14) Reboot: fastboot reboot
15) Done! The first boot will likely take quite a bit longer than you are used to, as Android builds the Dalvik cache.
Now you have a fully stock image on your device. The only thing that is different from out-of-the-box condition is that your bootloader is unlocked. See the notes section at the end of this post for information on re-locking the bootloader.
You have to unpack the system.image file as you can only flash .img files in fastboot. What`s with the sleep 5?
Good luck.
I've seen some youtube tutos that use that .sh file and it does flash the .zip with fastboot......
That's why I ask, I mean: The previous thread, which i already read before, is like a step-by-step process, when this .sh file would do it all for you!!
The sleep command gives 5 seconds of grace time for the device to reboot.....
GFXi0N said:
I've seen some youtube tutos that use that .sh file and it does flash the .zip with fastboot......
That's why I ask, I mean: The previous thread, which i already read before, is like a step-by-step process, when this .sh file would do it all for you!!
The sleep command gives 5 seconds of grace time for the device to reboot.....
Click to expand...
Click to collapse
Haven`t used that method myself, but if you think it will work go ahead
WOrst case scenario, the console woud throw me out to the command prompt and I would have to do it by hand......

[HOW TO] Root, Flash TWRP & Install busybox in YUOS Official - Android 6.0.1 Build

[HOW TO] Root, Flash TWRP & Install busybox in YUOS Official - Android 6.0.1 Build
First Flash YUOS from here
How to flash YUOS.
Flash images with Fastboot
Code:
Execute below commands in terminal
Connect device in fastboot mode
adb reboot bootloader
Check if device is detecting in fastboot mode
fastboot -i 0x1ebf devices
Unlock bootloader fastboot -i 0x1ebf oem unlock
Format User data
fastboot -i 0x1ebf format userdata
Flash kernel
fastboot -i 0x1ebf flash boot boot.img
Flash recovery
fastboot -i 0x1ebf flash recovery recovery.img
Flash system partition
fastboot -i 0x1ebf flash system system.img
Flash data partition
fastboot -i 0x1ebf flash userdata userdata.img
Reboot device
fastboot -i 0x1ebf reboot
WARNING: The stock boot image has dm-verity, which prevents you from booting if you swipe to enable system modifications!
Follow YU bootloader unlocking instructions here before you begin!
Download the latest TWRP .img for your device from twrp.me.
Use the same fastboot tool you downloaded in theYU unlock instructions to flash TWRP using the command:
fastboot flash recovery twrp-x.x.x-x.img
Click to expand...
Click to collapse
* Replace x.x.x-x with the actual version you are flashing!
Now you can either power off your phone and boot into recovery using the button combo [Volume Down] + [Power], or you can run this command in fastboot:
fastboot boot twrp-x.x.x-x.img
Click to expand...
Click to collapse
1. At this point, you will see the TWRP splash and reach a screen asking you if you want to allow system modifications.
By swiping right, you will trigger dm-verity, and if you don't follow step 4 you will be unable to boot!
If you are going to root your device or follow the rest of these steps, then it is safe to swipe right and enable modifications.
2. Only if you want internal storage or data to work in TWRP:
Go to [Wipe] -> [Format Data] (not advanced wipe) -> type "yes".WARNING: This will wipe your internal storage, disable encryption, and factory reset your phone!
Go to [Reboot] -> [Recovery].
3. Please consider backing up your stock boot partition in TWRP before proceeding to te next steps!
4. If you want to be rooted with SuperSU:
Download the latest SuperSU by Chainfire. OR Flash through TWRP this file.
Without exiting TWRP, transfer the SuperSU zip to your device over MTP* and flash it using [Install] in TWRP.-or-
If you only want a bootable system partition or writable data in TWRP:
Download dm-verity and force encryption disabler.
Without exiting TWRP, transfer no-verity-opt-encrypt.zip to your device over MTP* and flash it using [Install] in TWRP.
Go to [Reboot] -> [System].
Wait 2-5 minutes for your device to finish setting itself up.
To install busybox flash through TWRP this file >>>> this is recommended.
After rebooting to TWRP it will not ask for any password.
Took help from here & @h2o64 for guiding me.
This has been tried & tested by me on yureka.
Suggestions welcomed
YU FORUMS link
one million thank yous
thank you so much
I can confirm this is working on my moto e3 ( non-power )
keep doing what your doing you really helped
now I can get down to business with some cool root modifications!!!
Can we use Magisk instead of supersu.

[ROM][STOCK][FASTBOOT][OP8] Stock Fastboot ROMs for OnePlus 8

Things are changing with the advent of project treble and seamless updates. OnePlus will no longer release ROMs flashable via recovery (either stock) because is no more needed. The updates will be done on the slot not used for example if you are using slot a the update will be installed on slot b and the slot b will be set as default. If you brick and you are in bootloop how you can restore the rom? You can't with Stock ROM you have, because the zip can be only installed via Update Engine, so what can you do? Flash a stock rom via fastboot. I have extracted all images from the stock zip and i have made a new zip with the Fastboot ROM with a flash-all.bat included. This will work only if your bootloader is unlocked. This will erase all your data and will wipe your internal storage.
HOW TO FLASH
This version is only for not branded devices
Download the zip;
Unpack the zip in a folder;
Reboot the OnePlus 8 in fastboot-bootloader mode (Power and volume + and volume-);
Connect the OnePlus 8 to PC;
Run flash-all.bat flasher you need;
Wait until the process end;
The phone will automatically reboot.
DOWNLOAD
All roms on Sourceforge: https://sourceforge.net/projects/fastbootroms/files/OnePlus 8
BRANDED PHONE
For now branded device are not supported
MANUAL FLASH: Windows - OSX - Linux
If you want to manual flash these roms these are the commands (You need the latest sdk platform tools, you can find it here
Is reccomended to format data or the rom cannot boot:
Code:
fastboot -w
Others Commands to flash a fastboot rom
Code:
fastboot flash aop aop.img
fastboot flash bluetooth bluetooth.img
fastboot flash boot boot.img
fastboot flash dsp dsp.img
fastboot flash dtbo dtbo.img
fastboot flash LOGO LOGO.img
fastboot flash modem modem.img
fastboot flash oem_stanvbk oem_stanvbk.img
fastboot flash qupfw qupfw.img
fastboot flash storsec storsec.img
fastboot flash multiimgoem multiimgoem.img
fastboot flash uefisecapp uefisecapp.img
fastboot flash recovery recovery.img
fastboot --disable-verity flash vbmeta vbmeta.img
fastboot --disable-verity flash vbmeta_system vbmeta_system.img
fastboot flash opproduct opproduct.img
fastboot reboot fastboot
fastboot flash system system.img
fastboot flash vendor vendor.img
fastboot flash product product.img
fastboot reboot
REMEMBER
"Invalid sparce file format at header magic" is not an error, you need to wait a bit when you see that string, just wait.
If the device automatically reboot in Stock Recovery mode don't reboot it and wait the flash end.
These ROMs can't be used to update or downgrade your phone but just to restore your phone.
If the rom seems doesn't start go in recovery stock and follow this guideline: English -> Wipe data and cache -> Erase everything.
If you want to rebrand your phone from HydrogenOS to OxygenOS you can follow this guide: Rebrand Guide
If you want you can use also my tool to flash Factory Images, unlock bootloader, flash twrp or to understand if the device is recognized: https://toolaio.tk/
If you got some problems like write error or no partition, check this: https://forum.xda-developers.com/showpost.php?p=76658555&postcount=34
DONATE LINK
If you want to support this and others my projects please consider making a donation, thanks.
​
Branded devices is for example a Chinese version with HydrogenOS to which OxigenOS has been installed? If so, how can a branded device be recovered?
Thanks
Hi guys, i'm here again to ask for your support, actually with android 10 Google introduced a lot of changing, from dynamic partitions to the new keymaster 4 encryption/decryption. Teamwin is working hard to update TWRP but they will still take some time. Currently some things already work but there are difficulties in bringing them to the OnePlus 8/8 Pro, for example decryption already works but creates some problems on the OnePlus devices. That's why I decided to create a Paypal moneybox to be able to bring you the latest updates in the shortest time possible. As I have previously done, I assure you of a support of at least 2 years (within the limits of my possibilities). In addition to the TWRP I will improve the fastboot roms and add OnePlus 8/8 Pro to my TOOL ALL IN ONE (and maybe I will also bring the RevengeOS). By getting hold of a OnePlus 8 or 8 Pro I will also be able to improve the TWRP for OnePlus 7T and 7T Pro.
OnePlus 8/8 Pro PayPal MoneyBox: https://www.paypal.com/pools/c/8pfrIOL3Qa
If you are unable to participate in the PayPal moneybox, you can make a normal donation (perhaps specifying that it is for the moneybox), however all private donations that I will receive for this or other projects will be included in the moneybox.
Private PayPal Donations: https://www.paypal.me/MauronofrioTool
Why after flash it, it boot up to Qualcomm crashdump mode and how to fix?
sakun-ice said:
Branded devices is for example a Chinese version with HydrogenOS to which OxigenOS has been installed? If so, how can a branded device be recovered?
Thanks
Click to expand...
Click to collapse
I think unbranded devices mean the device bought from T-Mobile or Verizon. Nothing to do with chinese versiion flash oxygenOS, if I'm not wrong.
Can't seem to get this to work. I'm trying to flash a stock rom for my OnePlus 8 after bricking it during a rooting process.
The device' bootloader is obviously unlocked and i can get the phone into Fastboot mode and connected to my PC.
The only issue is when i execute the flash-all.bat file, it can't seem to flash any of the files and gives an error consisting of the message "FAILED (remote: 'Flashing is not allowed for Critical Partitions').
What to do guys? Can anyone help me out.
Does anyone know where to find mobile oneplus 8 5g tmobile from mine is bricked I had same error as post above
KJStar said:
Can't seem to get this to work. I'm trying to flash a stock rom for my OnePlus 8 after bricking it during a rooting process.
The device' bootloader is obviously unlocked and i can get the phone into Fastboot mode and connected to my PC.
The only issue is when i execute the flash-all.bat file, it can't seem to flash any of the files and gives an error consisting of the message "FAILED (remote: 'Flashing is not allowed for Critical Partitions').
What to do guys? Can anyone help me out.
Click to expand...
Click to collapse
Try to flash fastboot rom with "tool all in one),It worked for me.
I needed modem I forgot to fastboot reboot fastboot guy in post 6 that's all you need to do is reboot fastboot then flash all I was looking for different file
Never mind I fixed it by downloading ota and going to system updates in settings because fastboot won't flash to modem right
I am having issues flashing. flashing not allowed on critical partition. please help I tried to use the large address aware program but nothing has changed.
bluemoel said:
I am having issues flashing. flashing not allowed on critical partition. please help I tried to use the large address aware program but nothing has changed.
Click to expand...
Click to collapse
Make sure your on the latest update: 10.5.8
mauronofrio said:
Things are changing with the advent of project treble and seamless updates. OnePlus will no longer release ROMs flashable via recovery (either stock) because is no more needed. The updates will be done on the slot not used for example if you are using slot a the update will be installed on slot b and the slot b will be set as default. If you brick and you are in bootloop how you can restore the rom? You can't with Stock ROM you have, because the zip can be only installed via Update Engine, so what can you do? Flash a stock rom via fastboot. I have extracted all images from the stock zip and i have made a new zip with the Fastboot ROM with a flash-all.bat included. This will work only if your bootloader is unlocked. This will erase all your data and will wipe your internal storage.
HOW TO FLASH
This version is only for not branded devices
Download the zip;
Unpack the zip in a folder;
Reboot the OnePlus 8 in fastboot-bootloader mode (Power and volume + and volume-);
Connect the OnePlus 8 to PC;
Run flash-all.bat flasher you need;
Wait until the process end;
The phone will automatically reboot.
DOWNLOAD
All roms on Sourceforge: https://sourceforge.net/projects/fastbootroms/files/OnePlus 8
BRANDED PHONE
For now branded device are not supported
MANUAL FLASH: Windows - OSX - Linux
If you want to manual flash these roms these are the commands (You need the latest sdk platform tools, you can find it here
Is reccomended to format data or the rom cannot boot:
Code:
fastboot -w
Others Commands to flash a fastboot rom
Code:
fastboot flash aop aop.img
fastboot flash bluetooth bluetooth.img
fastboot flash boot boot.img
fastboot flash dsp dsp.img
fastboot flash dtbo dtbo.img
fastboot flash LOGO LOGO.img
fastboot flash modem modem.img
fastboot flash oem_stanvbk oem_stanvbk.img
fastboot flash qupfw qupfw.img
fastboot flash storsec storsec.img
fastboot flash multiimgoem multiimgoem.img
fastboot flash uefisecapp uefisecapp.img
fastboot flash recovery recovery.img
fastboot --disable-verity flash vbmeta vbmeta.img
fastboot --disable-verity flash vbmeta_system vbmeta_system.img
fastboot flash opproduct opproduct.img
fastboot reboot fastboot
fastboot flash system system.img
fastboot flash vendor vendor.img
fastboot flash product product.img
fastboot reboot
REMEMBER
"Invalid sparce file format at header magic" is not an error, you need to wait a bit when you see that string, just wait.
If the device automatically reboot in Stock Recovery mode don't reboot it and wait the flash end.
These ROMs can't be used to update or downgrade your phone but just to restore your phone.
If the rom seems doesn't start go in recovery stock and follow this guideline: English -> Wipe data and cache -> Erase everything.
If you want to rebrand your phone from HydrogenOS to OxygenOS you can follow this guide: Rebrand Guide
If you want you can use also my tool to flash Factory Images, unlock bootloader, flash twrp or to understand if the device is recognized: https://toolaio.tk/
If you got some problems like write error or no partition, check this: https://forum.xda-developers.com/showpost.php?p=76658555&postcount=34
DONATE LINK
If you want to support this and others my projects please consider making a donation, thanks.
​
Click to expand...
Click to collapse
Hi, do you know if patching with local update a Oxygen OS Europe release from a Global release may cause problems to the fingerprint? I have a IN2010 with the Global OxygenOS but I would like to switch to the European versione becasue I live in Italy like you
Why not flash reserve.img?
nnyd said:
Why not flash reserve.img?
Click to expand...
Click to collapse
Because it is placed in userdata and not in a dedicated partition
I have an issue trying to flash on fastboot. It's says I can't flash on critical partitions. Yes I know alot of people are saying that but what I haven't seen is this:
This is my problem:
Fastboot get device-info
(Bootloader) device unlocked:true
(Bootloader) device critical unlock: false
(Bootloader) charger screen enabled: true
I have already tried "fastboot flashing unlock_critical"
It says bootloader already unlocked. I then re lock bootloader which I know is not a good idea( reflash stock with msm tool) and it lock then I try unlock critical command again and it still says device critical unlock: false
i need help please ..
i tried this method not the latest version i tried the 10.5.4 global
so it gave me all failed and error to foramt and others
then it restart my phone to show me crashdump
what should i do ?
should i use latest version ?
i hope you replay fast .. thank you
Alucardo1 said:
i tried this method not the latest version i tried the 10.5.4 global
so it gave me all failed and error to foramt and others
then it restart my phone to show me crashdump
what should i do ?
should i use latest version ?
i hope you replay fast .. thank you
Click to expand...
Click to collapse
Try again with 10.5.7. When it reboot to recovery, let it continue to run till it reboots on its own.
Unbrick from fastboot method
I hope I can help someone since I spent the whole night trying various methods to unbrick my Oneplus 8 and only this one worked for me JUST FOR INTERNATIONAL VERSION
You must have the drivers installed (Adb & Fastboot)
You must have your phone with the bootloader unlocked
1.- Download the file
2.-Unzip it
inside you will find Flash-all.bat
3.-Enter Fastboot mode
4.-Double click on the Flash-all.bat command
5.-It will direct you to the recovery, select the English language and restart in fastboot mode so that the process continues, wait for it to finish flashing everything and ready, the phone restarts on the latest version
https://mega.nz/folder/8tpUSSrR#7wH4NX_ccr2a6Ub8LXpsEA
Donate Link to support my work
https://paypal.me/pakomorales?locale.x=es_XC
cannot relock bootloader on oneplus 8
bro thanks for fastboot room for oneplus 8,i flash your fastboot room 10.5.9 everthing ok,but i relocked to boot loader it the phone be correpted. what should i do ,
please help me.

Moto G7 and... Ubuntu Touch GSI

Maybe it isn't a right place to ask for it, however, I saw that erfanoabdi made an Ubuntu Touch GSI and also a halium-boot port for river. Maybe it's a silly question, but it is possible to just simply install this GSI (or maybe semi-GSI, because it requires halium port) on river and boot it? There's a simple guide for installing this GSI or any device which has a halium port, here it is:
0) Install treble compatible android 9 rom
1) FORMAT data in twrp
2) Flash halium-boot.img of your device
3) Flash GSI zip (I think I can't give a link here, it is allowed?)
So can it theoretically work? I tried it, but unfortunately I saw just blank screen after booting.
don't format data before LOS16
HueyT said:
don't format data before LOS16
Click to expand...
Click to collapse
So, I should:
1. Flash LOS 16 without formatting data (I'm on Android 10)
2. Format data
3. Flash halium boot
4. Flash UBports GSI
I'll try that but I don't think it's a data problem, because I've already tried it and the zip was successfully installed - files it should copy were copied on data partition, I've checked this. But I'll try once more, without formatting data. Should I boot lineage after flashing?
Yeah, so I followed this and it worked. Thanks!
If anyone had the same problem, I'll write down all what I did:
0. Temporarily booted TWRP and installed it via zip (twrp-3.3.1-14-river)
1. Installed LOS 16 (lineage-16.0-20200127-UNOFFICIAL-river) without formatting data.
2. Booted LOS but it rebooted as the data wasn't formatted and i kept it booting until it booted into LOS Recovery to format data, so I just rebooted phone without formatting data and installed TWRP as in step 0.
3. Flashed halium-boot as boot image in TWRP and installed UBports installed v5 zip, also in TWRP of course.
4. Rebooted phone.
5. Now Ubuntu Touch booted succesfully. Unfortunately, it reboots after about 1 minute. So it's not stable enough at this time. Or maybe I'm doing something wrong, I'll try also another vendor image.
EDIT: I've just tried another vendor.img from newer LOS16 build. Worked fine, but sim doesn't work
Nick_Nicker said:
Maybe it isn't a right place to ask for it, however, I saw that erfanoabdi made an Ubuntu Touch GSI and also a halium-boot port for river. Maybe it's a silly question, but it is possible to just simply install this GSI (or maybe semi-GSI, because it requires halium port) on river and boot it? There's a simple guide for installing this GSI or any device which has a halium port, here it is:
0) Install treble compatible android 9 rom
1) FORMAT data in twrp
2) Flash halium-boot.img of your device
3) Flash GSI zip (I think I can't give a link here, it is allowed?)
So can it theoretically work? I tried it, but unfortunately I saw just blank screen after booting.
Click to expand...
Click to collapse
Did it occur to you to maybe link to what you're talking about? Where is this halium-boot port for River you're talking about? I see nothing in the main GSI thread about anything but the G7 Power. No results on google for halium-boot river or halium river point to anything but this thread, so I have no idea what you could possibly mean.
Check on https://build.lolinet.com/file/halium/
Here you can find GSI and halium-boot images from Erfan. He also posted it on XDA, here you can find all information about it: https://forum.xda-developers.com/pr...development/gsi-ubuntu-touch-ubports-t4110581
So, halium-boot.img is found on build.lolinet.com
But you can also build Halium 9 image if your device's kernel source is available, here's some info https://github.com/ubports/porting-notes/wiki/Generic-system-image-(GSI)#how-to-install-gsi
Also it's very important to have Android 9 ROM installed before. However, stock Android 9 didn't work for me, I prefer LineageOS. So, just install Lineage and then the GSI and halium boot image. For Moto G7 also flash 'river-firmwares.zip' found on lolinet. It'll fix that weird vibration noise bug. For now, there are some visual glitches visible (also only on river), but it'll be fixed. Anbox is working if you have /data partition formatted in ext4 (not f2fs), so if you follow instructions, you can also run some Android apps. Unfortunately, for me internet connection inside Anbox doesn't work.
Thanks sorry I was just starting to feel a bit insane, that stuff is not indexed on google at all by the looks of it. Thank you.
So here is the process that worked for me.
I started with the stock rom.
1. Followed the full Lineage OS install instructions, including the partitions zip etc.
2. Installed Lineage OS on Slot B per the above instructions
3. Wiped data
4. Flash halium-boot.img
5. Flash GSI zip
Everything works perfectly including cellular functionality.
Followed the steps above. Is it possible to revert?
I followed the steps above, but I am have serious issues with the screen jitter. I have been looking all over the place to see if there is a way to revert back to android so that I can use my phone without the screen jitter. Does any one have any instructions on how to do this? I did turn on ADB mode on Ubuntu Touch but my computer does not see an adb device. Thank for any help.
Took me a long time to figure out too.
Main thing is, if you hold down Power and Volume Down, eventually it will reboot to the boot menu. Don't select anything, just plug it in, and you'll have fastboot.
To go back to stock:
1. Hold down Power and Volume till the boot menu shows up.
2. Plug the phone into your PC
3. Get the newest firmware for your phone model. I bought mine at Best Buy, so it was RETUS aka retail US. https://mirrors.lolinet.com/firmware/moto/river/official/
4. Extract the archive, and enter that folder in your terminal
5. Run the following commands from that folder. I saved these commands in a shell script and ran it but I think you can just paste it
THIS WILL WIPE ANY DATA ON YOUR PHONE AND PUT IT BACK TO FULL FACTORY FIRMWARE WITH LOCKED BOOT LOADER. At least when I ran it, it got my phone 100% no more complaints when it boots about untrusted code. After this you should have a fresh phone you can unlock and try flashing again. THis also restored my OTA ability and I was able to get the Android 10 update without any issues.
fastboot oem lock begin
fastboot oem fb_mode_set
fastboot flash partition gpt.bin
fastboot flash bootloader bootloader.img
fastboot flash modem NON-HLOS.bin
fastboot flash fsg fsg.mbn
fastboot erase modemst1
fastboot erase modemst2
fastboot flash dsp adspso.bin
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash dtbo dtbo.img
fastboot flash system system.img_sparsechunk.0
fastboot flash system system.img_sparsechunk.1
fastboot flash system system.img_sparsechunk.2
fastboot flash system system.img_sparsechunk.3
fastboot flash system system.img_sparsechunk.4
fastboot flash system system.img_sparsechunk.5
fastboot flash system system.img_sparsechunk.6
fastboot flash system system.img_sparsechunk.7
fastboot flash system system.img_sparsechunk.8
fastboot flash system system.img_sparsechunk.9
fastboot flash system system.img_sparsechunk.10
fastboot flash system_b system_b.img_sparsechunk.0
fastboot flash system_b system_b.img_sparsechunk.1
fastboot flash system_b system_b.img_sparsechunk.2
fastboot flash vendor vendor.img_sparsechunk.0
fastboot flash vendor vendor.img_sparsechunk.1
fastboot flash vendor vendor.img_sparsechunk.2
fastboot flash oem oem.img
fastboot flash oem_b oem_other.img
fastboot erase userdata
fastboot erase DDR
fastboot oem fb_mode_clear
fastboot oem lock
fastboot oem lock
fastboot oem lock
fastboot flash boot boot.img
fastboot flash system system.img_sparsechunk.0
fastboot flash system system.img_sparsechunk.1
fastboot flash system system.img_sparsechunk.2
fastboot flash system system.img_sparsechunk.3
fastboot flash system system.img_sparsechunk.4
fastboot flash system system.img_sparsechunk.5
fastboot flash system system.img_sparsechunk.6
fastboot flash system system.img_sparsechunk.7
fastboot flash system system.img_sparsechunk.8
fastboot flash system system.img_sparsechunk.9
fastboot flash system system.img_sparsechunk.10
fastboot flash oem oem.img
fastboot oem lock
Click to expand...
Click to collapse

[GUIDE] Unbrick or restore to OOS using only fastboot

This guide will only work up to OOS 11.
This guide is for users that can't or just don't want to download MsmDownloadTool. Linux users especially, since the tool is not available for linux. All you need is a recent version of android tools with a fastboot capable of executing fastboot reboot fastbootd.
To start, download the appropriate Oxygen OS zip for your device from the OP8T repo thread. Extracting the zip file should give you a file named
payload.bin.
Use payload dumper to extract payload.bin.
You can grab payload_dumper from here (Windows and macOS), here (linux), or here (github, any OS).
For the download link from github, make sure you're running python 3.6 or higher. Run payload dumper with:
python payload_dumper.py payload.bin
The image files will be extracted to a folder named output.
Before starting the flashing process, you can check your device memory type using the DevCheck app by flar2 or with the command adb shell getprop ro.boot.ddr_type. The adb command will return 0 for LPDDR4X chips and 1 for LPDDR5 chips. This is important to flash the right xbl img files. LPDDR4X is more common for OP8T, so no worries if you miss this step.
You can start flashing from the standard bootloader or fastbootd. The first three lines below will flash the stock recovery then reboot into fastbootd.
Code:
fastboot flash recovery recovery.img
fastboot flash boot boot.img
fastboot flash dtbo dtbo.img
fastboot reboot fastboot
fastboot flash --slot=all recovery recovery.img
fastboot flash --slot=all boot boot.img
fastboot flash --slot=all dtbo dtbo.img
fastboot flash --slot=all abl abl.img
fastboot flash --slot=all aop aop.img
fastboot flash --slot=all bluetooth bluetooth.img
fastboot flash --slot=all cmnlib64 cmnlib64.img
fastboot flash --slot=all cmnlib cmnlib.img
fastboot flash --slot=all devcfg devcfg.img
fastboot flash --slot=all dsp dsp.img
fastboot flash --slot=all featenabler featenabler.img
fastboot flash --slot=all hyp hyp.img
fastboot flash --slot=all imagefv imagefv.img
fastboot flash --slot=all keymaster keymaster.img
fastboot flash --slot=all logo logo.img
fastboot flash --slot=all mdm_oem_stanvbk mdm_oem_stanvbk.img
fastboot flash --slot=all modem modem.img
fastboot flash --slot=all multiimgoem multiimgoem.img
fastboot flash --slot=all qupfw qupfw.img
fastboot flash --slot=all spunvm spunvm.img
fastboot flash --slot=all storsec storsec.img
fastboot flash --slot=all tz tz.img
fastboot flash --slot=all uefisecapp uefisecapp.img
If your phone has the LPDDR4X memory chip (returned 0 with the adb shell command above), flash the images below:
Code:
fastboot flash --slot=all xbl_config xbl_config.img
fastboot flash --slot=all xbl xbl.img
LPDDR4X is the more common chip for OP8T, so if you forgot to check, you can flash this.
If your phone has the LPDDR5 chip (returned 1 with the adb shell command above), flash the images below:
Code:
fastboot flash --slot=all xbl_config xbl_config_lp5.img
fastboot flash --slot=all xbl xbl_lp5.img
This next section will clear the super partition (contains odm, system, system_ext, vendor and product). It's not absolutely necessary, so you can skip to the next step. Clearing the super partition will help avoid the following error, which can come up if you had manually flashed ROMs on both slots previously.
Code:
Resizing '<partition name>' FAILED (remote: 'Not enough space to resize partition')
Example: Resizing 'product' FAILED (remote: 'Not enough space to resize partition')
If you've ever had this error or you just want to be sure that everything is cleared, check the spoiler.
Spoiler
Before deleting, you can check the names of the logical partitions on your phone using fastboot getvar all. Scroll up to the section that looks like this:
Code:
(bootloader) is-logical:odm_a:yes
(bootloader) is-logical:product_a:yes
(bootloader) is-logical:system_a:yes
(bootloader) is-logical:system_ext_a:yes
(bootloader) is-logical:vendor_a:yes
or
(bootloader) is-logical:odm_b:yes
(bootloader) is-logical:product_b:yes
(bootloader) is-logical:system_b:yes
(bootloader) is-logical:system_ext_b:yes
(bootloader) is-logical:vendor_b:yes
As @Matt85m pointed out, you may also have:
Code:
(bootloader) is-logical:odm:yes
(bootloader) is-logical:product:yes
(bootloader) is-logical:system:yes
(bootloader) is-logical:system_ext:yes
(bootloader) is-logical:vendor:yes
It is also possible to have logical partitions with the same names ending in -cow (system_a-cow, system_b-cow, system_ext_b-cow, vendor_a-cow, product_b-cow, etc).
These are created by various ROMs during an OTA. Shout out to @mslezak for the discovery.
Delete everything with the commands below:
Code:
fastboot delete-logical-partition odm
fastboot delete-logical-partition system
fastboot delete-logical-partition system_ext
fastboot delete-logical-partition product
fastboot delete-logical-partition vendor
fastboot delete-logical-partition odm_a
fastboot delete-logical-partition odm_b
fastboot delete-logical-partition system_a
fastboot delete-logical-partition system_b
fastboot delete-logical-partition system_ext_a
fastboot delete-logical-partition system_ext_b
fastboot delete-logical-partition product_a
fastboot delete-logical-partition product_b
fastboot delete-logical-partition vendor_a
fastboot delete-logical-partition vendor_b
Delete any -cow partitions with the same command:
Code:
fastboot delete-logical-partition system_a-cow
and so on.
If you get an error deleting the -cow partitions, @firegate22 suggests changing slots from the bootloader (fastboot --set-active=a or b) not from fastbootd, then return to fastbootd and try the delete command again.
All logical partitions can be deleted to free up space in the super partition.
Recreate partitions a and b with the commands below.
Code:
fastboot create-logical-partition odm_a 100000
fastboot create-logical-partition odm_b 100000
fastboot create-logical-partition system_a 100000
fastboot create-logical-partition system_b 100000
fastboot create-logical-partition system_ext_a 100000
fastboot create-logical-partition system_ext_b 100000
fastboot create-logical-partition product_a 100000
fastboot create-logical-partition product_b 100000
fastboot create-logical-partition vendor_a 100000
fastboot create-logical-partition vendor_b 100000
Flash the rest of the images.
Code:
fastboot flash odm odm.img
fastboot flash system system.img
fastboot flash system_ext system_ext.img
fastboot flash product product.img
fastboot flash vendor vendor.img
fastboot flash --slot=all vbmeta vbmeta.img
fastboot flash --slot=all vbmeta_system vbmeta_system.img
Assuming everything flashes with no errors, return to recovery, do a factory reset and reboot.
I like what you're proposing. I've been thinking along these lines also.
Would you mind explaining why you're flashing to both slots rather than just the inactive one?
If you leave the current slot untouched you have a fallback position (the whole point of having A/B partitioning).
The same question applies to the flashing/deleting of the dynamic partitions in super.
BillGoss said:
I like what you're proposing. I've been thinking along these lines also.
Would you mind explaining why you're flashing to both slots rather than just the inactive one?
If you leave the current slot untouched you have a fallback position (the whole point of having A/B partitioning).
The same question applies to the flashing/deleting of the dynamic partitions in super.
Click to expand...
Click to collapse
For this guide specifically, the idea is to return as close to stock as possible. Wiping everything and replacing with OOS would be the best way to do that.
More generally, other than boot.img and recovery.img, the images flashed on both slots in the first part are the firmware files. You can grab and flash them from pretty much any new OOS version to update the firmware without affecting the installed ROMs. The specific files for the ROM are all in the third part. If you extract the payload.bin for any custom ROM, those are usually the only image files included.
You can certainly run two different firmware versions on the two slots, but if the inactive slots are empty or contain much older firmware, you can end up with weird issues in the active slots (usually a boot loop but could be more or less serious). Keeping the versions close is just to avoid unnecessary issues.
Some custom ROMs for OP8T like Lineage recommend or insist on flashing the copy-partitions.zip package for this reason. It's also why the install instructions for older A/B phones that have TWRP generally begin with "flash the stock ROM on both slots" - only the firmware files are strictly necessary, so you can keep the fallback ROM on the other slot if you want to.
That ended up much longer than planned. Hope it answers your questions though!
I'm going through this process rn, and I figured I'd ask here. How long does it usually take to flash dsp? It's been over 20 minutes of Sending 'dsp_a' (65536 KB)
65 M looks pretty big, and that's maybe the max size? How long did it take for you?
edit: seems to be unrelated to size as the modem part went fine, and that's bigger
No go, next step : fastboot reboot fastboot enter QDLoader mode
nero075 said:
I'm going through this process rn, and I figured I'd ask here. How long does it usually take to flash dsp? It's been over 20 minutes of Sending 'dsp_a' (65536 KB)
65 M looks pretty big, and that's maybe the max size? How long did it take for you?
edit: seems to be unrelated to size as the modem part went fine, and that's bigger
Click to expand...
Click to collapse
Did you figure this out? Flashing dsp should only take a couple seconds.
coomac said:
Did you figure this out? Flashing dsp should only take a couple seconds.
Click to expand...
Click to collapse
I ended up just skipping that one, and it turned out fine ¯\_(ツ)_/¯
Full time Linux user here, glad to see this guide after few days looking for a way to go back to stock without Msmtool.
However I do have some question, is it possible to have a OTA update from Oneplus if I go back to stock using this method and re-lock my bootloader?
mrhieu059 said:
Full time Linux user here, glad to see this guide after few days looking for a way to go back to stock without Msmtool.
However I do have some question, is it possible to have a OTA update from Oneplus if I go back to stock using this method and re-lock my bootloader?
Click to expand...
Click to collapse
Shouldn't be a problem. I was able to install an OTA update after returning to stock using this method with no issues even without relocking my bootloader.
thanks for this helped me alot to restore my device, i have one question though i checked all the commands and i see there might be one command missing, when i extracted the rom i checked all the img files and saw :
xbl_lp5.img
xbl_config_lp5.img
cant help wonder if i have to input the commands as well
rdlr19 said:
thanks for this helped me alot to restore my device, i have one question though i checked all the commands and i see there might be one command missing, when i extracted the rom i checked all the img files and saw :
xbl_lp5.img
xbl_config_lp5.img
cant help wonder if i have to input the commands as well
Click to expand...
Click to collapse
Glad it helped. Those files depend on whether your device has a DDR type 0 (LPDDR4X) or DDR type 1 (LPDDR5) memory chip.
You can check your device memory type with adb shell getprop ro.boot.ddr_type. It will return 0 or 1. You can also use the DevCheck app by flar2.
I believe most OP8Ts use DDR0, which requires xbl_config.img and xbl.img. The lp5 images are for DDR1.
According to the lineage OS wiki, you'd flash the lp5 images with the same commands on DDR1:
Code:
fastboot flash --slot=all xbl_config xbl_config_lp5.img
fastboot flash --slot=all xbl xbl_lp5.img
I've tried to bring my KB2003 back to stock from LineageOS using this guide and when it comes to flashing the odm, product and vendor files I get the following errors
Code:
Sending 'odm' (34544 KB) OKAY [ 0.849s]
Writing 'odm' FAILED (remote: 'No such file or directory')
fastboot: error: Command failed
Invalid sparse file format at header magic
Resizing 'product_a' FAILED (remote: 'Not enough space to resize partition')
fastboot: error: Command failed
Invalid sparse file format at header magic
Resizing 'vendor_a' FAILED (remote: 'Not enough space to resize partition')
fastboot: error: Command failed
I've cleared the logical partitions. any ideas? Ignoring these errors and the device doesnt boot, just get a black screen
edit: if I do these product and vendor files first, system throws the error. Are the posted logical partition sizes correct?
Matt85m said:
I've tried to bring my KB2003 back to stock from LineageOS using this guide and when it comes to flashing the odm, product and vendor files I get the following errors
Code:
Sending 'odm' (34544 KB) OKAY [ 0.849s]
Writing 'odm' FAILED (remote: 'No such file or directory')
fastboot: error: Command failed
Invalid sparse file format at header magic
Resizing 'product_a' FAILED (remote: 'Not enough space to resize partition')
fastboot: error: Command failed
Invalid sparse file format at header magic
Resizing 'vendor_a' FAILED (remote: 'Not enough space to resize partition')
fastboot: error: Command failed
I've cleared the logical partitions. any ideas? Ignoring these errors and the device doesnt boot, just get a black screen
edit: if I do these product and vendor files first, system throws the error. Are the posted logical partition sizes correct?
Click to expand...
Click to collapse
You need to clear more space in the super partition. You can basically delete and recreate both slots a and b for system, system_ext, product, vendor, and probably even odm to get more space.
coomac said:
You need to clear more space in the super partition. You can basically delete and recreate both slots a and b for system, system_ext, product, vendor, and probably even odm to get more space.
Click to expand...
Click to collapse
is't that was the
Code:
fastboot delete-logical-partition
fastboot create-logical-partition
commands were about? I've followed that step as you laid out. I've now tried it by adding a line for deleting and recreating the odm partition and still no joy
Matt85m said:
is't that was the
Code:
fastboot delete-logical-partition
fastboot create-logical-partition
commands were about? I've followed that step as you laid out. I've now tried it by adding a line for deleting and recreating the odm partition and still no joy
Click to expand...
Click to collapse
Yeah, that's what they're for. Strange. Any other errors before the one for odm? Would be helpful if you can upload a screenshot of your terminal with all the commands.
Edit: One suggestion is to make sure you're in fastbootd, not fastboot. Also, the size for the new logical partitions is arbitrary - they get resized when being flashed.
coomac said:
Yeah, that's what they're for. Strange. Any other errors before the one for odm? Would be helpful if you can upload a screenshot of your terminal with all the commands.
Edit: One suggestion is to make sure you're in fastbootd, not fastboot. Also, the size for the new logical partitions is arbitrary - they get resized when being flashed.
Click to expand...
Click to collapse
it definitely is in fastbootd, I ran into that issue initially as the android-tools package shipped with Fedora was out of date, I dumped the newer tools from google into my /usr/bin.
Here is a dump of my last step by step attempt text file
OK, couple things you can try.
- Switch to slot a and try flashing again.
- If that doesn't work, flash the copy-partitions zip from the lineage wiki then try again.
Btw you can check the size of the super partition using fastboot getvar partition-size:super (you'll have to convert the hex value to decimal). It should be around 7.5 gb. Use fastboot getvar all to get the sizes of all the logical partitions. The total should be between ~3.3 and 4 gb after flashing or about 500 mb after you delete/recreate them.
Matt85m said:
it definitely is in fastbootd, I ran into that issue initially as the android-tools package shipped with Fedora was out of date, I dumped the newer tools from google into my /usr/bin.
Here is a dump of my last step by step attempt text file
Click to expand...
Click to collapse
Responded above.
coomac said:
Responded above.
Click to expand...
Click to collapse
worked it out looking at the entire list of partitions - I had 3 lots of each rom partion for example system_a, system_b and system, for all vendor product etc. purging the ones without the _a/b allowed the process to complete.
Might be a quirk of lineageOS installation process - you might want to make a note of it on the OP incase someone else runs into it
Matt85m said:
worked it out looking at the entire list of partitions - I had 3 lots of each rom partion for example system_a, system_b and system, for all vendor product etc. purging the ones without the _a/b allowed the process to complete.
Might be a quirk of lineageOS installation process - you might want to make a note of it on the OP incase someone else runs into it
Click to expand...
Click to collapse
Good to know. I'll update the OP.

Categories

Resources