FORUMS
Remove All Ads from XDA
Honor 7x
Win an Honor 7X!

[MOD][RECOVERY] Working TWRP recovery for Pixel on Android O

249 posts
Thanks Meter: 307
 
By gubacsek, Senior Member on 5th August 2017, 02:42 PM
Post Reply Email Thread
Hey People! It seems, that after weeks of trying, hundreds of reboots, countless tests, I can present you a working version of TWRP 3.1. for the Pixel with Android O Developer Preview 4.
Edit: and it also works on the final Android O.


But let's not rush into things.. First of all a DISCLAIMER:
This is a TEST release, you are using it at your own risk. If your phone gets damaged in any way, nobody else but you can be held responsible. If you do not agree, stop reading and don't use this mod!


I would like to give credits to the people who helped me, and made all this possible:
First of all, @Chainfire, who did more then you would think Among other things, he was the one who showed me how to use tune2fs and reset quotas on /data, which makes it possible to mount it. Without this , I couldn't even start. So thank you very much!
Of course where would we be without @Dees_Troy and the other TWRP guys (i.e.: CaptainThrowback, nkk71, steadfasterX, _that...), who created and maintain TWRP, and demonstrated some serious patience on IRC , where I was asking them for help. For days. For weeks Thank you guys! You helped a lot!

What is this "mod"?
This is stock, normal TWRP 3.1 compiled from source, for the Google Pixel (sailfish) with some small tweaks to make it possible to mount /data, and decrypt it.

Can you use it on the Pixel XL (marlin)?
I don't know... I don't have a Pixel XL to test. If you want, you can buy me one and I'll be glad to compile, prepare, and test it for you.
EDIT: Chainfire "tested a few zip installs" and those were working for him on the Pixel XL, so maybe it is worth a try guys! - thanks for this CF! -

What happens behind the curtains?
I made some modifications to a script that prepared stuff to make the decryption of /data possible. Now it does a bit more... It copies libraries and binaries from /system and /vendor partitions to /system and /vendor folders, so they can be un-mounted (needed for backup). Basically, the recovery uses the real files/commands of the currently installed android os to prepare and mount /data partition (to make it ready for decrypting).
I updated the fstab file, so TWRP knows what to mount where.
I also changed a few things in the order how services are started during TWRP boot.
This is mostly everything. I was only changing external parts/files/tools of TWRP. The original code, the core is left intact.


How well was it tested?
I have only 1 phone, the pixel. I have only tested on this one phone, and it works for me. Of course I can't be certain it will for you, but you will see if you try it
I tested decrypting of /data, flashing a zip file, making a backup. Didn't dare to test restore yet :P


How can you try it?
This is not a flashable zip, this is a bootable image. So to use it, you have to put the phone into fastboot mode, and fastboot boot the image.
1. reboot the phone into fastboot mode
- if you have adb: adb reboot bootloader
- if you don't, then turn off the phone and press volume down while turning it on

2. open a terminal and issue the following command:
Code:
fastboot boot <path to your twrp image here>
(for example: fastboot boot /home/you/twrp-3-1-pixel-bootable-mod.img)


What about a flashable zip?
I had some quick test runs only for now, and it was working for me (flashing the zip, rebooting to recovery) until I flashed supersu, or rebooted the phone to android. I will need some more time to work on this, and see what is going wrong. So please be patient, I will try to do something, but can't guarantee it will work. Soon. Anytime.


Enough of the talk, you can download the image file from here:
https://www.androidfilehost.com/?fid=745425885120753892


Good luck and don't forget to report back!
I will try to do my best to help you, but I have a family and I inted to spend most of my time with them. Please be patient!
If you like my work, you can buy me a beer, it is damn hot here right now, and I would love to drink one


Edit: Because I'm a noob and couldn't push my changes to the gerrits, I created a diff file with all my changes.
If you are checking it, please take into account, that I was in a hurry, and there was a point where I said "F*** it!" and I copied ALL the libs and bins from /system and /vendor
Anyway, here it is : https://www.androidfilehost.com/?fid=817550096634795329
The Following 76 Users Say Thank You to gubacsek For This Useful Post: [ View ] Gift gubacsek Ad-Free
 
 
5th August 2017, 02:43 PM |#2  
OP Senior Member
Thanks Meter: 307
 
Donate to Me
More
reserved...
5th August 2017, 03:11 PM |#3  
Chainfire's Avatar
Senior Moderator / Senior Recognized Developer - Where is my shirt?
Thanks Meter: 86,197
 
Donate to Me
More
I've only tested installing a few ZIPs but that seems to work fine (on Pixel XL).

I've looked at your modified script and I see the tune2fs commands and copying /system and /vendor files, but I don't see where you actually mount/decrypt /data. Or is this still handled by the TWRP binary?
The Following 14 Users Say Thank You to Chainfire For This Useful Post: [ View ]
5th August 2017, 04:00 PM |#4  
OP Senior Member
Thanks Meter: 307
 
Donate to Me
More
Quote:
Originally Posted by Chainfire

I've only tested installing a few ZIPs but that seems to work fine (on Pixel XL).

I've looked at your modified script and I see the tune2fs commands and copying /system and /vendor files, but I don't see where you actually mount/decrypt /data. Or is this still handled by the TWRP binary?

Hi Chainfire!
I'm happy to hear, that it works on the Pixel XL
Thanks for the confirmation!

Yes, decrypting the data partition is still being handled by TWRP. I added some debug lines to the C code, you can see it in /tmp/recovery.log.
The main issue was mounting /data first, and I had to enable file based encryption instead of vold...
5th August 2017, 04:21 PM |#5  
roirraW "edor" ehT's Avatar
Recognized Contributor
Flag Columbus, OH
Thanks Meter: 4,793
 
Donate to Me
More
Thanks, I'll have to make time in the very near future to prep my phone for a fresh install.

I haven't had a need to host Android files since I moved on from LG devices before my HTC 10 and Pixel, but I highly recommend Android File Host with optional FTP access on request.

If you prefer a regular cloud service, I recommend Mega. They give 50GB for free and they have an Android app as well as Windows. Possibly others (Mac?), not sure.
5th August 2017, 04:49 PM |#6  
Senior Member
Flag Chicago
Thanks Meter: 206
 
More
My God this is amazing. Thank you so so much.
5th August 2017, 09:46 PM |#7  
OP Senior Member
Thanks Meter: 307
 
Donate to Me
More
Quote:
Originally Posted by bbender716

My God this is amazing. Thank you so so much.

You are welcome! Try to imagine how happy I was when I first succeeded At that time I had to issue 5 commands after boot, and restart it twice to make it work
But I was already able to flash ARISE sound mod and I almost cried of joy :P
The Following User Says Thank You to gubacsek For This Useful Post: [ View ] Gift gubacsek Ad-Free
5th August 2017, 10:54 PM |#8  
OP Senior Member
Thanks Meter: 307
 
Donate to Me
More
Quote:
Originally Posted by roirraW "edor" ehT

Thanks, I'll have to make time in the very near future to prep my phone for a fresh install.

I haven't had a need to host Android files since I moved on from LG devices before my HTC 10 and Pixel, but I highly recommend Android File Host with optional FTP access on request.

If you prefer a regular cloud service, I recommend Mega. They give 50GB for free and they have an Android app as well as Windows. Possibly others (Mac?), not sure.

Ahh I haven't thought of Android File Host! Although I downloaded gigbytes of roms, and mods from there already

Thanks for the tip!
The Following User Says Thank You to gubacsek For This Useful Post: [ View ] Gift gubacsek Ad-Free
6th August 2017, 12:30 AM |#9  
caballon's Avatar
Senior Member
Flag Puerto Rico
Thanks Meter: 57
 
More
is my path is cd/adb what command i write before twrp.img
Quote:
Originally Posted by gubacsek

Hey People! It seems, that after weeks of trying, hundreds of reboots, countless tests, I can present you a working version of TWRP 3.1. for the Pixel with Android O Developer Preview 4.


But let's not rush into things.. First of all a DISCLAIMER:
This is a TEST release, you are using it at your own risk. If your phone gets damaged in any way, nobody else but you can be held responsible. If you do not agree, stop reading and don't use this mod!


I would like to give credits to the people who helped me, and made all this possible:
First of all, @Chainfire, who did more then you would think Among other things, he was the one who showed me how to use tune2fs and reset quotas on /data, which makes it possible to mount it. Without this , I couldn't even start. So thank you very much!
Of course where would we be without @Dees_Troy and the other TWRP guys (i.e.: CaptainThrowback, nkk71, steadfasterX...), who created and maintain TWRP, and demonstrated some serious patience on IRC , where I was asking them for help. For days. For weeks Thank you guys! You helped a lot!

What is this "mod"?
This is stock, normal TWRP 3.1 compiled from source, for the Google Pixel (sailfish) with some small tweaks to make it possible to mount /data, and decrypt it.

Can you use it on the Pixel XL (marlin)?
I don't know... I don't have a Pixel XL to test. If you want, you can buy me one and I'll be glad to compile, prepare, and test it for you.
EDIT: Chainfire "tested a few zip installs" and those were working for him on the Pixel XL, so maybe it is worth a try guys! - thanks for this CF! -

What happens behind the curtains?
I made some modifications to a script that prepared stuff to make the decryption of /data possible. Now it does a bit more... It copies libraries and binaries from /system and /vendor partitions to /system and /vendor folders, so they can be un-mounted (needed for backup). Basically, the recovery uses the real files/commands of the currently installed android os to prepare and mount /data partition (to make it ready for decrypting).
I updated the fstab file, so TWRP knows what to mount where.
I also changed a few things in the order how services are started during TWRP boot.
This is mostly everything. I was only changing external parts/files/tools of TWRP. The original code, the core is left intact.


How well was it tested?
I have only 1 phone, the pixel. I have only tested on this one phone, and it works for me. Of course I can't be certain it will for you, but you will see if you try it
I tested decrypting of /data, flashing a zip file, making a backup. Didn't dare to test restore yet :P


How can you try it?
This is not a flashable zip, this is a bootable image. So to use it, you have to put the phone into fastboot mode, and fastboot boot the image.
1. reboot the phone into fastboot mode
- if you have adb: adb reboot bootloader
- if you don't, then turn off the phone and press volume down while turning it on

2. open a terminal and issue the following command:

Code:
fastboot boot <path to your twrp image here>
(for example: fastboot boot /home/you/twrp-3-1-pixel-bootable-mod.img)


What about a flashable zip?
I had some quick test runs only for now, and it was working for me (flashing the zip, rebooting to recovery) until I flashed supersu, or rebooted the phone to android. I will need some more time to work on this, and see what is going wrong. So please be patient, I will try to do something, but can't guarantee it will work. Soon. Anytime.


Enough of the talk, you can download the image file from here:
(If you know a good file hosting service, please let me know):
https://drive.google.com/open?id=0By...Utialo5Y01Dc3c


Good luck and don't forget to report back!
I will try to do my best to help you, but I have a family and I inted to spend most of my time with them. Please be patient!
If you like my work, you can buy me a beer, it is damn hot here right now, and I would love to drink one

Any help don't want reistall all again!!!!


is my twro .img is on cd/adb what command i write to flash this beauty?
The Following User Says Thank You to caballon For This Useful Post: [ View ] Gift caballon Ad-Free
6th August 2017, 12:31 AM |#10  
mngdew's Avatar
Senior Member
Flag Los Angeles
Thanks Meter: 81
 
More
Well, I was able to boot to TWRP, and successfully flashed WETA audio mod. However, upon rebooting, the V4A app wasn't there.
6th August 2017, 03:54 AM |#11  
Senior Member
Flag Chicago
Thanks Meter: 206
 
More
Quote:
Originally Posted by gubacsek

You are welcome! Try to imagine how happy I was when I first succeeded At that time I had to issue 5 commands after boot, and restart it twice to make it work
But I was already able to flash ARISE sound mod and I almost cried of joy :P

Hilariously, the ARISE sound mod is exactly why I had flashed back from DP4. I'm close with those guys and they know their stuff for sure.
Post Reply Subscribe to Thread

Tags
mod, pixel, twrp

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

Advanced Search
Display Modes