FORUMS
Remove All Ads from XDA

[RECOVERY][Hima] TWRP touch recovery

19,635 posts
Thanks Meter: 21,769
 
By Captain_Throwback, Retired Moderator / Recognized Developer / Recognized Contributor on 28th March 2015, 08:24 PM
Post Reply Email Thread
Announcement from Captain_Throwback: TWRP now supports flashing of zips up to 4GB in size! (See Post #2)
Code:
*** Disclaimer ***

All flashing is done at your own risk!
While nothing from this thread should break your device,
don't come back here blaming anyone if it does!

Introduction
Quote:

Team Win Recovery Project 3.x, or twrp3 for short, is a custom recovery built with ease of use and customization in mind. Its a fully touch driven user interface no more volume rocker or power buttons to mash. The GUI is also fully XML driven and completely theme-able. You can change just about every aspect of the look and feel.

Images


Installation instructions
Quote:

NOTE: Read the FAQ from Post #3 to ensure that you're installing the correct version of TWRP!!

TWRP Image Install method:
Most devices can be updated quickly and easily within TWRP if you already have version 2.8.4.0 or higher installed.

  1. Download the latest version of TWRP appropriate for your device/firmware
  2. Reboot to TWRP
  3. Hit Install and tap the "Install Image" button in the lower right
  4. Browse to the location of the TWRP image on your device and select it
  5. Select recovery from the partition list and swipe to flash

Alternate Installation Method:
Fastboot Install Method:
You will need the platform-tools from the Android SDK on your computer. Find the Android command line tools section on the page linked and install the SDK tools package. From the SDK Manager, download only the platform-tools to get adb and fastboot binaries.

Windows users will need proper drivers installed on their computer. You can try the Naked ADB drivers or the Universal ADB drivers if you don't already have a working driver installed

On your device, go into Settings -> About and find the Build Number and tap on it 7 times to enable developer settings. Press back and go into Developer Options and enable USB debugging. From your computer, open a command prompt and type:
Code:
adb reboot download
You should now be in fastboot mode.

Download the correct image file and copy the file into the same folder as your adb and fastboot binaries. Rename the image to twrp.img and type:
Code:
fastboot flash recovery twrp.img
Code:
fastboot reboot

Device Changelog
Quote:

Current version: 3.1.1-0:

Code:
  • Initial official release
Older Device-specific versions:
Code:
  • N/A

TWRP Official Changelog
Quote:

Current version: 3.1.1:

Code:
  • Backups will now include adopted storage keys (Dees_Troy)
  • Fixed an adb restore issue (bigbiff)
  • Fixed rebooting when no OS is present (Dees_Troy)
  • Fixed line wrapping in the GUI terminal (_that)
  • Updated TWRP source code to AOSP 7.1.2 (Dees_Troy)
Older versions:
Code:
3.1.0:
  • vold decrypt on a few select HTC devices, TWRP will now attempt to use the system partition's vold and vdc binaries and libraries to decrypt the data partition (nkk71 and CaptainThrowback)
  • adb backup to stream a backup directly to or from your PC, see documentation here (bigbiff)
  • tweak MTP startup routines (mdmower)
  • support new Android 7.x xattrs for backup and restore to fix loss of data after a restore (Dees_Troy)
  • support POSIX file capabilities backup and restore to fix VoLTE on HTC devices and possibly other issues (Dees_Troy)
  • better indicate to users that internal storage is not backed up (Dees_Troy)
  • improve automatic determination of TW_THEME (mdmower)
  • minimal getcap and setcap support (_that)
  • try mounting both ext4 and f2fs during decrypt (jcadduono and Dees_Troy)
  • shut off backlight with power key (mdmower)
  • timeout during FDE decrypt (Dees_Troy and nkk71)
  • support for FBE decrypt and backing up and restoring FBE policies (Dees_Troy)
  • boot slot support (Dees_Troy)
  • TWRP app install prompt during reboot (Dees_Troy)
  • support for AB OTA zips (Dees_Troy)
  • support new Android 7.x log command (Dees_Troy)
  • update recovery sources to AOSP 7.1 (Dees_Troy)
  • numerous bugfixes and improvements by too many people to mention
3.0.3: 3.0.2:
  • Fix a bug with the input box that affected masked inputs (passwords). This fixes decrypt of full device encryption on devices that support decrypt. This bug also impacts encrypted backups. Users are highly encouraged to stop using 3.0.1 if you use encrypted backups or if you need decrypt of data in TWRP.
  • Add Greek translation to some builds.
3.0.1:
  • support new CM 13.0 pattern encryption (sultanqasim)
  • fix slow flashing issue due to modprobe (present on only some devices) (#twrp)
  • libtar updated to latest upstream and fixes (jcadduono)
  • fixes for loading custom themes (_that)
  • TWRP will now detect and install TWRP themes automatically through the normal zip install process (Dees_Troy)
  • translation updates - added Italian, Czech and Polish and significant updates to Dutch
  • progress bar improvements - progress bar updates during image flashing and better tracks progress during file system backups (tar) (Dees_Troy)
  • fix input box text display (Dees_Troy)
  • reboot option after zip install complete (bigbiff)
  • other mostly invisible bug fixes and improvements
3.0.0:
  • Completely new theme - Much more modern and much nicer looking (by z31s1g)
  • True Terminal Emulator - Includes arrow keys, tab and tab completion, etc. (by _that)
  • Language translation - It won’t be perfect and especially some languages that require large font files like Chinese & Japanese won’t be availble on most devices. Also some languages may only be partially translated at this time. Feel free to submit more translations to OmniROM’s Gerrit. (mostly by Dees_Troy)
  • Flashing of sparse images - On select devices you will be able to flash some parts of factory images via the TWRP GUI (by HashBang173)
  • Adopted storage support for select devices - TWRP can now decrypt adopted storage partitions from Marshmallow
  • Reworked graphics to bring us more up to date with AOSP - includes support for adf and drm graphics (by Dees_Troy)
  • SuperSU prompt will no longer display if a Marshmallow ROM is installed
  • Update exfat, exfat fuse, dosfstools (by mdmower)
  • Update AOSP base to 6.0
  • A huge laundry list of other minor fixes and tweaks
Additional Notes
  • WARNING: This is our first release in a long time. We have a lot of new and somewhat aggressive changes in this new release. The changes to the graphics back-end may cause some devices to not boot up properly or have other display-related issues. If you are not in a position to reflash an older build of TWRP, then wait until you are or at least wait until others have tried the new version for your specific device. You don’t want to end up with a non-working recovery and have to wait several hours or days to get to a computer to be able to fix it.
  • Notes for themers: In addition to the updated theme, we have introduced a theme version variable to the TWRP theme system. If the theme version does not match the version that TWRP expects, TWRP will reject the custom theme and load its stock theme. This change will ensure that people who update TWRP without updating their theme will still have a workable recovery. We have removed libjpeg support. The stock theme was only using a jpeg image for the splash / curtain. This change means that any custom themes will no longer be able to use jpeg images. It also means that tools used to repack recovery images with a different curtain / splash will need to be updated to use the new method.
  • Version number notes: For a while we’ve been using a 4 digit version number and reserved the 4th digit for device-specific updates. For instance, we find and fix a device-specific issue like decryption of data on Nexus 5, we would release that as a 2.8.7.1. After a while, some people would start asking where 2.8.7.1 was for other devices. So, going forward we have decided to change the numbering scheme to 3.0.0-2, etc. Our hope is that this version numbering scheme will more clearly identify that the 4th digit does not indicate a version change for the code base.
  • We need your help! The bulk of TWRP work is done by 3 people on a volunteer basis. We have pushed most of our device files to our github and we have a gerrit instance. If you have the ability, please help us maintain our official devices and/or add your device to our official device list. Thanks in advance!
2.8.7.0:
  • Initial ground work for software drawn keyboard (_that)
  • Fix handling of wiping internal storage on datamedia devices (xuefer)
  • Allow DataManager to set and read values from the system properties (xuefer)
  • Fix crash when taking screenshots on arm64 devices (xuefer)
  • Fix error message after an ORS script completes (Dees_Troy)
  • Fix crashes / error when creating encrypted backups (_that, Dees_Troy)
  • Add system read only option – more details below (Dees_Troy)
  • Add resize2fs and GUI option to run resize2fs (Dees_Troy)
  • Fix crash loop caused by empty lines in AOSP recovery command file (_that)
  • Prevent duplicate page overlays such as multiple lock screens (mdmower)
Additional Notes
  • Note: As always, be sure your custom theme is up to date (or remove your custom theme) before updating TWRP.
  • System read only option: Devices that ship with 5.0 and higher as their initial OS are using block level OTA updates. With this style of OTA update, the update script checks to see if the system partition has ever been mounted read/write. Further, the script also usually runs an SHA sum of the entire system partition to detect if any changes have been made. If any changes have been made, the OTA update will refuse to install. Since not all OEMs and devices have factory images available, we have created a new feature in TWRP that detects if the system partition has ever been mounted read/write. If not, you will be prompted asking if you want TWRP to mount system as read/write. If you choose not to allow TWRP to mount as read/write, TWRP won’t prompt to install SuperSU and TWRP won’t try to patch the stock ROM to prevent TWRP from being replaced by stock recovery. The goal of this option is to hopefully allow the user to make a raw system image backup that they can use to get back to a state where they can take OTA updates again.
  • resize2fs feature: On some devices like the Nexus 6, the factory images include a userdata image that is the proper size only for the 32GB units. If you flash the factory image to a 64GB Nexus 6, the data partition will appear as if it only has the free space of a 32GB device. Using the resize2fs option, TWRP can resize your data partition to take up the full space available. The resize2fs may also be useful to resize system partitions on devices where custom ROM system images don’t take up the full partition space. Lastly, resize2fs may be useful in some cases to reserve the proper space at the end of a data partition for a full disk encryption key, should your partition be formatted incorrectly for some reason.
  • This new version also marks our first set of full builds using our new jenkins build server. You can track the progress of builds at https://jenkins.twrp.me and we have taken additional steps to make it easier for device maintainers to step up and submit patches to our gerrit server at https://gerrit.twrp.me to help us keep devices up to date and working.

Downloads
Quote:

NOTE: Read the FAQ from Post #3 to ensure that you're installing the correct version of TWRP!!

Download
Latest Official versions

Sources
Device tree
Kernel source


FAQ - Post #3

Known Issues
Quote:

  • None

Bug Reporting
Quote:

If you have an issue, the first step is to post a recovery log so we can determine the cause of the issue. This is done in recovery using Advanced -> Copy Log, or adb pull /tmp/recovery.log. Once a log is uploaded we can determine how best to proceed. NOTE: Posts that are reporting bugs or issues without an accompanying recovery log will be ignored! Additionally, providing details about your device setup, including variant, firmware version, and exact steps to reproduce your issue will also be helpful in diagnosing the problem.


If your issue is determined to be a bug, please consider posting it to our github issues log. It's pretty much impossible for us to keep up with the more than 40 threads that we have for the devices that we "directly" support. If you have a significant problem that cannot be answered in this thread, your best bet is to contact us via our website, or find us in our IRC channel below. If you see someone that's struggling, feel free to point it out to us. We need your help to help us keep track of all of our devices! Thanks!

Additional Help/Support:
Quote:

Live support is available via #twrp on Freenode with your IRC client or just click this link.

XDA:DevDB Information
TeamWin Recovery Project (TWRP), Tool/Utility for the HTC One (M9)

Contributors
Captain_Throwback, nkk71, Dees_Troy, bigbiff, _that
Source Code: https://github.com/omnirom/android_bootable_recovery


Version Information
Status: Stable
Current Stable Version: 3.1.1-0
Stable Release Date: 2017-05-17

Created 2015-03-28
Last Updated 2017-05-19
The Following 85 Users Say Thank You to Captain_Throwback For This Useful Post: [ View ]
 
 
28th March 2015, 08:24 PM |#2  
Captain_Throwback's Avatar
OP Retired Moderator / Recognized Developer / Recognized Contributor
Flag Bensalem, PA
Thanks Meter: 21,769
 
10
Donate to Me
More
TWRP now supports flashing of zips up to 4GB in size!
In order for ROM zips to function properly, ROM devs may need to change the way they're used to performing mount commands in their updater-scripts. Many ROM devs like to use busybox to mount system, like this:
Code:
run_program("/sbin/busybox", "mount", "/system");
However, on the M9, this will not always be effective, due to the variable state of system when booting into TWRP (more information in the below post). The most reliable way to mount system in TWRP is to use the below command:
Code:
run_program("/sbin/mount", "-t", "ext4", "/dev/block/bootdevice/by-name/system", "/system");
Since this calls the mount binary and specifies the proper filesystem of /system, it will work regardless of the mount state of /system within TWRP.

The reason people are having issues booting ROMs flashed without the above command is because custom ROMs typically include a command to format system within the updater-script, like this one:
Code:
run_program("/sbin/mke2fs", "-t", "ext4", "-m", "0", "/dev/block/bootdevice/by-name/system");
Notice that this calls the mke2fs binary directly and specifies the filesystem, so this command will run properly and format system. However, when the script attempts to mount system using the busybox mount command, it's unsuccessful, resulting in a failed ROM install (even though there likely isn't an error message) and an empty system partition. The same command format should be used both to format system and to mount it.

So, the solution is easy - replace your busybox mount commands with the direct version noted above. Running it that way should work regardless of the update-binary used, since it's not running mount directly but calling it (this makes a difference to some binaries for some reason). This will even work in situations where system has been mounted read-only by TWRP (more on that in the below post).

ROM Devs - please consider making this change going forward. The above method will ALWAYS WORK. Please use this and discontinue whatever other methods to mount system that you have previously used, as they will have inconsistent results, leading people to flash old versions of TWRP or blame TWRP for their errors.

I know the M9 is a very different device than we're all used to, and the rules have all changed. Let's all adapt to the change together. :).

UPDATE: Thanks to @nkk71's patch, TWRP now supports flashing of zips up to 4GB in size! However, for this to work, a compatible update-binary must be used that includes the updated code. If AROMA is being used, it must also include the updated code. Fortunately, he has graciously provided these updated binaries pre-compiled for any that need them. They are attached to this post. Everyone please thank him for his work on this!! :) Additional information can be found here.
The Following 27 Users Say Thank You to Captain_Throwback For This Useful Post: [ View ]
28th March 2015, 08:24 PM |#3  
Captain_Throwback's Avatar
OP Retired Moderator / Recognized Developer / Recognized Contributor
Flag Bensalem, PA
Thanks Meter: 21,769
 
10
Donate to Me
More
Frequently Asked Questions (FAQ)
1. Why is this device different than my previous HTC device?
  • With the M9, HTC has moved to a block-based OTA system. This means that even mounting system as read-write (as TWRP typically does during startup checks) will nullify the device's ability to take an OTA. Any other changes to the system partition will also cause an OTA to fail (even if that check is removed from the OTA zip) due to "unexpected contents."
2. Which version of TWRP am I supposed to use?
  • If you're on Marshmallow (6.x) firmware or higher, the best version to use is 3.1.1-0, the latest official version from twrp.me. If you're on older firmware, you should use a 2.8.7.x version. The newest TWRP will not boot on Lollipop firmware.
3. Why is there a "System" backup option and a "System Image" backup option now?
  • The "System" option is the standard tar backup. The "System Image" option is only relevant if your system is unmodified. This allows you to make a fully stock backup that can be restored later to take an OTA.
    • NOTE: If you are using a FAT32-formatted card, a "System Image" backup will fail, due to the 4GB file limit on that format. For a successful System Image backup, NTFS or exFAT-formatted storage must be used (either SD card or USB-OTG)
4. How am I supposed to root?
  • As of SuperSU v2.79 SR1, it is FINALLY compatible with the M9 (again). Flashing the zip in TWRP will root the device.
  • phh's Superuser also works for root (standalone or Magisk-compatible version)
5. I tried to install x ROM, but it won't boot. Should I use TWRP 2.8.5.0 to flash it?
  • No, you shouldn't. You should use the version of TWRP recommended above. If the ROM updater-script is done properly, even if your device has system mounted read-only, the ROM should still flash fine. If your ROM chef/team has chosen to mount the partitions some other way, then you may have to mount system manually in order for the ROM to flash successfully. This can be done in the Mount menu, by unchecking the "Mount system as read-only" box and then checking the box next to System to mount it. The very act of booting 2.8.5.0 will change the system checksum, making it impossible to get a fully stock backup.
6. So what's the proper procedure to root without breaking OTA?
  • There is no way to take an OTA after you root. However, prior to rooting, you can take a fully untouched system image backup with TWRP, which can be used to restore a fully stock system to the device in order to take an OTA.
7. How do I backup stock recovery prior to flashing TWRP?
  • You can't. The "fastboot boot" command appears to be disabled on the M9's ABOOT, so TWRP must be fastboot flashed over stock recovery. The firmware zip included in the OTA will include a usable stock recovery image. That can be extracted and flashed after stock system is restored so that the OTA can be applied.
    • UPDATE: As of 3.x firmware, the M9 now supports the fastboot boot function from the bootloader! Now you can fastboot boot TWRP, and then select "Recovery" to back up stock recovery.
8. How do I restore stock system so that I can accept an OTA?
  • Check the "Mount system as read-only" box in the Mount menu.
  • Restore stock "System Image" backup (This will only work if you've made a System Image backup prior to making any modifications to /system). As of the official 2.8.6.1 version, it is no longer necessary to fastboot flash the stock system image.
    • NOTE: If you made a stock system backup with one of the Beta TWRP versions, you will have to rename the backup file in the backup folder manually from "system.emmc.win" to "system_image.emmc.win" for the new official TWRP to see it as a "System Image" backup rather than a "System" backup. Otherwise, you'll get an error that the backup can't be restored because system is read-only.
  • Fastboot flash stock recovery (fastboot flash recovery recovery_signed.img)
    • NOTE: It is also possible to restore stock recovery via the TWRP GUI. Rename the stock recovery file to "recovery.emmc.win" and place in the backup folder with the stock system image. Recovery will then show as a restore option. MAKE SURE YOU REALLY WANT TO DO THIS, AS TWRP WILL BE GONE WHEN YOU REBOOT OUT OF RECOVERY!!
  • Reboot to system, install OTA.
9. What if I have an RUU? Do I need to worry about all this OTA nonsense?
  • Not if you don't care about losing all your data. If you're S-ON and have an RUU available for your exact variant (model ID and CID must match) and software number (main version must be the same or newer), then you can get back to a fully stock state by relocking (fastboot oem lock) and flashing an RUU. However, if you'd prefer to take an OTA to keep your data intact, the method stated above is how to do so. Or, you can just run a custom ROM and wait for your ROM chef to update their ROM to the latest software (though you'll still have to find a way to update your firmware if you're not S-OFF)
10. After I go through all this and successfully apply an OTA, how do I make sure I have a clean starting point again?
  • After the OTA is applied and TWRP is flashed, it will once again detect an untouched system, which will mount system read-only and allow you to make a fully stock backup and start the process over again, this time with the new base.
11. How do I get that new stock theme from the Screenshots tab?12. What if I'm unlocked but unrooted and don't have access to a computer? How can I install TWRP?
The Following 89 Users Say Thank You to Captain_Throwback For This Useful Post: [ View ]
29th March 2015, 03:12 PM |#4  
DroidShift79's Avatar
Senior Member
Flag Frankfurt am Main
Thanks Meter: 488
 
More
Nice, I was able to make a system backup with your beta version. But I'm still not able to get SuperSU installed. Recovery sais installation went fine, but it doesn't.
29th March 2015, 03:16 PM |#5  
Captain_Throwback's Avatar
OP Retired Moderator / Recognized Developer / Recognized Contributor
Flag Bensalem, PA
Thanks Meter: 21,769
 
10
Donate to Me
More
Quote:
Originally Posted by DroidShift79

Nice, I was able to make a system backup with your beta version. But I'm still not able to get SuperSU installed. Recovery sais installation went fine, but it doesn't.

Recovery log?
The Following User Says Thank You to Captain_Throwback For This Useful Post: [ View ]
29th March 2015, 03:20 PM |#6  
DroidShift79's Avatar
Senior Member
Flag Frankfurt am Main
Thanks Meter: 488
 
More
could you tell me how to get it, Sir?
29th March 2015, 03:23 PM |#7  
Captain_Throwback's Avatar
OP Retired Moderator / Recognized Developer / Recognized Contributor
Flag Bensalem, PA
Thanks Meter: 21,769
 
10
Donate to Me
More
Quote:
Originally Posted by DroidShift79

could you tell me how to get it, Sir?

adb pull /tmp/recovery.log

OR

Advanced -> Copy Log to SD. Console output will tell you where it copied.
The Following User Says Thank You to Captain_Throwback For This Useful Post: [ View ]
29th March 2015, 03:32 PM |#8  
DroidShift79's Avatar
Senior Member
Flag Frankfurt am Main
Thanks Meter: 488
 
More
adb won't find my Device when in recovery mode, why?
. so I copied file to external_sd.
29th March 2015, 03:34 PM |#9  
Captain_Throwback's Avatar
OP Retired Moderator / Recognized Developer / Recognized Contributor
Flag Bensalem, PA
Thanks Meter: 21,769
 
10
Donate to Me
More
Quote:
Originally Posted by DroidShift79

adb won't find my Device when in recovery mode, why?
. so I copied file to external_sd.

Probably drivers. Have you installed the latest ones from HTC Sync Manager (and then uninstalled the program if you don't use it)?
The Following 2 Users Say Thank You to Captain_Throwback For This Useful Post: [ View ]
29th March 2015, 03:35 PM |#10  
DroidShift79's Avatar
Senior Member
Flag Frankfurt am Main
Thanks Meter: 488
 
More
good hint, I'll have to clean the driver mess
You have a clou why SuperSu doesn't surrive reboot after flashing with BETA TWRP ?
The Following User Says Thank You to DroidShift79 For This Useful Post: [ View ] Gift DroidShift79 Ad-Free
29th March 2015, 03:38 PM |#11  
Captain_Throwback's Avatar
OP Retired Moderator / Recognized Developer / Recognized Contributor
Flag Bensalem, PA
Thanks Meter: 21,769
 
10
Donate to Me
More
Quote:
Originally Posted by DroidShift79

adb won't find my Device when in recovery mode, why?
. so I copied file to external_sd.

There's no installation of SuperSU in that log.

But if you already have a stock backup, let's do this:
Under Advanced, choose Terminal, press the select button to start it in the root folder, and then type this command:
Code:
mount -t ext4 /dev/block/bootdevice/by-name/system /system
Then run the SuperSU installer zip.
The Following 23 Users Say Thank You to Captain_Throwback For This Useful Post: [ View ]
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