Running flash_all.bat directly instead of using miflash - Xiaomi Poco X3 NFC Questions & Answers

Would it make a difference if I were to run the script directly?

Related

Installing Mi Flash Unlock Tool on Linux

1 Download MiFlash unlock tool version 2.2.406 from this site https://xiaomitools.com/mi-unlock-tool/ newer versions seem to be broken in wine
2 install wine staging for whatever distro you are using https://wiki.winehq.org/Download
3 extract miflash to a folder
4 run miflash
I have not tested if you can succesfully unlock a device using this method but it seems to be working in wine meaning you don't need to have a windows partition or run a vm just to unlock your device. If you get a white screen after agreeing to the terms and conditions make sure you have downloaded the correct version of miflash. I have also tested odin 13.3 which also works flawlessly
U dont need wine anymore. There is already a mi unlock tool made for linux.
Now U can directly run miunlock tool using linux. :highfive:
Make sure u have java openjfx package installed .
https://forum.xda-developers.com/an...miunlocktool-unlock-bootloader-t3782444/page2
Is here still needed authorized account to unbrick?
"I have not tested if you can succesfully unlock a device using this method" Seriously?
fail
This is not only linux. It can be work with wyne. So it is not linux application.

Relock bootloader

I need google pay, looks like it won't run on onlocked bootloader, has anyone experience relocking bootloader
yerman said:
I need google pay, looks like it won't run on onlocked bootloader, has anyone experience relocking bootloader
Click to expand...
Click to collapse
I have bought 2 devices as an early bird backer, one of them had issues (battery problems), so I had to relock it before sending it back to the official store. From past experience with MIUI, I reflashed my original MIUI version (was 12.0.2.0 at that time which came from factory) without locking first. Rebooted to see if it works, then flashed the same version again with the flash_all_lock script and everything went ok.
Unlocking again ofc would be through Mi unlock tool. Just don't do it on a custom Rom.
Slim K said:
I have bought 2 devices as an early bird backer, one of them had issues (battery problems), so I had to relock it before sending it back to the official store. From past experience with MIUI, I reflashed my original MIUI version (was 12.0.2.0 at that time which came from factory) without locking first. Rebooted to see if it works, then flashed the same version again with the flash_all_lock script and everything went ok.
Unlocking again ofc would be through Mi unlock tool. Just don't do it on a custom Rom.
Click to expand...
Click to collapse
Good news, did you use mi flash tool, any more info on flash_all_lock script and how to use it.
thanks for the quick reply
yerman said:
Good news, did you use mi flash tool, any more info on flash_all_lock script and how to use it.
thanks for the quick reply
Click to expand...
Click to collapse
I didn't use flash tool. The flash_all script/s can be found inside the .tgz fastboot firmware as a .bat file for windows (CMD) and/or .sh for linux (terminal). There is no real difference between the tool and script, however the tool is easier to work with for beginners, since it is a GUI.
There are three types of scripts:
flash_all. Flashes w/o locking, formats data partition
flash_all_except_data_storage. Flashes w/o locking, doesn't format data partition.
flash_all_lock flashes with locking, formats data as well.
Instructions for using scripts:
as admin run terminal or cmd inside the folder where the script and the rest of the firmware files are.
fastboot devices to make sure device is connected.
Then type fastboot followed by dragging and droping the script to terminal/cmd, then Enter.
I prefer terminal over flash tool for the info I get during installation (very detailed if something goes wrong).
Slim K said:
I didn't use flash tool. The flash_all script/s can be found inside the .tar fastboot firmware as a .bat file for windows (CMD) and/or .sh for linux (terminal). There is no real difference between the tool and script, however the tool is easier to work with for beginners, since it is a GUI.
There are three types of scripts:
flash_all. Flashes w/o locking, formats data partition
flash_all_except_data_storage. Flashes w/o locking, doesn't format data partition.
flash_all_lock flashes with locking, formats data as well.
Instructions for using scripts:
as admin run terminal or cmd inside the folder where the script and the rest of the firmware files are.
fastboot devices to make sure device is connected.
Then type fastboot followed by dragging and droping the script to terminal/cmd, then Enter.
I prefer terminal over flash tool for the info I get during installation (very detailed if something goes wrong).
Click to expand...
Click to collapse
thanks again for the help, appreciated

General [Root] Magisk Patched Boot image

Firmware 18.0830.2101.81 Magisk patched boot image.
I have dumped the boot image from Asus payload BIN using Python. Tested and works flawlessly.
Try on your own RISK!
How to install:
- Unlock your bootloader using ASUS unlock app.
- Enable debugging in developers options.
- Install ADB & Fastboot Drivers.
- Extract then copy the attached boot.img to ADB tools folder.
- Open a prompt command in ADB folder, enter command "adb reboot bootloader"
- Select Recovery using the volume keys and power key , then select fastboot.
- Enter command "adb flash boot boot.img"
if the above doesn't make sense, then probably you shouldn't be trying to root using this method.
Thanks.
M.Qassem said:
Firmware 18.0830.2101.81 Magisk patched boot image.
I have dumped the boot image from Asus payload BIN using Python. Tested and works flawlessly.
Try on your own RISK!
How to install:
- Unlock your bootloader using ASUS unlock app.
- Enable debugging in developers options.
- Install ADB & Fastboot Drivers.
- Extract then copy the attached boot.img to ADB tools folder.
- Open a prompt command in ADB folder, enter command "adb reboot bootloader"
- Select Recovery using the volume keys and power key , then select fastboot.
- Enter command "adb flash boot boot.img"
if the above doesn't make sense, then probably you shouldn't be trying to root using this method.
Thanks.
Click to expand...
Click to collapse
Thanks dear I'm on 18.0830.2101.75 can you provide patched image boot for my version because i want to change fingerprint to WW then install newer version through my phone.
İs there stock boot.img
How to relock the bootloader and remove root?
M.Qassem said:
Firmware 18.0830.2101.81 Magisk patched boot image.
I have dumped the boot image from Asus payload BIN using Python. Tested and works flawlessly.
Try on your own RISK!
How to install:
- Unlock your bootloader using ASUS unlock app.
- Enable debugging in developers options.
- Install ADB & Fastboot Drivers.
- Extract then copy the attached boot.img to ADB tools folder.
- Open a prompt command in ADB folder, enter command "adb reboot bootloader"
- Select Recovery using the volume keys and power key , then select fastboot.
- Enter command "adb flash boot boot.img"
if the above doesn't make sense, then probably you shouldn't be trying to root using this method.
Thanks.
Click to expand...
Click to collapse
Hey i got update version 18.0810.2101.95
Can i use this img to root or i have to update first?
Eeveeone said:
Hey i got update version 18.0810.2101.95
Can i use this img to root or i have to update first?
Click to expand...
Click to collapse
First update, then flash this img, this img caused bootloop my phone so take care.
sorankira said:
First update, then flash this img, this img caused bootloop my phone so take care.
Click to expand...
Click to collapse
If like that better not update to 18.0830. but how i want to get stock img for 18.0810
Eeveeone said:
If like that better not update to 18.0830. but how i want to get stock img for 18.0810
Click to expand...
Click to collapse
Download 18.0810 firmware on your PC and download dumper tool it will extract payload.bin you can find stock images there.
sorankira said:
Download 18.0810 firmware on your PC and download dumper tool it will extract payload.bin you can find stock images there.
Click to expand...
Click to collapse
Can you help me by doing it. coz i couldnt do the proper way. it say syntax error
Eeveeone said:
Can you help me by doing it. coz i couldnt do the proper way. it say syntax error
Click to expand...
Click to collapse
My internet is very slow indeed like 100KB/s but i will try to download it and send you the stock img.
sorankira said:
My internet is very slow indeed like 100KB/s but i will try to download it and send you the stock img.
Click to expand...
Click to collapse
Thx a lot.. currently i managed to do it. Now i have the stock img
Does anyone tried applying an OTA update while rooted? Is it sufficient to restore stock boot image, apply update zip file and flash new patched boot image? I have not tried it yet, because there is no TWRP available and I want to backup my data before trying.
MarekPietrzak said:
Does anyone tried applying an OTA update while rooted? Is it sufficient to restore stock boot image, apply update zip file and flash new patched boot image? I have not tried it yet, because there is no TWRP available and I want to backup my data before trying.
Click to expand...
Click to collapse
Yes you can apply ota update.
When the OTA Update finishes don't reboot click later, then go to magisk install OTA to inactive slot.
THANK YOU! This file saved my phone. I installed some other boot image that wouldn't let me boot the phone, this file brought it back to life.
Thank you again!
M.Qassem said:
Firmware 18.0830.2101.81 Magisk patched boot image.
I have dumped the boot image from Asus payload BIN using Python. Tested and works flawlessly.
Try on your own RISK!
How to install:
- Unlock your bootloader using ASUS unlock app.
- Enable debugging in developers options.
- Install ADB & Fastboot Drivers.
- Extract then copy the attached boot.img to ADB tools folder.
- Open a prompt command in ADB folder, enter command "adb reboot bootloader"
- Select Recovery using the volume keys and power key , then select fastboot.
- Enter command "adb flash boot boot.img"
if the above doesn't make sense, then probably you shouldn't be trying to root using this method.
Thanks.
Click to expand...
Click to collapse
Hallo
Any boot.img for latest version WW ASUS-18.0840.2103.26-1.1.81?
Can`t get my payload working, because not installing in correct folder.
ltth said:
Hallo
Any boot.img for latest version WW ASUS-18.0840.2103.26-1.1.81?
Can`t get my payload working, because not installing in correct folder.
Click to expand...
Click to collapse
Try extracting from your phone for payload.bin file. Or there is a "rooting my notes" discussion video in one of the post. You can see there
I have the payload bin file, but can`t extract in payload_dumper-master (not working correctly so I get the boot.img
ltth said:
I have the payload bin file, but can`t extract in payload_dumper-master (not working correctly so I get the boot.im
Click to expand...
Click to collapse
[Tutorial] Android OTA payload dumper on Android
Introduction This tutorial will teach you how to specifically extract the boot.img from your OTA/ROM's payload.bin on your Android device, rather than a computer. In addition to this, you will also have the ability to access all other img files...
forum.xda-developers.com
Use this link to extract the boot.img from payload.bin using your phone. Give a try. I also had issues extracting from pc. So did in my phone and worked.
jhosharath said:
Try extracting from your phone for payload.bin file. Or there is a "rooting my notes" discussion video in one of the post. You can see the
Click to expand...
Click to collapse
I found a Payload_Dumper wich worked very well, just have execute the scipt, then I got my boot.img
Thanks for your help!!

Question All kinds of errors when flashing a rom

I use the command fastboot -w update insert rom.zip or fastboot -w also fastboot update rom name.zip does not work. I use minimal adb fastboot I can't seem to sideload any roms even with the current build. What is going on? I get invalid sparse then failed within 20 seconds. Yes, I am in the bootloader screen and my phone is bootloader unlocked. Ones like StagOS for example or the more recent roms. I have no problem with Graphene OS or Caylx OS though.
UltimateGamer83 said:
I use the command fastboot -w update insert rom.zip or fastboot -w also fastboot update rom name.zip does not work. I use minimal adb fastboot I can't seem to sideload any roms even with the current build. What is going on? I get invalid sparse then failed within 20 seconds. Yes, I am in the bootloader screen and my phone is bootloader unlocked. Ones like StagOS for example or the more recent roms. I have no problem with Graphene OS or Caylx OS though.
Click to expand...
Click to collapse
Because you're not supposed to use "Minimal ADB and Fastboot". The binaries inside that package are years old. No wonder you're getting all those errors and have issues while trying to flash a ROM that is straightforward.
Download the latest platform-tools from Android's website (google).
Also, make sure that you're not using Windows PowerShell, but the actual CMD.
ekin_strops said:
Also, make sure that you're not using Windows PowerShell, but the actual CMD.
Click to expand...
Click to collapse
What is the reasoning behind this? I pretty much always use PS, guess I'll have to stop?
It being PowerShell or cmdline is irrelevant. Anyways..
Well, you should be using the latest platform-tools and have it added to PATH. A lot of unofficial drivers floating around on the internet install outdated adb/fastboot along with the drivers. Please refrain from installing these as well as minimal adb & fastboot; Use the official google driver and official platform-tools instead.
Alternatively you can prefix each adb/fastboot cmd with ./ while in the platform-tools folder via powershell or bash, etc.
For example:
./adb sideload ./rom.zip
Or
./fastboot -w update ./rom.zip
This tells the shell "Hey, I want to execute this local file, not the one in PATH".

How To Guide How to extract boot.img from OnePlus 9 firmware packages to patch with Magisk & flash to your phone using Linux Mint 21.1

As a OnePlus 9 user who likes to root their phone mainly to allow Network Signal Guru to work (as well as a few other root things like AdAway) I had been trying to extract the boot.img the same way as I had done with a OnePlus 7T using Payload Dumper for Windows. However it looks like Payload Dumper has issues with extracting xx.img files (including boot.img) if the payload.bin file is bigger than 4.3 GB in size. So I've been looking to see if another method was possible that would work for our OnePlus 9 ROMs that are above this file size. As I use Linux Mint as my usual desktop OS & only fall back onto Windows for stuff that'll only run on that OS, I went to have a look to see if something could be done under Linux. Turns out there is an old thread elsewhere on XDA that almost nearly provides what is needed for this, and I thought I would gives details here that should work for the time of this post (March 2023).
This not only extracts the boot.img to patch in Magisk, but also extracts other xx.img files as well.
I'm using Linux Mint 21.1, but I'd assume that this will also work for similar Ubuntu builds or anything that is based on Debian.
Obligatory disclaimer: The following instructions I'm giving below have worked well for me several times in the past, however I am in no way responsible for screwing up or damaging your phone if you try and follow what I've written below. In extreme cases, a bad flash may require using the OnePlus MSM tool to completely reflash your phone. Back up anything important first before doing any of the following!​
1. You will need to ensure that you have downloaded packages to be able to do adb & fastboot from the command line. You can check by running the following commands - if it's already installed with the latest versions, the terminal interface will let you know...
Code:
sudo apt install adb
Code:
sudo apt install fastboot
2. You will need to go to your software manager in LM21.1 and install both Python 3 & the Python Protobuf compiler. Just search for "Python 3" & "Protobuf-compiler" in the software manager and the first option for each search is what you should need - if they are not installed, install them.
3. Create a read/writable directory that will hold your ROM that you've just downloaded & other files that I'll mention soon. I just use a folder calls "ROM" in my Downloads folder (e.g. /home/lawhec/Downloads/ROM ), but you can choose wherever you want that suits you.
4. If you have not done so already, make sure you have the FULL package of your OnePlus 9 ROM downloaded. As of right now (March 2023) it seems the best way is to download the package using the Oxygen Updater app which is available on Google Play - more info available at oxygenupdater.com - just download the ROM to your phone and transfer it on to your computer into the folder you've created for it.
5. Download and save the following two Python scripts/files ("Right click" & "Save Link As") into the folder you have just created for your ROM (all credit to Gregory Cyxx at github.com/cyxx )...
https://raw.githubusercontent.com/c...payload/master/extract_android_ota_payload.py
https://raw.githubusercontent.com/cyxx/extract_android_ota_payload/master/update_metadata_pb2.py
6. Make sure in your file browser (Nemo in my case as it is the default for LM21.1 Cinammon, yours may differ) the window is open in the ROM folder that contains the two Python scripts above that you've just downloaded as well as a ROM package (ZIP file) you've downloaded (in my case from Oxygen Updater mentioned in step 3). Create a new folder for the extracted images to be written to - in my case I just call the folder "output" which is located at "/home/lawhec/Downloads/ROM/output" but again you can call it what you wish.
7. After you've created your output folder, in your ROM directory in the file manager window right-click on your mouse in a white or free space and select "Open in Terminal" - a command terminal will pop up defaulting to your directory.
8. In the command terminal, type the following command and press enter/return...
Code:
sudo python3 extract_android_ota_payload.py <<Your ROM.zip>> <<Your Output Directory>>
...for example, in my case the command would be either...
Code:
sudo python3 extract_android_ota_payload.py LE2113_11_F-75.zip output
...or for handiness you can type "sudo python3 extract_android_ota_payload.py " (remember to leave a space) and simply drag the ROM zip file to the command terminal, press space and then drag the output foler to the terminal line, which will look like in my case...
Code:
sudo python3 extract_android_ota_payload.py '/home/lawhec/Downloads/ROM/LE2113_11_F-75.zip' '/home/lawhec/Downloads/ROM/output'
...this will now run the python script you downloaded earlier that will begin extracting the ROM you've specified and will output all relevant xx.img files into your output folder, including the one we want, "boot.img" - there is no need to extract paylod.bin beforehand, the script will automatically do this for you. Once all xx.img files have been extracted the script will stop, depending on your computer this will take anything from 1-5 minutes, maybe longer on some very old or low spec'd computers - but just let it run its course. Once it is done you can then close the terminal window.
9. Now with the boot.img we've extracted, transfer this file on to your phone (the Downloads folder is usually a good choice). Now open Magisk and patch the boot.img file - once this has been completed, it'll generate a patched boot.img file named something like "magisk_patched-25200_12345.img" - copy and paste this patched boot image back on to your computer (into the folder you've been using will be fine here).
10. If your OnePlus 9 phone is connected to your computer via USB cable, disconnect it now. Then shutdown your phone into a power-off state then reboot it into fastboot mode - this can be done by holding down the volume up & down buttons, then holding down the power button and keep holding down all three buttons until you feel a vibration from your phone. Your OnePlus 9 should then boot into fastboot mode.
11. Now reconnect your OnePlus 9 to your computer via the USB cable and then open up a new display terminal (preferably by right-clicking in the file window of the directory where you saved your Magisk patched boot.img file). Enter the following...
Code:
fastboot devices
...you should then get a line featuring a block of numbers that should match the serial number that is displayed on your phone's display, followed by "fastboot", for example...
Code:
85f53405 fastboot
...if you get anything else, double check your connections at try again - if more than one device is displayed, disconnect the and try again to make sure that only one device is listed. It might also be the case that you don't have the proper drivers installed on your computer for your phone though in my case LM21.1 automatically recognises my phone, so I'm not of any direct help here I'm afraid for this, sorry.
12. Now you will be flashing your patched boot.img to your phone - this is where things can be a little nervous though as long as you do everything right nothing should really go wrong. Type the following into the command terminal, assuming you did so by opening a command terminal from the folder your Magisk Patched boot.img file is located...
Code:
fastboot flash boot <<Magisk Patched boot.img>>
...for example in my case the command line would be...
Code:
fastboot flash boot magisk_patched-25200_12345.img
...otherwise you will need to provide the location of where your patched boot.img is, so in this case...
Code:
fastboot flash boot '/home/lawhec/Downloads/ROM/magisk_patched-25200_12345.img'
...either way, your phone will now be in the process of getting its boot image replaced with the one patched by Magisk. This should take no more than a few seconds and that should be it done! You can then close the terminal window again.
13. Once you've patched the boot image, disconnect the phone from the USB cable to the computer and make sure that the screen on your mobile says "START" in green at the top, if it doesn't, use the volume keys to change this. Then just simply press the power button and your phone will now reboot, this can take a little bit longer than before as your phone's firmware has changed so give it time - (however if it takes longer than 10 minutes or so you might have a problem here) - once your home screen becomes available, give it a few seconds once you've entered before selecting the Magisk app. Once you've done this, Magisk should say that it is installed however to double check, use an app that requires root permissions either to work (e.g. Network Signal Guru) or to do additional things, like a simple root checker app that you can download from wherever you download your apps. If everything is good, then you've rooted your OnePlus 9!
Notes: This process will probably work for other firmware packages for various phones where the boot.img can be extracted to be patched by Magisk and then flashed via fastboot (assuming the bootloader is unlocked) which includes the OnePlus 7T's stock firmware, but I can give no guarantees for this. Once again, try at your own risk.​
I would suggest to boot the magisk patched image and then doing a direct install from the app instead of flashing it directly. This way you can use the "Restore images" feature in the Magisk app that can be useful when doing incremental update.
Thank You for thinking of Us Linux Users !
Attempted to update to LOS 20 via ADB, and now my touch screen will not work. All the remedies here require a Windows system for the MSM tool, which I do not have...
barguybrady said:
Thank You for thinking of Us Linux Users !
Attempted to update to LOS 20 via ADB, and now my touch screen will not work. All the remedies here require a Windows system for the MSM tool, which I do not have...
Click to expand...
Click to collapse
You have a computer you can install windows on another partition it's not like you don't have the ability to use msm
stez827 said:
You have a computer you can install windows on another partition it's not like you don't have the ability to use msm
Click to expand...
Click to collapse
no comment
barguybrady said:
Yup.
Just gonna spend another 4 or 5 hours prepping a drive to somehow install windows just to fix a phone.
Maybe - No....
Click to expand...
Click to collapse
It does not take that long as a Linux user who has had to install for that exact reason it took maybe an hour or 2
lawhec said:
As a OnePlus 9 user who likes to root their phone mainly to allow Network Signal Guru to work (as well as a few other root things like AdAway) I had been trying to extract the boot.img the same way as I had done with a OnePlus 7T using Payload Dumper for Windows. However it looks like Payload Dumper has issues with extracting xx.img files (including boot.img) if the payload.bin file is bigger than 4.3 GB in size. So I've been looking to see if another method was possible that would work for our OnePlus 9 ROMs that are above this file size. As I use Linux Mint as my usual desktop OS & only fall back onto Windows for stuff that'll only run on that OS, I went to have a look to see if something could be done under Linux. Turns out there is an old thread elsewhere on XDA that almost nearly provides what is needed for this, and I thought I would gives details here that should work for the time of this post (March 2023).
This not only extracts the boot.img to patch in Magisk, but also extracts other xx.img files as well.
I'm using Linux Mint 21.1, but I'd assume that this will also work for similar Ubuntu builds or anything that is based on Debian.
Obligatory disclaimer: The following instructions I'm giving below have worked well for me several times in the past, however I am in no way responsible for screwing up or damaging your phone if you try and follow what I've written below. In extreme cases, a bad flash may require using the OnePlus MSM tool to completely reflash your phone. Back up anything important first before doing any of the following!​
1. You will need to ensure that you have downloaded packages to be able to do adb & fastboot from the command line. You can check by running the following commands - if it's already installed with the latest versions, the terminal interface will let you know...
Code:
sudo apt install adb
Code:
sudo apt install fastboot
2. You will need to go to your software manager in LM21.1 and install both Python 3 & the Python Protobuf compiler. Just search for "Python 3" & "Protobuf-compiler" in the software manager and the first option for each search is what you should need - if they are not installed, install them.
3. Create a read/writable directory that will hold your ROM that you've just downloaded & other files that I'll mention soon. I just use a folder calls "ROM" in my Downloads folder (e.g. /home/lawhec/Downloads/ROM ), but you can choose wherever you want that suits you.
4. If you have not done so already, make sure you have the FULL package of your OnePlus 9 ROM downloaded. As of right now (March 2023) it seems the best way is to download the package using the Oxygen Updater app which is available on Google Play - more info available at oxygenupdater.com - just download the ROM to your phone and transfer it on to your computer into the folder you've created for it.
5. Download and save the following two Python scripts/files ("Right click" & "Save Link As") into the folder you have just created for your ROM (all credit to Gregory Cyxx at github.com/cyxx )...
https://raw.githubusercontent.com/c...payload/master/extract_android_ota_payload.py
https://raw.githubusercontent.com/cyxx/extract_android_ota_payload/master/update_metadata_pb2.py
6. Make sure in your file browser (Nemo in my case as it is the default for LM21.1 Cinammon, yours may differ) the window is open in the ROM folder that contains the two Python scripts above that you've just downloaded as well as a ROM package (ZIP file) you've downloaded (in my case from Oxygen Updater mentioned in step 3). Create a new folder for the extracted images to be written to - in my case I just call the folder "output" which is located at "/home/lawhec/Downloads/ROM/output" but again you can call it what you wish.
7. After you've created your output folder, in your ROM directory in the file manager window right-click on your mouse in a white or free space and select "Open in Terminal" - a command terminal will pop up defaulting to your directory.
8. In the command terminal, type the following command and press enter/return...
Code:
sudo python3 extract_android_ota_payload.py <<Your ROM.zip>> <<Your Output Directory>>
...for example, in my case the command would be either...
Code:
sudo python3 extract_android_ota_payload.py LE2113_11_F-75.zip output
...or for handiness you can type "sudo python3 extract_android_ota_payload.py " (remember to leave a space) and simply drag the ROM zip file to the command terminal, press space and then drag the output foler to the terminal line, which will look like in my case...
Code:
sudo python3 extract_android_ota_payload.py '/home/lawhec/Downloads/ROM/LE2113_11_F-75.zip' '/home/lawhec/Downloads/ROM/output'
...this will now run the python script you downloaded earlier that will begin extracting the ROM you've specified and will output all relevant xx.img files into your output folder, including the one we want, "boot.img" - there is no need to extract paylod.bin beforehand, the script will automatically do this for you. Once all xx.img files have been extracted the script will stop, depending on your computer this will take anything from 1-5 minutes, maybe longer on some very old or low spec'd computers - but just let it run its course. Once it is done you can then close the terminal window.
9. Now with the boot.img we've extracted, transfer this file on to your phone (the Downloads folder is usually a good choice). Now open Magisk and patch the boot.img file - once this has been completed, it'll generate a patched boot.img file named something like "magisk_patched-25200_12345.img" - copy and paste this patched boot image back on to your computer (into the folder you've been using will be fine here).
10. If your OnePlus 9 phone is connected to your computer via USB cable, disconnect it now. Then shutdown your phone into a power-off state then reboot it into fastboot mode - this can be done by holding down the volume up & down buttons, then holding down the power button and keep holding down all three buttons until you feel a vibration from your phone. Your OnePlus 9 should then boot into fastboot mode.
11. Now reconnect your OnePlus 9 to your computer via the USB cable and then open up a new display terminal (preferably by right-clicking in the file window of the directory where you saved your Magisk patched boot.img file). Enter the following...
Code:
fastboot devices
...you should then get a line featuring a block of numbers that should match the serial number that is displayed on your phone's display, followed by "fastboot", for example...
Code:
85f53405 fastboot
...if you get anything else, double check your connections at try again - if more than one device is displayed, disconnect the and try again to make sure that only one device is listed. It might also be the case that you don't have the proper drivers installed on your computer for your phone though in my case LM21.1 automatically recognises my phone, so I'm not of any direct help here I'm afraid for this, sorry.
12. Now you will be flashing your patched boot.img to your phone - this is where things can be a little nervous though as long as you do everything right nothing should really go wrong. Type the following into the command terminal, assuming you did so by opening a command terminal from the folder your Magisk Patched boot.img file is located...
Code:
fastboot flash boot <<Magisk Patched boot.img>>
...for example in my case the command line would be...
Code:
fastboot flash boot magisk_patched-25200_12345.img
...otherwise you will need to provide the location of where your patched boot.img is, so in this case...
Code:
fastboot flash boot '/home/lawhec/Downloads/ROM/magisk_patched-25200_12345.img'
...either way, your phone will now be in the process of getting its boot image replaced with the one patched by Magisk. This should take no more than a few seconds and that should be it done! You can then close the terminal window again.
13. Once you've patched the boot image, disconnect the phone from the USB cable to the computer and make sure that the screen on your mobile says "START" in green at the top, if it doesn't, use the volume keys to change this. Then just simply press the power button and your phone will now reboot, this can take a little bit longer than before as your phone's firmware has changed so give it time - (however if it takes longer than 10 minutes or so you might have a problem here) - once your home screen becomes available, give it a few seconds once you've entered before selecting the Magisk app. Once you've done this, Magisk should say that it is installed however to double check, use an app that requires root permissions either to work (e.g. Network Signal Guru) or to do additional things, like a simple root checker app that you can download from wherever you download your apps. If everything is good, then you've rooted your OnePlus 9!
Notes: This process will probably work for other firmware packages for various phones where the boot.img can be extracted to be patched by Magisk and then flashed via fastboot (assuming the bootloader is unlocked) which includes the OnePlus 7T's stock firmware, but I can give no guarantees for this. Once again, try at your own risk.​
Click to expand...
Click to collapse
If Using the t-Mobile Variant - LE2117 - we are Unable to Install any OTA Updates with OxygenUpdater, and are promptly warned of this limitation upon install. Nevertheless, I forged ahead and,
Following this Method, I downloaded a LE2115_11_F.17.zip, and proceeded to use your helpful .py scripts to extract the boot.img file, and Flash it - promptly sending me to a Qualcomm CrashDump mode.
Having a chance to MSM back to "stock" LE2117 - 11.2.2.2 LE54CB, I am wondering if I should just let the t-Mobile Update, through "Settings >> System >> System update" to Update the Stock ( bloated !? ) OS with all that are available,
Then attempt to Extract a boot.img and Magisk patch it ?
Any Advice?
TIA

Categories

Resources