yashsingh1/xdaforums huggingface dataset:
[Moto G8 Plus Questions & Answers] Rockel:
Seems I was a bit confused. I often used TWRP in rooting proces, so I thought it was also the case here. I even had this saved TWRP file stored in the phone directory on my PC.

Like mentioned in post #29, I've found some documentian I had made about the rooting procedure. It are actually the exact steps I've made. Maybe it's helpfull.

Seems I never used TWRP in the rooting proces, but Magisks instead. Probably because, like you had mentioned already, is not supporting Android 10.

Also had the Magisks app installed on the phone and had to use it once in a while. But actually don't remember annymore why I had this TWRP file on my PC then.

Is it not possible to do the same with Magisks instead? Since it was used in the rooting proces? To decrypt and acces my data?

Edit:

Not sure if it will be helpfull, but I also still have the generated file of "step 6" from the rooting proces above, "magisk_patched.img", that I had created during the root proces.
[Moto G8 Plus Questions & Answers] alecxs:
right, the usual rooting method is without TWRP. but it requires working android. It's good you still have all the files, because I checked (step 2.) lolinet ROM no longer available.

The magisk_patched.img of step 6. is the file I asked for in post #10, this is the file you need to undo the flashing of TWRP, see adb commands in first part of post #18.

There is no need of installing TWRP (second part of post #18) as once in TWRP you can do backup (and fix boot-loop).

But in case you want permanently install TWRP, it is (most likely) required to disable avb/dm-verity (possible reason a why fastboot boot failed)?

I can't tell you exact reason, I know from the early times of Moto G7 play (I also never owned) that @Spaceminer figured out modified dtbo.img is required for TWRP. devices are different and so the reasons.

possible reason a)

Disable avb/dm-verity. This is done by flashing vbmeta.img with proper flags. Once avb/dm-verity is disabled there should be absolutely no issues with TWRP. Not absolutely sure it's required (as Magisk does similar) and I don't know if that applies to recover ramdisk in boot, but it won't harm.

possible reason b)

TWRP not compatible for Android 10. I think we can rule this out, as there are users confirmed the TWRP is working on Android 10, and maybe @mauronofrio has already updated his build with the patches from @Electimon. Anyway, there is still OrangeFox, so you now have two more custom recovery for testing...

possible reason c)

fastboot boot works only sometimes and requires special conditions (refer to @Exelios's comment quoted by me in post #26). So kindly check the conditions and chose the right slot.

possible reason d)

fastboot boot command generally not working/supported. Although it's contradictory to installation guide, your last resort is flashing TWRP recovery into boot partition. This is what you already did, but I forgot about the vbmeta (post #24). Nevertheless, this method will work, assuming TWRP itself is working. Of course, it requires undo flashing and restoring of boot.img/magisk_patched.img afterwards.

Please start with fastboot boot cmd. if nothing else works, repeat with fastboot flash cmd.

right. all you do is "destroying" boot partition. but this is no problem as you can restore its content from fastboot later (you have the file).

As your device is most likely encrypted, let's cross fingers TWRP encryption works as it should.
[Moto G8 Plus Questions & Answers] Rockel:
Oh yes, I think I got verry confused with things. Missed it because of that.

But yes! I also still have this file! :)

This is for the same as mentioned above?

So yes, I still have ths Patched Magisk file. I actually wouldn't care about soft-bricking the phone at this point. As long I could retrieve my data.

I would even open and solder it to an USB cable and plug it into the PC if it would work to retrieve my data at this moment haha (I know it's not that easy)

I still have these files yes, so you really could make a working way to get TWRP working and being able to retrieve the data with this zip and the requested files? That would be great! I would gladly share these files with you then ofcourse. :)

So this encryption key would be still untouched since I'm not able to boot into android annymore at the moment? And I can decrypt it by putting in the password? (I believe there was also something with a slider in previous TWRP versions I had used?

So I could also try this?

I'm using the same fastboot command as you told me to do with the TWRP file then? So with the "boot" command? (I think I understand it a bit more now, with the "boot" command is fastboot forcing to boot into TWRP or OrangeFox in this case without actually "installing" it?)
[Moto G8 Plus Questions & Answers] alecxs:
y

n (Electimon did)

y

y

y

y

y

y

y
[Moto G8 Plus Questions & Answers] Rockel:
Thanks! That are a lot of "y" 's. So that looks positive on most questions.

Only don't understand the "n" about Electimon.

In case of this TWRP you could make and the requested files. How could I share them with you?

Only Android is updating this encryption? So trying in TWRP/ OrangeFox would not change annything?
[Moto G8 Plus Questions & Answers] Rockel:
This is so far good I suppose?

View attachment 5811229View attachment 5811231
[Moto G8 Plus Questions & Answers] alecxs:
sry.. :) at time of writing only doha16.zip was available (not useful for fastboot) so I asked how to create twrp.img of it. But meanwhile Electimon has updated his download section on request, so you can just download doha16.img straight from his thread, no need to make one anymore... ;)

edit: yes looks good. does it accept lock screen pin? if not please provide recovery.log
[Moto G8 Plus Questions & Answers] Rockel:
Well... The touchscreen wasn't working with OrangeFox...

But tried the last method immediately and look! :D

View attachment 5811291View attachment 5811255

It even recognised the internal storage on my PC. So I'm actually copying all the files to my PC now (going to take a while...).

View attachment 5811265

At least I will still have most of my files then I think :D
[Moto G8 Plus Questions & Answers] alecxs:
the way you are copying files (Microsoft MTP protocol) is buggy, I prefer adb pull /sdcard (#2).

also timestamps of pictures aren't preserved. for adb pull you can use -a flag.

please note you skipped the TWRP backup of /data so now no apps data is copied.
[Moto G8 Plus Questions & Answers] Rockel:
Thanks for being alert on this. It was actually coppying and it's there. But actually containing few files. Didn't checked if something was hidden.

But I'm also copying with ADB now. Which goes waaaaaaay faster! :O

Now I've backed up everything, do you maybe know how to get this system framework back? Or at least being able to boot into android again? :)

It would simplify some other backup tasks. Like the whatsapp problem I had in the other thread for instance :)

Although I also have the latest complete backed up folders now.
[Moto G8 Plus Questions & Answers] alecxs:
yes, if you answer question in post #22 ;)
[Moto G8 Plus Questions & Answers] Rockel:
I'm afraid I don't understand much of things yet explained in post #22 :(

So for this I need to exit TWRP and just use these commands in the fastboot section? Do I need some files for this?

I used this app for accidentally remove the real "System Framework"

System app remover - Apps on Google Play

Took all bloat ware out of your devices.

play.google.com
[Moto G8 Plus Questions & Answers] alecxs:
okay let me check what this app is...

Unfortunately I don't know what is "System Framework" - as you can see I have extracted (newer version of) stock ROM and searched for apps with 'System' or 'Framework' in file name. There are few results you can see, but it tells me nothing..

Don't you know the file name (or package name) of the removed app?
[Moto G8 Plus Questions & Answers] Rockel:
Oh excuse me then, I thought it also was an official system app because android got corrupted after removing it. If not, then maybe it's not that bad as I thought.

I had installed this app:

Cerberus security: Antitheft, Persona, Kids

Cerberus is a suite of services to protect your phone, yourself and your loved ones: Antitheft - the best protection you can get to recover your misplaced, lost or stolen Android device; Persona - get help in an emergency, share real-time location with your family and friends; Kids - tool for...

www.cerberusapp.com

I use it for manny years already and I always set it to hide. Once hidden it's disquised as "System Framework" and gets it a green Android icon.

I only had a license for one phone, so I tried to completely remove it to activate it on my new phone, But I encountered problems removing it (it was converted as a system app), So I decided taking an extra step looking for a program that could remove a system app. So then I tried using this one:

System app remover - Apps on Google Play

Took all bloat ware out of your devices.

play.google.com

there was still an "system framework" available after deleting, but it had a different package size as I could remember correctly. So I actually thought I had removed an official system app after Android was refusing to boot after removing and rebooting the phone.

But if you don't recognize this app, this "system framework", then maybe it was just something from Gerberus itself. But then I find it strange that it was still there after removing? But maybe it got reloaded automatically.

I'm pretty sure I had installed it as a system app, probably with one of these guides:

So I actually think I must have done the last step.
[Moto G8 Plus Questions & Answers] alecxs:
so you deleted app from /system/priv-app? thats all apps in there. which one?

3c_devicemanagement-binary.apk
3c_notification.apk
AppDirectedSmsProxy.apk
BackupRestoreConfirmation.apk
BlockedNumberProvider.apk
CalendarProvider.apk
CallLogBackup.apk
CellBroadcastReceiver.apk
com.qualcomm.location.apk
ContactsProvider.apk
CtsShimPrivPrebuilt.apk
daxService.apk
DocumentsUI.apk
DownloadProvider.apk
DownloadProviderUi.apk
DynamicSystemInstallationService.apk
ExternalStorageProvider.apk
FusedLocation.apk
GoogleExtServicesPrebuilt.apk
GooglePackageInstaller.apk
GooglePermissionControllerPrebuilt.apk
InProcessNetworkStack.apk
InputDevices.apk
LMIRescueSecurity.apk
LocalTransport.apk
ManagedProvisioning.apk
MediaProvider.apk
MmsService.apk
MotoFaceUnlock.apk
MotoSystemServer.apk
MtpDocumentsProvider.apk
ONS.apk
PartnerBookmarksProvider.apk
PlatformNetworkPermissionConfig.apk
ProxyHandler.apk
SettingsProvider.apk
SharedStorageBackup.apk
Shell.apk
StatementService.apk
TagGoogle.apk
TeleService.apk
Telecom.apk
TelephonyProvider.apk
UserDictionaryProvider.apk
VpnDialogs.apk
[Moto G8 Plus Questions & Answers] Rockel:
I'm sure I only removed "System Framework" using that root removal app. it showed the same name and icon as this disguised Cerberus app when removing:

View attachment 5811435

It was just showing up in this "system app remover" app like this.

If you don't recognize this, and it's probably just part of this Cerberus app. But I don't know how it was possible getting my phone stuck like this after removing only this "System Framework"
[Moto G8 Plus Questions & Answers] alecxs:
that is from working phone? check the package name (and path) of this "System Framework" app with Link2SD please.
[Moto G8 Plus Questions & Answers] Rockel:
It shows "/data/users/0"

But could it be on another location once it's installed as an system app? I did not rooted my new phone. So I could not install it as a system app.

View attachment 5811483

This is a screenshot from my previous phone, also rooted. but not sure if it was installed as a system app here.

Edit:

I'm checking it on my previous phone now, installed this same app remover there, and I'm pretty sure I deleted this app. It gave me the possibility to show extra info, maybe it's helpfull:

View attachment 5811487
[Moto G8 Plus Questions & Answers] alecxs:
/data/user/0 is the directory of app data, it is same for user apps and system apps as /data is the only writeable location.

so the package name is "com.lsdroid.cerberuss" with additional "s" in contrast to standard app I just installed. it's not a system app, or at least no hint about which system app was replaced (as you said).

This leads nowhere. However, if you think one of the system apps is deleted, just flash whole system partition of stock ROM from fastboot. XT2019-1_DOHA_RETEU_10_QPI30.28-Q3-28-26-3_subsidy-DEFAULT_regulatory-DEFAULT_CFC.zip

fastboot flash system_a system.img_sparsechunk.0
fastboot flash system_a system.img_sparsechunk.1
fastboot flash system_a system.img_sparsechunk.2
fastboot flash system_a system.img_sparsechunk.3
fastboot flash system_a system.img_sparsechunk.4
fastboot flash system_a system.img_sparsechunk.5
fastboot --set-active a

in case you did not restore boot yet (+ optional install TWRP in ramdisk) don't forget to flash boot partition.

fastboot flash boot_a magisk_patched.img

instead of flashing magisk_patched.img you could flash stock boot.img to boot without Magisk and rule out possible issue with Magisk modules or systemless overlays.

if that does not fix boot-loop then package-restrictions.xml must be responsible.
[Moto G8 Plus Questions & Answers] Rockel:
Well this "System Framework" (Cerberus) is the only app I had removed. I'm sure about that.

I thought I deleted a real system app since I noticed a difference in package size. But I actually see this difference in this last screenshot too now. This made me believe I deleted an actual system app after being not able to boot annymore.

Actually thought that "system framework" was an system app, and that this disguised version of Cerberus was disguised as this same "system app"

But if this "System Framework" is no official system app as you say, and it even doesn't sound familiar, then it should be only the Cerberus app I had deleted, causing rebooting to fail.

Nothing else should have been changed since I had rebooted the phone imediately after deleting this "System Framework" (and then it didn't boot into Android annymore). So I asume all the rest should be still intact then.

But I don't understand what is preventing booting into Android then.

I believe not no, only tried these fastboot command regarding TWRP and OrangeFox, didn't took anny other steps yet, being afraid to ruin annything :)
[Moto G8 Plus Questions & Answers] alecxs:
does the app maybe still exist on phone?

/data/data/com.lsdroid.cerberus*

/data/app/com.lsdroid.cerberus*
[Moto G8 Plus Questions & Answers] Rockel:
I'm going to check! I think I can use TWRP for this now too?

Asuming that it's the boot partition that is causing troubles here? I see I actually have more options now I have the possibility booting into TWRP. Could this help to retrieve (backup) or replace things?

Seems I only can find this: /data/data/com.lsdroid.cerberus (with double "s" if you mean this with *).

Can't find this: /data/app/com.lsdroid.cerberus
[Moto G8 Plus Questions & Answers] alecxs:
So the app is maybe still there in /system. all it needs is to enable it in package-restrictions.xml

you can also check /data/system/packages.xml for the location of apk
[Moto G8 Plus Questions & Answers] Rockel:
You mean /data/system?

Oh wait, you tried to say here that I also needed to backup the /data partition?

I thought you were refering to the data folder in /sdcard.
[Moto G8 Plus Questions & Answers] alecxs:
in post #2 - create backup of /data from menu - I meant the backup button in TWRP. it creates backup of /data excluding /sdcard (aka /data/media/0). the backup is created in TWRP directory in /sdcard1 or /sdcard.

regarding cerberus, get these file to PC and search for string com.lsdroid.cerberuss inside. you will figure it out. it's late I am offline.

adb pull /data/system/users/0/package-restrictions.xml
adb pull /data/system/packages.xml
[Moto G8 Plus Questions & Answers] Rockel:
I made a seperate backup of /data and /boot using the backup button in TWRP and saved it to the SD-card (internal memory wasn't suffiecient).

/data/system/users/0/package-restrictions.xml showed this:

/data/system/packages.xml
[Moto G8 Plus Questions & Answers] alecxs:
if not in packages.xml the app was uninstalled. you can "install" it as system app. in TWRP mount System rw. from File manager or adb shell create new directory /system/system/priv-app/MyApp/ and copy the apk inside (names doesn't matter, only pkgname com.lsdroid.cerberuss inside apk).

in TWRP wipe menu, wipe dalvik. the app will installed on next boot.
[Moto G8 Plus Questions & Answers] Rockel:
I did so as you asked. But put the slider in wipe to the right. So it turned out it was also wiping data (it was the standard wipe).

I've rebooted after, but it still looked the same.

The I tried to see if there's now this crberus app in this "packages.xml" file.

But I get this responce on the pull command now:

Edit:

I suppose this "standard wipe" is the problem here? Having it included data too? Since this packages.xml is located on the /data partition. That might explain the error.

I made a backup of /data using the internal TWRP backup method. So I guess I could recover?

I supose the wipe of "cache" should not have been a big deal?
[Moto G8 Plus Questions & Answers] alecxs:
in case you wiped /data phone can no longer boot. either restore backup of /data from /sdcard1 or completely format /data (will delete Internal Storage /sdcard also)
[Moto G8 Plus Questions & Answers] Rockel:
Oops....

Glad I made this extra backup yesterday...

Just had to few sleep last night I think, I should have been aware of this :/
[Moto G8 Plus Questions & Answers] Rockel:
I've restored /data now.

And ofcourse it finds "packages.xml" now. But I think this is the old file of the backup. Nothing looks changed and I can't find the cerberus app after doing the steps of post #56.

Talking about that...

I was looking to repeat those steps after recovering /data. But it seems I can't find /system now. Is this normall? Standard wipe only included Data, Cache and Dalvik. I did no manual slection and I didn't wiped /system myself.

Only did a restore of /data after wipe so far.

edit:

Oh excuse me, seemed /system was not mounted.

I just mounted it and I can see it now in file manager. But the dir I've created in post #56 isn't there annymore. I could repeat all these steps now if it helps.
[Moto G8 Plus Questions & Answers] alecxs:
you need to mount system rw each time, it's not mounted by default.

changes in /system are persistent, unless you restored system.img_sparsechunks.
[Moto G8 Plus Questions & Answers] Rockel:
Oh my mistake! Overlooked that I always needed to mount system again. But no, I didn't wiped system. Only did the standard wipe without further selection and system thus is not included

So now I did the folowing:

- restored /data from my backup

- followed the steps in post #56 again

- wiped only Dalvik

- rebooted

After reboot it still tends to get stuk at fastboot. So don't know at which point this cerberus app of post #56 will be installed?

I booted TWRP again and I think everything still looks the same.

Tried to extraxt "packages.xml" again, and still no trace of Cerberus.

I'm not sure if I had reached a point where Cerberus was installed on boot yet.
[Moto G8 Plus Questions & Answers] alecxs:
have you properly restored boot partition from magisk_patched.img on PC? maybe it doesn't boot into right slot? how do you enter TWRP - have you installed TWRP into recovery ramdisk meanwhile, or does fastboot boot command work?
[Moto G8 Plus Questions & Answers] Rockel:
I just clicked the restore button in TWRP, selected the Data partition and swiped to restore, I'm not sure if I could have done things verry differently there?

No I did not installed TWRP into recovery ramdisk, only used fastboot "boot" all the time.
[Moto G8 Plus Questions & Answers] alecxs:
okay maybe it's something about slots or dm-verity. please flash magisk_patched.img and vbmeta.img (into both slots) accordingly (#24) and set slot a as active.

if still not booting, restore stock system.img_sparsechunks into both slots (#48) and delete package-restrictions.xml file of /data partition. this way it should boot into standard configuration of apps.

if still no success, last resort try with stock boot.img instead of magisk_patched.img to rule out Magisk issues.

if still no chance then I am out of ideas to fix boot-loop. then you are left with formatting /data (+ /sdcard) and start from scratch.

before that kind of factory reset, have a look at Migrate_EMERGENCY_FLASHABLE.zip it can help to restore selected apps later. the process is manually so choose wise which apps you really need (requires packages.list, see readme.txt inside zip).
[Moto G8 Plus Questions & Answers] Rockel:
Manny thanks again! Going to try all of this right away!

But what about "vbmeta.img"? Where do I find this file?
[Moto G8 Plus Questions & Answers] alecxs:
use the stock vbmeta.img from XT2019-1_DOHA_RETEU_10_QPI30.28-Q3-28-26-3_subsidy-DEFAULT_regulatory-DEFAULT_CFC.zip and flash with proper flags --disable-verity --disable-verification (requires latest platform-tools).
[Moto G8 Plus Questions & Answers] Rockel:
Oh yes, I see now!

I've extracted this vbmeta.img file now,.

I was looking how to disable those mentioned flags, but I'll do with this command in ADB?

Thought I needed to open something in an editor and rule out those flags...
[Moto G8 Plus Questions & Answers] alecxs:
you mean fastboot ;)

just type as written. if it does not work post the output of fail

fastboot flash --disable-verity --disable-verification vbmeta_a vbmeta.img
fastboot flash --disable-verity --disable-verification vbmeta_b vbmeta.img
[Moto G8 Plus Questions & Answers] Rockel:
Oh ofcourse haha

Fastboot yes! :D

I think that turned out good so far

So I did this prior to flashing, I think the file is edited for the a and b slot now? And now I can proceed flashing magisk_patched.img and vbmeta.img according to post #24?

And to my understanding: First I activate slot A, and if this does not work activating slot B and try again?
[Moto G8 Plus Questions & Answers] alecxs:
you have already done the flashing of vbmeta. the patch is applied during the flashing process, the file on PC remains untouched. according to the output post #15 slot a is the correct one. slot b is unused, but it does not harm to preventive duplicate slots. always only try to boot into slot a, as this is the last known working slot.

you can double-check from fastboot

fastboot getvar current-slot
fastboot getvar slot-bootable
fastboot getvar slot-successful
[Moto G8 Plus Questions & Answers] Rockel:
Ok!

- So I've edited "vbmeta.img" during the flashing method, and installed it in both slot A & B.

- Then I flashed "magisk_patched" into slot A & B

- Made slot A active, and rebooted.

Then the booting proces (showing the splash screen) took way much longer then it did after being "bricked". Normally it was the same behaviour when booting, showing the splash screen for a verry long time.

But eventually it returned to Fastboot. (at least the bootloop is gone now)

So I tried to make slot B active. Again the same long bootscreen. But it eventually brought me into Android. I saw the lock screen with my own background, the custom text I had put onto it and it showed my profile picture in the upper right corner.

But touchscreen wasn't responding, time and date were wrong and the battery indicator shows 0%, while TWRP shows 100%

But it's something already I guess (and hope).

I tried making slot A active again after. But it still boots as in the first try.
[Moto G8 Plus Questions & Answers] alecxs:
Surprisingly slot b seems the right one? touch might be related to dtbo just guesswork, try

fastboot flash dtbo_b dtbo.img