Root OnePlus 2 with TWRP or OTA stock ? - OnePlus 2 Q&A, Help & Troubleshooting

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.

Related

Root Nexus One on a Mac/Linux/Windows

Hi guys. I published a step by step guide for all the newbies (I had a tough time the first time. Slightly different combination but it works! Also flashed the custom recovery image!
http://ilikemygooglephone.com/2010/...-and-root-google-nexus-one-mac-windows-linux/
This tutorial on rooting and flashing the RA recovery rom is THE BOMB!
Followed all the steps and now I too have gone to the dark side, and eaten some cookies....
Nice work.
Great! Love it!
This how I REroot Android in my N1.
Needs:
1) RA recovery image v2.0
2) fastboot
3) adb
1) Set to bootloader
Code:
adb reboot-bootloader
2) Boot RA-recovery 2.0
Code:
fastboot boot /path/to/recovery-RA-nexus-v2.0.0.img
Yes, it only boot the recovery image in memory.
2a) If you have RA already, then just boot the recovery
3) RA: Mount -> mount /system
4) Change permission /system/bin/su to 4755
Code:
adb shell 'chmod 4755 /system/bin/su'
5) Reboot, and enjoy your rooted Android.
Tested, on FRG83D, FRG83G and GRI40 stocks
Good luck.
Thank you.
Does it have to be 2.0.0? or can it be any of the RA recoveries above 2.0.0?
bahathir said:
This how I REroot Android in my N1.
Needs:
1) RA recovery image v2.0
2) fastboot
3) adb
1) Set to bootloader
Code:
adb reboot-bootloader
2) Boot RA-recovery 2.0
Code:
fastboot boot /path/to/recovery-RA-nexus-v2.0.0.img
Yes, it only boot the recovery image in memory.
2a) If you have RA already, then just boot the recovery
3) RA: Mount -> mount /system
4) Change permission /system/bin/su to 4755
Code:
adb shell 'chmod 4755 /system/bin/su'
5) Reboot, and enjoy your rooted Android.
Tested, on FRG83D, FRG83G and GRI40 stocks
Good luck.
Thank you.
Click to expand...
Click to collapse
A question for you, if it's possible to simply just change the permission of the su file on the phone, why do most auto root zip's come with an su file of their own?
Could they not just run the script above?
this whole procedure thing ... do stock users like myself lose anything? Like, does it wipe data or does it simply root and nothing at all changes?
You can never tell with these procedures... half wipe the phone...
I haven't tested it, but from the steps listed above (by bahathir) you won't lose any data.
All he's doing is getting you to boot into fastboot mode (power on the phone while pressing the trackball), and then loading the custom recover into temporary memory.
Then, the system folder is mounted and the required permissions are applied to the su file. Once that's done, you reboot your phone and nothing else changes.
The question that I had above though, is that I've not seen this method used before. Most one-click root methond replace the su file (requiring you to flash a zip file from custom recovery).
ahh too bad it doesn't work. maybe a 2.3.3 thing, but I just tried unlocking my bootloader and it says I'm missing AdbWinApi.dll from my PC ... but it's clearly there.
I have the most up-to-date Android SDK packages. I've used them before to root my nexus without a hitch...
SU should be present on the system, and the method above takes it for granted. Thus it's for RErooting. Rooting methods bring the SU - they don't care if there's one on the system, assuming that there isn't.
On the other hand, I'm completely unsure that "fastboot boot recovery.img" will work on custom image and locked bootloader. If it's the case - this is the most overlooked and bulletproof rooting method for Nexus. But I doubt it's the case.
Here's a n00b question. I have an unlocked boot loader and had previously rooted my phone using superoneclick. I wiped all the data before moving to stock gingerbread since I was on CM7 nightlies before. So there is no "su" in my phone. I get the obvious error:
c:\android-sdk-windows\platform-tools>adb shell 'chmod 4755 /system/bin/su'
/sbin/sh: chmod 4755 /system/bin/su: not found
when I try to run the steps listed here. Any ideas how to get the 'su' on my phone?
I guess you're executing "rerooting guide". Well, you can stop now, since there is no SU.
Flash it on your phone. That would be the obvious solution. Running unlocked bootloader and custom recovery, not really hard to do.
When you're doing things you don't fully understand, sometimes you go in extremely awkward ways to accomplish simple tasks. Having unlocked bootloader, why are you bothering with those guides? Reboot to fastboot, flash custom recovery, flash SU package in recovery, reboot. That would be all. Hard? not really.
Jack_R1 said:
I guess you're executing "rerooting guide". Well, you can stop now, since there is no SU.
Flash it on your phone. That would be the obvious solution. Running unlocked bootloader and custom recovery, not really hard to do.
When you're doing things you don't fully understand, sometimes you go in extremely awkward ways to accomplish simple tasks. Having unlocked bootloader, why are you bothering with those guides? Reboot to fastboot, flash custom recovery, flash SU package in recovery, reboot. That would be all. Hard? not really.
Click to expand...
Click to collapse
Thanks Jack! Can you point me to an su package that I can safely flash with gingerbread?
Sent from my Nexus One using XDA App
I found the package nexus-addon-0.1-signed.zip while searching for 'su' packages to root an unlocked nexus one on this guide http://forum.xda-developers.com/showthread.php?t=636795 . Will it be safe to flash this on a stock gingerbread?
aliezad said:
I found the package nexus-addon-0.1-signed.zip while searching for 'su' packages to root an unlocked nexus one on this guide http://forum.xda-developers.com/showthread.php?t=636795 . Will it be safe to flash this on a stock gingerbread?
Click to expand...
Click to collapse
I don't think that zip would work.
I rooted by applying the su.zip provide by dsixda here: http://forum.xda-developers.com/showthread.php?t=968396 (attachment, bottom of first post)
You would need to flash this from custom recovery (I used Amon RA 2+).
Thanks Brownbay! Worked like a charm!
Jack_R1 said:
...I'm completely unsure that "fastboot boot recovery.img" will work on custom image and locked bootloader.
Click to expand...
Click to collapse
Unfortunately this won't work on a locked bootloader (at least, not on mine!), so if you've used 'super one click' to root your N1 without unlocking it (like me), this method won't work for you.
I already have had my bootloader unlocked. I'm wondering if this rooting method alone will wipe my phone?
No, it won't wipe your phone.

Install Stock Recovery Meizu M2 Mini

Step :
Install driver adb
USB Debugging - ON
Root device
Install Rootexplorer-3.3.8.apk
Install Rebootmanager.apk
Take the file system/bin/install-recovery.sh from stock rom.zip
Customize with its version Flyme
Copy the file install-recovery.sh to sdcard (mmc internal)
Rename root/system/ recovery-from-boot.bak
Into root/system/recovery-from-boot.p
Seting permission recovery-from-boot.p into rw-r-r
Execution using adb
adb shell
sh /sdcard/install-recovery.sh
reboot recovery​
Or execution with terminal emulator.apk
su
sh /sdcard/install-recovery.sh
reboot recovery​
Finished :laugh:
Install Custom Recovery with fastboot, flashify, etc.
Bootloop solution after unlock the bootloader because the data can not be mounted:
Press and hold the key (vol+ & power) a bit longer to actually able to enter recovery mode (twrp/cwm/philztouch/etc)
Wipe factory reset
Flash stock rom.zip
Finished
* Thanks to Allah SWT.
zround said:
Step :
Install driver adb
Root device
Install Rebootmanager.apk
Customize with its version Flyme
Rename root/system/ recovery-from-boot.bak
Seting permission recovery-from-boot.p into rw-r-r
Or execution with terminal emulator.apk
su
sh /sdcard/install-recovery.sh
reboot recovery
Press and hold the key (vol+ & power) a bit longer to actually able to enter recovery mode (twrp/cwm/philztouch/etc)
Flash stock rom.zip
Finished
* Thanks to Allah SWT.
Click to expand...
Click to collapse
in terminal command it shows that recovery.sh not found
My mini M2 condition:
1. It's UBL
2. Custom recovery TWRP
3. Custom ROM Lineages 14.1
Problem: GAPPS error. Google play services keep stopped.
Steps you've tried:
1. install GAPPS with OpenGapps for Lineages 14.1
2. install using f-droid (Gapps replacement)
3. install Google installer.apk with ROM Flyme 6
the problem remains the same as above.
is it can solve my problem wanna get back to Flyme Os and also GAPPS problem?
or flashing use the firmware via flashtool?
I tried looking at the XDA Forum, and Google has not found it.
.
thank you
zround said:
Step :
Install driver adb
USB Debugging - ON
Root device
Install Rootexplorer-3.3.8.apk
Install Rebootmanager.apk
Take the file system/bin/install-recovery.sh from stock rom.zip
Customize with its version Flyme
Copy the file install-recovery.sh to sdcard (mmc internal)
Rename root/system/ recovery-from-boot.bak
Into root/system/recovery-from-boot.p
Seting permission recovery-from-boot.p into rw-r-r
Execution using adb
adb shell
sh /sdcard/install-recovery.sh
reboot recovery
Or execution with terminal emulator.apk
su
sh /sdcard/install-recovery.sh
reboot recovery
Finished :laugh:
Install Custom Recovery with fastboot, flashify, etc.
Bootloop solution after unlock the bootloader because the data can not be mounted:
Press and hold the key (vol+ & power) a bit longer to actually able to enter recovery mode (twrp/cwm/philztouch/etc)
Wipe factory reset
Flash stock rom.zip
Finished
* Thanks to Allah SWT.
Click to expand...
Click to collapse
By the way,you don't need to do all these. If you need to replace twrp to stock. Just flash flyme update.zip inside twrp or any recovery you have now. It may get replaced to stock automatically.
Guys, you can just flash the stock recovery using fastboot

[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

[Guide] Enable ADB on the stock OxygenOS recovery

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!

Categories

Resources