Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
OnePlusRoot

Root OnePlus5 without unlocking the bootloader

Gain adb root.

$ adb shell am start -n com.android.engineeringmode/.qualcomm.DiagEnabled --es "code" "angela"

Download Magisk-v14.0 and extract it somewhere. Download MagiskManager.

Now, open a shell (adb shell).

OnePlus5:/ # mkdir /data/magisk
OnePlus5:/ #

Push the required file to the device:

adb push {arm64/*,common/*} /data/magisk/
arm64/magisk: 1 file pushed. 6.7 MB/s (192736 bytes in 0.027s)
arm64/magiskboot: 1 file pushed. 20.2 MB/s (316536 bytes in 0.015s)
common/boot_patch.sh: 1 file pushed. 3.1 MB/s (7732 bytes in 0.002s)
common/init.magisk.rc: 1 file pushed. 0.3 MB/s (675 bytes in 0.003s)
common/magisk.apk: 1 file pushed. 21.6 MB/s (3311368 bytes in 0.147s)
common/util_functions.sh: 1 file pushed. 2.5 MB/s (6688 bytes in 0.003s)
6 files pushed. 17.9 MB/s (3835735 bytes in 0.205s)

Download busybox for arm. Extract it and push it to the device:

adb push busybox-armv6l/system/xbin/busybox /data/magisk/

Install MagiskManager:

adb install ../MagiskManager-v5.4.0.apk

Back on the ADB shell (adb shell):

OnePlus5:/ # cd /data/magisk/
OnePlus5:/data/magisk # ls
boot_patch.sh busybox init.magisk.rc magisk magisk.apk magiskboot util_functions.sh
OnePlus5:/data/magisk # ./magisk --createimg magisk.img 64
Creating filesystem with parameters:
    Size: 67108864
    Block size: 4096
    Blocks per group: 32768
    Inodes per group: 4096
    Inode size: 256
    Journal blocks: 1024
    Label:
    Blocks: 16384
    Block groups: 1
    Reserved block group size: 7
Created filesystem with 11/4096 inodes and 1294/16384 blocks
OnePlus5:/data/magisk # mv magisk.img ..
OnePlus5:/data/magisk # ./magisk --createimg xbin.img 64
Creating filesystem with parameters:
    Size: 67108864
    Block size: 4096
    Blocks per group: 32768
    Inodes per group: 4096
    Inode size: 256
    Journal blocks: 1024
    Label:
    Blocks: 16384
    Block groups: 1
    Reserved block group size: 7
Created filesystem with 11/4096 inodes and 1294/16384 blocks
OnePlus5:/data/magisk # ./magisk --mountimg xbin.img xbin
/dev/block/loop0
OnePlus5:/data/magisk # cp /system/xbin/* xbin/
OnePlus5:/data/magisk # cp magisk xbin
OnePlus5:/data/magisk # umount xbin
OnePlus5:/data/magisk # rmdir xbin
OnePlus5:/data/magisk # ./magisk --mountimg xbin.img /system/xbin
/dev/block/loop0
OnePlus5:/data/magisk # magisk --post-fs
OnePlus5:/data/magisk # magisk --post-fs-data
OnePlus5:/data/magisk # magisk  --service

That's it, your phone is now rooted and Magisk modules should work too. After a reboot you'll need to repeat the last steps:

$ adb shell
OnePlus5:/ # cd /data/magisk/
OnePlus5:/data/magisk # ./magisk --mountimg xbin.img /system/xbin
/dev/block/loop0
OnePlus5:/data/magisk # magisk --post-fs
OnePlus5:/data/magisk # magisk --post-fs-data
OnePlus5:/data/magisk # magisk  --service
@bunduuk
Copy link

bunduuk commented Dec 1, 2017

@andQlimax it still works

Copy link

ghost commented Dec 2, 2017

I cancelled the two .sh files by wrong. How can I get them again?

Copy link

ghost commented Dec 2, 2017

I updated to Oreo Open Beta and I tried to root my device again, but I cancelled that files.

Copy link

ghost commented Dec 2, 2017

Please, can you add the angelaroot folder into a zip to share me it?

@shark0der
Copy link

shark0der commented Dec 3, 2017

Adb push was failing for me:

# adb push {arm64/*,common/*} /data/magisk/
failed to copy 'arm64/magisk' to 'arm64/magiskboot': secure_mkdirs failed: No such file or directory

So I've used this instead:

# for file in {arm64/*,common/*}; do adb push -p $file /data/magisk/; done
Transferring: 192736/192736 (100%)
2214 KB/s (192736 bytes in 0.084s)
Transferring: 316536/316536 (100%)
3163 KB/s (316536 bytes in 0.097s)
Transferring: 7732/7732 (100%)
164 KB/s (7732 bytes in 0.045s)
Transferring: 675/675 (100%)
13 KB/s (675 bytes in 0.049s)
Transferring: 3311368/3311368 (100%)
6545 KB/s (3311368 bytes in 0.494s)
Transferring: 6688/6688 (100%)
145 KB/s (6688 bytes in 0.044s)

@aoprea75
Copy link

aoprea75 commented Dec 5, 2017

How can we delete some apps (directory) from system/app or system/priv-app ??? (debloating)

i falow the guide and obtained root .. but system is read-only and cannot delete anything
i tried mount -o rw,remount /system but phone is restarted

sow .. it's possible to debloat system folder ?

thanks

@RBuenemann
Copy link

RBuenemann commented Dec 8, 2017

Just to let you all know I just received the OnePlus 5T Monday and it has EngineerMode on it. Do you all believe this will still work with it?

@Martmists-GH
Copy link

Martmists-GH commented Dec 15, 2017

@RBuenemann most likely, yes

@aoprea75 some devices do not allow remounting /system

@shark0der make sure the correct directories have been made

@andQlimax It works on my device

@Martmists-GH
Copy link

Martmists-GH commented Dec 16, 2017

@aldur Here's an idea for persistant root:

EDL

@andQlimax
Copy link

andQlimax commented Dec 19, 2017

@Martmists isn't there any way to change bootloader status without trigger factory reset?

@Martmists-GH
Copy link

Martmists-GH commented Dec 19, 2017

@andQlimax what do you mean? It's not possible to unlock the bootloader without doing that...

@lu-zero
Copy link

lu-zero commented Dec 19, 2017

I tried with a oneplus5t and looks like they plugged the su side-effect =/

@SelaO
Copy link

SelaO commented Dec 21, 2017

Can I do this with the latest OS update on the op5?

I'm getting this:
image

@Martmists-GH
Copy link

Martmists-GH commented Dec 21, 2017

It seems OnePlus removed the EngineeringMode app on the OP5 and OP5T devices in an OTA, so it is no longer possible until you install the app manually.

@YUDHPK
Copy link

YUDHPK commented Dec 22, 2017

Guys magisk manager v5.5.0 is working great on open beta 19 of op3T

@fhebuterne
Copy link

fhebuterne commented Dec 23, 2017

It's work with OnePlus2 ?

@YUDHPK
Copy link

YUDHPK commented Dec 26, 2017

@aldur can you guide us for magisk 15.0 and manager 5.5.1

@Martmists-GH
Copy link

Martmists-GH commented Dec 27, 2017

@Fabien91 if you have an EngineeringMode app, yes
@YUDHPK procedure should be the same, shouldn't it?

@bunduuk
Copy link

bunduuk commented Dec 28, 2017

@Martmists no the file names have changed, further if you already had magisk installed on previous version then you can run the command and you get root. If not you need to go back to older version and update Magisk sustains.

@bunduuk
Copy link

bunduuk commented Dec 29, 2017

I tried doing it but since the file names and files have changed did not succeed, your help is needed, please. @Martmists

@Martmists-GH
Copy link

Martmists-GH commented Jan 1, 2018

Stay with using Magisk 14.0, I don't actually know how to do it with 15.0 either

Currently I'm trying to get a modified boot image to be flashed using EDL, but I'm getting an md5 mismatch

@Raboo
Copy link

Raboo commented Jan 1, 2018

I might have fucked up. I used the magisk built in auto update. And now my OP3T doesn't recognize my pin when I rebooted the Phone.
What are my options?

@Raboo
Copy link

Raboo commented Jan 1, 2018

I was able to recover using recovery and adb sideload to put in the original ROM. And all my settings remained :-)

@doegox
Copy link

doegox commented Jan 3, 2018

There is a 15.2 release fixing issues for oneplus5: https://www.xda-developers.com/magisk-v15-2-oneplus-samsung-devices/
Any idea how to install it?

@YUDHPK
Copy link

YUDHPK commented Jan 4, 2018

@doegox nope not yet

guys for latest open beta on oneplus 3t you should run this command
adb shell am start -n com.oneplus.factorymode/.qualcomm.DiagEnabled --es "code" "angela"

@dotternetta
Copy link

dotternetta commented Jan 11, 2018

adb noob here :-( this is killing me! When I enter the first push command I get this:

C:\Android>adb shell
root@OnePlus2:/ # adb push {arm64/,common/} /data/magisk/
adb push {arm64/,common/} /data/magisk/
/system/bin/sh: adb: not found

Please help. I download Download Magisk-v14.0 and extracted it in the c:/android/ folder from where I run adb

@gbesh
Copy link

gbesh commented Feb 10, 2018

is there anyway to unroot after using this method?

@dalfaand
Copy link

dalfaand commented Dec 29, 2018

Does this method still work? I have my OPO with the stock rom and updated. I don't see EngineerMode app so I guess it doesn't work.
Should I install an outdated rom for this to work? One that still has EnginnerMode apk?

@lukavia
Copy link

lukavia commented Sep 16, 2019

@doegox nope not yet

guys for latest open beta on oneplus 3t you should run this command
adb shell am start -n com.oneplus.factorymode/.qualcomm.DiagEnabled --es "code" "angela"

In seams that with the stable release that is not working anymore. Either they have removed it, or changed the password :(

@JulesLassara
Copy link

JulesLassara commented Oct 21, 2020

Hello, do you think this is working on other OnePlus devices ? Like OnePlus 7 pro ? Open beta does matter ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment