yashsingh1/xdaforums huggingface dataset:
[Thinkpad Tablet Android Development] Pipeline79:
Hi again, which is the installer QFIL tool you mention?

I'm using this one:

Archives - QFIL Tool

Following is the list of various QFIL Tool, including the latest and the previous versions.

qfiltool.com

2.0.3.5

But that's portable.

And it's giving me 'download' errors. (When I try to flash the TB-X505F_S001142_210804_ROW firmware).

I've got it back to latest firmware at the moment and I also have the newer version of TWRP (not 2021) installed.

Or can I keep the latest firmware on there and still root it by installing magisk?
[Thinkpad Tablet Android Development] montolla:
Hello

IT is this one, install driver as well otherwize the device will not appear on port popup

QPST Tool v2.7.496 for Windows

Download the official QPST Tool v2.7.496, which enables you to flash the stock firmware on your Qualcomm smartphones and tablets.

qpsttool.com

That will install Qpst service and it will include a working Qfil tool

Thanks
[Thinkpad Tablet Android Development] Yahoo Mike:
I might be missing something, but unfortunately I don't think this is going to work. Internal storage is stored on the data partition. The data partition was wiped during the factory reset.

If TWRP is working, you can connect the tablet to your PC. It should appear in File Explorer, where you can examine the internal storage. It's most likely empty.

You don't need magisk to get root access to the data partition - TWRP has root access already. So you can use the "dd" tool to do a dump of your data partition to the Windows PC. Something like:

C:\> adb shell
TB-X505F:/ # cd external_sd
TB-X505F:/external_sd # dd if=/dev/block/by-name/userdata of=userdata.bin
TB-X505F:/external_sd # exit
C:\> adb pull /external_sd/userdata.bin userdata.bin

The "dd" command will take a long time (15mins+), because the partition is very big (64GB+). It copies every byte, not just the used bytes.

I haven't used EaseUS mobile recovery tool, but my experience with other recovery tools is that they only work if the file was recently deleted, and the disk space where it resided has not been overwritten. I'd be pleasantly surprised if EaseUS can restore the files you want. Let me know if it does.

That's a last-resort method. You only need to do it if you can't power off your tablet, and fastboot and recovery are not working. If you can power off your tablet, then holding VOL+ while inserting the USB cable will start EDL mode. If fastboot is working, flash twrp. With access to twrp you can select "Reboot->EDL" or just type adb reboot edl.

But kudos to you for making it work. If you have to do it again, take a photo of the test points and post the photo. It's always helpful to others to know where they are.
[Thinkpad Tablet Android Development] Transi:
my lenovo tab m10 tb-x505f crashed and I can only get into Fastboot and Stock TWRP, Windows recognizes the tablet in Fastboot Mode and Stock TWRP, ADB does not recognize the tablet, I also get no Enable USB debugging, how do I get I use Fastboot Mode and Stock TWRP Mode Enable USB debugging?
[Thinkpad Tablet Android Development] Pipeline79:
Thanks @Yahoo Mike yeah the adb method was what I thought I had to do but I didn’t know you could do that from twrp. I have the thing installed with the latest Lenovo firmware now and rooted with magisk anyway.
[Thinkpad Tablet Android Development] alecxs:
what is "Stock TWRP"?
[Thinkpad Tablet Android Development] Transi:
sorry recovery menü. my lenovo tab m10 tb-x505f crashed and I can only get into Fastboot and Recovery, Windows recognizes the tablet in Fastboot Mode and Recovery, ADB does not recognize the tablet, I also get no Enable USB debugging, how do I get I use Fastboot Mode and Recovery Mode Enable USB debugging?
[Thinkpad Tablet Android Development] alecxs:
you don't need adb or authorize fastboot. only install Android Bootloader Interface drivers.
[Thinkpad Tablet Android Development] Transi:
I installed all drivers, every mode of Windows is recognized. QcomDLoader_1.3.2.0 doesn't want the rawprogram_upgrade.xml from ROM Lenovo_Tab_M10_HD_TB-X505F_HW70_S001035_1912310946_Q00015_ROW_QDL
[Thinkpad Tablet Android Development] alecxs:
every mode? you say you can only get into fastboot mode and recovery mode. now you're interested in EDL mode? that requires Qualcomm HS-USB QDLoader 9008 drivers, unrelated to the other modes/drivers.

not sure how that fits in this thread...

edit: seems you're talking to montolla

but why would you do that? you can flash more comfortable in fastboot mode (except bootloader is locked, you can't install TWRP in that case)
[Thinkpad Tablet Android Development] Transi:
bootloader is locked

bootloader unlocked without USB debugging?
[Thinkpad Tablet Android Development] Yahoo Mike:
If you have stock recovery, select "power off". Then use Lenovo's LMSA tool to restore stock ROM. Note: this will wipe all your data on the tablet.
[Thinkpad Tablet Android Development] Transi:
Thanks, I've already done it, Toch doesn't work yet, it's probably defective
[Thinkpad Tablet Android Development] Yahoo Mike:
New version of twrp in the OP.

The TW_EXTRA_LANGUAGES flag has been set and the latest TB_X505F_S001149_221115_ROW kernel injected. Thanks to @Tonyha7 for the changes. Languages like Chinese, Japanese and Korean should now be available.
[Thinkpad Tablet Android Development] harvey:
Hi, i have TB_X505F_S001149_221115_ROW and just installed twrp 3.7 and newest Magisk. But now i cant go into system. After boot i'm allways back to twrp. Fastboot is also possible, but no more.

Any Ideas? Thanks

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

OK got it. Downloaded the same stockfirmware with the rescue-assistent from lenovo, but the rescue in edl-mode didnt work- gives error after 80%. Maybe because i tried it in Virtualbox on a linuxsystem, but i have no native win anymore.

So i flashed original recovery, vendor and system with fastboot and make a factory-reset in stock recovery. After reboot i did a quick install without network, installed magisk. Magisk telled me, it would allways be installed (ok, new boot.img i didnt flash), so i let it make the things necessary and reboot. Activated developer settings, usb-debugging (didnt know whether this was necessary at this point) and flashed twrp_3.7 again.

After reboot system works, also twrp and root.

Thanks for custom-recovery.
[Thinkpad Tablet Android Development] uschipower:
since my last post here in this thread in 11.2022, Lenovo released another ROM for TB-X505F

In November, latest ROM was TB_X505F_S001147_220830_ROW.

Now, LRSA offers TB_X505F_S001149_221115_ROW

At the moment, I have a clean TB-X505F with TB_X505F_S001149_221115_ROW installed with LRSA. Bootloader is still unlocked.

But my latest TWRP-Backup was made with Stock-Rom < TB_X505F_S001147_220830_ROW --> with your TWRP 3.6

How can I use this Backup to Restore Apps, Settings, etc. in the new Rom?

I also noticed that OTA-Updates from Lenovo do not work if Rom has been modified (TWRP + Magisk). If I flash an older rom + twrp 3.6, it is not possible to update the rom, right?
[Thinkpad Tablet Android Development] Yahoo Mike:
This post explains a little about why there are two versions of TWRP in the OP. Bottom line: if one doesn't work, try the other one.

And this post (and the other posts around it) might help with your OTA question.
[Thinkpad Tablet Android Development] uschipower:
I read it.

TB_X505F_S001149_221115_ROW together with your TWRP 3.7 works ok.

But how can I restore from a twrp-backup made with TWRP 3.6?
[Thinkpad Tablet Android Development] Yahoo Mike:
What is the exact error message you get when you try to restore backups?
[Thinkpad Tablet Android Development] uschipower:
No message.

I start with a clean TB_X505F_S001149_221115_ROW flashed with LRSA.

- Boot into Download-Mode

- flash your TWRP 3.7 with fastboot

- Boot into TWRP

- until now, everything is ok

- use Restore in TWRP (boot, system, data, misc)

- Restore without any Error-Messages

- Then restart, but now I can neither boot into Recovery nor in System

Which Partitions should i restore from backup, which not?
[Thinkpad Tablet Android Development] alecxs:
boot, system, (vendor?) is ROM. misc, fota, cache, para are just trash partitions were android stores temporary instructions or some settings (although I have seen devices where misc contains important data such as imei?)

all other partitions is firmware, such as efs, nvram, modem, audio, display...

https://xdaforums.com/t/info-android-device-partitions-and-filesystems.3586565

userdata is the only partition that is writeable to user. but you can't restore backup of userdata that has its origin of different ROM (at least not

for major versions)

Note: stock ROM won't boot along with TWRP installed, unless patched against avb/dm-verity.
[Thinkpad Tablet Android Development] uschipower:
At the moment, I have a clean installation of newer rom than in the backup.

Which Partitions should I restore, and which partitions should i keep from newer rom?

You said that I can not mix partitions from different roms. So I have to restore boot, system and userdata together.

What about other partitions?

Is there a way to find out from TWRP-Backup-Files which rom-version was installed when I made the backup?

When I made the backup, of course there was TWRP-Recovery installed.

When I restore all Partitions (Recovery with twrp, boot, system, userdata), I read that I exactly have the status when I made the Backup.

Is this true? Do I have to patch against avb/dm-verity too?
[Thinkpad Tablet Android Development] alecxs:
as I said, the only writeable partition is userdata. therefore only userdata should be restored.

if you restore system, you restore old ROM. if it's that what you want, then clean flash from LSMA was almost pointless.

dm-verity usually is patched in vbmeta, vendor or boot. if you have stock partitions, it should patched again, otherwise it will boot-loop
[Thinkpad Tablet Android Development] uschipower:
ok, this would be case one. Which partitions should I restore for this case? You mentioned system. Of course userdata. What about boot, recovery, vendor, etc.?

but you said that i cannot use userdata in other rom.

I am a little bit confused. Could you explain this, when it is possible and when not, and how to find out this. Thanks.
[Thinkpad Tablet Android Development] alecxs:
open new thread.
[Thinkpad Tablet Android Development] uschipower:
ok,

which category here in Forum do you suggest for this?
[Thinkpad Tablet Android Development] alecxs:
https://xdaforums.com/f/general-questions-and-answers.456
[Thinkpad Tablet Android Development] Yahoo Mike:
@Alecxs is correct.

Restore the userdata partition

(aka "data") only

You should restore the userdata partition only. Your data and Android settings are all stored on that partition.

Before you restore userdata with twrp, boot into the stock ROM at least once. This will ensure that the data partition is encrypted properly by Android. You can then try a restore.

As @Alecxs said, sometimes you cannot restore userdata from an old backup. But it's worth a try.

If you try to restore an old backup from a previous Android version, it will usually fail. For example, a userdata backup from Android 10 will probably cause big problems if you restore it over an Android 12 ROM.

But from memory TB_X505F_S001147_220830_ROW and TB_X505F_S001149_221115_ROW are the same version of Android. So you should be ok.

There are other things that can make a restored userdata partition cause problems. It all depends on what has changed "under the hood" between ROM versions. If the changes are not backwardly-compatible, then your userdata backup probably won't work.

Do NOT restore the other partitions

TB_X505F_S001149_221115_ROW is the most recent stock ROM. It has its own unique system, boot, vendor (etc) partitions. They are different to (and incompatible with) the system, boot, vendor (etc) partitions from any other ROM.

Furthermore, when Android starts up it will check to make sure that these important partitions are all from the same ROM version. Android will bootloop if they are not all from the same version. As @Alecxs says, there are ways to stop this. But you don't need to worry about that.

So

do not

restore those partitions (boot, system, vendor and others) from your backup of TB_X505F_S001147_220830_ROW over the top of a different ROM (like TB_X505F_S001149_221115_ROW). If you are an advanced user and you know what you are doing, there might be times when you want to do this (for example, to restore a GSI). But for now - just don't do this.
[Thinkpad Tablet Android Development] uschipower:
That is what I have in my mind after I read the postings von Alecxs.

Is this called "dirty flash" when you mix partitions from different roms? I read this expression in some Threads.

Alecxs asked what is my intension

option 1: restore userdata + old rom (the exact status of device when I made the backup)

option 2: restore userdata in newer rom

My intension depend on what is working.

Of course, option 2 would be very nice if it works.

But if not, the only way would be option 1 to get a working device including my settings and data.

My idea is to restore the exact status from May 2022 (= my last backup), and try to update via OTA-Update. Unfortunately, I made no backup in Nov 2022 when Lenovo released the OTA-Update.

If only option 1 would work, which partitions should I take from backup (and which one should I take from newer rom flashed with LRSA)?

By the way, that is exactly where I came from.

In Nov 2022, I thought, I have an stock rom (I was unsophisticated, I though ok I have root but it is still a stock rom) and tried the OTA-Update.

After this failed in several tries, my idea was simply use uninstall-feature of magisk to make the rom more "Lenovo-like". But this crashed my rom. After that, the device did not neither boot into recovery nor in System.

Your think of this "avb/dm-verity"?

That was completely new for me. I have never read this in Threads and HowTos that there are some specials you have to look for when using stock rom (custom roms dont have, right?). I found no HowTo which describe how to make a save Backup and Restore, and what you have to look for in each case.

Would you be so kindly and explain what I have to do for this "patch against avb/dm-verity"?

Otherwise, I open a new thread as Alexcs suggested.
[Thinkpad Tablet Android Development] Yahoo Mike:
Don't mix-and-match partitions from different stock ROMs. It won't work.

If I was you, I'd just restore the data partition over the latest stock ROM. If it works, there's nothing to worry about.

If you really want to restore TB_X505F_S001147_220830_ROW, then you'll have to get hold of that stock ROM and use QFil (or similar) to load it to your device. If you used LMSA before the OTA, the ROM should be in the RomFiles subdirectory. Otherwise, someone on this forum might have a copy if you ask nicely.
[Thinkpad Tablet Android Development] uschipower:
??

The latest Rom is TB_X505F_S001149_221115_ROW.

As I wrote, my backup was made on an older StockRom.

How should I restore userdata without mixing?

You also said that I can restore an userdata from a backup made in 2022 because B_X505F_S001147_220830_ROW and TB_X505F_S001149_221115_ROW are Android 10.

I am confused.

How can I check at the backupfiles made with with rom-Version are in the files?
[Thinkpad Tablet Android Development] Yahoo Mike:
Sorry if I confused you.

All you need to do is restore your userdata partition.
[Thinkpad Tablet Android Development] uschipower:
Hi,

now, I found some time again for testing with my tab.

Have you really tested what you have wrote?

I made this:

- made a clean install with LRSA with TB_X505F_S001149_221115_ROW

- booted in that clean rom, clicked first-start-assistant

- reboot again in system

- enabled ADB-debug

- reboot in fastboot

- flashed your recovery

- made a twrp backup of all partitions

then

- made again a clean install with LRSA with TB_X505F_S001149_221115_ROW

- booted in that clean rom, clicked first-start-assistant

- reboot again in system

- enabled ADB-debug

- reboot in fastboot

- flashed your recovery

- restored the data-partition which i made before

result: device tries to boot 1-2 times in system which doesn work (=reboot), the next boot ended in recovery

so, nothing with different rom-versions, only data-partitions restored, no root, no magisk, etc.

have you tested this?

where is my mistake?
[Thinkpad Tablet Android Development] alecxs:
did you test android can still boot after installing TWRP? usually that is not the case and requires avb/dm-verity disabled.
[Thinkpad Tablet Android Development] uschipower:
yes, you can boot into system.

But when you do this, TWRP is overwritten with stock recovery.

I think, this is normal, right? I suppose, this is done until installing magisk.
[Thinkpad Tablet Android Development] alecxs:
That's another protection. should be disabled when you swipe to allow modifications on system. or rename /system/recovery-from-boot.p to .bak to prevent that behaviour.

If it then boot-loops, it's an issue with dm-verity. that is patched in boot or vendor. you can find flashable zip for this.
[Thinkpad Tablet Android Development] uschipower:
Is this the job of TWRP?

Then, it seems that the TWRP in this thread is not doing this.

what do i have to look for?

if I found a zip described as dmverity.zip is there a dependency to android version or something else?
[Thinkpad Tablet Android Development] Yahoo Mike:
I can confirm this behaviour. That shouldn't happen. Thanks for reporting it.

I'll have a look at this over the next week or so.

My guess is that @alecxs is on the right track. Maybe those unexpected new OTAs have changed the verity rules???
[Thinkpad Tablet Android Development] Yahoo Mike:
New version of twrp is available on OP. It fixes the big fat juicy bug that crept in which corrupted backup/restore of the /data partition.

I recommend you download the new twrp and make new backups.

Any backups you have made with any versions of twrp for TB-X505F (from Dec 2021 onwards) might be corrupt.

For those who care about the details: it was a one line change. The problem was with the fscrypt policy. In May 2021, v2 became default. The X505F uses v1. The incompatibility caused problems with backup/restore. The corrupt backups/restores did not abort due to this change (and similar).
[Thinkpad Tablet Android Development] Yahoo Mike:
Google provides a standard backup/restore feature for the everyday Android user.

TWRP is really useful for those who like to tinker with Android. Tinkering with Android is fun. And XDA is a great community with lots of very clever, amazing and supportive people.
[Thinkpad Tablet Android Development] uschipower:
That is no backup. Google doesnt backup neither apps nor backup data (Android-Settings + Accounts + App-Settings). Google does simply save in a database which apps from playstore are installed.

When restoring on the same or other device, google simply installs the apps automatically. That's all - no other config-data, no apps which are not in playstore.

(By the way, Gdrive and Gphoto are also not a backup, that are only using cloudspace for saving)

My posting was no criticism on you or your TWRP.

There are only questions I have.

Whould you and Alecs be so kindly and answer them?

Thanks
[Thinkpad Tablet Android Development] Tonyha7:
I built one for those people using A13 gsi.

Here're my changes.
[Thinkpad Tablet Android Development] uschipower:
today, I want to install a TB-X505F completely new.

I am using AndyYans LOS20TD GSI-Images.

I noticed that your TWRP cannot handle current GSI-Images from AndyYan

Andy Yan's personal builds // GSI - Browse /lineage-20-td at SourceForge.net

sourceforge.net

After installing GSI-Image in System-partition, TWRP shows errors:

"Failed to mount '/system_root' (Invalid argument)

What i am doing:

- install newest stock rom with LRSA

- flash your TWRP with fastboot

- boot into TWRP, install Disable_Dm-Verity-fec-quota.zip

- format Data

- boot again into stock rom

At this point, when booting again in TWRP, there is no error message.

Then

- use TWRP to flash AndyYan's img-File into sytem-partition (the img-File, not the *.xz)

- format data

After that, the mentioned error appears in TWRP

How can I fix this?
[Thinkpad Tablet Android Development] uschipower:
some questions

- how do I compile your version of twrp? what does I need? where do I have to run compiling?

- what are is the advantage of your recovery?

- does yahoo mike's recovery not work for A13 GSI (why not)?

In general, Magisk app says that TB-X505F has no Ramdisk.

In Installation guide of TopJohnWu

Installation

The Magic Mask for Android

topjohnwu.github.io

he says that in this case you have to patch magisk in recovery.

But he also says that there are some devices where magisk is saying "No Ramdisk" although device has one.

Is TB-X505F such a special device?

In other words, do I have to patch Magisk in Recovery or not?

Thanks.
[Thinkpad Tablet Android Development] zubair1836:
No, its not special. I had the device a year ago,

What I remember is: I put the magisk zip in internal storage, boot to twrp, install the magisk zip,

that's it.

The device was rooted.

I dont know about latest updates but it was back then on android 8 or 9 maybe.
[Thinkpad Tablet Android Development] uschipower:
the device never got a stock rom from lenovo higher then Android 9.

A9 ist very outdated. The only way to get a maintained rom for the device is Treble GSI. That is the backround I am ask.
[Thinkpad Tablet Android Development] Tonyha7:
To compile it, just use branch android-12.1 of twrp.

Mine used FBEv2, which is forced to use in aosp13. That's why yahoo mike's twrp can't decrypt a13 roms. But mine can only decrypt a13 and some a12 roms.

Patch boot.img and flash magisk in recovery are both OK for this device.
[Thinkpad Tablet Android Development] uschipower:
that is not a question of which source-code to take. ;-)

How do I compile the source code? Which tools do I need? How does compiling work?

I used Disable_Dm-Verity-fec-quota.zip

So I dont have FBEv2, right?

does your recovery have any other features which mike one's doesnt have?

After installing an a13-LOS-GSI-Rom in system-partition, I got a errors in Mike's twrp:

failed to mount '/system_root' (invalid argument)

Is this something which your recovery will fix?

Are you sure that TB-X505F is a device where magisk can be patched in system?

I am asking because topjohnwu wrote in his guide for installing magisk that devices which say Ramdisk-No in Magisk-app and nethertheless you can install in system-partition would be very rare. He speaks of some Xiaomi-Devices.
[Thinkpad Tablet Android Development] Tonyha7:
The compilation is kind of complex. You can refer to lineageos's wiki.

If you flashed something to disable encryption, then both twrp will be able to manage '/sdcard'.

In my memory, mine is able to mount '/system_root' on a13 roms. But you should try it out by yourself.;)

The best way to flash magisk is backup boot patition in twrp, patch it in magisk app, then flash patched img to '/boot' in twrp. There will be no errors, and it's totally safe.
[Thinkpad Tablet Android Development] uschipower:
just a question.

When you use a Treble-GSI-Image, I think it's the same on all devices. You take the boot-Partition from stock-ROM and the system-partition is the GSI-Image.

Is it possible to get running a GSI-Image without installing Magisk.zip?

I tested to flash only Disable_Dm-Verity-fec-quota.zip

This disables encryption, quota and Verity, but it seems that this is not enough.

Of yourse, I formated data before and after Disable_Dm-Verity-fec-quota.zip

The device doesnt boot.