• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[RECOVERY] [11] [OFFICIAL] TeamWin Recovery Project (8T / Kebab) (2021-29-11)

Search This thread

haitower

Senior Member
Jun 27, 2017
65
9
Yes it will be overwritten with the stock recovery, so you would need to flash TWRP again.
If you are using magisk you can also use this https://forum.xda-developers.com/t/...ices-platforms.2239421/page-102#post-77770683 module by @osm0sis
Thank you!

Yes, I plan on installing Magisk. I know, this is not directly the topic of this thread but still related to my question:
Lets say I installed TWRP and Magisk and there is an OTA available and I want to stay rooted: Do I need to flash the original boot.img before flashing the OTA or not? (And after the OTA I would reinstall Magisk in the manager app)

Some guides do say to flash the original boot.img, some not. I don't understand in which cases this needs to be done?
 

BillGoss

Senior Member
Sep 2, 2010
4,808
4,262
Sydney
OnePlus 3T
OnePlus 8T
Thank you!

Yes, I plan on installing Magisk. I know, this is not directly the topic of this thread but still related to my question:
Lets say I installed TWRP and Magisk and there is an OTA available and I want to stay rooted: Do I need to flash the original boot.img before flashing the OTA or not? (And after the OTA I would reinstall Magisk in the manager app)

Some guides do say to flash the original boot.img, some not. I don't understand in which cases this needs to be done?
An OOS OTA incremental update checks for the presence of stock versions of both boot and recovery before it runs.
This means that if you're using Magisk you have to restore the stock boot image before starting the update. And if you're using TWRP you have to restore the stock recovery image before starting the update.
 

Qnorsten

Senior Member
Mar 14, 2012
192
86
Thank you!

Yes, I plan on installing Magisk. I know, this is not directly the topic of this thread but still related to my question:
Lets say I installed TWRP and Magisk and there is an OTA available and I want to stay rooted: Do I need to flash the original boot.img before flashing the OTA or not? (And after the OTA I would reinstall Magisk in the manager app)

Some guides do say to flash the original boot.img, some not. I don't understand in which cases this needs to be done?

An OOS OTA incremental update checks for the presence of stock versions of both boot and recovery before it runs.
This means that if you're using Magisk you have to restore the stock boot image before starting the update. And if you're using TWRP you have to restore the stock recovery image before starting the update.

I think this is only true if you run the global version (and possible the T-Mobile version) where they only provide incremental zips over OTA. It has been a while since I used the stock system update (mostly use oxygen updater to download my OTA). At least for my phone running EU rom the system update will show a prompt like "root detected download full OTA zip" and then it will update normally.
After install before reboot , I just flash the TWRP retention module in magisk manager and then onstall magisk to inactive slot from magisk manager. No need go restore any stock boot or recovery.
 

haitower

Senior Member
Jun 27, 2017
65
9
Thanks @BillGoss and @Qnorsten

I have the EU version. So if the updater offers the full OTA, I will just do what Qnorsten said and not flash the original boot/recovery beforehand.

However, just to be sure I would like to backup my original boot and recovery. How do I do that?

Edit: I think I found how to backup boot.img:
Code:
fastboot getvar all

fastboot boot recovery.img
adb shell
dd if=/dev/block/by-name/boot_a of=/sdcard/boot_a.img
exit
adb pull /sdcard/boot_a.img boot_a.img
adb reboot

The first command is to identify the active slot (either a or b). The code above is for slot a. If it is b, adapt the commands from a to b.

Anyone knows how to backup the OOS recovery?
 
Last edited:

BillGoss

Senior Member
Sep 2, 2010
4,808
4,262
Sydney
OnePlus 3T
OnePlus 8T
Thanks @BillGoss and @Qnorsten

I have the EU version. So if the updater offers the full OTA, I will just do what Qnorsten said and not flash the original boot/recovery beforehand.

However, just to be sure I would like to backup my original boot and recovery. How do I do that?

Edit: I think I found how to backup boot.img:
Code:
fastboot getvar all

fastboot boot recovery.img
adb shell
dd if=/dev/block/by-name/boot_a of=/sdcard/boot_a.img
exit
adb pull /sdcard/boot_a.img boot_a.img
adb reboot

The first command is to identify the active slot (either a or b). The code above is for slot a. If it is b, adapt the commands from a to b.

Anyone knows how to backup the OOS recovery?
Replace "boot" with "recovery".

And this is now well off-topic for TWRP so, if you need more help, ask in the Q&A forum.
 
  • Like
Reactions: haitower

haitower

Senior Member
Jun 27, 2017
65
9
Replace "boot" with "recovery".

And this is now well off-topic for TWRP so, if you need more help, ask in the Q&A forum.
Thanks, and yes, probably. But I think it maybe would be a good idea to include that in the OP. So that people have a backup of their original recovery before modifying it.
 

haitower

Senior Member
Jun 27, 2017
65
9
Is this TWRP alpha version already able to backup & restore other partitions (system/boot/recovery) or only the data partition?

I just wonder because in the OP's third post it says:
Backup: Select only the Data partition.

Background: I want to try out LineageOS and I want to backup my OOS system before.
 

Fif_

Senior Member
Jun 5, 2013
1,147
1,209
Google Nexus 10
Google Nexus 4
Is this TWRP alpha version already able to backup & restore other partitions (system/boot/recovery) or only the data partition?

I just wonder because in the OP's third post it says:


Background: I want to try out LineageOS and I want to backup my OOS system before.
You can go back to OOS with fastboot and a copy of the OOS zip file:
 

haitower

Senior Member
Jun 27, 2017
65
9
You can go back to OOS with fastboot and a copy of the OOS zip file:
Thanks a lot! That is a nice to have option. However, if possible, I'd prefer TWRP backup since it also restores my settings and apps ;)
 
  • Like
Reactions: Lz3807775t

Qnorsten

Senior Member
Mar 14, 2012
192
86
Is this TWRP alpha version already able to backup & restore other partitions (system/boot/recovery) or only the data partition?

I just wonder because in the OP's third post it says:


Background: I want to try out LineageOS and I want to backup my OOS system before.

There are posts earlier in the thread describing how to backup and restore other partitions.
If I recall correctly.
To restore not only data you need to backup and restore
Super
Boot
DBTO
And you need to make sure you restore it to the same slot (a or b) that it was backuped from, as some super part of the super partition is slot specific.
That will restore most but not all of your settings.
Read further back in the thread and someone have detailed everything.

I have yet to try a restore myself.
 
  • Like
Reactions: Lz3807775t

haitower

Senior Member
Jun 27, 2017
65
9
There are posts earlier in the thread describing how to backup and restore other partitions.
If I recall correctly.
To restore not only data you need to backup and restore
Super
Boot
DBTO
And you need to make sure you restore it to the same slot (a or b) that it was backuped from, as some super part of the super partition is slot specific.
That will restore most but not all of your settings.
Read further back in the thread and someone have detailed everything.

I have yet to try a restore myself.
Uhh, that sounds nasty.. Things were so much easier with the Nexus 5 and the OP5T..

For a novice it is such a big effort nowadays to backup and try out new ROMs.

I think I'll just stay with OOS then. However: thanks for your explanation!
 

tom65824

Senior Member
Aug 3, 2018
62
14
short question...
when i install a new version of lineage via updater it overwrites the TWRP and reinstalls the ONEPLUS recovery.
can i prevent this ?

thanks
 

tom65824

Senior Member
Aug 3, 2018
62
14
Settings > System > Advanced > Updater > Preferences > Update recovery.
Make sure that's unchecked.

hi FiF_ Thanks... i´ve found it !!

...BUT... if i want to disable the switch for "update recovery: ---> It pops up: "It is not possible to disable the updates from Lineage -Recovery on this device !"
 

osm0sis

Senior Recognized Developer / Contributor
Mar 14, 2012
14,857
33,604
Halifax
GT-i9250
Nexus 7 (2013)
I think Lineage disabled changing that toggle on all A/B devices, but really they should have only done it on boot-as-recovery devices, since recovery is in the boot image so can't be excluded there... But definitely should be able to change it on recovery_a/_b like we have; go mention it to your Lineage maintainer. (y)
 
  • Like
Reactions: theincognito

azoller1

Senior Member
Aug 4, 2011
1,854
1,752
My Room
OnePlus 8T
I think Lineage disabled changing that toggle on all A/B devices, but really they should have only done it on boot-as-recovery devices, since recovery is in the boot image so can't be excluded there... But definitely should be able to change it on recovery_a/_b like we have; go mention it to your Lineage maintainer. (y)
I am assuming this is done somewhere in the device tree? How would one go about this? Sorry, this may be a little off-topic.
 

gossf

New member
Nov 9, 2011
3
0
Question about restoring TWRP backups: Given that you have to remove your lock code before restoring, what are your options if you're stuck in a bootloop (and hence unable to get into the OS to remove your lock) and trying to restore a backup to fix it? Do you just have to MSM or fastboot a bootable OS back on before restoring?
 

Top Liked Posts

  • 1
    This is how i do:
    Update AICP via OTA preserve TWRP recovery and magisk root & magisk settings and modules

    0. THIS STEP IS OPTIONAL!
    Remove your PIN/pattern/password on your device.
    (I have not tested with no removing password but latest twrp should manage encryption now, so if you are not removing password/PIN/pattern should be okay...However i have not tested yet. I recommend remove all password/PIN/pattern before you are doing anything. But the choiche is yours...)

    1. Make sure you have twrp installer .zip and magisk.zip on your internal storage.

    2. Perform the OTA update. Once you see Reboot DO NOT reboot!! Open Magisk Manager.

    3. On Magisk Manager go to modules and select Install from Storage. Select the twrp installer zip and flash it.

    4. On Magisk Manager click on Install and select "Install to Inactive Slot (After OTA)" and select the magisk.zip and flash it.

    5. Reboot your device. Once you have succesfully booted into the updated AICP, reboot again into recovery. You should get TWRP recovery again, it means installer .zip has been succesfully applied. Now you can flash gapps and addons and whatever you want.

    6. Reboot into system. Set it back your password/PIN/pattern.
    7. Reboot AGAIN!!
    8. Done

    It can be applied on other custom ROMs also.
    I would skip:
    - removing password/pin (only required if doing the TWRP data backup restore process)
    - flashing Magisk.zip (you haven't uninstalled Magisk, so all the Magisk data is still there, as is the app).
  • 11
    Hello!

    I am just trying to undersand at which step of the flashing instructions the "copy-partitions.zip" should be flashed.
    Is it the first step you do to flash the copy-partitions before switching slot and reboot to TWRP (so I guess those steps can be skipped when havening flashed the copy-partitons or?)

    Also regarding the "format data" it seems there are different informations on when that should be done.
    In the OP it is the first step when coming from OOS to custom ROM but in the post you posted here it is mentioned like "do the format after flashing and rebooting to TWRP" .
    So I wonder which step is the correct one to do the format data and flash the copy-partitons from flashing from OOS to custom ROM.

    I thought like this perhaps?
    But I guess the format data should be after point 6. or, and is it so that 3. and 4. can be skipped when flashing the copy-partitons ?

    1. Format data
    2. Flash copy_partitions.zip
    3. switch slot
    4. reboot to TWRP
    5. sideload/flash ROM and TWRP Installer zip
    6. reboot to TWRP
    7. Flash Magisk
    8. Flash Gapps
    9. Reboot to System


    Thanks a lot.
    Things to know about A/B devices:
    1. The slots have different versions of firmware/software because an update only updates one of the slots. This means that it's very likely that your system won't boot if you just change slots.
    2. When you install an update or a new rom, the changes are always made to the inactive slot.

    So, if you're currently on OOS and install a custom rom, then it gets installed to the inactive slot which has firmware/software belonging to the previous version of OOS, which is not what you want.

    There are two ways to avoid this problem of installing the new rom on outdated firmware/software:
    1. Sync the inactive slot to be identical to the current working slot before starting the installation. Copy-partitions.zip does this.
    2. Boot to the inactive slot and then install new new rom. This way the rom gets installed on the slot that has the latest version of the firmware/software.

    The OP uses the 2nd method, but I prefer the first. In fact, I sync my active slot to the inactive one after every OOS update once I know all is good and I'm not going to revert to the previous version.
    Side note: if you've synced the slots then your system will successfully boot on either slot!

    As to the order of "format then flash" or "flash then format", both achieve the same result. But I prefer to do everything on my phone without using a PC (where possible) or OTG. Since all the installation files on the phone will be gone after a format, I prefer to do the installs first and then do the format.
    The fact that currently (version 210904 of TWRP) the data partition isn't set up properly after a format until after the system is rebooted, also means you can't push files to the phone before the system reboot and must use sideloading if installing stuff. Hence my strong preference for "flash then format" at this point.
    8
    Updated the thread with the official link.
    This is the official A11 release, not A12. So, don't expect A12 support on this build.
    5
    Updated post #3 with the updated data backup and restore procedure.
    Once again, huge thanks to @BillGoss :D
    3
    Yeah it's a safe guess, I feel dumb for not even considering it ahaha,
    can confirm at least sideloading works with A12!
  • 83



    Introduction:

    Team Win Recovery Project or TWRP for short, is a custom recovery built with ease of use and customization in mind. We started from the ground up by taking AOSP recovery and loading it with the standard recovery options, then added a lot of our own features. It's 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.

    Key Features:

    Touchscreen driven with real buttons and drag-to-scroll
    XML-based GUI that allows full customization of the layout true theming!
    Settings are saved to the sdcard and persist through reboots
    Ability to choose which partitions to back up and which to restore
    Ability to choose to compress backups now with pigz (multi-core processor support for faster compression times)
    Onscreen keyboard
    Easy selection of internal/external storage

    In addition to the above new features, TWRP features a scripting engine that allows an app to send commands to the recovery for the recovery to perform during startup. We call this scripting engine OpenRecoveryScript. This engine will be put to use immediately in the GooManager app. GooManager will be able to install recoveries automatically for most supported devices. The app will also let you choose to install multiple zips from within Android, wipe, and run a backup.

    We are looking for other talented developers, themers, and device maintainers if they are interested in helping with a free, open source project.

    Source Code:

    GitHub - https://github.com/TeamWin/android_bootable_recovery

    Gerrit Instance - http://gerrit.twrp.me

    If you have made your own TWRP build for an unsupported device, please let us know. We might add your build to the list of unofficial builds. Bear in mind that we are working hard to add more devices and we may add your device to our official build list later.


    Hello, this is TWRP, for Oneplus 8T

    Installation:
    # To temporarily boot it
    fastboot boot <twrp_file_name>.img

    # Since 8T/9R has a separate recovery partition, you can flash the recovery with
    fastboot flash recovery <twrp_file_name>.img

    Updating to a newer build:
    Simply flash the latest TWRP installer zip from TWRP

    OR

    Flash the img from TWRP/fastboot


    FAQ/Know Bugs are given in post #2

    Send me a beer, if you think I deserve it: PayPal


    Huge thanks to:
    @bigbiff (For everything :D 🥰 )
    @Lossyx
    @osm0sis
    @Nebrassy

    for helping in making this recovery. Without these people, TWRP for this device would not have been possible. :D

    Special mention to a friend @apophis9283 :)

    Trees:
    Device: https://github.com/theincognito-inc/android_device_oneplus_kebab
    Kernel: https://github.com/AOSPA/android_kernel_oneplus_sm8250

    Download:
    https://twrp.me/oneplus/oneplus8t.html
    28
    FAQ and Known bugs of TWRP:

    • OOS/H2OS flashing is broken.
    • If you are planning to switch to a custom ROM, and are currently on OOS/H2OS, format /data, switch slot, reboot to TWRP and then sideload/flash the ROM + installer.
    • It's better to flash ROM + TWRP installer, if you want to keep your TWRP after flashing a ROM.
    • Don't format /data, after a flashing a ROM, before the first reboot.
    • It takes around 50s to actually boot into TWRP.

    Ideal way to flash:
    • For OOS to Custom ROM - Format /data, switch slot, reboot to TWRP, sideload/flash ROM + installer, reboot to TWRP, flash Magisk/Gapps. Reboot to system.
    • For Custom to Custom ROM - Format /data. Flash ROM + installer, reboot to TWRP, flash Magisk/Gapps. Reboot to system.
    • For updating a custom ROM - Flash ROM + installer, reboot to TWRP, flash Magisk/Gapps. Reboot to system

    PS: After formatting /data, until the first time the device is booted to system, the files you send to phone via MTP (USB) will be at /data/media, not at /sdcard

    PS2: If, for some reason, you cannot send files to phone after formatting /data and rebooting to TWRP, press vol +, vol - and power button simultaneously.

    PS3: Factory reset WILL NOT wipe internal storage.
    24
    New build released - 20210726 (Kebab only)

    Changelog:

    1. Removed 9R support
    2. Fixed the TWRP screen overlapping with the notch
    3. Various mount errors while flashing ROMs should be gone now (atleast my testers think so)
    4. Latest upstream changes
    5. Removed AOSPA kernel, and updated to latest LOS kernel
    Download links:

    IMG: twrp-3.5.2_11-0-kebab-20210726-alpha
    Installer: twrp-installer-3.5.2_11-0-kebab-20210726-alpha

    As always, links are updated in the OP too.
    17
    Steps for backing up and restoring data in TWRP (Huge thanks to @BillGoss )

    TL;DR for data backup on custom ROMs:

    1. Backup /data (copy the backup folder to PC if you will format /data).
    2. Flash the ROM and boot it once to system.
    3. Restore /data (copy the backup folder back from PC if you formatted in step 1) and boot into system.
    4. If you find any issues like missing navigation bar or blank screen or something, just do a normal reboot again to system.

    System Backup and Restore
    The "system" partitions on the OnePlus 8T are:
    • Boot
    • DTBO
    • Super which contains the logical system, system_ext, odm, product, and vendor partitions
    Just backup and restore these partitions.
    Do NOT backup/restore any of the logical partitions individually.


    Data Backup
    1. Make sure USB debugging is enabled
    2. You do NOT need to remove your password

    In TWRP
    1. Backup: Select only the Data partition.
    2. Reboot System

    Restore
    Remove the current password before starting the restore process by Settings>Security & Lock Screen>Screen lock: Select Swipe (if prompted tap on "Yes, remove")
    If you don't do this, the system will not reboot properly after restoring.

    This will also remove your fingerprint data and your lockscreen (encryption) password (you won't be prompted for a password in TWRP or when you restart the system)

    In TWRP
    1. Wipe>Factory Reset
    2. Reboot System (this will rebuild the data partition)

    Back in TWRP
    1. Restore: Select the backup you want to restore
    2. Remove the SIM card. If you don't do this the system won't boot properly.
    3. Reboot system, making sure the phone is not connected to a PC

    Notes:
    1. At this point the phone will take longer than usual to boot - that's normal
    2. You will be presented with a blank screen
      • Connect the phone to a PC. You should be able to see the phone using adb devices
      • Disconnect the phone from the PC
    3. Hold the Power button down and select Restart

    In System
    1. Settings>Security & Lock Screen>Screen lock: set your password
    2. Insert the SIM card
    Note: Your fingerprints will have been restored because the backup was taken with the password set.
    16
    New build released - 20210904

    Changelog:
    1. Removed repack tools
    2. Allowed OpenAES encrypted backups (to conform with the TWRP source change)
    3. Added logical flag for relevant partitions (to conform with the TWRP source change)
    4. Latest upstream changes
    Download links:

    IMG: twrp-3.5.2_11-0-kebab-20210904-alpha
    Installer: twrp-installer-3.5.2_11-0-kebab-20210904-alpha


    NOTE for 9R users: This build SHOULD work with 9R - you SHOULD be able to do everything except flashing OOS. This is experimental. Use it at your own risk.

    As always, links are updated in the OP too.