[Guide] Enable ADB on the stock OxygenOS recovery - OnePlus 8T Guides, News, & Discussion

Since we don't have TWRP yet for our 8T, having ADB enabled on the stock recovery can be really helpful if you are unlocked and rooted.
For example, removing problematic magisk modules.
I tried to install the EdExposed module and ended with a boot loop. To get back I had to flash the stock boot.img again and reconfigure all my modules again.
Having ADB enabled in OOS recovery will let us delete the problematic module at /data/adb/modules without having to delete the working modules.
Credit goes to @s3axel for the Post in Oneplus 8 forums
Quoting the procedure to create the modified recovery.img :
s3axel said:
Description of the method to modify recovery by yourself:
Prerequisites:
Android Image Kitchen (credit to osm0sis for providing this tool)
the original recovery image file (henceforth called "recovery.img"). You can extract this yourself from an update zip file by unpacking "payload.bin" and then use a tool like payload_dumper (credit to vm03 for providing this) to extract the recovery.img file
Now do the following:
unpack image with Image Kitchen --> this will create a "ramdisk" and a "Split_img" directory with the unpacked content within
navigate into the "ramdisk" folder and use a text editor (on windows preferably Notepad++) to edit the file "prop.default"
look for entry "ro.adb.secure" and change entry value from "1" to "0". Note this entry can occur multiple times (I noticed twice), change each --> this will prevent adb from asking for authorization (the recovery does not provide such a dialogue)
look for entry "ro.debuggable" and change this from "0" to "1" --> this actually enables ADB
look for entry "ro.secure" and change this from "1" to "0" --> may be unnecessary but I wanted to avoid brick in case a modified recovery would result in such a behavior
save textfile
repack the image with Android Image Kitchen and voila:
you have a new modified recovery image you can flash
Click to expand...
Click to collapse
Installation Procedure:
s3axel said:
Prerequisites:
Oneplus 8T
unlocked bootloader
access to fastboot on the phone
adb and fastboot
Installation:
Reboot the phone to fastboot, then flash the recovery from fastboot with the command
Code:
fastboot flash recovery <filename>
(with <filename> being the name of the recovery in the format of "recovery.img" you wish to flash)
Uninstall:
Same as installation, but flash the original stock recovery instead.
Usage:
Boot up recovery, enter the encryption key if the file system is encrypted. Then connect the phone to a PC and you are ready to go with adb. E.g. by using
Code:
adb shell
to open a shell and access the file system. Magisk modules are located in /data/adb/modules, deleting the corresponding directory there will remove the module in question.
Step-by-step this would be:
Code:
cd /data/adb/modules
to change to the Magisk modules directory
Code:
ls
to list the content of this directory, each module has its own directory, usually with a well-recognizable name
Code:
rm -r <directory>
to delete the directory in question. Tip: in console TAB-autocomplete works
Notes of caution:
ADB security is disabled as I could not get the recovery to allow for authorizing a connected computer. As a consequence, any computer connected is automatically authorized in ADB, although with an encrypted filesystem at least no data is accessible without the key.
with direct ADB access to your file system you can easily wreck you phone requiring a factory reset or even reinstallation of the OS from fastboot - please be careful about what you are doing
Credits: Thanks to osm0sis for Android kitchen and all great developers for the Oneplus devices.
Click to expand...
Click to collapse
Pre-patched files for the lazy (upto 11.0.4.5):
To find your model and build:
Code:
adb shell getprop ro.product.model
KB2001
adb shell getprop ro.build.version.ota
OnePlus8TOxygen_15.I.16_GLO_0160_2010150110
KB2000 / KB05?? - Chinese Variant
11.0.1.2 Hydrogen_15.H.16_OTA_0160_all_2010150101_4101
STOCK recovery.img
adb patched recovery
KB2001 / KB05DA - Indian Variant
11.0.1.2 - OnePlus8TOxygen_15.I.16_GLO_0160_2010150110
STOCK recovery.img
adb patched recovery
11.0.2.3 - OnePlus8TOxygen_15.I.17_OTA_0170_all_2010240047
STOCK recovery.img
adb patched recovery
11.0.3.4 - OnePlus8TOxygen_15.I.18_OTA_0180_all_2011010208
STOCK recovery.img
adb patched recovery
11.0.4.5 - OnePlus8TOxygen_15.I.19_OTA_0190_all_2011101438_3032f.zip
STOCK recovery.img
adb patched recovery
KB2003 / KB05BA - EU Variant
11.0.1.2 - OnePlus8TOxygen_15.E.17_GLO_0170_2010150108
STOCK recovery.img
adb patched recovery
11.0.2.3 - OnePlus8TOxygen_15.E.18_OTA_0180_all_2010240038
STOCK recovery.img
adb patched recovery
11.0.3.4 - OnePlus8TOxygen_15.E.19_OTA_0190_all_2011010157
STOCK recovery.img
adb patched recovery
11.0.4.5 - OnePlus8TOxygen_15.E.20_OTA_0200_all_2011101442_ed5dc.zip
STOCK recovery.img
adb patched recovery
KB2005 / KB05AA - International Variant thanks to @card13
https://drive.google.com/drive/folders/1-i4P8sWPfyqwgYvBsKWAAftQW7m66Z70?usp=sharing
KB2007 / KB05CB - T-Mobile Variant
¯\_(ツ)_/¯
Code:
❯ adb devices
List of devices attached
75317573 recovery
❯ adb shell
# df
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 3648448 40396 3608052 2% /
tmpfs 3837328 1160 3836168 1% /dev
tmpfs 3837328 0 3837328 0% /mnt
tmpfs 3837328 0 3837328 0% /apex
tmpfs 3837328 4 3837324 1% /linkerconfig
tmpfs 3837328 24 3837304 1% /tmp
/dev/block/sda11 491464 140484 350980 29% /mnt/vendor/op2
/dev/block/sda20 11760 164 11596 2% /metadata
/dev/block/dm-3 1516540 1511956 4584 100% /vendor
/dev/block/sda2 27632 10452 17180 38% /mnt/vendor/persist
/dev/block/dm-7 110397292 6627020 103770272 7% /data

I will edit this post over time with few notes/misc stuff.
For some reason, the only way we can boot into the recovery is to perform a fastboot flash.
Fastboot boot recovery.img does not seem to work and I have no idea why. (Even on stock recovery.img!!)
It just ends up in a black screen.
If someone could explain why it'll be great, cuz if we can just temporarily boot into the patched recovery, we can pull the boot.img files and provide root for all the variants of the 8T without waiting for a full OTA, with the below method:
Next, there *might* be a way to root other variants of 8T which do not have the full OTA zips
WARNING: I am NOT responsible if this does not work. you have been advised! This can render your recovery partition unusable until OnePlus releases full OTA ZIPs for all variants of the 8T!
Unlike boot.img, I was actually successful in flashing the EU KB2003 recovery.img on my Indian variant KB2001. running OOS 11.0.1.2.KB05DA
So I tried to flash the adb-patched recovery.img from the EU OTA into my Indian 8T and I was able to enter the adb shell as root!
Now I can easily get the image of all the partitions as well. Here's a snippet from my PC:
Code:
~/oss_stuff/Android-Image-Kitchen
❯ adb devices
List of devices attached
75317573 recovery
~/oss_stuff/Android-Image-Kitchen
❯ adb shell
# ls -al /dev/block/bootdevice/by-name/boo*
lrwxrwxrwx 1 root root 16 1970-01-03 04:30 /dev/block/bootdevice/by-name/boot_a -> /dev/block/sde11
lrwxrwxrwx 1 root root 16 1970-01-03 04:30 /dev/block/bootdevice/by-name/boot_b -> /dev/block/sde35
Copy the active slot (b in my case) as boot.img to sdcard and reboot:
Code:
# dd if=/dev/block/bootdevice/by-name/boot_b of=/data/media/0/boot.img
196608+0 records in
196608+0 records out
100663296 bytes (96 M) copied, 0.247740 s, 388 M/s
# reboot
I am already rooted, so I am expecting magisk manager to detect a magisk patched bootimage.
And it did. Screenshot attached.
Again I AM NOT 100% SURE IF ALL THE VARIANTS CAN FLASH THE SAME RECOVERY.IMG.
Since there is no full OTA Available, if the patched recovery does not work you will have to wait for the full ZIP to be released to restore your recovery. You have been warned!

DroidFreak32 said:
I will edit this post over time with few notes/misc stuff.
For some reason, the only way we can boot into the recovery is to perform a fastboot flash.
Fastboot boot recovery.img does not seem to work and I have no idea why. (Even on stock recovery.img!!)
It just ends up in a black screen....
Click to expand...
Click to collapse
Sadly I have no real explanation either, but I had the same effect during my testing - I assumed it's related to some mechanism around the encryption of the partitions.
Cheers & thanks for continuing this for the 8T !

Sorry but I want to ask a noob question: can I use this method to adb sideload a FULL OTA zip via this recovery as currently when I'm trying to switch to EU OOS from IN OOS, the local upgrader says that I can't install an older version of OOS

dijia1124 said:
Sorry but I want to ask a noob question: can I use this method to adb sideload a FULL OTA zip via this recovery as currently when I'm trying to switch to EU OOS from IN OOS, the local upgrader says that I can't install an older version of OOS
Click to expand...
Click to collapse
No I don't think this recovery allows flashing in the first place.

DroidFreak32 said:
No I don't think this recovery allows flashing in the first place.
Click to expand...
Click to collapse
Well, first of all, nice of you to post this for everybody. I had did this following the same tutorial, my first day I received my phone itself, and I also encountered the same issue of unable to boot recovery img.
Btw, you are right. OnePlus disabled adb sideload in their A/B devices. I researched extensively and couldn't find a way to re-enable it.
Well, even if it was present, it will only allow zips with signed keys from OP to be flashed, so not a replacement for TWRP anyway.
As for flashing OP updates and other custom roms, you can use fastbootd.

@theincognito Did you ever figure out the reason why they disabled ADB and ADB Sideloading? And do you know if OnePlus has a workaround (new protocol or command to accomplish the same effect)?

card13 said:
@theincognito Did you ever figure out the reason why they disabled ADB and ADB Sideloading? And do you know if OnePlus has a workaround (new protocol or command to accomplish the same effect)?
Click to expand...
Click to collapse
First of all, ADB was there to facilitate ADB sideloading. Once sideloading went away, they removed ADB entirely.
As for removing sideloading, as far as I can understand, it started when they switched to A/B partition for their phones, because by default, A/B devices don't have a dedicated recovery partition(like Pixel/Android One phones). So they removed it.
However, from OnePlus 8, OnePlus brought back the dedicated recovery partition while still using A/B. So, now, if they want, they could bring back the sideloading, imo.
As for workaround, there are only 2 options: TWRP (or any custom recovery) and fastbootd.
You can flash stock roms via fastbootd, but that involves extracting the zip via payload and flashing the images individually. As for custom roms, from fastbootd, you can use "fastboot update <rom.zip>". As simple as that.

@theincognito Thank you for the info it is very, very informative and gives me a lot of ideas of what to try next!
@DroidFreak32 I uploaded all my Recovery files to my GDrive, along with all my rooting files. https://drive.google.com/drive/folders/1-i4P8sWPfyqwgYvBsKWAAftQW7m66Z70?usp=sharing

Hace latest ota 11.0.3.4 BA recovery modified and recovery stock?
---------- Post added at 01:23 AM ---------- Previous post was at 01:22 AM ----------
card13 said:
@theincognito Thank you for the info it is very, very informative and gives me a lot of ideas of what to try next!
@DroidFreak32 I uploaded all my Recovery files to my GDrive, along with all my rooting files. https://drive.google.com/drive/folders/1-i4P8sWPfyqwgYvBsKWAAftQW7m66Z70?usp=sharing
Click to expand...
Click to collapse
Have latest ota 11.0.3.4 BA recovery modified and recovery stock?

hmm. seems, they changed something with the adb rights in 11.0.3.4.
ls /data is also permitted.
(edit: i used adb-recovery to delete a magisk module previous on 11.0.2.3)

ChillDuder said:
hmm. seems, they changed something with the adb rights in 11.0.3.4.
ls /data is also permitted.
(edit: i used adb-recovery to delete a magisk module previous on 11.0.2.3)
Click to expand...
Click to collapse
It's working fine here
What's your 8t model?
Also updated the op with links for patched recovery from 11.0.3.4

DroidFreak32 said:
It's working fine here
What's your 8t model?
Also updated the op with links for patched recovery from 11.0.3.4
Click to expand...
Click to collapse
KB2003
Thank you. I'll flash again later. Maybe i did something wrong in the prop file.

if your device been rooted and grant su for adb shell, you can also use CMD to enter commands "
>adb shell
$su
#magisk --remove-modules
"to remove all modules and reboot;
others,you had to flash the stock boot.img again

hanajoruno said:
if your device been rooted and grant su for adb shell, you can also use CMD to enter commands "
>adb shell
$su
#magisk --remove-modules
"to remove all modules and reboot;
others,you had to flash the stock boot.img again
Click to expand...
Click to collapse
su in adb shell dont worked for me (su binary isnt installed from magisk)
but for whatever reason, i have to reboot normaly, and via advanced poweroff menu directly to recovery. then it worked flawless. weird. previous i reboot to fastboot and from there to recovery. seems that this maybe is a differnce.

Thank you! Thank you so much. I tried a risky module and it crashed my phone. I was so scared as I had a lot of important data which I didn't backup. I followed your guide and I was able to remove the module and boot properly. I just can't thank you enough. You saved my life.

@liver20 No I am still on 11.0.1.2 since I haven't had time this week (life loves to get in the way) to unroot -> Apply Incremental OTA update file -> re-root.

I'm getting the black screen even after flashing the recovery. I can get into adb but have no way of decrypting? I am not able to enter my pattern. Am I missing something here?

xDanVitox said:
I'm getting the black screen even after flashing the recovery. I can get into adb but have no way of decrypting? I am not able to enter my pattern. Am I missing something here?
Click to expand...
Click to collapse
What's your oos build and 8t variant?
Have you tried manualy patching the recovery image yourself from your oos build instead of using the patched images by me?

DroidFreak32 said:
What's your oos build and 8t variant?
Have you tried manualy patching the recovery image yourself from your oos build instead of using the patched images by me?
Click to expand...
Click to collapse
I'm on 11.0.4.5 - KB2005
I did, yes. I used the broken TWRP to pull the recovery off of my phone and patched that. I tried using the one from unpacked kebab image as well. Tried booting and flashing and both give the same result. They both "work" but result in blank screen. Flashing back my backup original copy from my phone returns normal function.
Am I supposed to be seeing my pattern input the same as stock?
And thanks for the response!

Related

Root OnePlus 2 with TWRP or OTA stock ?

Hi,
I've got a new OnePlus 2 phone.
Do i really have to flash TWRP in order to root my phone using SU tool ? or i can stay with the OnePlus 2 original stock ?
What are the advantages of TWRP?
Best,
Jonathan
rose10 said:
Hi,
I've got a new OnePlus 2 phone.
Do i really have to flash TWRP in order to root my phone using SU tool ? or i can stay with the OnePlus 2 original stock ?
What are the advantages of TWRP?
Best,
Jonathan
Click to expand...
Click to collapse
You can either FLASH TWRP recovery or BOOT into it: the difference is that when you boot into TWRP, it's temporary, which means when you've done your stuff and you reboot into the system, stock recovery will be present. To do so, boot into bootloader:
Code:
adb reboot-bootloader
and instead of:
Code:
fastboot flash recovery recovery.img
which FLASH the recovery, do:
Code:
fastboot boot recovery.img
which lets BOOT into TWRP.
Then you'll be able to flash SuperSu.V.Xx.zip beforehand pushed into your device.
Benefit of TWRP?
Full backup / restore, change file format, flash zip files, etc, etc.
For the OTA, you can still flash them, but you'll have to flash the stock ROM then the incremental zip if you FLASH TWRP or the full OTA update zip file from here.
Hi again,
After rooting my device....i can't copy a sound file to my /system/media/audio/ui..... How can i change the library permission ?
rose10 said:
Hi again,
After rooting my device....i can't copy a sound file to my /system/media/audio/ui..... How can i change the library permission ?
Click to expand...
Click to collapse
Which method? ADB shell? With an app?
If you use ADB shell / Terminal Emulator, you need to mount it into Read-Write mode.
To do so:
(
If you use ADB
Code:
adb shell
)
Code:
su
Code:
mount -o remount,rw /system
Then you can move your file.
Or if you use an app (ES File Explorer for example), you need to enable Root Mode: swipe from left, scroll down and activate "Root Explorer" case.
A thanks is always appreciated.

[GUIDE] Unlock/Flash/Root for the Pixel 2 (walleye)

Introduction
Hello everyone, this is a guide to assist you with customizing your Pixel 2! I will be going over installing fastboot and adb, unlocking your bootloader, how to flash the factory images for clean flashes and upgrades, and how to root. Please feel free to ask any questions if you need clarification. Enjoy!
This information has been distilled from Google's official factory image site and the Magisk thread.
Installing fastboot and adb
Thankfully, Google has provided just adb, fastboot, and systrace as a simple zip file, making this process super easy. You MUST be on at LEAST 26.0.2 for the commands in this guide to work. When in doubt, grab the latest copy and install them using the following instructions.
SDK Platform-Tools for Windows
SDK Platform-Tools for Mac
SDK Platform-Tools for Linux
Windows:
Unzip the folder somewhere on your hard drive.
Go to the folder containing the adb and fastboot files and type "cmd" in the path bar at the top.
A command prompt should open with the current folder showing on the prompt.
Type the following commands:
Code:
adb --version
fastboot --version
You should see some information appear. If that is the case, you were successful!
Mac/Linux:
Unzip the folder somewhere on your hard drive.
Navigate to that folder with your terminal.
Run the following commands:
Code:
sudo install adb dmtracedump e2fsdroid etc1tool fastboot hprof-conv make_f2fs mke2fs mke2fs.conf sload_f2fs sqlite3 /usr/local/bin
sudo mkdir -p /usr/local/lib64
sudo install lib64/libc++.so /usr/local/lib64
Type the following commands:
Code:
adb --version
fastboot --version
You should see the version information, along with telling you they are installed to /usr/local/bin. If so, you were successful!
Unlocking the bootloader
WARNING: This WILL wipe your entire phone. Please make copies or backups of any important data. This can also go wrong rendering your device inoperable. Proceed with caution.
On your phone, open Settings, navigate to "System" then "About phone", and tap on the build number 7 times.
Go one menu up, click on "Developer options", and turn on USB debugging and OEM unlocking.
In your terminal, type the following command:
Code:
adb reboot bootloader
Run the following command:
Code:
fastboot flashing unlock
Follow the prompts on your device then reboot!
Flashing factory images
NOTE #1: You CANNOT downgrade factory images. Google has prevented users from doing so to keep them safe from vulernabilities that were patched. You should only upgrade or reinstall the current image.
NOTE #2: If you have mounted /system as rw at any point (like in TWRP), you must upgrade using the factory image method. OTAs will fail because they cannot verify the integrity of the disk since its verity data has been changed.
NOTE #3: Flashing the factory images requires an unlocked bootloader. Flashing the OTA zips does not (but if anything goes wrong, you may not be able to recover without an RMA).
Updating to a new release (factory image):
Download the latest factory image from Google's website.
Reboot into the bootloader:
Code:
adb reboot bootloader
Unzip the factory image.
Inside you will see a bootloader image, a radio image, an image zip file, and a couple of flash scripts.
If you are on Windows, open the "flash-all.bat" file in a text editor. If you are on Mac or Linux, open the "flash-all.sh" instead.
Remove the "-w" flag before the fastboot command towards the end of the file. This will prevent fastboot from formatting your device.
Run the flash all script! Open a command prompt, navigate to the folder with the script, and run one of the following commands:
Windows:
Code:
flash-all
Mac/Linux:
Code:
./flash-all.sh
Reboot once it is finished!
Updating to a new release (OTA zip):
Download the latest OTA zip from Google's website
Reboot into recovery:
Code:
adb reboot recovery
Hold down the power button and push volume up
Select "Apply update from ADB"
Run the following command from the folder containing the OTA zip:
Code:
adb sideload <zip_name>.zip
Reboot once it is finished!
Clean flashing a factory image (wipe everything):
Download the latest factory image from Google's website
Reboot into the bootloader:
Code:
adb reboot bootloader
Unzip the factory image.
Run the flash all script! Open a command prompt, navigate to the folder with the script, and run one of the following commands:
Windows:
Code:
flash-all
Mac/Linux:
Code:
./flash-all.sh
Reboot once it is finished!
Rooting with Magisk
NOTE #4: This section assumes you are not going to install TWRP. If you are, skip to the next section and just flash the latest Magisk zip after installing TWRP.
Download the Magisk zip from the official thread and install the manager from the zip.
Grab a boot image to patch (either the one from the latest factory image or a custom kernel one) and push it to your device:
Code:
adb push <path_to_file> /sdcard/Download
Open Magisk Manager and click the Install button.
Click "Install" at the first prompt then choose "Patch Boot Image File". A file manager will pop up.
Select the boot image you want to patch and let Magisk Manager patch it.
Pull it off your device:
Code:
adb pull /sdcard/MagiskManager/patched_boot.img
Reboot into the bootloader:
Code:
adb reboot bootloader
Flash the boot image and reboot.
Code:
fastboot flash boot patched_boot.img
fastboot reboot
Open Magisk Manager and you should be rooted!
Installing TWRP
NOTE #5: If you just want to temporarily boot TWRP to flash Magisk and your custom kernel, you can just skip flashing the installer zip in this process.
NOTE #6: TWRP can be unstable at times given the way that security has been set up on this device (lack of decryption, failing to boot, etc).
Download both the TWRP image and zip installer from the official site.
Temporarily boot the TWRP image.
Code:
fastboot boot <path_to_twrp_image>
Flash the TWRP installer zip.
Reinstall Magisk and your custom kernel if you had them.
Reboot and profit!
Common issues
Outdated fastboot/adb: This device requires the latest fastboot and adb binaries to work properly. A lot of common quick adb/fastboot installation guides link to installers that are old. Please manually install the latest using the information at the beginning of the thread!
Using a USB-3.0 or USB-C port: Some newer USB ports do not work with fastboot. Issues manifest as weird errors during a flash. Use a different USB cable/port.
Closing statements
If there are any procedures you would like to see added (like flashing a custom kernel or booting TWRP), I am happy to add them if requested. Also, when requesting help, please be as specific as possible where you get confused. I want this guide to be clear as possible.
Reserved
Reserved
Stuck on this step
Run the flash all script! Open a command prompt, navigate to the folder with the script, and run one of the following commands:
How do I navigate in command prompt? When I typed flash-all, it said it is not a internal command etc. When I dragged and dropped flash-all into the command prompt, it said C:\Users\W Balls\Downloads\SAMPWND_SYSTEMROOT_ADB_FILES>"C:\Users\****** Jim\Downloads\walleye-opd1.170816.025-factory-4752baae\walleye-opd1.170816.025\flash-all.bat"
error: cannot load 'bootloader-walleye-mw8998-002.0059.00.img'
rebooting into bootloader...
OKAY [ 0.004s]
finished. total time: 0.004s
error: cannot load 'radio-walleye-g8998-00122-1708311414.img'
rebooting into bootloader...
OKAY [ 0.010s]
finished. total time: 0.015s
W/ ( 6448): Unable to open 'image-walleye-opd1.170816.025.zip': No such file or directory
error: failed to open zip file 'image-walleye-opd1.170816.025.zip': I/O Error
Press any key to exit...
You are calling the flash-all.bat out of a differende directory (C:\Users\W Balls\Downloads\SAMPWND_SYSTEMROOT_ADB_FILES) therefore it can't find the system image files since they are located under C:\U sers\****** Jim\Downloads\walleye-opd1.170816.025-factory-4752baae\walleye-opd1.170816.025. Make sure you extract your image to that directory, open up a command promt and navigate to it with "cd C:\Users\W Balls\Downloads\SAMPWND_SYSTEMROOT_ADB_FILES" and call the flash-all.bat from there.
Check out this for basic command line stuff https://www.digitalcitizen.life/command-prompt-how-use-basic-commands
---------- Post added at 10:58 AM ---------- Previous post was at 10:56 AM ----------
I tried this and it seems the magisk manager isn't able to download magisk on its own at least on my device:
Code:
DownloadManager: [356] Stop requested with status HTTP_DATA_ERROR: Unable to resolve host "forum.xda-developers.com": No address associated with hostname
DownloadManager: [356] Finished with status WAITING_TO_RETRY
EDIT: Seems like DNS66 was blocking the download patching was scucessfull now.
This is weird, can't I make 2 posts in a row??
Anybody figure out a solution for flashing when on MacOs High Sierra? Platform tools 26.0 1 was a fix for high Sierra, yet 26.0.2 seemed to have lost that commit, so fastboot doesn't work at all. Wondering if it's safe to use 26.0.1 on the pixel 2
nathanchance said:
Flashing factory images
Click to expand...
Click to collapse
First, thanks for putting this together. I've rooted using your method.
Regarding OTA updates: I've read that if we've rooted, we will need to un-root before we can receive an OTA update. Is this always true, or only if we've installed a custom recovery like TWRP? It would be really handy to have a guide on how to un-root, update, then re-root.
Related - let's say that for whatever reason, we have to flash an OTA update manually, rather than actually getting it OTA. Do we lose root by doing so?
Thanks!
JayBlack_686 said:
First, thanks for putting this together. I've rooted using your method.
Regarding OTA updates: I've read that if we've rooted, we will need to un-root before we can receive an OTA update. Is this always true, or only if we've installed a custom recovery like TWRP? It would be really handy to have a guide on how to un-root, update, then re-root.
Related - let's say that for whatever reason, we have to flash an OTA update manually, rather than actually getting it OTA. Do we lose root by doing so?
Thanks!
Click to expand...
Click to collapse
Magisk's OTA section should clear up some of your doubts: https://github.com/topjohnwu/Magisk/blob/master/docs/tips.md#ota-installation-tips
nathanchance said:
Magisk's OTA section should clear up some of your doubts: https://github.com/topjohnwu/Magisk/blob/master/docs/tips.md#ota-installation-tips
Click to expand...
Click to collapse
Looks really straightforward, thank you! Might be cool to point to it in the OP. I bet I'm not the only one who was only vaguely aware of the impact that rooting has on how we get OTAs. Then again, maybe everyone else wants to run custom ROMs.
JayBlack_686 said:
Looks really straightforward, thank you! Might be cool to point to it in the OP. I bet I'm not the only one who was only vaguely aware of the impact that rooting has on how we get OTAs. Then again, maybe everyone else wants to run custom ROMs.
Click to expand...
Click to collapse
Good point, I'll add it here in a bit
Sent from my Pixel 2 XL using XDA Labs
OTA vs factory image
Howdy,
really appreciate @nathanchance for putting this together. Would you mind adding a few lines about the differences between OTA and factory images. As a layman i haven't got the foggiest idea which route to go and would appreciate some wisdom. Thanks!
Thank you so much for this guide but can anybody please explain how you can tell which image to patch ?
I am unable to get this to work magisk is showing this message: stock kernel cannot be patched please use a custom kernel
i downloaded: walleye-opd1.170816.010-factory-63083164.zip
unsure as to whether this is correct for my phone as they are quite a few and its unclear how to tell
i have a pixel 2 from the UK that was factory unlocked and i unlocked the boot loader
what am i doing wrong please help
tango650 said:
Howdy,
really appreciate @nathanchance for putting this together. Would you mind adding a few lines about the differences between OTA and factory images. As a layman i haven't got the foggiest idea which route to go and would appreciate some wisdom. Thanks!
Click to expand...
Click to collapse
The primary difference is that the OTA can be flashed on an unlocked bootloader and is designed not to wipe your phone.
UpGrad3 said:
Thank you so much for this guide but can anybody please explain how you can tell which image to patch ?
I am unable to get this to work magisk is showing this message: stock kernel cannot be patched please use a custom kernel
i downloaded: walleye-opd1.170816.010-factory-63083164.zip
unsure as to whether this is correct for my phone as they are quite a few and its unclear how to tell
i have a pixel 2 from the UK that was factory unlocked and i unlocked the boot loader
what am i doing wrong please help
Click to expand...
Click to collapse
Are you supplying the boot image to Magisk? Show me a screenshot of what Magisk says when it tries to patch.
Thanks @nathanchance for this. I'm not a technical person, but can follow directions. This is the 4th phone that I've rooted following directions of some very smart and talented people here on XDA. I don't do this kind of thing everyday, and am not up on programming or coding or whatever you guys call it now days.
All I ended up doing is taking the OTA from Google to the .025. Then followed the Magisk rooting instructions to get root. I had Unlocked it the first day I turned the phone on, I haven't put my SIM in yet, but will play around with it a little more, and finish setting it up,
Again, thanks for the GUIDE to this Pixel 2 phone.
nathanchance said:
The primary difference is that the OTA can be flashed on an unlocked bootloader and is designed not to wipe your phone.
Are you supplying the boot image to Magisk? Show me a screenshot of what Magisk says when it tries to patch.
Click to expand...
Click to collapse
That is what i get. I have even flashed the whole factory image to the phone and still get this
@UpGrad3 you need to extract the boot.img out of your zip (walleye-opd1.170816.010-factory-63083164.zip) file and process this one, I'll guess you tried with the whole zip?? Also you can "attach" pictures to the post and not include the full res with the image tags...
@drmason I did extract the img from the zip. I followed the instructions exactly which is why im so confused as to what is going on ? Ok sorry i will do in future.
Amended post
UpGrad3 said:
@drmason I did extract the img from the zip. I followed the instructions exactly which is why im so confused as to what is going on ? Ok sorry i will do in future.
Amended post
Click to expand...
Click to collapse
You got the boot.img from the zip file that was inside the zip file?
from https://forum.xda-developers.com/showpost.php?p=74429474&postcount=90
Step by step
1. Download and extract factory image. Mine was taimen-opd1.170816.010-factory-c796ddb4.zip
***2. Once extracted go into the folder and extract image-taimen-opd1.170816.010.zip.
There you will find the boot.img.
---------- Post added at 08:36 AM ---------- Previous post was at 08:27 AM ----------
nathanchance said:
Good point, I'll add it here in a bit
Sent from my Pixel 2 XL using XDA Labs
Click to expand...
Click to collapse
@nathanchance, one more suggestion for the OP: at one point I was looking at using the stock boot img and couldn't figure out how to get it. Later, I found the below post, where the first two steps are essentially "open the zip inside the zip for the boot.img" to extract the stock boot image. Maybe it's really obvious, but I didn't get it.
https://forum.xda-developers.com/showpost.php?p=74429474&postcount=90
@UpGrad3 you are using the latest Magisk Manager 5.4.1 for this?
JayBlack_686 said:
You got the boot.img from the zip file that was inside the zip file?
from https://forum.xda-developers.com/showpost.php?p=74429474&postcount=90
Step by step
1. Download and extract factory image. Mine was taimen-opd1.170816.010-factory-c796ddb4.zip
***2. Once extracted go into the folder and extract image-taimen-opd1.170816.010.zip.
There you will find the boot.img.
---------- Post added at 08:36 AM ---------- Previous post was at 08:27 AM ----------
this is where i was going wrong i was using a file that had bootloader in the name rather than going into the second zip and finding boot
@nathanchance, one more suggestion for the OP: at one point I was looking at using the stock boot img and couldn't figure out how to get it. Later, I found the below post, where the first two steps are essentially "open the zip inside the zip for the boot.img" to extract the stock boot image. Maybe it's really obvious, but I didn't get it.
https://forum.xda-developers.com/showpost.php?p=74429474&postcount=90
Click to expand...
Click to collapse
drmason said:
@UpGrad3 you are using the latest Magisk Manager 5.4.1 for this?
Click to expand...
Click to collapse
yes i was
although im now stuck on the bootscreen with the G any suggestions ?
Fixed.
incase it happens to anyone else. i restored the factory image again then started the root procedure. im now rooted and fully working

[Guide][Root] How to install the latest Google software update

This guide is primarily intended for rooted users, since stock users can just take the OTA.
Key points
User data and applications are kept intact
You do not have to remove your PIN, password, or fingerprint
You do not have to remove TWRP, Magisk, your custom kernel, dtbo, or anything
This is intended for monthly security updates; developer previews and beta releases may or may not work with this method. You're welcome to try, but all may not work as expected
Installing Update:
Make sure you have the latest Google SDK Platform Tools. Extract the archive to a location of your choosing (creates platform-tools folder)
Get the latest walleye Factory Image (not OTA) from Google's Developer Page and save to a location of your choosing
Extract the archive, and open the extracted folder. You should see a list of files:
bootloader-walleye-[version string].img
flash-all.bat
flash-all.sh
flash-base.sh
image-walleye-[version string].zip
radio-walleye-[version string].img
Open the flash-all script (flash-all.bat for Windows, flash-all.sh for Linux/OSX) in your favorite text editor.
Find the line that reads "fastboot -w update image-walleye-[version].zip and remove "-w" (the wipe user data switch). Save and close the flash-all script.
Move (cut and paste, etc) all of these files to the platform-tools folder.
Enable USB Debugging from the Developer Options menu on your device (press "Build Number" 7 times if not already visible)
With your device plugged into the computer, open a command prompt in the platform-tools folder
Windows: Open the folder, hold down Shift and right click inside the folder, "Open Command window here"
Linux: If you're on Linux you already know how to do this
OSX: Open a folder in a terminal
Reboot to bootloader:
Code:
adb reboot bootloader
Execute update script in terminal:
Windows:
Code:
flash-all.bat
Linux/OSX:
Code:
./flash-all.sh
The device will reboot a few times while updating
Restoring root and/or a custom recovery
Download latest:
TWRP image
Magisk zip
TWRP zip
(Optional) Custom kernel zip
Place all files in the platform-tools folder
Reboot to bootloader
Boot TWRP image.
Code:
fastboot boot [twrp image filename].img
Push zip files to /tmp
Code:
adb push [magisk filename].zip /tmp
Optional: TWRP persistent installation + custom kernel:
Code:
adb push [twrp filename].zip /tmp
adb push [custom kernel filename].zip /tmp
Install Magisk:
Code:
adb shell twrp install /tmp/[magisk filename].zip
Optional: TWRP persistent installation + custom kernel:
Code:
adb shell twrp install /tmp/[twrp filename].zip
adb shell twrp install /tmp/[custom kernel filename].zip
adb shell twrp install /tmp/[magisk filename].zip
Reboot to system
[ Reserved ]
[ Reserved Post ]
Thanks for the guide
Sent from my Pixel 2 using Tapatalk
Thanks for that, but do not forget to mention to enable usb debugging mode, to account for people who are new to this community.
I'm having trouble Installing Magisk on Step 6. Every time I enter the code it says it can't locate the Magisk file for some reason.
Pianobeats said:
I'm having trouble Installing Magisk on Step 6. Every time I enter the code it says it can't locate the Magisk file for some reason.
Click to expand...
Click to collapse
Oops, my instructions were to push to /tmp but the flashing portion left that directory out. I updated the original post.
atifaslam7 said:
Thanks for that, but do not forget to mention to enable usb debugging mode, to account for people who are new to this community.
Click to expand...
Click to collapse
My thought was that if someone is following this guide, they're already rooted, so would already know to have USB Debugging enabled. I'll add it though for completeness sake.
ehi guys! i have one last doubt before updating to the latest factory image: i have a verizon pixel 2, bootloader unlocked, magisk installed on OPM1.171019.013, will i be able to keep my bootloader unlocked after i flash the latest factory image? i definitely don't want to lock it as i read the unlock command is not working anymore..
thanks a lot!
Thanks for the guide. Worked flawlessly!
daede86 said:
ehi guys! i have one last doubt before updating to the latest factory image: i have a verizon pixel 2, bootloader unlocked, magisk installed on OPM1.171019.013, will i be able to keep my bootloader unlocked after i flash the latest factory image? i definitely don't want to lock it as i read the unlock command is not working anymore..
thanks a lot!
Click to expand...
Click to collapse
Relocking your bootloader is not necessary to flash this. Bootloader will remain unlocked after flashing.
Telperion said:
Note: As of the February security update, TWRP 3.2.1-0 cannot decrypt the /data/ partition. When prompted for your PIN, cancel. You can keep /system/ read-only.
Click to expand...
Click to collapse
TWRP 3.2.1-1 and 3.2.1-2 are able to decrypt /data and /sdcard. MTP still doesn't work, but you can place files on the sdcard via USB in system.
socal87 said:
TWRP 3.2.1-1 and 3.2.1-2 are able to decrypt /data and /sdcard. MTP still doesn't work, but you can place files on the sdcard via USB in system.
Click to expand...
Click to collapse
This is hit and miss, for example 3.2.1-2 won't decrypt /data/ for me on P DP1. Others though have no problem decrypting data.
I kept the instructions the same, but took out the decryption note. Even if your TWRP can decrypt /data/ it's not strictly necessary for this process, so there's consistency in the guide in spite of inconsistent TWRP behavior.
Telperion said:
This is hit and miss, for example 3.2.1-2 won't decrypt /data/ for me on P DP1. Others though have no problem decrypting data.
I kept the instructions the same, but took out the decryption note. Even if your TWRP can decrypt /data/ it's not strictly necessary for this process, so there's consistency in the guide in spite of inconsistent TWRP behavior.
Click to expand...
Click to collapse
This honestly doesn't surprise me in the least; I would expect that Android P might use a different security scheme, so the decryption mechanism that works with Oreo may not be forward compatible.
For persistent twrp don’t you need to fastboot flash the recovery partition with the twrp image?
floepie said:
For persistent twrp don’t you need to fastboot flash the recovery partition with the twrp image?
Click to expand...
Click to collapse
There is no recovery partition, the recovery is now part of the boot image. You have to boot the TWRP image, then flash the TWRP zip which will patch the boot image in both slots.
Right I meant the boot partition. But this contradicts the main guide here where it indicates the necessity to flash both the twrp image to the boot partition (not just boot to the image on your PC), AND flash the twrp zip to make it persistent.
You don’t need to worry about the twrp zip at all if all you want to do is fastboot boot the twrp image.
floepie said:
Right I meant the boot partition. But this contradicts the main guide here where it indicates the necessity to flash both the twrp image to the boot partition (not just boot to the image on your PC), AND flash the twrp zip to make it persistent.
Click to expand...
Click to collapse
Not sure which guide you're referring to, but nathanchance's guide as far as I saw lined up with mine.
Sorry delete
Has there been a workaround created for those of us who can't unlock bootloader because OEM can't be unlocked? Wiping the phone and skipping wizard did not work for me. I'm just trying to root so I can delete apps I don't want.
Can someone tell me about the installing OTA.zip without unrooting or uninstalling the magisk. Is it possible to update through OTA on rooted stock ROM? Or what if we update using the OTA which comes automatically from Google?
Sent from my Pixel 2 using Tapatalk
nickporwal said:
Can someone tell me about the installing OTA.zip without unrooting or uninstalling the magisk. Is it possible to update through OTA on rooted stock ROM? Or what if we update using the OTA which comes automatically from Google?
Click to expand...
Click to collapse
That's not possible, which is why this process exists.

[GUIDE] Flashing and updating custom ROMs

Flashing for Dummies
In this guide we'll go over how to flash custom ROMs with root and TWRP in addition to updating
this guide will always be updated
Read the ENTIRE guide before you start
Code:
Your warranty is now void.
We are not responsible for bricked devices, bootloop... Please
do some research if you have any concerns about mods
included in these GUIDES before using them! YOU are choosing to
make these modifications.
things to keep in mind:
1- when you flash a ROM through TWRP, it will flash to your inactive slot, that's why you need to switch slot after flashing it and then flash everything else, think of it like an OTA update except you need to switch active slot yourself
2- when you change your active slot in TWRP, it will only change after you reboot, your active slot will always be the one you're currently booted on
3- the order of flashing anything that modifies boot is
1) TWRP
2) custom kernel
3) noverity
4)Magisk
if you're not sure, flash stock boot of your rom and do it again, flashing TWRP will break Magisk, flashing a custom kernel will break magisk, flashing TWRP after flashing a custom kernel will most likely get you a bootloop
Before you begin
you need to unlock your bootloader first https://forum.xda-developers.com/mi-a2/how-to/unlock-bootloader-n-root-magisk-easy-t3856800
It is no longer required to be on stock Oreo before flashing, but I currently still recommend you do so as there might be some minor bugs on some custom roms, but otherwise everything will work just fine.
get latest platform-tools if you haven't already, using an older one WILL result in errors
platform-tools
extract it and open the folder
hold shift then right click on an empty space then click "open command window here"
if you're on windows 10, doing that will open power shell instead, inside power shell, type "cmd" and press enter, use cmd for everything below
if you're coming from stock, you need to do this first
type the following command (data and files will be wiped)
Code:
fastboot -w
fastboot set_active b
Notes:
Pixel Experience includes Gapps, do not flash them after the rom
many roms include TWRP, such as Havoc, AICP and many others, check ROM thread first, if it includes it then don't flash TWRP.
Flashing custom ROMs and other stuff
download latest TWRP img and zip from https://twrp.me/xiaomi/xiaomimia2.html and place it in the same folder you extracted platform-tools to
NOTE: if you are on stock then use TWRP 3.2.3 img, not 3.3
note: if you're having issues with official TWRP, I've built an unofficial one with F2FS support which you can try here
be careful if you switch to F2FS, it will only work with a recovery that supports it and a ROM that supports it, no stock.
rename the img to twrp.img
in cmd, type
Code:
fastboot boot twrp.img
if you get a bootloop, force shutdown (power + volume down) and try again
using MTP copy the files needed to flash to your phone
if MTP doesn't work, you have the following options
1) wipe data from TWRP, try again
2) advanced > file manager, go to /data/media , if there is nothing in there, create a new folder called 0 there by going to Advanced > Terminal and typing the following commands
Code:
cd /data/media
mkdir 0
then reboot to bootloader and try again
3) try using PBRP for MTP, then go back to TWRP PBRP
4) use adb sideload:
in TWRP, go to Advanced > adb sideload, then on PC
Code:
adb sideload file.zip
do that for each thing you want to flash
(you can type adb sideload then drag and drop the file you want to flash onto cmd, make sure there's a space between sideload and the file you want to flash)
5) use adb push. follow methode 2 to create the folder, then in cmd, type this command
Code:
adb push file.zip /data/media/0/
do that for each file you need
after you got the files on your phone, it's time to flash
remember that when flashing a ROM, it will flash to your inactive slot, in this guide I'll assume your active slot is B, use "fastboot set_active b" in fastboot if you'd like to follow along
First go to wipe > advanced and select System and Data then wipe, then you can start flashing
1- flash the ROM zip
2- flash TWRP zip, so you can boot to TWRP without the need of a PC (ONLY if the ROM doesn't include it already)
3- switch your active slot (to A if you are on B and to B if you were on A)
4- reboot recovery
5- flash Gapps if required by the ROM you're flashing, Opengapps nano is recommended, you can get it here http://Opengapps.org
6- (optional) flash a custom kernel if desired/needed
7- (optional) flash DM-VERITY & FORCEENCRYPT DISABLER zip , this will disable DM verity and encryption in vendor, this is not required by most custom ROMs as they will disable encryption anyway, it is most useful on stock, and in the possibility that the ROM you're flashing does not disable encryption
8- flash Magisk
9- reboot to system
IMPORTANT, if you get an error while flashing ROM zip, do the following
use latest official TWRP, if you're already using it, then the ROM you're flashing is one of the older ROMs
previously, ROMs and TWRP used Jasmine as a codename for our device, while the real codename is Jasmine_sprout, this caused some issues, newer ROMs and TWRP now use the correct codename, but that means new TWRP can not flash older ROMs, and so you will need some simple modifications to the ROM zip:
1- open the ZIP using WinRAR on PC or X-plore on phone
2- go to META-INF/com/android/metadata and open it as text
3- on the last line, edit 'pre-device=jasmine' to 'pre-device=jasmine_sprout'
4- save it and try flashing again
Switching between custom ROMs
follow the same flashing instructions, you can boot directly to TWRP by holding power + volume up, wipe data and system first then flash ROM and the rest.
Updating Custom ROMs
For OFFICIAL ROMs which support A/B OTA it's very easy
1- once you get a notification that an update is available, download and install with the system updater but don't reboot (If the ROM includes TWRP then don't do any of the following steps, just reboot)
2- go to Magisk, Downloads, search for "TWRP A/B Retention Script" and install it
3- on the main Magisk page, click install > install > Install to Inactive Slot (After OTA)
4- once Magisk finishes, reboot, you will now be on the opposite slot with both Magisk and TWRP installed.
for Unofficial ROMs with no OTA or Official ROMs that don't support A/B OTA, you'll need to use TWRP, do not wipe anything:
1- boot to TWRP
2- flash the ROM zip
3- flash TWRP zip (ONLY IF the ROM doesn't include TWRP)
4- switch your active slot (to A if you are on B and to B if you were on A)
5- reboot recovery
6- flash Gapps if required by the ROM you're flashing, Opengapps nano is recommended, you can get it here http://Opengapps.org
7- (optional) flash a custom kernel if desired/needed
8- (optional) flash DM-VERITY & FORCEENCRYPT DISABLER zip , this will disable DM verity and encryption in vendor, this is not required by most custom ROMs as they will disable encryption anyway, it is most useful on stock, and in the possibility that the ROM you're flashing does not disable encryption
9- flash Magisk
10- reboot to system
Very good and very well detailed guide. This guide will be useful to those who are not so familiar with Flashing ROMs especially in our device with partitions.
Thank you for making this, as many users were asking this thing. Keep it up!
does rebooting to twrp gets stuck on twrp logo after flashing twrp zip?
its been an issue on stock or maybe i have been doing to wrong...
after wipe commands and setting active slot b,
i reboot into fastboot boot twrp.img and flash the rom and Im getting mount failed /system
is that normal?
Edit: NVM, it is normal. I successfully flashed Carbon ROM in my device. Thanks for this awesome guide.
This is great thank you. Going to try it once I get bored of stock rom.
@AxL said:
after wipe commands and setting active slot b,
i reboot into fastboot boot twrp.img and flash the rom and Im getting mount failed /system
is that normal?
Edit: NVM, it is normal. I successfully flashed Carbon ROM in my device. Thanks for this awesome guide.
Click to expand...
Click to collapse
Yes it's normal because you wiped system
levai_spencer said:
does rebooting to twrp gets stuck on twrp logo after flashing twrp zip?
its been an issue on stock or maybe i have been doing to wrong...
Click to expand...
Click to collapse
twrp.zip has a bootloop for TWRP when it is flash
Candy_Pineapple said:
twrp.zip has a bootloop for TWRP when it is flash
Click to expand...
Click to collapse
No, if you follow the instructions it works
coming from stock to pE I followed exacty the steps.
then flash CR. Here what Ive done
i-wipe cache,data,system for both partition using twrp
ii- set partition to B in twrp and flash zip
iii- set partition to A in twrp and reboot into bootloop
iv- set partition to B in twrp and reboot successfully
so what partition is my CR now?
which partition should i install gapps,kernel and magisk?
Thanks.
notJimz said:
coming from stock to pE I followed exacty the steps.
then flash CR. Here what Ive done
i-wipe cache,data,system for both partition using twrp
ii- set partition to B in twrp and flash zip
iii- set partition to A in twrp and reboot into bootloop
iv- set partition to B in twrp and reboot successfully
so what partition is my CR now?
which partition should i install gapps,kernel and magisk?
Thanks.
Click to expand...
Click to collapse
It's in B, because you didn't reboot after switching slot initially in twrp, stay in B and boot recovery then flash Gapps and the rest
Nebrassy said:
It's in B, because you didn't reboot after switching slot initially in twrp, stay in B and boot recovery then flash Gapps and the rest
Click to expand...
Click to collapse
You are right. I miss the first bl reboot.
I follow the step back and reboot after switch partition.
Only now i got the concept for A/B flashing. And my os in A now.
Thanks for the guide. Really helpful.
notJimz said:
You are right. I miss the first bl reboot.
I follow the step back and reboot after switch partition.
Only now i got the concept for A/B flashing. And my os in A now.
Thanks for the guide. Really helpful.
Click to expand...
Click to collapse
No prob, keep connected and click the tx button
Matteo (AIO Project Founder)
Hello,
after make adb push file.zip /data/media/0
I receive the next message
adb: error: failed to get feature set: no devices/emulators found
Please advice.
Thanks
Roviva said:
Hello,
after make adb push file.zip /data/media/0
I receive the next message
adb: error: failed to get feature set: no devices/emulators found
Please advice.
Thanks
Click to expand...
Click to collapse
What's the output of adb devices?
Nebrassy said:
What's the output of adb devices?
Click to expand...
Click to collapse
I entered in fastboot mode,:
C:\Users\DELL\AppData\Local\Android\Sdk\platform-tools>.\adb devices
List of devices attached
C:\Users\DELL\AppData\Local\Android\Sdk\platform-tools>
If I enter the command "adb devices" in normal mode (no fastboot) appear:
C:\Users\DELL\AppData\Local\Android\Sdk\platform-tools>adb devices
List of devices attached
a341410 device
Roviva said:
I entered in fastboot mode,:
C:\Users\DELL\AppData\Local\Android\Sdk\platform-tools>.\adb devices
List of devices attached
C:\Users\DELL\AppData\Local\Android\Sdk\platform-tools>
Click to expand...
Click to collapse
Adb devices
While in twrp, adb won't work while in fastboot, follow the guide carefully
Nebrassy said:
Adb devices
While in twrp, adb won't work while in fastboot, follow the guide carefully
Click to expand...
Click to collapse
Hello,
In your guide I dont understand the next part:
using MTP copy the files needed to flash to your phone
if MTP doesn't work, you have the following options
1) wipe data from TWRP, try again
If I made the step 1 above: I enter in the TWRP, select wipe, then, select wipe, advance wipe, select data and then swipe to wipe. After this reboot system, the telephone start but in normal mode, like restored.
2) advanced > file manager, go to /data/media , if there is nothing in there, create a new folder called 0 there by going to Advanced > Terminal and typing the following commands
I follow the step 2, in data/media appear a folder TWRP then i dont created a folder called 0
Then I go to advanced >> adb sideload and in the pc i wrote "adb sideload twrp.zip.
You write file.zip, I dont understand what is this file?
I dont understand what do you mean in the step 3: "try using PBRP for MTP, then go back to TWRP PBRP"
Code:
cd /data/media
mkdir 0
then reboot to bootloader and try again
3) try using PBRP for MTP, then go back to TWRP PBRP
4) use adb sideload:
in TWRP, go to Advanced > adb sideload, then on PC
Code:
adb sideload file.zip
do that for each thing you want to flash
(you can type adb sideload then drag and drop the file you want to flash onto cmd, make sure there's a space between sideload and the file you want to flash)
5) use adb push. follow methode 2 to create the folder, then in cmd, type this command
Code:
adb push file.zip /data/media/0/
do that for each file you need
Roviva said:
Hello,
In your guide I dont understand the next part:
using MTP copy the files needed to flash to your phone
if MTP doesn't work, you have the following options
1) wipe data from TWRP, try again
2) advanced > file manager, go to /data/media , if there is nothing in there, create a new folder called 0 there by going to Advanced > Terminal and typing the following commands
I follow the step 2, in data/media appear a folder TWRP then i dont created a folder called 0
Then I go to advanced >> adb sideload and in the pc i wrote "adb sideload twrp.zip.
You write file.zip, I dont understand what is this file?
I dont understand what do you mean in the step 3: "try using PBRP for MTP, then go back to TWRP PBRP"
Code:
cd /data/media
mkdir 0
then reboot to bootloader and try again
3) try using PBRP for MTP, then go back to TWRP PBRP
4) use adb sideload:
in TWRP, go to Advanced > adb sideload, then on PC
Code:
adb sideload file.zip
do that for each thing you want to flash
(you can type adb sideload then drag and drop the file you want to flash onto cmd, make sure there's a space between sideload and the file you want to flash)
5) use adb push. follow methode 2 to create the folder, then in cmd, type this command
Code:
adb push file.zip /data/media/0/
do that for each file you need
Click to expand...
Click to collapse
File.zip, as in the file you want to copy, you change that to the name of the file you want to copy
PBRP is another recovery, you can try booting it if twrp doesn't work to copy
Nebrassy said:
File.zip, as in the file you want to copy, you change that to the name of the file you want to copy
PBRP is another recovery, you can try booting it if twrp doesn't work to copy
Click to expand...
Click to collapse
hello,
I dont know how to follow:
flash the ROM zip
2- flash TWRP zip, so you can boot to TWRP without the need of a PC
3- switch your active slot (to A if you are on B and to B if you were on A)
4- reboot recovery
I wiped data and storage then I press back.
I flashed the PBRP that I pushed to data/media/TWRP
After flash I returned to the menu of PBRP
I switched to A
When I reboot, a warning message that "NO OS SYSTEM IS INSTALLED" appear.
I reboot to recovery but after this, the telephone does not restart. the screen "androidone" appear and dont advance...
How can I install the PBRP and magisk?
I succesfull push the files to the telephone but when flash the PBRP I cannot follow......
Roviva said:
hello,
I dont know how to follow:
flash the ROM zip
2- flash TWRP zip, so you can boot to TWRP without the need of a PC
3- switch your active slot (to A if you are on B and to B if you were on A)
4- reboot recovery
I wiped data and storage then I press back.
I flashed the PBRP that I pushed to data/media/TWRP
After flash I returned to the menu of PBRP
I switched to A
When I reboot, a warning message that "NO OS SYSTEM IS INSTALLED" appear.
I reboot to recovery but after this, the telephone does not restart. the screen "androidone" appear and dont advance...
How can I install the PBRP and magisk?
I succesfull push the files to the telephone but when flash the PBRP I cannot follow......
Click to expand...
Click to collapse
You didn't flash a rom, obviously it won't boot

How To Completely Remove TWRP and Return to Full Stock

Works only on Tank HD and Mantis 4K.
The process is really simple and requires very little effort to return back to 100% stock in case you return your device or for many reasons. Ok download and find the official latest stock image for your Fire TV, and download then install ADB and Fastboot on your computer, plug your Fire TV in to your computer, make sure ADB is on, then type in these given commands, ADB devices, ADB reboot recovery, ADB shell, twrp wipe /system, twrp sideload, ADB sideload update.zip (rename the .bin to .zip) and let it continue flashing. Once finished, take the update.zip and extract it. Find the boot.img from the folder and type this in. ADB sideload (drag and drop) boot.img /storage/emulated/0 (if this doesn't transfer while in TWRP, reboot into the /system and type in the same command again), this is where you'll need an OTG cable with a mouse (For the Fire TV Stick 4K it'll boot into TWRP on boot with OTG so cancel the rebooting in 3..2...1.. and click install in TWRP, on the lower right hand corner click on install image, boot.img and flash it as boot. Backup the boot.img and restore it with your mouse. Unplug your device, and plug it back into the computer, ADB reboot recovery, ADB shell reboot-amonet, it'll now be in hacked fastboot mode. Make sure it's recognized as a fastboot device and type in these final commands, fastboot flash boot (drag and drop) boot.img then reboot. After rebooting, type in ADB reboot recovery and you'll now see no command which means you successfully removed TWRP with stock updates now.
For those without OTG, still the same instructions (Backup the boot after flashing the stock image and restore it with these commands that can be found here):
https://twrp.me/faq/openrecoveryscript.html
Skel40 said:
Find the boot.img from the folder and type this in. ADB sideload (drag and drop) boot.img /storage/emulated/0 (if this doesn't transfer while in TWRP, reboot into the /system and type in the same command again), this is where you'll need an OTG cable with a mouse (For the Fire TV Stick 4K it'll boot into TWRP on boot with OTG so cancel the rebooting in 3..2...1.. and click install in TWRP, on the lower right hand corner click on install image, boot.img and flash it as boot. Backup the boot.img and restore it with your mouse.
Click to expand...
Click to collapse
You don't need to deal with the boot.img in TWRP, it gets flashed together with the rom. Also no need for a backup and a restore.
Simply flash the stock rom with TWRP, then reboot to the BL with 'adb shell reboot-amonet' followed by a 'fastboot flash boot boot.img'
In case someone wants to send the stick back, a 'fastboot format userdata' is a good idea, then fastboot reboot
Just at the reboot, TWRP gets replaced with the stock recovery.
Done.
Update: Finally got on the latest and greatest, no root or TWRP. I found a list of the stock ROMS in the link below. As stated above, I simply flashed the stock ROM in TWRP and then rebooted and did a factory reset followed by and update. Simple as that.
https://www.aftvnews.com/amazon-fire-tv-fire-tv-stick-software-update-history/
Where can I find an unrooted stock ROM? I'm trying to get rid of twrp on one of my firetv boxes. I started by allowing OTA updates and when I try to update, it will download and then acts like it will install it, but upon reboot it is still on the same version. Presumably because TWRP is interfering with the install process? Either way, direction yo a stock image is appreciated. All I can seem to find are rprerooted images.
For 4k
https://forum.xda-developers.com/fire-tv/general/official-stock-image-fire-tv-stick-4k-6-t4088247
First Post, rename bin to zip.
Flash with twrp.
adb push firmware.zip /sdcard/firmware.zip
adb shell twrp wipe cache
adb shell twrp wipe data
adb shell twrp wipe dalvik
adb shell twrp wipe /system
adb shell twrp install /sdcard/firmware.zip
Extract boot.img from Firmware.zip
adb shell reboot-amonet
fastboot flash boot boot.img
fastboot reboot
Now you are back at Stock.
0815hoffi said:
For 4k
https://forum.xda-developers.com/fire-tv/general/official-stock-image-fire-tv-stick-4k-6-t4088247
First Post, rename bin to zip.
Flash with twrp.
adb push firmware.zip /sdcard/firmware.zip
adb shell twrp wipe cache
adb shell twrp wipe data
adb shell twrp wipe dalvik
adb shell twrp wipe /system
adb shell twrp install /sdcard/firmware.zip
Extract boot.img from Firmware.zip
adb shell reboot-amonet
fastboot flash boot boot.img
fastboot erase userdata
fastboot reboot
Now you are back at Stock.
Click to expand...
Click to collapse
Does this remove twrp? I want to go back to stock but NOT UNISTALL TWRP because aftv-gapps are not working for me so i want to go back to stock and re-root it and install aftv gapps
ROM_gamer987 said:
Does this remove twrp? I want to go back to stock but NOT UNISTALL TWRP because aftv-gapps are not working for me so i want to go back to stock and re-root it and install aftv gapps
Click to expand...
Click to collapse
This will remove TWRP
Code:
adb shell reboot-amonet
fastboot flash boot boot.img
fastboot erase userdata
fastboot reboot
This code restores original Recovery and bootloader, if you want to keep TWRP then don't use these commands, you can use above commands to unroot.
ROM_gamer987 said:
I want to go back to stock but NOT UNISTALL TWRP because aftv-gapps are not working for me so i want to go back to stock and re-root it and install aftv gapps
Click to expand...
Click to collapse
If its a gapps system install, simply wipe system and flash a new stock bin (renamed to zip).
-----------------
Note to everyone, the guide above in OP works only for 'tank' (aka second gen stick) and 'mantis' (aka 4k stick).
SweenWolf said:
This will remove TWRP
Code:
adb shell reboot-amonet
fastboot flash boot boot.img
fastboot erase userdata
fastboot reboot
This code restores original Recovery and bootloader, if you want to keep TWRP then don't use these commands, you can use above commands to unroot.
Click to expand...
Click to collapse
Well I did these commands and twrp is still there, I guess I was lucky and the boot.img failed or something, Now I got gapps working
I might be missing something, but as far as i can see, following the steps from this thread will only flash the stock boot.img (which is not patched with amonet when using fastboot) and erase userdata (reset), but it will not remove twrp (which reside in the recovery partition).
To replace TWRP with stock recovery, the fastboot command should look like this:
fastboot flash recovery stock_recovery.img
"stock_recovery.img" filename is just an example,of course.
Pretoriano80 said:
I might be missing something
Click to expand...
Click to collapse
I don't know
k4y0z said in the 4k thread, that the stock recovery gets restored (out of the boot.img) at first boot...
Though your command should work fine obviously.
k4y0z said:
Is it possible to remove the hacked bootloader and twrp?
Click to expand...
Click to collapse
You would have to flash stock update-bin via TWRP first and then flash the stock boot.img from that same update-bin separately via hacked fastboot.
Amazon recovery should then be restored on first boot.
Click to expand...
Click to collapse
Permalink
@0815hoffi, i have followed all the mentioned command steps above and TWRP still exists. Attached is the proof. It doesn't show up during normal boots but when reset or Fire stick auto software update is performed it takes control. TWRP even installs Fire stick software update too.
@Pretoriano80 looks like you are correct. Is there a way i can completely remove TWRP since now i have restored Fire stick original OS and not going through shorting and root process again. adb doesn't work now.
TwrpFire
matrixddl said:
@0815hoffi, i have followed all the mentioned command steps above and TWRP still exists. Attached is the proof. It doesn't show up during normal boots but when reset or Fire stick auto software update is performed it takes control. TWRP even installs Fire stick software update too.
@Pretoriano80 looks like you are correct. Is there a way i can completely remove TWRP since now i have restored Fire stick original OS and not going through shorting and root process again. adb doesn't work now.
TwrpFire
Click to expand...
Click to collapse
For me it worked on TvStick2 .
You must use Stock rom , not prerooted.
Wipe System , Flash rom, Boot amonet, Flash Boot.bin with Fastboot, reboot.
Run oobe, enable ADB.
Adb shell reboot recovery.
Stock Recovery should comes up....
0815hoffi said:
For me it worked on TvStick2 .
You must use Stock rom , not prerooted.
Wipe System , Flash rom, Boot amonet, Flash Boot.bin with Fastboot, reboot.
Run oobe, enable ADB.
Adb shell reboot recovery.
Stock Recovery should comes up....
Click to expand...
Click to collapse
I have downloaded latest stock from here
Now to retry the process do i have to unlock again or anyway i can continue using existing twrp.
No if you can Boot to twrp.
Sus_i said:
I don't know
k4y0z said in the 4k thread, that the stock recovery gets restored (out of the boot.img) at first boot...
Though your command should work fine obviously.
Permalink
Click to expand...
Click to collapse
Ok, i figured how it works. Probably if the recovery signature doesn't match on first clean boot, then it will trigger the /system/bin/install-recovery.sh script and that will flash/install the stock recovery.
But if for some reason that script was removed/modified, then it will fail to replace TWRP with the stock recovery (maybe that's why this guide works for some but not for all).
0815hoffi said:
No if you can Boot to twrp.
Click to expand...
Click to collapse
I rooted again and tried to try to restore original and still TWRP exists. I have followed your steps as well as original OP's instructions still no luck.
I was on mantis-6.2.6.8-rooted_r1 and from there i used the stock update-kindle-mantis-NS6276_user_2933_0004396381572 to restore? Which version of stock rom did you use?
Pretoriano80 said:
Ok, i figured how it works. Probably if the recovery signature doesn't match on first clean boot, then it will trigger the /system/bin/install-recovery.sh script and that will flash/install the stock recovery.
But if for some reason that script was removed/modified, then it will fail to replace TWRP with the stock recovery (maybe that's why this guide works for some but not for all).
Click to expand...
Click to collapse
Is there a way to check or fix this?
Same as installed.
Try with
https://d1s31zyz7dcc2d.cloudfront.n...dle-mantis-NS6268_user_2315_0003255372676.bin
Flash it, boot, make initial Setup.
Then reboot to twrp and follow the Guide
matrixddl said:
I rooted again and tried to try to restore original and still TWRP exists. I have followed your steps as well as original OP's instructions still no luck.
I was on mantis-6.2.6.8-rooted_r1 and from there i used the stock update-kindle-mantis-NS6276_user_2933_0004396381572 to restore? Which version of stock rom did you use?
Is there a way to check or fix this?
Click to expand...
Click to collapse
I don't know why it doesn't work for you, so i have no idea how to fix.
Personally, when i went back to full factory condition, i flashed every partition with hacked fastboot.
I have it testet with my 4k Stick Installed Version 6.2.7.3.
I think the Problem is #fastboot erase userdata
dont run this.
Now i am back at Stock.
Thats the Log off my test.
https://androidfilehost.com/?fid=6006931924117923181
Installed Version 6.2.7.3
D:\FireTV2K4K>adb push ftvs4k_6.2.7.3.zip /sdcard/
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
10290 KB/s (648296329 bytes in 61.522s)
D:\FireTV2K4K>adb shell reboot recovery
D:\FireTV2K4K>adb shell twrp wipe cache
Formatting Cache using mke2fs...
Done.
Done processing script file
D:\FireTV2K4K>adb shell twrp wipe data
Wiping data without wiping /data/media ...
Done.
Formatting cache using mke2fs...
Done.
Done processing script file
D:\FireTV2K4K>adb shell twrp wipe dalvik
Wiping Cache & Dalvik...
-- Dalvik Cache Directories Wipe Complete!
Done processing script file
D:\FireTV2K4K>adb shell twrp wipe /system
Formatting System using mke2fs...
Done.
Done processing script file
D:\FireTV2K4K>adb shell twrp install /sdcard/ftvs4k_6.2.7.3.zip
Installing zip file '/sdcard/ftvs4k_6.2.7.3.zip'
Checking for Digest file...
[amonet] Load microloader from recovery...
[amonet] Remove boot patch...
[amonet] OK
Target: Amazon/mantis/mantis:6.0/NS6273/2773N:user/amz-p,release-keys
Patching system image unconditionally...
Patching vendor image unconditionally...
script succeeded: result was [1.000000][amonet] Install boot patch...
[amonet] OK
[amonet] Install recovery patch...
[amonet] ALREADY_INSTALLED
Done processing script file
D:\FireTV2K4K>adb shell reboot-amonet
D:\FireTV2K4K>fastboot devices
************* fastboot
D:\FireTV2K4K>fastboot flash boot boot.img
target reported max download size of 134217728 bytes
sending 'boot' (7522 KB)...
OKAY [ 0.312s]
writing 'boot'...
OKAY [ 0.484s]
finished. total time: 0.797s
D:\FireTV2K4K>fastboot erase userdata
******** Did you mean to fastboot format this ext4 partition?
erasing 'userdata'...
OKAY [ 0.141s]
finished. total time: 0.156s
D:\FireTV2K4K>fastboot reboot
rebooting...
finished. total time: -0.000s
D:\FireTV2K4K>
_________________________________________________
TWRP is still here
_________________________________________________
Update on initial Setup is running > auto reboot to TWRP
_________________________________________________
D:\FireTV2K4K>adb shell
~ # ^[[5;5R
~ # ^[[7;5R
~ # ^[[9;5R
~ # ^[[11;5Rexit
exit
D:\FireTV2K4K>
D:\FireTV2K4K>adb push ftvs4k_6.2.7.3.zip /sdcard/
9691 KB/s (648296329 bytes in 65.325s)
D:\FireTV2K4K>adb shell twrp install /sdcard/ftvs4k_6.2.7.3.zip
Installing zip file '/sdcard/ftvs4k_6.2.7.3.zip'
Checking for Digest file...
[amonet] Load microloader from recovery...
[amonet] Remove boot patch...
[amonet] OK
Target: Amazon/mantis/mantis:6.0/NS6273/2773N:user/amz-p,release-keys
Patching system image unconditionally...
Patching vendor image unconditionally...
script succeeded: result was [1.000000][amonet] Install boot patch...
[amonet] OK
[amonet] Install recovery patch...
[amonet] ALREADY_INSTALLED
Done processing script file
D:\FireTV2K4K>adb shell reboot-amonet
D:\FireTV2K4K>fastboot devices
************* fastboot
D:\FireTV2K4K>fastboot flash boot boot.img
target reported max download size of 134217728 bytes
sending 'boot' (7522 KB)...
OKAY [ 0.312s]
writing 'boot'...
OKAY [ 0.489s]
finished. total time: 0.801s
D:\FireTV2K4K>fastboot reboot
rebooting...
finished. total time: -0.000s
D:\FireTV2K4K>
__________________________________________________________________________________________________
After Bootup Update is running, now it reboots to Stock recovery and 6.2.7.6 will be is installed.
__________________________________________________________________________________________________
Click to expand...
Click to collapse
adb shell reboot recovery > boots now to stock Amazon recovery.
This worked.
Installed version 6276. adb reboot recovery returns "No Command".
Kudos for you help and patience.
0815hoffi said:
I have it testet with my 4k Stick Installed Version 6.2.7.3.
I think the Problem is #fastboot erase userdata
dont run this.
Now i am back at Stock.
Thats the Log off my test.
adb shell reboot recovery > boots now to stock Amazon recovery.
Click to expand...
Click to collapse

Categories

Resources