[RECOVERY] [TWRP] Android system recovery <3e> universal checksum disabler - Miscellaneous Android Development

This is a Flashable Zip for restoring backups created from different recoveries. No more problems with checksums, checksums will be ignored.
- Android system recovery <3e>
- CWM
- TWRP
- ADB Backup
- MIUI Backup
This is a alpha release, in this state you can test it for Android system recovery <3e> only!
I need testers for proof of concept. If you have a Mediatek Phone with encrypted userdata_20160823_100259.backup, please try to restore with bckp2raw.zip from TWRP. Please give feedback if failed or vote :good: if worked.
bckp2raw.zip (v1.0.3) 32-bit
bckp2raw.zip (v1.0.5) universal
(other backup formats following soon, feel free to request)

TUTORIAL - under construction

aIecxs said:
TUTORIAL - under construction
Click to expand...
Click to collapse
Is this solves problem of Android 7 stock recovery backup?
I got second phone stock recovery problem for 7 version
stock recovery do not want to recover his backup. complains - "it is corrupted, please reset your phone"
I install twrp recovery and try to install this .zip
bit it give error 134 (or something like that)

sorry this project is abandoned. in generally, backup can not restored to other device because of the checksum mismatch. Thats where this zip comes in game. If you upload recovery.log right after installing this zip i will try to fix the errors..

aIecxs said:
sorry this project is abandoned. in generally, backup can not restored to other device because of the checksum mismatch. Thats where this zip comes in game. If you upload right after installing this zip i will try to fix the errors..
Click to expand...
Click to collapse
I meant - I got another (second) phone looped reboot, same as in 2018. And try to stock recovery backup (55Gbyte and ) restore.
BTW - first phone is still waiting to restore 11Gbyte stock recovery backup!
last file: userdata_20191106_110350.backup27
Android 7 again same as in topic: https://forum.xda-developers.com/showthread.php?t=2528969&page=7
I copied lines from recovery.log:
I: operation_start: 'Flashing'
Installing zip file '/external_sd/bckp2raw.zip'
Checking for Digest file...
Skipping Digest check: no Digest file found
I:Update binary zip
I:Zip does not contain SELinux file_contexts file in its root.
I:Legacy property environment initialized.
Archive: /external_sd/bckp2raw.zip
inflating: bckp2raw.sh
Archive: /external_sd/bckp2raw.zip
inflating: busybox-arm
Archive: /external_sd/bckp2raw.zip
inflating: tar-arm
CANNOT LINK EXECUTABLE "/system/bin/sh": "/system/lib/libc++.so" is 32-bit instead of 64-bit
Aborted
Updater process ended with ERROR: 134
I:Legacy property environment disabled.
I:Install took 0 second(s).
Error installing zip file '/external_sd/bckp2raw.zip'
Dont want to boring and get you, if you would give help - you can save many people with same problem with android-7

ah i see, script does not even start. i don't have a x64 device for testing, i assume twrp is not able to run mksh from /system. i have added paths please try this one instead...
update-binary
Code:
LD_LIBRARY_PATH=/system/lib64:/system/vendor/lib64:/system/lib:/system/vendor/lib
bckp2raw.zip (v1.0.5) universal

for those who want to quickly convert TWRP ADB backup.ab into data.ext4.win
usage for unpacking files (don't do this on windows disk)
Code:
bash twab.sh backup.ab
cd 20*
mkdir data
sudo tar --ignore-command-error --numeric-owner --selinux --xattrs -xpf data.ext4.win -ivC data 2> /dev/null

data partition is encrypted
Hi , I've been trying a lot of methods to get my data back from my .backup files. All with no results. Your bckp2raw script seems to be one of the most successfull , but it ends by a " data partition is encrypted" ... Do you think I can still recover my files ... The original phone is actually working but it has been factory wiped ...

that message just means that your current /data partition is encrypted (message for encrypted backup is different)
- do a backup of metadata partition (just in case)
- do a backup of /sdcard to PC (adb/mtp)
- format userdata partition
- reboot TWRP
- check userdata partition is unencrypted
- restore userdata*.backup from zip
- restore metadata partition from backup
- restore /sdcard backup
the restoring process will deny if userdata is not empty. please note if backup is encrypted it is most likely useless without corresponding backup of metadata partition

aIecxs said:
that message just means that your current /data partition is encrypted (message for encrypted backup is different)
- do a backup of metadata partition (just in case)
- do a backup of /sdcard to PC (adb/mtp)
- format userdata partition
- reboot TWRP
- check userdata partition is unencrypted
- restore userdata*.backup from zip
- restore metadata partition from backup
- restore /sdcard backup
the restoring process will deny if userdata is not empty. please note if backup is encrypted it is most likely useless without corresponding backup of metadata partition
Click to expand...
Click to collapse
Thank you very much for your quick reply. Ok so I tried it , the restoring part worked , but when I rebooted it asked me for my code and said "password is correct but data is corrupted" ....
Do you have any idea for me to get my data back .... at least my pictures ...?

sounds like the backup is encrypted, can you confirm? more important is this the source phone of this backup? or do you try to restore on other device?

aIecxs said:
sounds like the backup is encrypted, can you confirm? more important is this the source phone of this backup? or do you try to restore on other device?
Click to expand...
Click to collapse
I'm pretty sure it is encrypted. Yes the phone is the source phone of the backups

encryption should work in theory, but you need a copy of metadata partition from the day you created backup. you most likely don't have it, therefore your data is lost forever

aIecxs said:
encryption should work in theory, but you need a copy of metadata partition from the day you created backup. you most likely don't have it, therefore your data is lost forever
Click to expand...
Click to collapse
Yes I don't have the metadatas from that day, is there a chance that they have been backup with the android backup ?
Thanks for your help anyways, I'm sad

no, nothing you can do. even a old metadata from the first day when you buyed this device would probably do it. metadata partition is formatted on factory reset.
for some devices the crypto footer is not located at separate partition, but at the end of userdata partition instead. But this is not the case for your device, otherwise this zip would have restored. you can double check, search with hex editor in last -16384 bytes of last file for string aes-cbc-essiv:sha256 (or aes-xts)

aIecxs said:
no, nothing you can do. even a old metadata from the first day when you buyed this device would probably do it. metadata partition is formatted on factory reset.
for some devices the crypto footer is not located at separate partition, but at the end of userdata partition instead. But this is not the case for your device, otherwise this zip would have restored. you can double check, search with hex editor in last -16384 bytes of last file for string aes-cbc-essiv:sha256
Click to expand...
Click to collapse
Cannot find anything like this but i'm not used to HEX reading .... Is there a chance that the metadata is on the SD card i was using for (external) storage on the phone (not the ones for the backups) ?

Hello there and thanks for creating such a productive thread, just what I needed for my current situation. so am trying to retrieve .backup files on cxAir android 7.0 after root through twrp but apparently, when running the script from the zip file you've shared I get the Error: data partition not mounted.
I'm still new in the dev world but am totally excited about it and I may not understand a lot of things but am willing to work my ass off to figure out the most of what I can so please I'd really appreciate it if I could get some help on this one, thanks in advance

mount data partition and try again?

Related

CWM 6.0.3.2 recovery for Galaxy Core LTE G386F (ported from Samsung Galaxy Mega 5.8)

Hi.
This is CWM recovery ported from Samsung Galaxy Mega 5.8.
What works:
-installing zip files
-wiping dalvik cache
-rooting (when exiting from recovery it'll ask to root phone - if it's not already rooted)
-making backup
-advanced restore (tested for system and data partitions, You need to:
mounts and storage -> format /system and:
backup and restore -> advanced restore -> "my backup" -> restore system, same with data partition)
-restore backup works if system and data partitions are earlier formatted (mounts and storage -> format /system and format /data)
-wipe cache
Bugs:
If You use "wipe data/factory reset" (which includes formatting cache partition) and then use "wipe cache partition" phone will hangs at system loading animation.
Cons:
checking MD5 sums may take few minutes
need to format system and data partitions before restore backup (or phone won't boot after restore)
How to:
unpack and flash with odin
Hey ! Congratulations on your port ! Well, it's pretty useless if you can't restore a backup but anyway. Could be something to deal with partitions mounts ?
I'm pretty curious about what you did to bypass the damned secure boot XD ?
AmineIzumi said:
Hey ! Congratulations on your port ! Well, it's pretty useless if you can't restore a backup but anyway. Could be something to deal with partitions mounts ?
I'm pretty curious about what you did to bypass the damned secure boot XD ?
Click to expand...
Click to collapse
I was able to restore system partition. Just needed to do:
mounts and storage -> format /system and mount /system
and then:
backup and restore -> advanced restore -> "my backup" -> restore system.
Will we find a brave one to test data partition as well?
Let's say that restore works too. At least partially.
As for secure boot, it seems that we can freely replace files in ramdisk -> sbin and edit a rc files. Im still not sure when secure boot reacts. Your recovery had boot folder in ramdisk?
Mh, okay. Does it means that system partition isn't mounted at recovery boot?
could you provide an .img file to flash directly to recovery partition in terminal emulator ?
(By dumping yourself your recovery partition)
Mhh, i don't think so
AmineIzumi said:
Mh, okay. Does it means that system partition isn't mounted at recovery boot?
could you provide an .img file to flash directly to recovery partition in terminal emulator ?
(By dumping yourself your recovery partition)
Mhh, i don't think so
Click to expand...
Click to collapse
Yes, it's not mounted but even if You mount it manually and then try to restore backup it still doesn't work. I red somewhere that system or data has to be empty to restore backup. Probably it's why "advanced restore" worked when I formatted system (also data partition works that way). Maybe if system and data partition will be formatted (manually with mounts and storage) before restoring backup will work.
As for recovery img, download it from xda, unpack, remove md5 and unpack again (with 7zip for example) if any error - ignore.
Agasharr said:
Maybe if system and data partition will be formatted (manually with mounts and storage) before restoring backup will work.
Click to expand...
Click to collapse
confirmed, with /system and /data partition formatted earlier restore backup works
Good work !
Well, I've no idea why it didn't worked the first time but after that I used "wipe cache" dozen times and it always works as it should so I'm removing it from bug list.
May I asked if anyone is willing to test my TWRP build. Wanted to try this on my friends core LTE but turns out his loader is locked by O2. If anyone is willing to test : TWRP Core lte. PM me to tell me if it works or not.
CTXz said:
May I asked if anyone is willing to test my TWRP build. Wanted to try this on my friends core LTE but turns out his loader is locked by O2. If anyone is willing to test : TWRP Core lte. PM me to tell me if it works or not.
Click to expand...
Click to collapse
Unfortunately it hangs at boot logo. I'm really glad to see someone doing something constructive for g386f development as i'm planning to sell my core lte and will no longer develop anything for that phone. Good luck.
btw.
Try to repack your recovery with boot folder from original recovery.
Agasharr said:
Unfortunately it hangs at boot logo. I'm really glad to see someone doing something constructive for g386f development as i'm planning to sell my core lte and will no longer develop anything for that phone. Good luck.
btw.
Try to repack your recovery with boot folder from original recovery.
Click to expand...
Click to collapse
hmm... Guess it's the kernel. I'll try it.
CTXz said:
hmm... Guess it's the kernel. I'll try it.
Click to expand...
Click to collapse
Well, You can try with my kernel:
http://forum.xda-developers.com/gal...ip-galaxy-core-lte-g386f-hope-kernel-t3197096
It's not listed there but it contains changes in rtboot and rt_boot_sub files from drivers/char/rtapi/rtboot/ (the files are described as renesas - so it may be related to boot process)
http://forum.xda-developers.com/showpost.php?p=63849597&postcount=15
As for locked bootloader, is there any g386f with unlocked one?
Always thought all of them have secure boot enabled.
btw.
Can You try to implement kexec hardboot as a way to bypass a locked bootloader?
Agasharr said:
Well, You can try with my kernel:
http://forum.xda-developers.com/gal...ip-galaxy-core-lte-g386f-hope-kernel-t3197096
It's not listed there but it contains changes in rtboot and rt_boot_sub files from drivers/char/rtapi/rtboot/ (the files are described as renesas - so it may be related to boot process)
http://forum.xda-developers.com/showpost.php?p=63849597&postcount=15
As for locked bootloader, is there any g386f with unlocked one?
Always thought all of them have secure boot enabled.
btw.
Can You try to implement kexec hardboot as a way to bypass a locked bootloader?
Click to expand...
Click to collapse
Hey, I've already fixed those issues. It's because i'm building via omni 5.1.1 sources.
I'd need a last_kmsg if this kernel supports it.
To kexec, it would be hard since you need a unlocked loaded to modify it.
CTXz said:
I'd need a last_kmsg if this kernel supports it.
Click to expand...
Click to collapse
Sorry, I can't check that right now. Maybe someone else...
CTXz said:
It's because i'm building via omni 5.1.1 sources.
Click to expand...
Click to collapse
Doesn't this require selinux support in kernel? It's not used in 4.2.2 and default kernel (or my) is compiled without it.
Btw.
Looking at your github - You still need to fix:
BOARD_BOOTIMAGE_PARTITION_SIZE := 0x105c0000
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 0x105c0000
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 0x105c0000
BOARD_USERDATAIMAGE_PARTITION_SIZE := 0x105c0000
Agasharr said:
Sorry, I can't check that right now. Maybe someone else...
Doesn't this require selinux support in kernel? It's not used in 4.2.2 and default kernel (or my) is compiled without it.
Btw.
Looking at your github - You still need to fix:
BOARD_BOOTIMAGE_PARTITION_SIZE := 0x105c0000
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 0x105c0000
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 0x105c0000
BOARD_USERDATAIMAGE_PARTITION_SIZE := 0x105c0000
Click to expand...
Click to collapse
Fixed those already. Check the TWRP branch
CTXz said:
I'd need a last_kmsg if this kernel supports it.
Click to expand...
Click to collapse
It seems to be unavailable
Agasharr said:
Hi.
This is CWM recovery ported from Samsung Galaxy Mega 5.8.
What works:
-installing zip files
-wiping dalvik cache
-rooting (when exiting from recovery it'll ask to root phone - if it's not already rooted)
-making backup
-advanced restore (tested for system and data partitions, You need to:
mounts and storage -> format /system and:
backup and restore -> advanced restore -> "my backup" -> restore system, same with data partition)
-restore backup works if system and data partitions are earlier formatted (mounts and storage -> format /system and format /data)
-wipe cache
Bugs:
If You use "wipe data/factory reset" (which includes formatting cache partition) and then use "wipe cache partition" phone will hangs at system loading animation.
Cons:
checking MD5 sums may take few minutes
need to format system and data partitions before restore backup (or phone won't boot after restore)
How to:
unpack and flash with odin
Click to expand...
Click to collapse
Do you mind if I ask you for the source ? Do you have a github ?
Now that the last Windows build include a bash environment, I want to try some other things with this phone.
AmineIzumi said:
Do you mind if I ask you for the source ? Do you have a github ?
Now that the last Windows build include a bash environment, I want to try some other things with this phone.
Click to expand...
Click to collapse
hi, I'm afraid I have already deleted the whole virtual machine I was working on.
But You can quickly do the same kernel:
Source:
http://opensource.samsung.com/reception/receptionSub.do?method=sub&sub=F&searchValue=g386f
Adding governors and I/O schedulers:
http://xda-university.com/as-a-developer/adding-features-to-your-kernel
For overclocking You need to play with PLL in:
https://github.com/CTXz/android_ker...b/TWRP-5.1.1/arch/arm/mach-shmobile/cpufreq.c
And maybe in some other files, I don't remember.
I also made some changes described here:
http://forum.xda-developers.com/showpost.php?p=63849597&postcount=15
As for github, I'm not familiar with it, I tried to use it but got some erros that some files are too large and I gave up so no source there.
Agasharr said:
hi, I'm afraid I have already deleted the whole virtual machine I was working on.
But You can quickly do the same kernel:
Source:
http://opensource.samsung.com/reception/receptionSub.do?method=sub&sub=F&searchValue=g386f
Adding governors and I/O schedulers:
http://xda-university.com/as-a-developer/adding-features-to-your-kernel
For overclocking You need to play with PLL in:
https://github.com/CTXz/android_ker...b/TWRP-5.1.1/arch/arm/mach-shmobile/cpufreq.c
And maybe in some other files, I don't remember.
I also made some changes described here:
http://forum.xda-developers.com/showpost.php?p=63849597&postcount=15
As for github, I'm not familiar with it, I tried to use it but got some erros that some files are too large and I gave up so no source there.
Click to expand...
Click to collapse
Arf, okay ! I remember taking some time while setting the infos in the BoardConfig.mk, i'll research them again XD.
Thank you !
AmineIzumi said:
Arf, okay ! I remember taking some time while setting the infos in the BoardConfig.mk, i'll research them again XD.
Thank you !
Click to expand...
Click to collapse
Hi, I manage to find some backup of kernel source code. I have no idea at what point it was made and what changes contains. But You may download it from:
https://drive.google.com/file/d/0ByjzuAr8UpryYVVGWmJlNkc5YlE/view?usp=sharing

Soft-bricked Z5 when trying to restore a TWRP backup

Hey there,
My brother was trying to install a custom ROM on his phone but it was having issues so he went to restore a TWRP backup of an AOSP ROM he had before. Unfortunately, it was a backup of every partition, including the Firmware partition. When it got to restoring Firmware, it formatted the existing firmware partition, but then immediately failed at restoring the old Firmware partition backup with the following showing in the recovery.log:
Code:
I:Extracting uncompressed tar
==> extracting: /firmware//image/ (mode 40550, directory)
tar_extract_file(): failed to set permissions on /firmware//image/ !!!
I:Unable to extract tar archive '/data/media/0/TWRP/BACKUPS/QV7013TG03/Firm/firmware.vfat.win'
Error during restore process.
extractTarFork() process ended with ERROR: 255
After this, any attempts to start the phone result in a bootloop. We can still get into recovery but every time we try to restore the TWRP backup it fails at firmware again. Any ideas on how to get the phone working?
EDIT: Fixed!
I fixed this a while ago but if I recall correctly, we ended up flashing the stock firmware files with Flashtool. Basically go to this thread follow the steps under Part 2 and Part 2.5, then once you've created the firmware, flash it using Flashtool --> Lightning Button --> Flashmode --> Choose the firmware you made --> Wipe Userdata (not sure if we did this or not, try without it, if it doesn't work then wipe userdata) -->Flash. That should fix it.
I have never managed to restore backup on this stupid phone. Always errors with making backup or restoring backup or not detecting storage or some other crap. Sick of it

Can't backup with TWRP

When I try to backup with TWRP I get the message ''TWRP createTarFork() error 255 when backing up data''. After googling this error I found out that I needed to ADB pull the log. I did that and I think that I know what the problem is. But I am not sure how to fix it now. Here's the log: I can't past the log because this is a new account. Send a dirrect message for the log.
Edit 1: I think that this the error is: I:Check_Lifetime_Writes file does not exist '/sys/fs/ext4/system_a/lifetime_write_kbytes'
Mighty_Pig said:
When I try to backup with TWRP I get the message ''TWRP createTarFork() error 255 when backing up data''. After googling this error I found out that I needed to ADB pull the log. I did that and I think that I know what the problem is. But I am not sure how to fix it now. Here's the log: I can't past the log because this is a new account. Send a dirrect message for the log.
Edit 1: I think that this the error is: I:Check_Lifetime_Writes file does not exist '/sys/fs/ext4/system_a/lifetime_write_kbytes'
Click to expand...
Click to collapse
When I had twrp installed and tried to backup I would always get the error 255.
When I boot a twrp img from fastboot, a backup will succeed. (fastboot boot twrp*.img)
Barsky said:
When I had twrp installed and tried to backup I would always get the error 255.
When I boot a twrp img from fastboot, a backup will succeed. (fastboot boot twrp*.img)
Click to expand...
Click to collapse
I tried it but it dind't work
Hi all - tried today to backup my data (before upgrading to PIE) with TWRP from eng.stk but it won't succeed in any way
Errormessage:
Code:
Starting TWRP 3.2.3-0-840f04f7 on Tue Apr 28 20:15:35 1970
failed to lookup tar policy for '/data/misc_ce/999' - '509be37f3fe33969'
I:Error adding file '/data/misc_ce/999' to '/data/media/0/TWRP/BACKUPS/xxxxxx/2018-09-23--17-36-14/data.ext4.win000'
Error creating backup.
I:ERROR tarList for thread ID 0
Error creating backup.
I:InfoManager saving '/data/media/0/TWRP/BACKUPS/xxxx/2018-09-23--17-36-14/data.info'
createTarFork() process ended with ERROR: 255
Backup Failed. Cleaning Backup Folder.
I:Copying file /tmp/recovery.log to /data/media/0/TWRP/BACKUPS/xxxx/2018-09-23--17-36-14/recovery.log
@eng.stk
Any Idea?
I tried it but it dind't work
Click to expand...
Click to collapse
https://forum.xda-developers.com/oneplus-6/how-to/255-error-twrp-backup-restore-999-t3801632
I could resolve my nandroid /data backup error on my EMUI 8.0 Mediapad M5 device with those following steps:
1 - Use a correct TWRP implementation
TWRP need to access the uncyphered partition /data.
There no possibility to backup it, if TWRP does not implement deciphering user data partition.
2 - Remove all users except user 0 (the administrator)
You can verify that there is no unwanted users, looking at directory /data/user : the only subdirectory should be "0".
To remove the others users :
Remove the PrivateSpace if you have one (Settings > Security & Privacy > PrivateSpace, and tap on the garbage can).
Remove all the secondary users (Settings > Users & accounts > users, and tap on each users to delete them). Keep just the main administrator user.
On EMUI, remove all twins applications (Settings > Apps & Notifications > App Twin, and disable all twin apps).
On OxygenOS, remove all parallel apps (Settings > Apps > Parallel Apps, and disable all parallel apps).
On MIUI, remove all dual apps (Settings > Dual Apps, and disable all dual apps)
On others devices ... you must find all parameters that create those unwanted users.
If you are not able to get the correct settings to suppress those users, in last resort you can try this command : "pm remove-user user-no. (For example "pm remove-user 999").
3 - Do not forget to protect your backups by a password
This would be stupid to cipher your /data partition and keep backups of this partition unprotected.
These steps fixed the nandroid backup problem for /data partition on my Huawei Mediapad M5 device.
I post on this forum because I hope that this will be helpful for others devices owners.

a51 recover data

Hello.
I have a problem: after downgrading my device from Magisk 24.1 back to Magisk 23 I can't unlock my device.
I can only see my wallpaper, but it doesn't respond to touch actions and may reboot.
When I reflash patched boot magisk file it is all the same thing.
Reflashing original boot makes only bootloop or message that data is incompatible.
It is Android 10, AP data file: 'AP_A515FXXU3BTF4_CL18770262_QB31913704_REV00_user_low_ship_meta_OS10'
The question is: how can I pull my /data and /sdcard from my phone?
The recovery is stock version, I've tried to flash TWRP, but TWRP sees only gibberish encrypted file names.
I made a copy of /data/unencrypted folder seems to be containing decryption keys. and entire sda32 containing data partition.
Please help me with ways to restore the system without data wipe or ways how to backup data before reinstalling firmware.
You could try to recover you data with Samsung Smart Switch, when IT doesn't work, there is a way top recover Data from a Phone with ADB tools and a PC.

[RECOVERY][TB128FU][UNOFFICIAL] TWRP 3.7.x for Lenovo Tab M10 Plus (Gen 3)(SDM680)

This version of TWRP works on the Lenovo TB128FU: Tab M10 Plus (Gen 3) and Xiaoxin Pad 2022. It might also work on the TB128XU and Moto Tab G62 - to be confirmed.
Warning: this TWRP will not work for any of the Tab M10 Plus Gen 3 variants with Mediatek SoCs (TB125FU) or UniSoc SoCs (TB328FU,TB328FX).
Code:
#include <std_disclaimer.h>
/*
* 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 ROM
* 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.
*/
Working:
Almost everything is working including:
data decryption
ADB/MTP
external SD card
OTG
Known issues:
vibration
when you unmount then remount the data partition, twrp forgets how to decrypt it
you tell me
This guide is not for noobs
There are two problems with the bootloader on these tablets:
Lenovo does not allow bootloader unlocking on some tablets
Lenovo has not enabled fastboot flash on some tablets
So it's not easy to install twrp on these devices. If you are a noob, don't ask for a step-by-step guide - you'll just have to learn more about Android before trying this guide. It's not my fault - blame Lenovo for making development on this tablet so difficult.
unlocked bootloader
You will need a tablet with an unlocked bootloader. Lenovo has not provided a method to unlock many of these tablets. The commands fastboot oem unlock-go, fastboot flashing unlock and fastboot flashing unlock_critical do not work.
You can check on the fastboot menu. The "DEVICE STATE" should be "unlocked".
Some Xiaoxin Pad 2022 models already come with an unlocked bootloader.
There is also a known method to unlock the bootloader. I have not tried it and can't provide any support for it. Use it at your own risk.
Hopefully Lenovo will provide a method in an upcoming OTA.
fastboot flash
If your tablet does not support fastboot flash, you will get an "unknown command" error like this:
Code:
C:\>fastboot flash recovery_a twrp_TB128FU_12.img
Sending 'recovery_a' (98304 KB) OKAY [ 2.288s]
Writing 'recovery_a' FAILED (remote: 'unknown command')
fastboot: error: Command failed
In this case you can use a tool like QFil or edl to EDL-flash twrp. Use the prog_firehose_ddr.elf program from the stock ROM.
Installation
With a stock ROM, it is recommended that you also install Magisk. This will ensure TWRP remains your default recovery. You can either use the boot image patch method, or flash the magisk apk in twrp.
ensure your bootloader is unlocked. On the fastboot menu, "DEVICE STATE" should be "unlocked".
download TWRP to your PC (see the Download section below)
flash the TWRP image:
Code:
adb reboot fastboot <== NOT "adb reboot bootloader"
fastboot flash recovery_a twrp_TB128FU_12.img
fastboot flash recovery_b twrp_TB128FU_12.img
fastboot reboot recovery
if fastboot flash does not work, then use Qfil or EDL to flash twrp to recovery_a and recovery_b
in TWRP: backup the boot, oem and persist partitions in TWRP, if you don't have backups already.
load Magisk by loading the patched boot image, or by installing the zip file. Instructions are linked above.
If you prefer to use button combos, rather than fastboot/ADB commands:
Vol Up + Power = fastboot mode
Vol Up + Vol Down + Power = recovery mode
Changelog
Code:
2023-02-13 - removed abl, bluetooth and modem partitions from twrp
2023-01-10 - fastbootd working
2023-01-06 - fixed "unable to locate parent partition" errors
2023-01-06 - TWRP 3.7.0_12-0: initial release (UNOFFICIAL)
Downloads
twrp-TB128FU_12.img
Source code
https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp/tree/twrp-12.1
https://github.com/Yahoo-Mike/recovery_device_lenovo_TB128FU
Credits
The guys at TeamWin Recovery Project.
Everyone whose device trees I plagiarised from GitHub.
Contributors
Yahoo Mike
Created: 2023-01-06
Last Updated: 2023-02-23 - removed abl, modem and bluetooth from fstab
How to load a GSI using TWRP​prereqs​
unlocked bootloader
copy of vbmeta.img and vbmeta_system.img from your stock ROM
optional: backup of system, data and metadata partition
how to...
adb reboot fastboot
fastboot --disable-verity --disable-verification vbmeta vbmeta.img
fastboot --disable-verity --disable-verification vbmeta_system vbmeta_system.img
fastboot flash system system_arm64_b.img
fastboot -w
fastboot reboot
note: step #5 wipes userdata and metadata
New version just posted.
I fixed the "unable to locate parent partition" problem that resulted in multiple false positives for external partitions.
Now the "Select Storage" menu consists of only "Internal Storage", "Micro SDCard" and "USB-OTG". All are working.
It seems that few people are interested in this machine
Thank you!!!!
Thank you! You have greatly facilitated the tasks with the tablet
I tried to make a full backup in TWRP, everything went fine, I threw a backup on the computer, made a full formatting of all partitions, then an attempt to throw a backup into the internal memory will not succeed, the internal memory is not mounted and generally asks for a password. Need DFE?
AForan said:
I tried to make a full backup in TWRP, everything went fine, I threw a backup on the computer, made a full formatting of all partitions, then an attempt to throw a backup into the internal memory will not succeed, the internal memory is not mounted and generally asks for a password. Need DFE?
Click to expand...
Click to collapse
Thanks for reporting this.
I don't know why the re-formatted data partition is not mounting or allowing you to write to it. I will have a look at this over the next few days.
Are you using adb push to copy to the tablet? Or are you using Windows Explorer (MTP) to copy to the tablet?
Before you formatted the data partition, was it password protected? Or no password/pin/etc ?
You shouldn't need to disable force-encryption.
In the meantime, you could use an SDcard or OTG device to restore your partitions.
Restoring the data partition is a special case. When you format the data partition, there should be a warning in twrp. Something like: "You need to boot into Android before you can re-use the data partition". TWRP only re-formats the partition, it does not encrypt it. So you'll need to boot into Android to let it re-encrypt the partition. After the data partition is re-encrypted, you can restore your backup of the data partition.
Yahoo Mike said:
Thanks for reporting this.
I don't know why the re-formatted data partition is not mounting or allowing you to write to it. I will have a look at this over the next few days.
Are you using adb push to copy to the tablet? Or are you using Windows Explorer (MTP) to copy to the tablet?
Before you formatted the data partition, was it password protected? Or no password/pin/etc ?
You shouldn't need to disable force-encryption.
In the meantime, you could use an SDcard or OTG device to restore your partitions.
Restoring the data partition is a special case. When you format the data partition, there should be a warning in twrp. Something like: "You need to boot into Android before you can re-use the data partition". TWRP only re-formats the partition, it does not encrypt it. So you'll need to boot into Android to let it re-encrypt the partition. After the data partition is re-encrypted, you can restore your backup of the data partition.
Click to expand...
Click to collapse
I understand everything, thank you
I used MTP to transfer files. As for the password, no, the password was not set in the system
AForan said:
I tried to make a full backup in TWRP, everything went fine, I threw a backup on the computer, made a full formatting of all partitions, then an attempt to throw a backup into the internal memory will not succeed, the internal memory is not mounted and generally asks for a password. Need DFE?
Click to expand...
Click to collapse
The short answer
TWRP does not support MTP for our tablet on a re-formatted data partition. You must reboot your tablet before MTP will work properly again.
I can't change that, sorry. You could ask the Teamwin team to change it by raising an issue.
The long answer
TB128FU tablets use FBE (file-based encryption).
In October 2021, the TWRP team decided that TWRP does not support MTP on FBE devices after formatting data until you reboot into Android. This is because mtp uses /data/media as a mount point. TWRP does not recreate that directory for FBE devices:
Code:
void TWPartition::Recreate_Media_Folder(void) {
string Command;
string Media_Path = Mount_Point + "/media";
if (Is_FBE) {
LOGINFO("Not recreating media folder on FBE\n");
return;
}
...
That code has been in TWRP ever since FBE support was introduced in 2016.
Since that change in October 2021, when you reformat the /data partition on an FBE device, you will get the warning: "TWRP will not recreate /data/media on an FBE device. Please reboot into your rom to create /data/media."
When you reformat the /data partition, it will be unencrypted. When you reboot to Android, Android will re-encrypt the partition.
Before you reboot to Android, you can still adb push files to the unencrypted data partition. You can still use it in adb shell. It's just MTP that won't work properly.
When you reboot to Android, the data partition will be re-encrypted and you might lose everything you put on the (unencrypted) data partition. But MTP will work again for internal storage in TWRP.
Just updated OP with new version of TWRP. It fixes fastbootd. I've done basic tests, but if there are any issues let me know.
Theoretically you should now be able flash a GSI (even a signed one) from TWRP. Let me know if there are issues.
Edit: post #2 updated with instructions on how to flash GSI using TWRP. I successfully flashed Andy Yan's LOS19 using those instructions.
Yahoo Mike said:
The short answer
TWRP does not support MTP for our tablet on a re-formatted data partition. You must reboot your tablet before MTP will work properly again.
I can't change that, sorry. You could ask the Teamwin team to change it by raising an issue.
The long answer
TB128FU tablets use FBE (file-based encryption).
In October 2021, the TWRP team decided that TWRP does not support MTP on FBE devices after formatting data until you reboot into Android. This is because mtp uses /data/media as a mount point. TWRP does not recreate that directory for FBE devices:
Code:
void TWPartition::Recreate_Media_Folder(void) {
string Command;
string Media_Path = Mount_Point + "/media";
if (Is_FBE) {
LOGINFO("Not recreating media folder on FBE\n");
return;
}
...
That code has been in TWRP ever since FBE support was introduced in 2016.
Since that change in October 2021, when you reformat the /data partition on an FBE device, you will get the warning: "TWRP will not recreate /data/media on an FBE device. Please reboot into your rom to create /data/media."
When you reformat the /data partition, it will be unencrypted. When you reboot to Android, Android will re-encrypt the partition.
Before you reboot to Android, you can still adb push files to the unencrypted data partition. You can still use it in adb shell. It's just MTP that won't work properly.
When you reboot to Android, the data partition will be re-encrypted and you might lose everything you put on the (unencrypted) data partition. But MTP will work again for internal storage in TWRP.
Click to expand...
Click to collapse
Thank you for the detailed explanation!
Tell me, how can I unpack backups of this recovery? (.win) in view of the vendor update (zui 14.675), I would like to create patches for convenient firmware
OTA ZUI are not installed, there is a reboot in recovery to install and then boot into the system again
AForan said:
OTA ZUI are not installed, there is a reboot in recovery to install and then boot into the system again
Click to expand...
Click to collapse
Official OTA Updates and TWRP
We found that in the previous version there was this option (the system partition is read-only), here, on the latest version this option is missing
AForan said:
We found that in the previous version there was this option (the system partition is read-only), here, on the latest version this option is missing
Click to expand...
Click to collapse
Welcome to the wonderful world of dynamic partitions (aka super partition). TWRP does not support mounting dynamic partitions as read-write. You can flash dynamic partitions in twrp fastbootd mode, but you can't mount them r/w in twrp recovery mode.
On this device the following partitions are dynamic:
product
system (mounted at /system_root in twrp)
system_ext
vendor
The option you are talking about (Mount system partition read-only) should never have been in the old version. That was my fault. I forgot to tell TWRP that the device has dynamic partitions. I fixed my error in the new version. I apologise for the confusion.
Workarounds​There are workarounds that people have been using on other devices, but there's no guarantee they'll work on our devices. Use them with caution. If any of them work for you, let us know on this thread.
Here's one method.
Here's another method. Note: the developer has just been banned from XDA for 3 months.
If you have the skills, you can also use Magisk modules to write to dynamic partitions.
Must be useful this program: https://forum.xda-developers.com/t/...system-partitions-to-read-write-mode.4521131/
Use it on TB-J716F from TWRP, positive experience.
Yahoo Mike said:
Welcome to the wonderful world of dynamic partitions (aka super partition). TWRP does not support mounting dynamic partitions as read-write. You can flash dynamic partitions in twrp fastbootd mode, but you can't mount them r/w in twrp recovery mode.
On this device the following partitions are dynamic:
product
system (mounted at /system_root in twrp)
system_ext
vendor
The option you are talking about (Mount system partition read-only) should never have been in the old version. That was my fault. I forgot to tell TWRP that the device has dynamic partitions. I fixed my error in the new version. I apologise for the confusion.
Workarounds​There are workarounds that people have been using on other devices, but there's no guarantee they'll work on our devices. Use them with caution. If any of them work for you, let us know on this thread.
Here's one method.
Here's another method. Note: the developer has just been banned from XDA for 3 months.
If you have the skills, you can also use Magisk modules to write to dynamic partitions.
Click to expand...
Click to collapse
Thanks, it's clearer now
Could u makle it available for P11 5G (TB-J607Z) with Android 12???

Categories

Resources