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

Search This thread

kiran8631

Senior Member
Oct 3, 2015
239
58
Google Pixel 4 XL
OnePlus 9 Pro

Attachments

  • Screenshot_20170806-135300.png
    Screenshot_20170806-135300.png
    115.8 KB · Views: 1,053

gubacsek

Senior Member
Jun 18, 2010
262
310

I/O error usually means your partition is full (most probably /system). You need to free up some space by deleting not needed packages (apk files) from /system/app or /system/priv-app and then re-flash the ARISE zip.
But this thread is not about ARISE... Please post your problems in the ARISE thread, and let this one be about TWRP recovery!
If you manage to boot into recovery, and decrypt the data partition, then my work is done. From here, it is about your system and the mod that you are trying to flash.

Thanks!
 
  • Like
Reactions: rockingondrums

kiran8631

Senior Member
Oct 3, 2015
239
58
Google Pixel 4 XL
OnePlus 9 Pro
I/O error usually means your partition is full (most probably /system). You need to free up some space by deleting not needed packages (apk files) from /system/app or /system/priv-app and then re-flash the ARISE zip.
But this thread is not about ARISE... Please post your problems in the ARISE thread, and let this one be about TWRP recovery!
If you manage to boot into recovery, and decrypt the data partition, then my work is done. From here, it is about your system and the mod that you are trying to flash.

Thanks!
Thanks bro got it working
 

gubacsek

Senior Member
Jun 18, 2010
262
310
@gubacsek could you upload the device tree recovery files so people can see what was changed? :confused:

Sent from my Pixel using XDA Labs

I was thinking a lot about this :)
I will of course do it, because I would like to help the TWRP guys to include these changes in their next release.
But right now it is a kind of a big mess :) I added some debug lines which are not needed, I was acting out of rage, and the script copies the entire system and vendor lib folders instead of what is really needed so it is not at all professional :)
I will clean it up a bit, then I'll push my changes.
For now please check /sbin/pulldecryptfiles.sh, /etc/recovery.fstab, and the init rc files. Those are the biggest changes. There is also one option in Boardconfig.mk, to enable FBE (file based encryption) instead of vold decrypt.
 

glyphsays

New member
Apr 13, 2016
2
0
I made the mistake of updating to DP4 while expecting TWRP and everything to work as normal. All I want is to flash back to purenexus, but this update isn't making it easy. Can I flash PN using this TWRP mod, or should I just wait until an official release?
 

piperx

Senior Member
I made the mistake of updating to DP4 while expecting TWRP and everything to work as normal. All I want is to flash back to purenexus, but this update isn't making it easy. Can I flash PN using this TWRP mod, or should I just wait until an official release?
You can't downgrade like that.

Just flash stock image to both slots, then flash pure nexus

Sent from my Pixel using XDA-Developers Legacy app
 

gubacsek

Senior Member
Jun 18, 2010
262
310
I made the mistake of updating to DP4 while expecting TWRP and everything to work as normal. All I want is to flash back to purenexus, but this update isn't making it easy. Can I flash PN using this TWRP mod, or should I just wait until an official release?

In my opinion the way for you to go is to make a backup of everything (internal sd, pictures, music, everything, best the whole internal SD as it is) because this method will reformat your phone and you will loose everything. Download and then flash the stock android N factory image via fastboot (that should flash back your old bootloader, and reformat your phone as it should be for android N), and finally install the stock TWRP recovery, flash purenexus, and restore back your stuff from backup to internal SD.

This would be the cleanest approach, not the easiest... You could start with only flashing a few partitions, flashing purenexus, or even keep the /data partition, but this way god and google only knows what will happen...

After the factory image flash via fastboot, you could try to use my modded recovery, but I never tested it under android N. Theoretically it should work, but I can't be 100% certain it will..... If you dare to test it, please report back, so I know :D

Thanks!
 
Last edited:

glyphsays

New member
Apr 13, 2016
2
0
In my opinion the way for you to go is to make a backup of everything (internal sd, pictures, music, everything, best the whole internal SD as it is) because this method will reformat your phone and you will loose everything. Download and then flash the stock android N factory image via fastboot (that should flash back your old bootloader, and reformat your phone as it should be for android N), and finally install the stock TWRP recovery, flash purenexus, and restore back your stuff from backup to internal SD.

This would be the cleanest approach, not the easiest... You could start with only flashing a few partitions, flashing purenexus, or even keep the /data partition, but this way god and google only knows what will happen...

You can't downgrade like that.

Just flash stock image to both slots, then flash pure nexus

Unfortunately after upgrading to DP3/4 any time I flash the factory N image (ANY factory N image) and try to boot TWRP, TWRP always sends me to a black screen that forces me to hard reset. After the upgrade I'm unable to downgrade and boot TWRP, even after flashing factory images.
 

mngdew

Senior Member
Aug 17, 2010
611
97
Los Angeles

Follow the step below.
1. Rename "audio.effects.conf" in /system/vendor/etc to "audio.effects.conf.bak"
2. Download ARISE 3.09. https://www.androidfilehost.com/?fid=529152257862712061 and save it to "Internal Memory"
3. Donwload "arise_customize.prop" https://drive.google.com/file/d/0B-0lMNJzHcabRFc3SHYxclFYNlk/view?usp=sharing, and save it to "Internal Memory". This is my prop, and it only flashes the V4A core only. If you want to flash additional stuff you can modify the prop further before you flash.
4. fastboot to TWRP to flash ARISE 3.09.
5. Upon reboot, make sure the access to the storage is enabled for V4A.

Hope this works for you, too.
 

piperx

Senior Member
Unfortunately after upgrading to DP3/4 any time I flash the factory N image (ANY factory N image) and try to boot TWRP, TWRP always sends me to a black screen that forces me to hard reset. After the upgrade I'm unable to downgrade and boot TWRP, even after flashing factory images.
Flash the n factory image

Download TWRP 3.0.2- rc1 zip & image

https://dl.twrp.me/sailfish/

Fastboot the twrp image and install the zip

Install pn



Sent from my Pixel using XDA-Developers Legacy app
 

maflin18

Senior Member
Apr 4, 2015
431
124
Iowa City
plus.google.com
Follow the step below.
1. Rename "audio.effects.conf" in /system/vendor/etc to "audio.effects.conf.bak"
2. Download ARISE 3.09. https://www.androidfilehost.com/?fid=529152257862712061 and save it to "Internal Memory"
3. Donwload "arise_customize.prop" https://drive.google.com/file/d/0B-0lMNJzHcabRFc3SHYxclFYNlk/view?usp=sharing, and save it to "Internal Memory". This is my prop, and it only flashes the V4A core only. If you want to flash additional stuff you can modify the prop further before you flash.
4. fastboot to TWRP to flash ARISE 3.09.
5. Upon reboot, make sure the access to the storage is enabled for V4A.

Hope this works for you, too.
Tried this and got stuck on Google boot logo for 20+ mins. ADB reboot and got stuck again. Flashed modified flashall, back to normal now. Still no viper :(
 

bbender716

Senior Member
Sep 11, 2014
794
231
Chicago
Guys! Check the free space on /system! On Android O DP4 I had about 100MB free space, and I had to remove some **** before flashing anything. Try /system/app and Pinyin input, Chinese input apks....
The recovery is fine...
Hmm yeah arise gets mine frozen on the boot screen. Is that an issue with space on /system?
 

imaverik

Senior Member
May 17, 2010
277
70
audio not working?

This is probably something with "selinux" being on. Most of the arise and v4a versions ive ever seen need the selinux enforce=1
 

gubacsek

Senior Member
Jun 18, 2010
262
310
Hmm yeah arise gets mine frozen on the boot screen. Is that an issue with space on /system?

Don't think so. I had 400+mb free in system, still frozen.

Which version did you flash? For me, Deuteronomy 309 is working. Fastboot flash system and vendor back, and then try to flash that in recovery!
But again: if you can boot my modded recovery, and it can decrypt your data partition, then my work is done. This is what I made possible. The rest is up to your rom, and what you try to flash....
 
Last edited:

gubacsek

Senior Member
Jun 18, 2010
262
310
Great job on this! DP4 on Pixel Xl. Booted into Twrp just fine. Flashed Twrp RC2 in recovery and so far no issues.

I'm glad you like it :D Can you please let me know if you can still boot into recovery after booting Android once, or after flashing Supersu (if you intend to flash it anyway :D) ? Just asking, because right after flashing my modded TWRP, I could reboot into recovery from the fastbooted one, but after booting the OS once, I couldn't anymore. I will take some time to check things later, I just would like to get a confirmation if it is the same for others too...
And to be honest, I don't understand why the normal TWRP RC2 would work if you flash it :D
 

cjkacz

Inactive Recognized Developer
May 11, 2013
1,310
2,053
Sardinia
www.teamoctos.com
I'm glad you like it :D Can you please let me know if you can still boot into recovery after booting Android once, or after flashing Supersu (if you intend to flash it anyway :D) ? Just asking, because right after flashing my modded TWRP, I could reboot into recovery from the fastbooted one, but after booting the OS once, I couldn't anymore. I will take some time to check things later, I just would like to get a confirmation if it is the same for others too...
And to be honest, I don't understand why the normal TWRP RC2 would work if you flash it :D
I first fastboot booted this modded Twrp. Once Twrp booted I flashed RC2, rebooted recovery and saw that it worked. I booted into DP4 and it was fine. Went back into bootloader menu and selected recovery. It booted me into RC2 just fine. I made a backup of Android O. I then tried flashing magisek for Pixel. Rom boots fine but no root exists. I may try SuperSU at some point but I do not really have a need for root atm
 

Top Liked Posts

  • There are no posts matching your filters.
  • 74
    EDIT:
    My mod is not needed anymore!
    Everything is fine now, the TWRP guys made the decryption in their latest version (3.2.1 at the time of this post) possible, even with android 8.1.
    Go ahead and download it from twrp.me. and don't forget to thank them, because it was a LOT of hard work! Google made big changes under the hood, and it took a lot of patience and endurance to adapt.
    Big up to @Dees_Troy and the rest of the team!



    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 :D 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 :D 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 :D
    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 :D
    Anyway, here it is : https://www.androidfilehost.com/?fid=817550096634795329
    19
    For now, flash back stock boot image ( grab it at https://desktop.firmware.mobi/ if you don't have it handy) and fastboot boot TWRP to re-flash SuperSU.

    I'm looking at a fix for fastboot flashing TWRP, but these issues are the very hardest to debug due to being so early in the boot process.
    13
    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?
    9
    Can we get a flashable zip of this? I'd love to replace RC2

    I'll see what I can do tonight...
    But even if it works, it will still be RC2 :p
    8

    Follow the step below.
    1. Rename "audio.effects.conf" in /system/vendor/etc to "audio.effects.conf.bak"
    2. Download ARISE 3.09. https://www.androidfilehost.com/?fid=529152257862712061 and save it to "Internal Memory"
    3. Donwload "arise_customize.prop" https://drive.google.com/file/d/0B-0lMNJzHcabRFc3SHYxclFYNlk/view?usp=sharing, and save it to "Internal Memory". This is my prop, and it only flashes the V4A core only. If you want to flash additional stuff you can modify the prop further before you flash.
    4. fastboot to TWRP to flash ARISE 3.09.
    5. Upon reboot, make sure the access to the storage is enabled for V4A.

    Hope this works for you, too.