[Recovery][Stock OOS 10.0.3BA]Oxygen OS Stock recovery with ADB enabled

Search This thread

s3axel

Senior Member
While waiting for a working TWRP for all those needful of the possibility to access their file system from recovery, e.g. for removing an offensive magisk extension preventing boot I repackaged the Stock OOS recovery from the 10.0.1BA package but with ADB enabled.

Prerequisites:
  • Oneplus 7T Pro :)
  • 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
(when taking the file as downloaded the filename is "OP7TP_StockRecovery_ADB_nosec.img")

Uninstall:
Same as installation, but flash the original stock recovery instead.

Usage:
Boot up recovery, enter encryption key if file system is encrypted. Then connect the phone to 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.

Downloads:

10.0.3BA Recovery
  • Modified 10.0.3BA recovery from GDrive
  • Original 10.0.3BA stock recovery from Gdrive
10.0.4BA Recovery
  • Modified 10.0.4BA recovery from GDrive
  • Original 10.0.4BA stock recovery from Gdrive
10.0.7BA Recovery
  • Modified 10.0.7BA recovery from GDrive
  • Original 10.0.7BA stock recovery from Gdrive
Open Beta 1 Recovery
  • Modified OB1 recovery from GDrive
Open Beta 2 Recovery
  • Modified OB2 recovery from GDrive

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 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 on what you are doing ;)

Credits: Thanks to osm0sis for Android kitchen and all great developers for the Oneplus devices, specifically mauronofrio for his TWRP efforts.
 
Last edited:

991547436

New member
Jan 8, 2016
3
0
But this rec has a bug
After swiping in and entering REC, the interface does not need to enter a password, and the adb shell opens /data is empty.
Only the boot_a and boot_b that have not been modified by magisk are brushed in and the password is entered again after booting and re-entering rec, and the data can be modified.

但是这个rec有个BUG
刷入并进入REC后 界面不需要输入密码,并且adb shell打开/data是空的
只有刷入没有被magisk修改过的boot_a和boot_b并且开机后重新进入rec才有输入密码的界面,并且data可以修改
 

HolyChickenGuy

Senior Member
Jul 30, 2017
143
87
www.instagram.com
But this rec has a bug

After swiping in and entering REC, the interface does not need to enter a password, and the adb shell opens /data is empty.

Only the boot_a and boot_b that have not been modified by magisk are brushed in and the password is entered again after booting and re-entering rec, and the data can be modified.



但是这个rec有个BUG

刷入并进入REC后 界面不需要输入密码,并且adb shell打开/data是空的

只有刷入没有被magisk修改过的boot_a和boot_b并且开机后重新进入rec才有输入密码的界面,并且data可以修改
English only pls?

OnePlus 7T Pro
 

991547436

New member
Jan 8, 2016
3
0
While waiting for a working TWRP for all those needful of the possibility to access their file system from recovery, e.g. for removing an offensive magisk extension preventing boot I repackaged the Stock OOS recovery from the 10.0.1BA package but with ADB enabled.

Prerequisites:
  • Oneplus 7T Pro :)
  • 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 <recovery_filename.img>
(when taking the file as downloaded the filename is "OP7TP_StockRecovery_ADB_nosec.img")

Uninstall:
Same as installation, but flash the original stock recovery instead.

Usage:
Boot up recovery, enter encryption key if file system is encrypted. Then connect the phone to 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.

Downloads: (all based on 10.0.3BA image from Oneplus)
  • Modified recovery from GDrive
  • Original stock recovery from Gdrive

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 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 on what you are doing ;)

Credits: Thanks to osm0sis for Android kitchen and all great developers for the Oneplus devices, specifically mauronofrio for his TWRP efforts.

English only pls?

OnePlus 7T Pro

English is a translation. I don't know if the translation is correct.
 

s3axel

Senior Member
But this rec has a bug
After swiping in and entering REC, the interface does not need to enter a password, and the adb shell opens /data is empty.QUOTE]

I noticed the same behaviour when trying "fastboot boot", the recovery needs to be flashed to work.

Second I own an EU device with BA firmware/OS on it, maybe global devices with AA firmware are different...
 

Az4z3l11

New member
Nov 10, 2019
2
0
This has caused my device to bootloop to recovery. Flashing stock recovery doesn't fix this problem.
Doing fastboot boot boot.img starts my rom, but every time I reboot (via fastboot, adb or normally from rom) it goes back to recovery. I am running 10.0.3.HD01BA and don't have any ideas how to recover from this.
Any help would be appreciated, I am truly a novice in this scene.
 

HolyChickenGuy

Senior Member
Jul 30, 2017
143
87
www.instagram.com
This has caused my device to bootloop to recovery. Flashing stock recovery doesn't fix this problem.

Doing fastboot boot boot.img starts my rom, but every time I reboot (via fastboot, adb or normally from rom) it goes back to recovery. I am running 10.0.3.HD01BA and don't have any ideas how to recover from this.

Any help would be appreciated, I am truly a novice in this scene.
Did you install any modules?

OnePlus 7T Pro
 
  • Like
Reactions: Az4z3l11

s3axel

Senior Member
This has caused my device to bootloop to recovery. Flashing stock recovery doesn't fix this problem.

Doing fastboot boot boot.img starts my rom, but every time I reboot (via fastboot, adb or normally from rom) it goes back to recovery. I am running 10.0.3.HD01BA and don't have any ideas how to recover from this.

Any help would be appreciated, I am truly a novice in this scene.
Just a thought: could it be that you flashed this recovery with "Fastboot flash boot <filename.img> ? This would explain that when booting not the original boot image but recovery comes up.

From your message I take that you have the original boot image at hand, you could try flashing it with "fastboot flash boot boot.img"

The recovery image in this thread is flashed with "fastboot flash recovery <filename.img>...

Hth, cheers,
Axel

Gesendet von meinem HD1913 mit Tapatalk
 
  • Like
Reactions: Az4z3l11

Az4z3l11

New member
Nov 10, 2019
2
0
Did you install any modules?

OnePlus 7T Pro

Only one that came with my Swift Installer.

Just a thought: could it be that you flashed this recovery with "Fastboot flash boot <filename.img> ? This would explain that when booting not the original boot image but recovery comes up.

From your message I take that you have the original boot image at hand, you could try flashing it with "fastboot flash boot boot.img"

The recovery image in this thread is flashed with "fastboot flash recovery <filename.img>...

Hth, cheers,
Axel

Gesendet von meinem HD1913 mit Tapatalk

Negative, I have the command prompt window still open, and was extra careful to flash the recovery with recovery, not boot.
The image I have is a patched boot image from another xda thread. I am scared that flashing that would brick my device.

EDIT: Is there a way to extract my original boot.img and then try to flash it?

EDIT2: Extracted my boot.img from /data folder in stock_boot_xxxxxxxxxxx.img.gz. I will try to flash it once I have backed everything up.

EDIT 3: Tried flashing original boot.img and re-rooting phone with magisk, and no luck. The solution was too obvious though. I didn't realize that my phone had encryption on and the password was my lockscreen PIN code. After decrypting the recovery the phone boots normally and the adb recovery works perfectly.
Thanks for the support, it seems that tinkering with your phone is way harder than I remember it from back in the days; hopefully TWRP will fix this, once it supports Android 10.
Thank you very much for the recovery!
 
Last edited:

s3axel

Senior Member
Just curious, do you have a guide on how to this yourself?
It's actually pretty easy and this would most probably also work for the 7T...

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:
  1. unpack image with Image Kitchen --> this will create a "ramdisk" and a "Split_img" directory with the unpacked content within
  2. navigate into the "ramdisk" folder and use a text editor (on windows preferably Notepad++) to edit the file "prop.default"
  3. 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)
  4. look for entry "ro.debuggable" and change this from "0" to "1" --> this actually enables adb
  5. 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 behaviour :)
  6. save textfile
  7. repack the image with Android Image Kitchen and voila:
  8. you have a new modified recovery image you can flash
 
Last edited:

Oswald Boelcke

Forum Moderator / Recognized Translator
Staff member
  • English only pls?

    OnePlus 7T Pro

    English is a translation. I don't know if the translation is correct.
    Moderator Announcement:
    The way you did is very fine and exemplary!
    *********
    您的做法非常好,堪称典范!
    XDA Forum Rules (excerpt):

    ...
    4. Use the English language.

    We understand that with all the different nationalities, not everyone speaks English well, but please try. If you're really unable to post in English, use an online translator. You're free to include your original message in your own language, below the English translation. (This rule covers your posts, profile entries and signature). You could try :- https://translate.google.com/ or https://www.babelfish.com/ or use one of your choice.
    ...
     

    ktp1976

    Senior Member
    Jun 11, 2012
    507
    170
    Frankfurt a. M.
    But this rec has a bug
    After swiping in and entering REC, the interface does not need to enter a password, and the adb shell opens /data is empty.
    Only the boot_a and boot_b that have not been modified by magisk are brushed in and the password is entered again after booting and re-entering rec, and the data can be modified.
    I was in a bootloop, because of the GCam aux Magisk module. For me it was the same at first attempt. I installed with
    Code:
    fastboot flash recovery OP7TP_StockRecovery_ADB_nosec.img
    After that I rebooted to recovery. I also did not get a password prompt. I connected with
    Code:
    adb shell
    but /data was empty. Because I wanted to see if my system still works without Magisk, I booted with the unmodified boot.img by using
    Code:
    fastboot boot boot.img
    System came up without Magisk and was usable. After that I rebooted and it got stuck at fastboot screen again. I tried one more time to select recovery from fastboot screen and it asked me for password. Since I don't have encryption I just tried to connect again with
    Code:
    adb shell
    This time /data was properly mounted and I was able to delete the Magisk module. After that I rebooted to system with
    Code:
    adb reboot
    and now I have my fully functional system back. I don't know why it didn't work in the first attempt but this is awesome.
    @s3axel you made my day! Thank you very much!!! Your work is appreciated!
     
    • Like
    Reactions: s3axel

    Top Liked Posts

    • There are no posts matching your filters.
    • 15
      While waiting for a working TWRP for all those needful of the possibility to access their file system from recovery, e.g. for removing an offensive magisk extension preventing boot I repackaged the Stock OOS recovery from the 10.0.1BA package but with ADB enabled.

      Prerequisites:
      • Oneplus 7T Pro :)
      • 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
      (when taking the file as downloaded the filename is "OP7TP_StockRecovery_ADB_nosec.img")

      Uninstall:
      Same as installation, but flash the original stock recovery instead.

      Usage:
      Boot up recovery, enter encryption key if file system is encrypted. Then connect the phone to 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.

      Downloads:

      10.0.3BA Recovery
      • Modified 10.0.3BA recovery from GDrive
      • Original 10.0.3BA stock recovery from Gdrive
      10.0.4BA Recovery
      • Modified 10.0.4BA recovery from GDrive
      • Original 10.0.4BA stock recovery from Gdrive
      10.0.7BA Recovery
      • Modified 10.0.7BA recovery from GDrive
      • Original 10.0.7BA stock recovery from Gdrive
      Open Beta 1 Recovery
      • Modified OB1 recovery from GDrive
      Open Beta 2 Recovery
      • Modified OB2 recovery from GDrive

      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 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 on what you are doing ;)

      Credits: Thanks to osm0sis for Android kitchen and all great developers for the Oneplus devices, specifically mauronofrio for his TWRP efforts.
      13
      Just curious, do you have a guide on how to this yourself?
      It's actually pretty easy and this would most probably also work for the 7T...

      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:
      1. unpack image with Image Kitchen --> this will create a "ramdisk" and a "Split_img" directory with the unpacked content within
      2. navigate into the "ramdisk" folder and use a text editor (on windows preferably Notepad++) to edit the file "prop.default"
      3. 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)
      4. look for entry "ro.debuggable" and change this from "0" to "1" --> this actually enables adb
      5. 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 behaviour :)
      6. save textfile
      7. repack the image with Android Image Kitchen and voila:
      8. you have a new modified recovery image you can flash
      4
      can you please share the tutorial for how to patch the recovery to be adb enabled? if this is easy for normal users

      thanks in advance
      https://forum.xda-developers.com/7t...n-os-stock-recovery-adb-t3991865/post80866897


      Sent from my OnePlus7TPro using XDA Labs
    Our Apps
    Get our official app!
    The best way to access XDA on your phone
    Nav Gestures
    Add swipe gestures to any Android
    One Handed Mode
    Eases uses one hand with your phone