FORUMS
Remove All Ads from XDA

[Recovery] Official TWRP for the OnePlus 3 & 3T

1,431 posts
Thanks Meter: 5,593
 
Post Reply Email Thread
Announcement from jcadduono: Let the development ...continue?
Team Win Recovery Project 3.0.4-1 (unreleased)

Notice #1: Please don't wipe your data partition if TWRP cannot decrypt it. Instead, make an effort to gather logs to help solve the issue!

Notice #2: Themes from 3.0.0 to 3.0.3 are incompatible with 3.0.4. Sorry! (small theme engine changes regarding backlight control)




This is a unified build for both the OnePlus 3 and the OnePlus 3T!

WARNING: The OnePlus 3 & 3T stock boot image has dm-verity, which prevents you from booting if you swipe to enable system modifications!
SOLUTION: Follow the full rooting steps below, in order, to allow system modifications without the risk of a boot loop!

WHAT IS TWRP?

Oh come on, you know what it is - don't try to fool me!
In case you're serious, though...

Team Win Recovery Project is a custom recovery for Android devices.
It allows you to back up and restore your data, flash custom ROMs to your device, repair broken file systems, and root your device.

Read more about TWRP here: https://twrp.me/about/

DOWNLOAD

You can find the device page here:
http://teamw.in/devices/oneplusthree.html
Use 3.0.4-1 for now, rather than the builds on twrp.me until an official release happens. You will have problems with 3.0.3 on Nougat!

For now, please download the build from:
https://build.nethunter.com/twrp/one...1-oneplus3.img

Officially 3.0.4 has not been released yet, but it has critical fixes for this device on Nougat, so please be patient.

There is a download link there, as well as instructions on how to flash it.

You can find up to date fastboot & adb binaries here!

FULL STEPS FOR OBTAINING ROOT

Follow these instructions until someone nice comes along and makes a video from them (without ads):
  1. Extract/install adb & fastboot to your computer.
  2. Download TWRP for OnePlus 3 & 3T (oneplus3).
  3. In your ROM, go to Settings -> About device. Tap 7 times on Build number to enable Developer options.
  4. Now go to Settings -> Developer options. (above About device)
    You need to enable OEM unlock, otherwise you might end up with boot problems or be unable to flash later on.
  5. Reboot your device into fastboot mode. To do this, select reboot from the power menu and hold the [Volume Up] + [Power] buttons while your device reboots or boots from power off.
  6. Once you're in fastboot mode, you need to unlock your bootloader. To do this, run the command:
    fastboot oem unlock
    WARNING: Unlocking your bootloader will erase all userdata on the device! Your device will be completely reset to factory defaults!
  7. Once your bootloader is unlocked, you're ready to flash TWRP. To do this, run the command (replacing twrp.img with the actual image name):
    fastboot flash recovery twrp.img
  8. Once the image is flashed, you should use your volume keys to navigate to RECOVERY and the press the power key to select it.
  9. At this point, you will reach the screen asking you if you want to allow system modifications.
    By swiping right, you will trigger dm-verity, and if you don't follow the next step you will be unable to boot!
    If you are going to root your device and follow the rest of these steps, then it is safe to swipe right and enable modifications.
  10. If your device asks for a password to mount internal storage, and your password doesn't work or you haven't set one, see below under known issues for a fix!
  11. If you want to be rooted with SuperSU:
    Download the latest SuperSU Stable by Chainfire.
    Without exiting TWRP, transfer the SuperSU zip to your device over MTP* and flash it using [Install] in TWRP.
    ---or (not both) ---
    If you want to be rooted with something else or just want a bootable system:
    Download the latest dm-verity and forced encryption disabler zip.
    Without exiting TWRP, transfer the no-verity-opt-encrypt zip to your device over MTP* and flash it using [Install] in TWRP.
    This will also allow you to use [Format Data] to completely disable your encryption if desired.
  12. Go to [Reboot] -> [System].
  13. Wait 2-5 minutes for your device to finish setting itself up. (SuperSU will reboot you a few times)
* MTP, known as Media Transfer Protocol, is the same way you transfer files from your PC to your device when booted into system.

UPDATING TWRP

To update TWRP, simply download the new twrp.img on your phone, then boot into your current TWRP and flash it.
To flash a twrp.img, navigate to [Install] -> [Flash Image] -> select your twrp.img -> [x] Recovery -> Flash!
After that, just use [Reboot] -> [Recovery] to reboot into the updated TWRP.

CHANGES
  • v3.0.4-1 (build.nethunter.com) - Fix crash when trying to reboot that resulted in TWRP restarting, CAF kernel updates
  • v3.0.4-0 (build.nethunter.com) - Capability restoration for Nougat, F2FS backport support, EXT4 decryption support
  • v3.0.3-0 (twrp.me) - Same as 3.0.3-1-rc2. In sync with the OnePlus 3T device tree (3.0.3-1).
  • v3.0.3-1-rc2 (build.nethunter.com) - Redo the device tree for OOS 4.0, including dynamic encryption support (pull libs from ROM)

FEATURES
  • MTP support
  • USB OTG storage support
  • Hardware Qualcomm-based full-disk encryption support
  • f2fs file system support (read, write, format, backup & restore)
  • exFAT file system support (read, write, format)
  • NTFS file system support (read, write, format)
  • ADB root
  • Full SELinux support
  • Built in android 6.0 tree
  • Allows OnePlus full OTA flashing

KNOWN ISSUES
  • F2FS takes a long time to boot, see below.
  • If your device is taking more than 10 minutes to boot, you probably have a misc flag enabled that disables passing cmdline, see below.
  • Reboot buttons don't work in TWRP (restarts TWRP) - disable Ask to install TWRP App on settings page, fix on the way. - fixed in 3.0.4-1

WHY AM I STUCK ON THE TWRP SPLASH SCREEN FOR 8 HOURS?

Be patient, wait another 8 hours.
Just kidding, try this while stuck on the loading screen:
adb shell wipe_misc; adb shell reboot recovery
Some devices might somehow get a flag set in misc that tells the bootloader to ignore the android boot image command line.
This results in the kernel not receiving the hardware name (qcom), which then confuses recovery and causes it to wait forever. FOREVER.
Personally, I'd have tried this after 15 minutes.

WHY DOES F2FS MAKE TWRP SO SLOW?

When TWRP boots up or wipes partitions and a few other scenarios, it checks each partition to see how much disk space is used. Ext4 handles disk usage calls quite efficiently and will finish this very fast. F2FS on the other hand is very slow when it comes to checking disk usage. We're unsure why this is. Every file on the F2FS formatted partition adds a little more time, and a device that is 30 GB full could take up to 10 minutes to boot TWRP!
I suggest switching your data partition to ext4 - all the f2fs hype is merely from benchmarks that don't actually represent real world use (ie. you're not writing thousands of files per second)
For someone who doesn't do lots of write access to their data partition, ext4 can actually be advantageous (it has faster access times and reads!)

WHY WON'T MY DATA DECRYPT / WHY IS MY PASSWORD INVALID IN TWRP?

In order for encryption to work in TWRP, it must pull the encryption libraries from your current ROM. It does this during TWRP boot logo. If you have no ROM installed, then it will fall back to the default OxygenOS 4.0.2 encryption libraries included in the TWRP image.
The crypto daemon in recovery will not be able to decrypt unless the version of the encryption key matches the version of the libraries. This is an unusual restriction that was added by OnePlus.

You can usually fix this by simply booting into your ROM and changing your boot up password. You can change it back or remove it if you want immediately after. This will generate a new crypto key which should be compatible when you next enter TWRP.

HOW DO I GET LOGS SO WHEN I COMPLAIN I'M NOT COMPLETELY IGNORED OR SHAMED BY OTHER USERS?

To get logs while in TWRP, you should connect your device to your PC and use adb.
adb pull /tmp/recovery.log
adb exec-out dmesg > dmesg.log

This will create 2 files in the directory your shell is currently in, recovery.log and dmesg.log. You will need to upload these somewhere such as a pastebin or Google Drive. You can also attach it to your XDA post (recommended!)

If you are having an operating system boot issue, you should gather a ramoops log instead. Do this while in TWRP after the failed boot:
adb exec-out "tar c /sys/fs/pstore 2>/dev/null" > pstore.tar

CONTACT & SUPPORT

You can find us on IRC at #twrp on chat.freenode.net.
You can also post in this thread and I will attempt to answer any questions you may have.

SOURCE CODE

TWRP: https://github.com/omnirom/android_bootable_recovery (android-7.1)
Device tree: https://github.com/TeamWin/android_d...eplus_oneplus3 (android-6.0)
Kernel: https://github.com/jcadduono/android...neplus_msm8996 (twrp-7.0)

CONTRIBUTIONS

Gerrit for TWRP: http://gerrit.omnirom.org/
Gerrit for officially supported devices: http://gerrit.twrp.me/

XDA:DevDB Information
Team Win Recovery Project for the OnePlus 3 & 3T, Tool/Utility for the OnePlus 3

Contributors
jcadduono, Team Win
Source Code: https://github.com/jcadduono/android...eplus_oneplus3


Version Information
Status: Stable
Current Stable Version: 3.0.4-1
Stable Release Date: 2017-01-21

Created 2017-01-23
Last Updated 2017-02-07
The Following 137 Users Say Thank You to jcadduono For This Useful Post: [ View ]
 
 
23rd January 2017, 03:55 AM |#2  
jcadduono's Avatar
OP Recognized Developer
Flag Thunder Bay
Thanks Meter: 5,593
 
Donate to Me
More
Reserved
ONEPLUS FULL OTA ZIPS

You can flash these zips in TWRP to update your device or save yourself from a broken or soft-bricked state.
They are official zips distributed by OnePlus.

For the OnePlus 3 only:
For the OnePlus 3T only:
Warning: Do not flash partial update OTAs (under 1 GB) on a modified device! If you want to use partial OTAs, you must first flash a full OTA that it applies to, and then flash the partial OTA from stock recovery. Flashing partial OTAs from TWRP will either fail or soft brick your device. You can return to a usable state by flashing one of the above full OTA zips in recovery.
The Following 61 Users Say Thank You to jcadduono For This Useful Post: [ View ]
23rd January 2017, 05:26 AM |#3  
Senior Member
Flag Athens
Thanks Meter: 126
 
More
Quote:
Originally Posted by jcadduono

Team Win Recovery Project 3.0.4-0 (unreleased)

Nice mate as always.

Pm: you might need yo check the format of the first post, everything is written 3 times.
The Following User Says Thank You to peshellas For This Useful Post: [ View ] Gift peshellas Ad-Free
23rd January 2017, 05:45 AM |#4  
RohanAJoshi's Avatar
Senior Member
Flag Pune
Thanks Meter: 1,564
 
More
Quote:
Originally Posted by peshellas

Nice mate as always.

Pm: you might need yo check the format of the first post, everything is written 3 times.

Never quote full op, this is spamming.
For 3 times same content, open xda in browser, it's xda app bug.
The Following 5 Users Say Thank You to RohanAJoshi For This Useful Post: [ View ] Gift RohanAJoshi Ad-Free
23rd January 2017, 06:55 AM |#5  
Senior Member
Flag Athens
Thanks Meter: 126
 
More
Quote:
Originally Posted by RohanAJoshi

Never quote full op, this is spamming.
For 3 times same content, open xda in browser, it's xda app bug.

You re Right mate, i know, i have been here since the very old days, I thought i had deleted ot, and continued, apparently not. Thanks for the tip, didn't know about the bug.
23rd January 2017, 07:03 AM |#6  
Senior Member
Thanks Meter: 202
 
More
ext4 decrypted fine on OnePlus 3 OOS 4.0.2.
23rd January 2017, 07:43 AM |#7  
fbf2201's Avatar
Senior Member
Thanks Meter: 388
 
More
Is flashing twrp-data-fstype-swap-x.x.zip still necessary when switching between f2fs and ext4?
The instructions and the link are not stated in OP anymore.
23rd January 2017, 08:15 AM |#8  
AcmE85's Avatar
Senior Member
Thanks Meter: 1,617
 
More
Quote:
Originally Posted by fbf2201

Is flashing twrp-data-fstype-swap-x.x.zip still necessary when switching between f2fs and ext4?
The instructions and the link are not stated in OP anymore.

Both EXT4 and F2FS should work out of the box now.
No flashing needed.
The Following 2 Users Say Thank You to AcmE85 For This Useful Post: [ View ] Gift AcmE85 Ad-Free
23rd January 2017, 08:24 AM |#9  
_nKo_'s Avatar
Senior Member
Flag Rouen (Normandy)
Thanks Meter: 45
 
More
Hello and thanx for the hard job.
I wanted to try a clean install starting from stock, hoping to correct my issue with twrp black screen.

I need your help. Here is what I've done :
- Restore stock with the unbrick tool
- Update to Nougat 7.0 and OOS4.0.2 via oneplus update
- Unlock bootloader
- Flash twrp 3.0.4-0 via fastboot
- Flash no-verity-opt-encrypt-5.0
- Flash RR rom
- Wipe data and Dalvik
- Reboot.

This is the first time it made it to me. It ask me a password when it boot. I saw a lot of post about that, but I can't understand how to solve it.

Can someone help me please ? My phone is OP3T
23rd January 2017, 08:39 AM |#10  
tropicanapure's Avatar
Senior Member
Thanks Meter: 107
 
More
Hello, thanks for the super-useful tool. TWRP has been my goto recovery for as long as I have been rooting (days of htc-hd2). I am experiencing the following issues with v3.0.2-1 (all my checkpoint backups are in that version).

* Device = op3
* If it helps, this was a OOS 4.0.1 backup. I was trying to restore it because of a 4.0.2 upgrade failure attempt
* restore hangs at 100% after the backup is complete.
* After waiting for nearly 15 mins, I used the power down to restart the phone - i had lost recovery
* tried to re-install recovery. but when twrp boots - it doesn't get to main menu
* Oddly enough op recovery installs and boots into fine. Which is what I am on.

I am currently on stock recovery without root unable to restore backup ups in twrp and in titanium backup

any thoughts?
23rd January 2017, 08:45 AM |#11  
ScratMan38's Avatar
Senior Member
Flag Grenoble
Thanks Meter: 461
 
More
Is the 3.0.4 version from this link https://build.nethunter.com/twrp/one...0-oneplus3.img a unified 3/3T version ? or 3 only ?
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes