Development [RECOVERY][UNOFFICIAL] TWRP for barbet

Search This thread

nijel8

Senior Member
Dec 24, 2011
2,423
5,654
All over US
Google Pixel 5a
Sadly I think there is way more ot this bug..

Flashed TWRP will not save it's settings, so each time I load the flashed twrp recovery, it's as if I never used it before, and have to disable vibration settings. It's also having AVC issue as well...I can't really narrow it down :/
I can't debug it since I am not running A11 but from your logs posted earlier it looks like twrp is using /data/media/TWRP folder for settings and backup and not /data/media/0/TWRP as it should if internal storage is decrypted... Is it decrypted? Looks like not... Do you see your files in /sdcard? Do you have pin/pattern/password setup in android?
Decryption issues explain twrp settings not saved. TWRP is pretty much useless if internal storage is encrypted....
AVC denials are just reported but not a problem since SELinux is permissive...
 
Last edited:
I must say that this is annoying.
If I attempt to install Lineage it hoses a ton of partitions. Resulting in the need to reflash stock.
I thought I had a screenshot of it in TWRP after attempting the install, but it seems TWRP wont write to my storage(USB Flash).
after that the device is in an unbootable state. defaulting to bootloader.
What am I missing here.

fastboot boot twrp.img
install twrp from booted image, via advanced menu
either sideload or flash lineage rom zip by any means
Expect it to work and not break things like /vendor
Start over and reflash stock because something got broken.

logs soon if I can replicate it without much issue.


I'd almost speculate that it no longer works with Android 11/Lineage. It seems to work after installing lineage, booting it, then going back and applying the image via twrp advanced menu. Also inconsistently leaves me without touch. Not just a delay, but touch, just not working. and yes, vibrator issue, disabling vibration fixes the delay. copying boot_b to boot_a also fixed all of the issues.
Seems to work with Lineage Recovery, no issue.
I'm stuck.
 
Last edited:

bobpiesz

Member
Nov 24, 2012
29
12
Migrated to android 12, and that solved many issues.. Is there any eta from teamwin for android 12 decrypt? If I remove pass codes, I can no longer use finger prints to login :/
 

naterz

Senior Member
Sep 21, 2010
89
11
Having some issues getting it to install to ramdisk after updating to A12. Factory image'd both A and B slots (B being active) went through setup, installed magisk, installed fsociety kernel, booted TWRP and made a nandroid backup, then attempted to flash TWRP to the ramdisk via the advanced menu. This leaves me stuck at bootloader with a verified boot error. Now I do notice encryption is on for my device, but I have made sure to disable screen lock as is required (which allows me to decrypt data when fastboot booting twrp) - not sure if that matters at all. Seems like @eriklion is the only one who had a similar issue as me.

Figured it out after lots of messing around and research. Turns out in order to actually flash TWRP to A / B devices like the Pixels, you need to inject TWRP into BOTH boot_a and boot_b slots. This must have been taken care of on the A11 build and been an automatic process since it wasn't this much trouble for me on the October A11 image. Pretty sure my process went like this: Stock A12 Barbet - June build -> fastboot boot twrp.img -> TWRP/Advanced Menu/Install Recovery Ramdisk ->TWRP/Reboot Menu/Reboot To Recovery -> TWRP/Advanced Menu/Install Current TWRP -> TWRP/Advanced Menu/Install Kernel*** (I used the fsociety barbet A12 kernel) -> TWRP/Install Menu/Flash magisk.apk OR .zip ( magisk being completely optional I imagine) -> TWRP/Reboot Menu/Reboot to System.

The order of operations here might not be 100% correct towards the end of it, but it has to be pretty close. If anyone can verify the full process for A12 I would be super interested! Either way, I imagine how it functions now is about as good as it gets until the dev group irons out the rest of the A12 bugs and streamlines some features. @nijel8 Big time thank you for your work and commits to this device branch and for releasing a usable recovery build in the meantime. It's so cool to see the evolution of Android developer work on such a huge project like TWRP. If there's anything I can do for you regarding this device down the road, let me know. Happy to pull dmesg/logcat/whatever.

*** note: At one point prior to installing the Kernel / after TWRP was bootable via fastboot reboot recovery, I lost the touch screen driver. Ended up using a USB A->C adapter and a USB mouse to install the kernel through TWRP and rebooted. On next boot to TWRP the touch function was back. Somewhere along the way, I ended up with the vibrator/lag bug and had to disable vibration through TWRP settings to rid myself of it.

----------------------------------------------------------------------------

Another note for @eriklion , I would suggest doing what you did - fastboot boot twrp.img - but then try sideloading the Rom OTA - and then, before letting the device reboot, load the twrp.img to ramdisk. Then perhaps reboot to recovery from within twrp, and if that works- then Advanced Menu - Install Current TWRP. Not saying it will work for you, but it's likely where I'd start if I were in your position. From what I've read, when you flash/load a systemOTA.zip on a Recovery-Via-Boot.Img A/B device, it will overwrite the existing boot.img and then switch to the other boot slot on next reboot.
 
Last edited:
  • Like
Reactions: Armentanzirian

Veraster

Member
Apr 28, 2013
47
1
Houston TX
Is there a version of TWRP that works on android 12? This one doesn't work on 12 (it runs but after installing itself, the system and recovery screen don't work). The latest TWRP on twrp.me doesn't work on 12 (freezes on splash screen). Every rom needs firmware 12 to install. It's a catch 22.
 

TheSayaMan

Senior Member
Sep 12, 2016
450
202
Is there a version of TWRP that works on android 12? This one doesn't work on 12. The latest TWRP on twrp.me doesn't work on 12. Every rom needs firmware 12 to install. It's a catch 22.
It works with custom roms, not stock firmware which I assume your using because I have my own ROMs for LineageOS and Pixel Experience and it works fine.
 

Veraster

Member
Apr 28, 2013
47
1
Houston TX
What are the actual steps to install one of these custom roms? So far I have tried several different orders of operations to get lineage os installed including:

  1. flash official firmware
  2. fastboot boot twrp
  3. flash rom file
  4. reboot (doesn't boot)
  5. try fastboot boot twrp again. Doesn't work, dead end. The only way to get anywhere at this point is to flash official firmware again.
and
  1. flash official firmware
  2. fastboot boot twrp
  3. flash rom file
  4. flash twrp in advanced options before rebooting. doesn't work, spits out red errors, system doesn't boot. Can't fastboot boot twrp without flashing official firmware, so dead end.
and
  1. flash official firmware
  2. fastboot boot twrp
  3. wipe everything. I no longer have access to sd card
  4. format everything. Still no access to sd card
  5. system no longer boots. Can't flash anything because no sd card
  6. I can still fastboot boot twrp but no sequence of options, data wiping or formatting gets me access to sdcard again.
  7. dead end
and

  1. flash official firmware
  2. fastboot boot twrp
  3. flash twrp in advanced options
  4. try to flash rom (I can't because no sd card or memory access)
  5. try every combination of formatting and data wiping. Nothing regains access to sdcard.
  6. dead end

I have not been successful getting Lineage OS 19 or AICP 16.1 to boot or even flash without spitting out red errors. I am absolutely stumped here. I guess I could try pixel experience and AICP 17 just because I haven't tried those yet..
 
Last edited:

TheSayaMan

Senior Member
Sep 12, 2016
450
202
What are the actual steps to install one of these custom roms? So far I have tried several different orders of operations to get lineage os installed including:

  1. flash official firmware
  2. fastboot boot twrp
  3. flash rom file
  4. reboot (doesn't boot)
  5. try fastboot boot twrp again. Doesn't work, dead end. The only way to get anywhere at this point is to flash official firmware again.
and
  1. flash official firmware
  2. fastboot boot twrp
  3. flash rom file
  4. flash twrp in advanced options before rebooting. doesn't work, spits out red errors, system doesn't boot. Can't fastboot boot twrp without flashing official firmware, so dead end.
and
  1. flash official firmware
  2. fastboot boot twrp
  3. wipe everything. I no longer have access to sd card
  4. format everything. Still no access to sd card
  5. system no longer boots. Can't flash anything because no sd card
  6. I can still fastboot boot twrp but no sequence of options, data wiping or formatting gets me access to sdcard again.
  7. dead end
and

  1. flash official firmware
  2. fastboot boot twrp
  3. flash twrp in advanced options
  4. try to flash rom (I can't because no sd card or memory access)
  5. try every combination of formatting and data wiping. Nothing regains access to sdcard.
  6. dead end

I have not been successful getting Lineage OS 19 or AICP 16.1 to boot or even flash without spitting out red errors. I am absolutely stumped here. I guess I could try pixel experience and AICP 17 just because I haven't tried those yet..
Try factory resetting in the bootloader instead.
fastboot -w
I haven't had a issue with that at all. Also this twrp is unable to decrypt so if you have a password, pin, screen lock set then twrp will be unable to do a proper wipe so you have two options, either remove your security lock then factory reset in twrp after that or you can keep locks but you have to fastboot -w in bootloader instead to do a proper wipe then install rom.
 

Veraster

Member
Apr 28, 2013
47
1
Houston TX
I was able to get Lineage OS working by using fastboot to flash the lineage os recovery to vendor_boot, then flashing lineage os and gapps through there. However I can't flash twrp without borking the lineage os installation. Flashing twrp then flashing lineage os again does make lineage os boot but twrp gets replaced.

How are you getting lineage os working through twrp? Are you using firmware 12 and lineage os 19? Do you have magisk functionality at all?

I can rename the magiskapk to magisk.zip and flash it throught the lineage os recovery and that actually works. However it owuld be nice to have twrp for backup and restore.
 
Last edited:

TheSayaMan

Senior Member
Sep 12, 2016
450
202
I was able to get Lineage OS working by using fastboot to flash the lineage os recovery to vendor_boot, then flashing lineage os and gapps through there. However I can't flash twrp without borking the lineage os installation. Flashing twrp then flashing lineage os again does make lineage os boot but twrp gets replaced.
This makes it pretty much impossible to get magisk working.

How are you getting lineage os working through twrp? Are you using firmware 12 and lineage os 19? Do you have magisk functionality at all?

I was able to get Lineage OS working by using fastboot to flash the lineage os recovery to vendor_boot, then flashing lineage os and gapps through there. However I can't flash twrp without borking the lineage os installation. Flashing twrp then flashing lineage os again does make lineage os boot but twrp gets replaced.
This makes it pretty much impossible to get magisk working.

How are you getting lineage os working through twrp? Are you using firmware 12 and lineage os 19? Do you have magisk functionality at all?
Boot twrp first then sideload ROM and gapps. Reboot to system. Put the twrp.img file on your phone. Do not use a security lock. Reboot to bootloader and boot twrp again. After that, go to install, and select image file and select your twrp.img file that you put on your phone earlier, select install as recovery ramdisk. That will permanently install twrp. Now reboot to system then reboot back to recovery and it will go to twrp. Click install, select your magisk.apk file on your phone and swipe to flash it. Then reboot to system. You now have permanent twrp, and magisk with root. When their is a update though, you can't update through the built in updater on the phone or twrp will be gone. All you have to do is download the update file from the LineageOS site, and transfer it to your phone. Reboot to recovery, select install, then select the new update file and flash it then flash gapps again. Now twrp will be replaced by LineageOS recovery so before you reboot your phone you need to select install again, image and select your twrp.img file again and install it again as recovery ramdisk. Reboot to system, you will be unrooted but simply reboot to twrp and flash magisk as before and you will have twrp, and magisk. Just make sure you don't miss the step about reinstalling twrp in recovery ramdisk, that's why your losing twrp. Here's a link to my ROM if it will help you any further. https://forum.xda-developers.com/t/lineageos-rom-for-pixel-5a-android-12-july-12-2022.4456655/
 

Veraster

Member
Apr 28, 2013
47
1
Houston TX
Boot twrp first then sideload ROM and gapps. Reboot to system. Put the twrp.img file on your phone. Do not use a security lock. Reboot to bootloader and boot twrp again. After that, go to install, and select image file and select your twrp.img file that you put on your phone earlier, select install as recovery ramdisk. That will permanently install twrp. Now reboot to system then reboot back to recovery and it will go to twrp. Click install, select your magisk.apk file on your phone and swipe to flash it. Then reboot to system. You now have permanent twrp, and magisk with root. When their is a update though, you can't update through the built in updater on the phone or twrp will be gone. All you have to do is download the update file from the LineageOS site, and transfer it to your phone. Reboot to recovery, select install, then select the new update file and flash it then flash gapps again. Now twrp will be replaced by LineageOS recovery so before you reboot your phone you need to select install again, image and select your twrp.img file again and install it again as recovery ramdisk. Reboot to system, you will be unrooted but simply reboot to twrp and flash magisk as before and you will have twrp, and magisk. Just make sure you don't miss the step about reinstalling twrp in recovery ramdisk, that's why your losing twrp. Here's a link to my ROM if it will help you any further. https://forum.xda-developers.com/t/lineageos-rom-for-pixel-5a-android-12-july-12-2022.4456655/
That was the very thing that finally made it work. The trick was to not flash twrp from from from the "advanced" menu of twrp but from the manual flash menu where you install roms and stuff. Selecting the twrp image then flashing it to ramdisk is what made it work.
Thanks a lot for your help!
 

TheSayaMan

Senior Member
Sep 12, 2016
450
202
That was the very thing that finally made it work. The trick was to not flash twrp from from from the "advanced" menu of twrp but from the manual flash menu where you install roms and stuff. Selecting the twrp image then flashing it to ramdisk is what made it work.
Thanks a lot for your help!
No problem, anytime.
 

rchris494

Senior Member
May 7, 2011
226
54
That was the very thing that finally made it work. The trick was to not flash twrp from from from the "advanced" menu of twrp but from the manual flash menu where you install roms and stuff. Selecting the twrp image then flashing it to ramdisk is what made it work.
Thanks a lot for your help!
really there is no need to flash twrp anymore. i usually just boot it by fastboot boot twrp.img. custom roms are not what they use to be. real custom roms. Project Treble & google ruined that. you only need advanced ==> sideload in twrp. every rom now a days seems to be based off android open source project and include their own generic custom recovery. so you only need to do a factory wipe in the stock recovery or fastboot -w in bootloader mode. just make sure you remove security pins, face locks, swipe locks first. TheSayaMan builds of pe or lineage include the recovery in the zip. so you only need to factory reset and then boot twrp to sideload. it installs everything else needed to work. the generic custom recovery it includes has a sideload mode that you can use to flash OTAs and/or magisk. making twrp more or less not needed. beyond the initial install.or if you want to make a nand backup.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 20
    Download:
    twrp-3.6.0_11-0-barbet.img

    This is my unofficial built, fully working with A12 with some remarks:

    - internal storage decryption works but you have to set Screen lock to None or Swipe in Android Settings -> Security. If Pattern, Pin or Password are set storage decryption and MTP will not work until TeamWin fixes the code for A12.

    - nandroid backup/restore works but you might need to reboot Android a couple of times after restore until dalvic-cache fully rebuilds. Until then you will see black home screen background instead of your wallpaper... Just keep restarting until everything is back to normal.

    - DON'T MESS(WIPE) WITH METADATA in TWRP Advanced Wipe!!! If you do you can't boot Android until formatting data = factory reset.

    DO NOT FLASH THIS TWRP IMAGE IN FASTBOOT!!!
    Install TWRP form within itself after boot with fastboot.


    Not tested on A11 so might have some bugs...
    recovery.log and logcat are helpful.

    To boot it connect USB and run these commands:

    Code:
    adb reboot bootloader
    
    fastboot boot twrp-3.6.0_11-0-barbet.img

    While in recovery you can install it permanently on the boot partitions by going to Advanced and pressing Flash current TWRP. Root will be lost so after that you have to reboot to bootloader again, fastboot boot your magisk patched boot.img, direct patch boot with magisk to get root back and reboot. Done. You have root and TWRP on device. To get to TWRP:
    Code:
    adb reboot recovery

    Big thanks to @bigbiff, @Captain_Throwback and the entire TeamWin for their work!

    Source code:

    device tree - my GitHub
    recovery - TeamWin GitHub
    5
    Updated... Please redownload from OP

    - fixed touchscreen not working on A11 ROMs(not tested but should work), please report...
    - fixed MTP on reconnecting

    Do not flash twrp-3.6.0_11-0-barbet.img!!! Install it form its Advanced meny ones booted with fastboot...
    5
    Updated... Please redownload from OP

    - fixed vibration haptics
    - synced with latest TeamWin code

    Do not flash twrp-3.6.0_11-0-barbet.img!!! Install it form its Advanced menu ones booted with fastboot...
    4
    I changed magisk.apk to magisk.zip and flashed it in twrp to get root back. Patching is not necessary. Also I have been able to update lineage and keep twrp. This is what I do. I download the new lineage update and place it on my otg cable, you can keep it in your internal storage if you don't have a security lock pin/pattern etc. I use a OTG cable because I have a security pattern set and it won't encrypt internal storage. I also have the gapps on there as well and the twrp.img file. If you update through the built in updater on the phone it will overwrite twrp with lineageos recovery and you will have to boot twrp again in the bootloader. My way, you won't ever have to do that. So what you do next is reboot to twrp and go to install, select the lineage update file and flash it. It will automatically flash it in the opposite slot which is what you want it to do. When it's done, twrp will be overwritten but all you have to do is select install again, and choose install image and select your twrp.img file and install it as recovery ramdisk. This will get twrp back because it was overwritten with LineageOS recovery when you installed update. Now install gapps, it will install them on the current slot which is what you want. After it's done, reboot to system and wait for the update to complete. Then reboot to recovery and flash magisk.zip in recovery again to get rooted again. Reboot to system and your done. If you update this way, don't forget the part to install twrp.img as recovery ramdisk before rebooting the phone otherwise twrp will be gone and you will have to boot it in bootloader again.
    You can actually just flash the Magisk.apk in TWRP now, no need to change to Magisk.zip
    4
    It wouldn't be the likely culprit of the touchscreen issues being brought up, would it?
    Yeah forgot and ran the install script I usually use to install my boot.img.. But Idk about it stopping touchscreen inputs tho.
    Touchscreen wasn't working b/c A11 bootloader reports different bootreason value(guessing...) than A12(on what I test) and the script that loads the appropriate touchscreen drivers for the booted kernel got confused...
    Fixed it... Now script reads booted kernel cmdline which has special twrp fastboot portion and should never load wrong drivers.