[xorcan] Oneplus-5 Guide

arpcan

New member
Sep 17, 2017
1
1
0
## OEM UNLOCK and USB DEBUGGING

Go to your phone’s Settings » About phone » and tap “Build number” Seven/Ten times.
This will enable Developer options on your OnePlus 5.
Now go to Settings » Developer options » and look for “Enable OEM unlock” option, tick the checkbox next to it.
On the same page, also tick the USB debugging checkbox.

Connect your phone to PC and open a command window on the PC.
Reboot your OnePlus 5 into Bootloader/Fastboot mode by issuing the following command:

adb reboot bootloader

Check your phone’s screen, if it asks for “Allow USB debugging”, accept it by selecting OK/Yes.
Once it is booted into Bootloader mode, issue the following command to finally unlock the bootloader on your device:

fastboot oem unlock

This will unlock the bootloader on your OnePlus 5/5T and also completely wipe your phone while doing that.
So make sure you backup everything important on your device before unlocking the bootloader.
Once the bootloader is unlocked, your OnePlus 5/5T will automatically reboot.
In case it asks for bootloader unlock permission on the device, accept it.

source: https://www.theandroidsoul.com/oneplus-5-root/

## BACKUP
backup your apps with "titanium backup" and backup your photos.
and copy them to another device. just in case. (for example a pc.)

## DOWNLOAD
("ota full rom" includes recovery, firmware and gapps.)
***download latest rom from:
+https://forum.xda-developers.com/on...eeseburger-t3810283/post76943628#post76943628
+https://www.oneplus.com/support/softwareupgrade/details?code=5

***copy downloaded file to your device with this name: "update.zip"

## FLASHING
***open usb debug and advanded restart from developer settings:

On Android 4.1 and lower, the Developer options screen is available by default.
On Android 4.2 and higher, you must enable this screen as follows:

Open the Settings app.
(Only on Android 8.0 or higher) Select System.
Scroll to the bottom and select About phone.
Scroll to the bottom and tap Build number 7 times.
Return to the previous screen to find Developer options near the bottom.

At the top of the Developer options screen, you can toggle the options on and off (figure 1).
You probably want to keep this on.
When off, most options are disabled except those that don't require communication
between the device and your development computer.

Next, you should scroll down a little and enable USB debugging.
This allows Android Studio and other SDK tools to recognize your device when connected via USB,
so you can use the debugger and other tools.

source: https://developer.android.com/studio/debug/dev-options
-----------------------------------------------------------------

***unlock oem (command: fastboot oem unlock)

-----------------------------------------------------------------
***open oneplus 5 in fastboot mod:
+press and hold the volume down and power button for 5-6 seconds then release.
+command: adb reboot bootloader

source: https://www.teamandroid.com/2017/07/24/oneplus5-enter-fastboot-mode/
-----------------------------------------------------------------

- flash latest twrp codework. (command: fastboot flash recovery twrp.img)

- make a nandroid backup. (twrp > backup > system, boot, data.)

? for clean install; wipe all exclude internal storage and otg.
? for update os; wipe all exclude internal storage, data and otg.
-
- flash rom (update.zip) -

(if you want) flash magisk and other zips. (full turning to return stock, skip this step)
-----------------------------------------------------------------

- wipe dalvik cache. -

? turning fully stock: power off device. open phone in fastboot.
? lock oem with using command: fastboot flashing lock
? this wipes your all data with internal storage.
-----------------------------------------------------------------

rom is ready for use.

## MODS
magisk -https://github.com/topjohnwu/Magisk/releases
install: flash with twrp using magisk.zip
uninstall: flash with twrp using magisk-uninstaller.zip

youtube -https://vanced.app
install in magisk. (magisk > downloads > search > youtube)
uninstall in magisk. (magisk > modules > youtube > remove)

## ENCRYPTED and OEM LOCKED

after flashed succesfully the "ota full" zip, you have stock recovery, kernel and rom.
this step is for lock your oem. this will wipes your all of files. including internal storage.
because of this reason, do a full backup your device to another device (for example a pc.)

command: fastboot oem lock

OnePlus 5 Lock Bootloader

Boot the OnePlus 5 into Fastboot Mode
Connect the PC to your OnePlus 5 via a USB cable
Type the following command into the Command Prompt. . .
fastboot flashing lock
. . and press Enter on the keyboard
Press the Volume Down or Volume Up button until the Yes option is highlighted
Press the Power button to confirm and select this option
Wait for the OnePlus 5 to reboot and perform the factory reset
Then wait for the OnePlus 5 to reboot back into the Android OS
Disable the OEM Unlock feature (optional)

source: https://www.androidexplained.com/oneplus-5-lock-bootloader/

## WHAT DOES “FASTBOOT OEM LOCK” DO?

Simply put, fastboot oem lock puts your bootloader into a mode that prevents you from overwriting your recovery image, without a subsequent fastboot oem unlock. This serves as a security precaution, primarily where the default recovery and firmware is installed.

Because:
The default recovery will only allow manufacturer/Google signed firmware to be installed and doesn't allow you to do much of anything else.
Unlocking the bootloader will erase all data.

....you can rest assured that, under this configuration, no one can take your phone and, say, bypass a screen lock by installing a custom firmware where the security considerations are different.

Note that as this merely locks in your recovery, and then again only from bootloader-overwrites, this is most useful where the recovery is stock, and the installed ROM is an official one that has no security vulnerabilities. This is important because in most recoveries, and in some ROMs, there are ways to clandestinely access data via USB, bypass security settings with fixed button presses or unpatched backdoors, or install custom recoveries.

ANOTHER COMMENT:

The command locks your bootloader. What the consequences are really depends on your device. Most devices enable signature-verification for the boot partition (kernel) which prevents you from booting any kernels not signed by device manufacturer (unless you exploit some security breaches like 2nd boot). They also disallow you to flash any partition via 'fastboot flash' command, but not on all devices.

So no, you are not okay with relocking your phone: If you use custom firmware, you typically use a custom kernel and in this case, re-locking your bootloader via 'fastboot oem lock' will put your device in a state where it will not boot anymore! Be careful with that.

source: https://android.stackexchange.com/questions/21460/what-does-fastboot-oem-lock-do

## Errors

### Error 255:
download a terminal from play store.
grant root permission (type "su" and enter Then give superuser permissions)
then type "pm remove-user 999" hit enter and reboot.
now you should be able to boot into twrp recovery and backup your phone ok fixing error 255 in twrp.
source: https://www.youtube.com/watch?v=AmB4zPP4ksQ

-----------------------------------------------------------------
+ alternative

## SOURCE
https://github.com/xorcan/oneplus-5
 
Last edited:
  • Like
Reactions: piratedpanda

strongst

Forum Moderator
Staff member
Sep 18, 2007
11,592
8,425
253
prolific location
prolific-page.com
Since the moderators won't take action here I must warn everyone to follow that guide cause of wrong information which recoverys to flash at which stage and how to prevent twrp to be overwritten.



This isn't a correct guide for unlocking, flashing etc.

For unlocking the bootloader use this https://forum.xda-developers.com/oneplus-5/how-to/oneplus-5-unlock-bootloader-flash-twrp-t3624877

For flashing OxygenOS stable this https://forum.xda-developers.com/oneplus-5/how-to/official-oxygenos-4-5-2-7-1-1-ota-t3627003

For flashing OxygenOS beta this https://forum.xda-developers.com/oneplus-5/how-to/official-oxygenos-beta-1-android-oreo-t3710003

For mods use @shadowstep guides here https://forum.xda-developers.com/oneplus-5/how-to/collection-shadowsteps-android-t3832556 and the index thread https://forum.xda-developers.com/oneplus-5/how-to/index-oneplus-5-cheeseburger-t3810283
 
  • Like
Reactions: lekiaM