FORUMS

[RECOVERY][UNOFFICIAL] TWRP HH for Nexus 5 (hammerhead)

71 posts
Thanks Meter: 596
 
By z3DD3r, Member on 8th February 2020, 03:43 PM
Post Reply Email Thread
TWRP HH for Nexus 5

About:
Quote:

TWRP is an open source, community project. TWRP development is done by roughly 4 people at this point. We also have a large support community with many people who are willing to answer questions and help people with their devices either through our IRC channel or on forums like xda-developers.

Team Win was originally formed to work on porting WiMAX to CM7 for the HTC EVO 4G. After our work on the EVO 4G we wanted to work on a project that would work on more devices than just the EVO 4G and we settled on working on a recovery. Today TWRP is the leading custom recovery for Android phones.

A custom recovery is used for installing custom software on your device. This custom software can include smaller modifications like rooting your device or even replacing the firmware of the device with a completely custom "ROM" like OmniROM

Disclaimer:
Code:
#include <std_disclaimer.h>

/*
 * Your warranty is now void.
 *
 * We are not responsible for bricked devices, dead SD cards,
 * thermonuclear war, or you getting fired because the alarm app failed. Please
 * do some research if you have any concerns about features included in this RECOVERY
 * before flashing it! YOU are choosing to make these modifications, and if
 * you point the finger at us for messing up your device, we will laugh at you.
 *
 */
You can find the source code for TWRP on GitHub. If you would like to contribute to TWRP, please visit Gerrit Code Review.

Features:
HH.S version with stock partitions map. S means stock.
HH.R version with repartition support. R means repartition.
Working decryption on custom roms. Tested on LOS 16.0 and LOS 17.1 but should work on all Androids since Nougat.
exFAT and NTFS support (read and write) for USB OTG

Requirements:
You need to have an unlocked bootloader to install and use TWRP!

Known bugs:
Tell me...

Downloads:
https://sourceforge.net/projects/ham...rp/files/beta/

Credits:
TeamWin
@Clamor
@steadfasterX
And all the contributors out there in the community

Contributors:
@z3DD3r

Source Code:
Device tree: https://github.com/z3DD3r/twrp_andro...lge_hammerhead
Prebuilt Kernel tree: https://github.com/z3DD3r/android_ke...eage-16.0-twrp

Version Information:
Satus: Beta
TWRP version: 3.3.1
HH Project versions: HH.S.4 and HH.R.4

Created 2020-02-08
Last Updated 2020-02-16
The Following 13 Users Say Thank You to z3DD3r For This Useful Post: [ View ] Gift z3DD3r Ad-Free
8th February 2020, 03:44 PM |#2  
OP Member
Flag Minsk
Thanks Meter: 596
 
More
Repartition (HH.R versions)

ALWAYS DO THE BACKUPS!!!
No one is responsible for your actions!
Repartition may potentially brick your device, although risk is reduced to minimum.

Features:
Increases /system partition to ~1444Mb
Decreases /cache partition to ~255Mb
Doesn't provide /vendor partition
Doesn't touch /data partition

Requirements:
Not modified partitions by any other solutions

How to increase /system partition and change partitions map:
- Flash the HH.R version of TWRP and launch it
- Open terminal (TWRP -> Advanced -> Terminal)
- Type hh_repart -m
- Wait until your phone reboots
- Install your rom

How to revert back to stock /system size and stock partitions map:
- Launch HH.R version of TWRP
- Open terminal (TWRP -> Advanced -> Terminal)
- Type hh_repart -r
- Wait until your phone reboots
- Flash official TWRP or HH.S version of TWRP! Don't ignore this step!

How to dump partitions map:
- Launch HH.R version of TWRP
- Open terminal (TWRP -> Advanced -> Terminal)
- Type hh_repart -d
- Wait until process finishes
- Look at /sdcard/partitions.log file
The Following 11 Users Say Thank You to z3DD3r For This Useful Post: [ View ] Gift z3DD3r Ad-Free
8th February 2020, 03:45 PM |#3  
OP Member
Flag Minsk
Thanks Meter: 596
 
More
reserved
The Following User Says Thank You to z3DD3r For This Useful Post: [ View ] Gift z3DD3r Ad-Free
8th February 2020, 03:45 PM |#4  
OP Member
Flag Minsk
Thanks Meter: 596
 
More
reserved
The Following User Says Thank You to z3DD3r For This Useful Post: [ View ] Gift z3DD3r Ad-Free
8th February 2020, 05:17 PM |#5  
OP Member
Flag Minsk
Thanks Meter: 596
 
More
Some technical notes about the decryption and Android Q support.

Right now the only possible way to decrypt data on our devices is to use system's vold. This logic was added to TWRP some time ago but one required change wasn't in the tree. This change is here: https://gerrit.twrp.me/c/android_boo...ecovery/+/1919. Without this patch system's vold will fail on hammerhead. I don't know why but services in the sbin can't handle decryption. Also using the system's vold means that ROM should be installed to decrypt data. Without installed ROM decryption is not possible!

About SAR and Android Q. Work on SAR support in TWRP is still in progress but some patches are already available on gerrit. These patches are required to properly detect SAR and mount partitions. Also since Android Q one more service should be run before trying to decrypt data. This service is apexd. Android Q runs apexd on early-init stage to provide required runtime libraries. U can see how it launched at https://android.googlesource.com/pla...dir/init.rc#37. Only after that step all other services like qseecomd, hwservicemanager, servicemanager and keymaster can be run from system or vendor.

The last point is prebuilt vdc. Prebuilt vdc_pie which is shipped with TWRP fails to run because of linker error. I don't remember exactly what was the error but i guess that something is removed in libc. To fix that problem i've built vcd_ten binary with Android Q sources and placed it into device tree for hammerhead as a temporary solution. The source code of that binary is identical to vdc_pie which located at https://github.com/TeamWin/android_b...pt/vdc_pie.cpp

This is just a quick notes about what was done.
Patched bootable_recovery is located at https://github.com/z3DD3r/twrp_andro...ndroid-9.0-sar
Device tree for Q located at https://github.com/z3DD3r/twrp_andro...ead/tree/q-sar

I hope this will be helpful for TWRP Team!
PS: Changes i've made should be improved. Don't treat them as production ready and/or stable!

FYI @Dees_Troy
The Following 8 Users Say Thank You to z3DD3r For This Useful Post: [ View ] Gift z3DD3r Ad-Free
9th February 2020, 11:41 AM |#6  
VnnAmed's Avatar
Senior Member
Flag PoznaƄ
Thanks Meter: 605
 
More
Hi, thank you very much for this solution.

hh_repart -d - worked but I couldn't read the log file before rebooting, maybe it's obvious
hh_repart -m - worked without any issues

I have also successfully flashed Lineage 17.1 from your other thread, gapps and Magisk.
The Following User Says Thank You to VnnAmed For This Useful Post: [ View ] Gift VnnAmed Ad-Free
13th February 2020, 10:10 PM |#7  
OP Member
Flag Minsk
Thanks Meter: 596
 
More
New versions are up (HH.S.3 and HH.R.3)

Added exFAT and NTFS support (read and write) for USB OTG
Kernel image is compressed with XZ LZMA2 compression algorithm (smaller size of the recovery image)
The Following 7 Users Say Thank You to z3DD3r For This Useful Post: [ View ] Gift z3DD3r Ad-Free
16th February 2020, 01:53 PM |#8  
OP Member
Flag Minsk
Thanks Meter: 596
 
More
New versions are up (HH.S.4 and HH.R.4)

Fixed mounting issues of the system partition
Fixed device overheating while in recovery

I highly suggest everyone update to this version!
The Following 9 Users Say Thank You to z3DD3r For This Useful Post: [ View ] Gift z3DD3r Ad-Free
22nd February 2020, 03:43 PM |#9  
dahawthorne's Avatar
Senior Member
Flag Brighton
Thanks Meter: 1,641
 
More
I have a question, certainly not in any way a complaint.
I have been running HH4 for a few days. Last night I made a TWRP backup of my LineageOS 17.1, which I installed on 20th without Gapps to see how it works without Google - quite well, in fact, with the help of APK Updater.
This morning I stupidly applied the 22nd update with Gapps - I was on autopilot and forgot that this device had no Google.
No problem, I thought, I'll just restore last night's backup. So I did a total wipe and format ("yes"), but no backup will restore. I just get the LOS line-&-circle animation for ages. I've tried earlier backups, and even standard unmodified TWRP, all with the same result. No backup will restore.
It's not a big deal - I can start with a totally new installation - but I'd like to know if anyone has taken a backup and successfully restored it. Or am I just lucky...? If I can't restore, then it sort of defeats the point of TWRP, no?
Edit: Seriously, 85 people have downloaded HH4. Has not a single one of you tried a restore of a backup?
Edit: Tumbleweed...
Edit: Do I take it that nobody has tried to restore a backup? If you haven't, and my experience is normal, then we're risking a two-hour fresh install in case of update problems rather than a two-minute restore.
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