Invalid Magisk installation (/data/adb/magisk.img not found) - Huawei Mate 10 Questions & Answers

I have clean installed Magisk because of an irregularity. To be specific: when I TWRP>Install systemless_xposed-uninstaller-signed.zip, I get an error: Updater process ended with ERROR: 1. TWRP last_log shows ¨e2fsck: No such file or directory¨while trying to open /data/adb/magisk.img¨. So Magisk seems not to be installed.
While this happens, at the same time, when sytem is booted, I have no issues (seemingly) using Magisk manager and installing and using modules.
Because of this irregularity I clean installed Magisk:
- un-installed Magisk through Magisk manager>Uninstall>Complete uninstall
- flashed stock boot image using ¨fastboot flash ramdisk RAMDISK.img¨
- and re-installed Magisk TWRP>Install Magisk-v16.0.zip
After which the Magisk installation on my device is still broken in some way and regarded as ¨weird¨ by fellow xda members; I was advised to ask about it in the device forum.
I attach last_log-magisk-install.txt & last_log-systemless_xposed-uninstaller-signed.txt
Does anybody have a clue and/or experience in this matter maybe?

It's because /data/adb/ is encrypted after installing Magisk.
Not sure why it does that, that folder used to stay unencrypted after installing.
You can use TWRP file manager and check /data/adb/ for encrypted files, and check while booted too. If it's empty it is indeed not installing correctly.
Why are you running Xposed uninstaller by the way?

ante0 said:
It's because /data/adb/ is encrypted after installing Magisk.
Not sure why it does that, that folder used to stay unencrypted after installing.
You can use TWRP file manager and check /data/adb/ for encrypted files, and check while booted too. If it's empty it is indeed not installing correctly.
Why are you running Xposed uninstaller by the way?
Click to expand...
Click to collapse
/data/adb in twrp filemanager looks encrypted yes. Booted to system however, it shows correctly (screenshot). I do not understand why you expected it to be empty as you say.
What do you advise? Decrypt data partition maybe?
You ask why i run Xposed uninstaller; I just ran this script now to get the log. Before all this investgation started I was advised to run it to get rid of possible Xposed framework leftovers after I had installed Xposed, bootlooped and deletef the module.

lvbaal said:
/data/adb in twrp filemanager looks encrypted yes. Booted to system however, it shows correctly (screenshot). I do not understand why you expected it to be empty as you say.
What do you advise? Decrypt data partition maybe?
You ask why i run Xposed uninstaller; I just ran this script now to get the log. Before all this investgation started I was advised to run it to get rid of possible Xposed framework leftovers after I had installed Xposed, bootlooped and deletef the module.
Click to expand...
Click to collapse
No, I meant if it was empty it would be a reason why it can't find magisk.img. But in this case its encryption thats causing it.
You could decrypt, it would fix it. Though as you probably know you'd have to do this after each update.
You might be able to go back to fastboot directly after update finishes and flash twrp, then to twrp and replace fstab in /vendor/etc/ so it doesn't encrypt again. I haven't tested but should work. As long as you don't boot to system before replacing fstab it should stay decrypted.
I have a feeling it's caused by the FBE bypass that was introduced in v16 (actually 1541 from the custom honor v10 link, but added in 16 to stable). Magisk refused to even install because of encryption before this was fixed.

ante0 said:
No, I meant if it was empty it would be a reason why it can't find magisk.img. But in this case its encryption thats causing it.
You could decrypt, it would fix it. Though as you probably know you'd have to do this after each update.
You might be able to go back to fastboot directly after update finishes and flash twrp, then to twrp and replace fstab in /vendor/etc/ so it doesn'tencrypt again. I haven't tested but should work. As long as you don't boot to system before replacing fstab it should stay decrypted.
I have a feeling it's caused by the FBE bypass that was introduced in v16 (actually 1541 from the custom honor v10 link, but added in 16 to stable). Magisk refused to even install because of encryption before this was fixed.
Click to expand...
Click to collapse
Thanks for your input. I'll keep decrypting in mind. For now, it looks like I can install a module from Magisk manager - greenify4magisk. I could not do this however when I had v16. Now on v16.1 it installs. I will check it's functioning later.

ante0 said:
No, I meant if it was empty it would be a reason why it can't find magisk.img. But in this case its encryption thats causing it.
You could decrypt, it would fix it. Though as you probably know you'd have to do this after each update.
You might be able to go back to fastboot directly after update finishes and flash twrp, then to twrp and replace fstab in /vendor/etc/ so it doesn't encrypt again. I haven't tested but should work. As long as you don't boot to system before replacing fstab it should stay decrypted.
I have a feeling it's caused by the FBE bypass that was introduced in v16 (actually 1541 from the custom honor v10 link, but added in 16 to stable). Magisk refused to even install because of encryption before this was fixed.
Click to expand...
Click to collapse
I'm not sure what alteration in /vendor/etc/fstab is needed to prevent encryption. Can you elaborate maybe? Also, in this regard, can you confirm the following:
when I decide to format internal storage in TWRP with ¨Format Data¨and thus getting rid of encryption(link), will it still be (re-)encrypted if I use the unmodified stock kernel (I'm using stock Emui8)? If so, do you know of a modified kernel without encryption for BLA-L29(C432)?

lvbaal said:
I'm not sure what alteration in /vendor/etc/fstab is needed to prevent encryption. Can you elaborate maybe? Also, in this regard, can you confirm the following:
when I decide to format internal storage in TWRP with ¨Format Data¨and thus getting rid of encryption(link), will it still be (re-)encrypted if I use the unmodified stock kernel (I'm using stock Emui8)? If so, do you know of a modified kernel without encryption for BLA-L29(C432)?
Click to expand...
Click to collapse
This flag: ",fileencryption=aes-256-xts:aes-256-cts" on the /data line needs to be removed. After that you format data in twrp and decryption will stick. As of Oreo fstab is located in /vendor/etc so it doesn't matter what ramdisk you use, only matter is when you update firmware as /vendor is over-written. In theory you should be able to update, go straight to fastboot after and flash twrp, go to twrp and replace fstab. I haven't tested that yet, but as long as you don't boot to system it should stay decrypted.
(TWRP with FBE decryption support is on the horizon so you might want to wait. A fix was pushed a few days ago and it works on Honor 9, we just need a newly built twrp. I can't get the 8.1 tree to build a working one so I will check if it can be done with the 7.1 tree.)

ante0 said:
This flag: ",fileencryption=aes-256-xts:aes-256-cts" on the /data line needs to be removed. After that you format data in twrp and decryption will stick. As of Oreo fstab is located in /vendor/etc so it doesn't matter what ramdisk you use, only matter is when you update firmware as /vendor is over-written. In theory you should be able to update, go straight to fastboot after and flash twrp, go to twrp and replace fstab. I haven't tested that yet, but as long as you don't boot to system it should stay decrypted.
(TWRP with FBE decryption support is on the horizon so you might want to wait. A fix was pushed a few days ago and it works on Honor 9, we just need a newly built twrp. I can't get the 8.1 tree to build a working one so I will check if it can be done with the 7.1 tree.)
Click to expand...
Click to collapse
Hi and thanks for the clarification. As I'm in the process of re-flashing complete stock firmware (131->138 from pro-teammt.ru) I think I will be going for the solution provided by @Didgeridoohan. As I understand it at this moment, both solutions will permanently decrypt my /data, but the your solution does not mention Magisk installation. Does a Magisk installation not have any bearing to the issue then?

lvbaal said:
Hi and thanks for the clarification. As I'm in the process of re-flashing complete stock firmware (131->138 from pro-teammt.ru) I think I will be going for the solution provided by @Didgeridoohan. As I understand it at this moment, both solutions will permanently decrypt my /data, but the your solution does not mention Magisk installation. Does a Magisk installation not have any bearing to the issue then?
Click to expand...
Click to collapse
I'm not sure Magisk can. It could when I pushed a commit that added fileencryptioninline (this was for nougat), and when fstab was located in boot partition.
But that was removed as it broke support for Pixel devices.
This is what it looks for: https://github.com/topjohnwu/Magisk...285d860b4d95db13f7/native/jni/utils/pattern.c
"const char *encrypt_list[] = { "forceencrypt", "forcefdeorfbe", NULL };"
As you see it doesn't contain "fileencryption".
I'm not sure it even looks for fstab in /vendor. That would break the systemlessness of Magisk (doesn't modify /system or /vendor)
Though, it doesn't matter anyway, it does the exact same thing as manually editing /vendor/etc/fstab.kirin970
You can test though, to confirm
When you do Format Data you need to manually flash back the public and hw data zips in TWRP, they give errors but it's the folder "hw_init" that's placed in /data/ that's needed. Themes and stuff are in there.

ante0 said:
This flag: ",fileencryption=aes-256-xts:aes-256-cts" on the /data line needs to be removed. After that you format data in twrp and decryption will stick. As of Oreo fstab is located in /vendor/etc so it doesn't matter what ramdisk you use, only matter is when you update firmware as /vendor is over-written. In theory you should be able to update, go straight to fastboot after and flash twrp, go to twrp and replace fstab. I haven't tested that yet, but as long as you don't boot to system it should stay decrypted.
(TWRP with FBE decryption support is on the horizon so you might want to wait. A fix was pushed a few days ago and it works on Honor 9, we just need a newly built twrp. I can't get the 8.1 tree to build a working one so I will check if it can be done with the 7.1 tree.)
Click to expand...
Click to collapse
Thanks again But I cannot quite picture this; when you say ¨In theory you should be able to update, go straight to fastboot after and flash twrp¨, because when I have flashed the complete stock firmware, I suppose Developper option USB debugging is off and I cannot send command <fastboot flash recovery_ramdisk twrp.img> from PC, or can I?

lvbaal said:
Thanks again But I cannot quite picture this; when you say ¨In theory you should be able to update, go straight to fastboot after and flash twrp¨, because when I have flashed the complete stock firmware, I suppose Developper option USB debugging is off and I cannot send command <fastboot flash recovery_ramdisk twrp.img> from PC, or can I?
Click to expand...
Click to collapse
When you flash on Oreo it will not wipe anything, /data stays.
Basically it does an OTA but with a full fw.
Unless you factory reset after, then it would wipe.
As I said it's in theory as I haven't tested it yet, so you're free to try if you're going to update anyway
Mine has been on everytime I've updated anyway. Only difference was in Nougat where bootloader was locked and you had to unlock it, which meant a mandatory wipe...

ante0 said:
This flag: ",fileencryption=aes-256-xts:aes-256-cts" on the /data line needs to be removed. After that you format data in twrp and decryption will stick. As of Oreo fstab is located in /vendor/etc so it doesn't matter what ramdisk you use, only matter is when you update firmware as /vendor is over-written. In theory you should be able to update, go straight to fastboot after and flash twrp, go to twrp and replace fstab. I haven't tested that yet, but as long as you don't boot to system it should stay decrypted.
(TWRP with FBE decryption support is on the horizon so you might want to wait. A fix was pushed a few days ago and it works on Honor 9, we just need a newly built twrp. I can't get the 8.1 tree to build a working one so I will check if it can be done with the 7.1 tree.)
Click to expand...
Click to collapse
Hello again. I've studied the shell scripts used in the HWOTA8 package and found out that the kernel and stock recovery will be flashed to the device after which it switches to recovery mode and the update zips will be pushed to /data/update along with update commands in /cache/recovery/command. Then it is supposed to reboot to recovery; to apply the updates I presume?. So when I interrupt this flow and do not boot to recovery but to fastboot to flash twrp and replace fstab, how will the updates be applied then?
I attach the script in question.
Any news already on TWRP on the horizon?

lvbaal said:
Hello again. I've studied the shell scripts used in the HWOTA8 package and found out that the kernel and stock recovery will be flashed to the device after which it switches to recovery mode and the update zips will be pushed to /data/update along with update commands in /cache/recovery/command. Then it is supposed to reboot to recovery; to apply the updates I presume?. So when I interrupt this flow and do not boot to recovery but to fastboot to flash twrp and replace fstab, how will the updates be applied then?
I attach the script in question.
Any news already on TWRP on the horizon?
Click to expand...
Click to collapse
First, copy fstab to computer and remove the fileencryption flag.
If course you need to flash update first.
You install update using HWOTA8. After it's done with the update in recovery mode you boot directly to fastboot instead of booting to system. You'd have to watch phone while it's updating as it reboota automatically. You should have USB plugged in already, so just start holding vol down when it says update is complete and it will reboot and you should land in fastboot. Now flash twrp to recovery_ramdisk and type 'fastboot reboot'. Remove USB and hold vol up. Now you should boot to twrp. Adb push the modified fstab to /vendor/etc/fstab.kirin970.
Also check Internal storage in twrp to make sure it's still decrypted. (you would have to decrypt before installing update to make sure this theory actually works ).
I could actually test it tonight on my Mate 9.
As for TWRP, the fix has been pushed to gerrit but it's not merged yet. I've been trying to get the android-8.0/8.1 branch to build a functional twrp but no luck yet. For some reason a bunch of folders are missing, and I'm not sure why. They are there in the source branch for both 8.0/8.1... I will test using git clone instead if repo sync.

ante0 said:
As for TWRP, the fix has been pushed to gerrit but it's not merged yet. I've been trying to get the android-8.0/8.1 branch to build a functional twrp but no luck yet. For some reason a bunch of folders are missing, and I'm not sure why. They are there in the source branch for both 8.0/8.1... I will test using git clone instead if repo sync.
Click to expand...
Click to collapse
I managed to build an Ubuntu based development environment, but using minimal manifest (8.1 branch) to build TWRP throws errors (i don't know if you have the same errors).
Here's the error log - > https://pastebin.com/C6jVg2eY

ante0 said:
First, copy fstab to computer and remove the fileencryption flag.
If course you need to flash update first.
You install update using HWOTA8. After it's done with the update in recovery mode you boot directly to fastboot instead of booting to system. You'd have to watch phone while it's updating as it reboota automatically. You should have USB plugged in already, so just start holding vol down when it says update is complete and it will reboot and you should land in fastboot. Now flash twrp to recovery_ramdisk and type 'fastboot reboot'. Remove USB and hold vol up. Now you should boot to twrp. Adb push the modified fstab to /vendor/etc/fstab.kirin970.
Also check Internal storage in twrp to make sure it's still decrypted. (you would have to decrypt before installing update to make sure this theory actually works ).
I could actually test it tonight on my Mate 9.
As for TWRP, the fix has been pushed to gerrit but it's not merged yet. I've been trying to get the android-8.0/8.1 branch to build a functional twrp but no luck yet. For some reason a bunch of folders are missing, and I'm not sure why. They are there in the source branch for both 8.0/8.1... I will test using git clone instead if repo sync.
Click to expand...
Click to collapse
Actually the ota.sh script boots to recovery after pushing the update. Presumably to apply the update through stock recovery. There fore I issued command adb reboot bootloader in an other powershell window. Then I flashed TWRP rebooted to TWRP to replace replaced fstab but then TWRP decides to apply the update because of input in /cache/recovery/command, so at that point I cannot replace fstab. Therefor I altered the script ota.sh and de-activated writes to /cache/recovery/command, and started over...
[/B]

lvbaal said:
Actually the ota.sh script boots to recovery after pushing the update. Presumably to apply the update through stock recovery. There fore I issued command adb reboot bootloader in an other powershell window. Then I flashed TWRP rebooted to TWRP to replace replaced fstab but then TWRP decides to apply the update because of input in /cache/recovery/command, so at that point I cannot replace fstab. Therefor I altered the script ota.sh and de-activated writes to /cache/recovery/command, and started over...
[/B]
Click to expand...
Click to collapse
Well, it has to apply the update in stock recovery. It can't do it in TWRP.
Basically you:
Format Data in TWRP and replace fstab with one that has fileencryption flag removed.
Boot to system once and then back to TWRP, check that you are decrypted (file manager in TWRP to Internal SD or browse child folders in /data).
Run HWOTA8 and let it update through stock recovery.
When it's done updating and about to reboot back to system, hold vol down so it goes to fastboot mode.
Now flash TWRP and issue 'fastboot reboot', quickly remove usb cable and hold volume up. Or remove usb and hold power+vol up.
Check that you are still decrypted.
Replace Fstab again with the 'fileencryption' flag removed one.
Now you can boot to system.
Edit: I managed to get TWRP source working, will test the decrypt fix soon.
---------- Post added at 08:44 PM ---------- Previous post was at 08:01 PM ----------
Pretoriano80 said:
I managed to build an Ubuntu based development environment, but using minimal manifest (8.1 branch) to build TWRP throws errors (i don't know if you have the same errors).
Here's the error log - > https://pastebin.com/C6jVg2eY
Click to expand...
Click to collapse
You need the full Omni source. Takes a while to sync
It's missing stuff from minimal that's needed.
After it's done syncing, you need to git clone https://github.com/omnirom/android_bootable_recovery to TWRPfolder/bootable/ and replace the recovery folder.
Same with https://github.com/omnirom/android_external_busybox/ to TWRPfolder/external/busybox (folder doesn't exist).
I'm not sure why it does this, the source looks fine when viewed in browser, but it doesn't sync everything...

ante0 said:
Well, it has to apply the update in stock recovery. It can't do it in TWRP.
Basically you:
Format Data in TWRP and replace fstab with one that has fileencryption flag removed.
Boot to system once and then back to TWRP, check that you are decrypted (file manager in TWRP to Internal SD or browse child folders in /data).
Run HWOTA8 and let it update through stock recovery.
When it's done updating and about to reboot back to system, hold vol down so it goes to fastboot mode.
Now flash TWRP and issue 'fastboot reboot', quickly remove usb cable and hold volume up. Or remove usb and hold power+vol up.
Check that you are still decrypted.
Replace Fstab again with the 'fileencryption' flag removed one.
Now you can boot to system.
Edit: I managed to get TWRP source working, will test the decrypt fix soon.
Click to expand...
Click to collapse
When I format data in twrp, replace fstab and boot to system once and then back to twrp to check encryption state in twrp filemanager, will /data not be empty then, so there's noting to check? Or am I missing something here?

lvbaal said:
When I format data in twrp, replace fstab and boot to system once and then back to twrp to check encryption state in twrp filemanager, will /data not be empty then, so there's noting to check? Or am I missing something here?
Click to expand...
Click to collapse
/data will not be empty. Unless you completely wipe it. But I think phone refuses to boot if you Wipe instead of Format Data

ante0 said:
/data will not be empty. Unless you completely wipe it. But I think phone refuses to boot if you Wipe instead of Format Data
Click to expand...
Click to collapse
I took my chances and did as proposed: only booting to system will not happen: it tries 2 times and the third time Huawei eRecovery comes up ¨Data partition was damaged seriously and you are recommended to format it to recover your phone¨ . It recommends Low level format data partition or shutdown. I chose Shutdown and booted to twrp once more to check /data. There's only lost+found and media/0 both empty. So /data turns out to be empty nevertheless. I did not completely wipe it; I did TWRP>Wipe>Format Data and typed ¨yes¨ to continue. Is this not what you meant by Format data in TWRP then?

lvbaal said:
I took my chances and did as proposed: only booting to system will not happen: it tries 2 times and the third time Huawei eRecovery comes up ¨Data partition was damaged seriously and you are recommended to format it to recover your phone¨ . It recommends Low level format data partition or shutdown. I chose Shutdown and booted to twrp once more to check /data. There's only lost+found and media/0 both empty. So /data turns out to be empty nevertheless. I did not completely wipe it; I did TWRP>Wipe>Format Data and typed ¨yes¨ to continue. Is this not what you meant by Format data in TWRP then?
Click to expand...
Click to collapse
Yes. That's where you Format Data.
Hmm.
Unless this twrp actually wipes rather than format.
Did you do update too now or just remove the flag in fstab and Format Data?
To get to Low level format, flash stock recovery OR the nocheck recovery from HWOTA8.

Related

TWRP 3.2.3-1 for Pixel Devices

TLDR: It's here and it may eat your data, and you will lose SuperSU root if currently installed. READ the install instructions carefully!
Pixel XL
Pixel
DO NOT RESTORE DATA FROM alpha builds of TWRP using RC1. You will probably lose all data including internal storage. If you need to restore a data backup from an alpha build, reinstall the alpha and restore using the alpha and make a new backup using RC1.
Note: Do not use if you have multiple users (including a guest user)
File Based Encryption (FBE) can be a bit tricky. If a restore doesn't work correctly, it can trigger an automatic wipe of your data. Sometimes TWRP will fail to prompt you to enter your password or otherwise fail to set up decrypt properly. If this happens, reboot TWRP. It seems to be some kind of timing issue and I haven't had time to track it down yet.
Pixel devices have 2 "slots" for ROMs / firmware. TWRP will detect whichever slot is currently active and use that slot for backup AND restore. There are buttons on the reboot page and under backup -> options to change slots. Changing the active slot will cause TWRP to switch which slot that TWRP is backing up or restoring. You can make a backup of slot A, switch to B, then restore the backup which will restore the backup of A to slot B. Changing the slot in TWRP also tells the bootloader to boot that slot.
The zip install method installs TWRP to both slots.
Installation:
If you already have TWRP installed: Download the latest zip and install the zip using TWRP.
If you do not already have TWRP installed: Download both the img and the zip. Copy the zip to your device. You will need to have fastboot binaries and the correct drivers installed. Power off your device completely. Hold volume down and turn on the device. Your device should now be in the bootloader. Connect the device to your PC. Open a command window and run the following command from the proper location:
fastboot boot path/to/twrp.img
This will temporarily boot TWRP on your device. If you are using a lockscreen pin/pattern/password and do not get prompted to enter your passord, reboot to the bootloader and try again. Go to install and browse to the zip and install the zip. If you are currently rooted with SuperSU, you will need to reflash the stock boot image before installing TWRP. After installing the stock boot image, follow the instructions for installing TWRP. Once TWRP is installed, grab the very latest SuperSU released on 2015-11-15 or later and install SuperSU.
If you accidently flash TWRP to your device using fastboot instead of temporarily booting the image, you will need to download the latest factory image for your device and reflash the boot image.
NOTE about 3.2.1-0: This version will decrypt Android 8.1, however the new image is built in Android 8.1 and may not be compatible with SuperSU and/or Magisk until they update their stuff. I have not tested. Good luck.
3.2.1-1 has working decrypt with the February security patch!
3.2.1-2 fixes some zip install errors
3.2.3-1 supports decrypting Android 9.0 Pie even with a pin / pattern / password set
How to install SuperSU SR5 on TWRP RC1: In TWRP tap on Advanced -> File Manager and scroll to and select the fstab.marlin or fstab.sailfish file and then delete it.
You're the man! Props for all the hard work you've put into this.
TY!!!!
Awesome. I might have to wait a bit to install but glad to see the Pixel getting twrp.
Sent from my Pixel XL using Tapatalk
Wow, and so it begins. Thanks!
Thank you!!
Nice!!! Awesome job @Dees_Troy
Sent from my Pixel XL using Tapatalk
I just installed the IMG w/out issue.
I can't find the zip in TWRP file manager to flash though.
Everything looks encrypted.
EDIT: It went through on the 4th try of flashing the IMG, now I can see my /sdcard and install the zip.
But somehow this killed my OS.
Just flashed the flash-all.bat after removing -w so it doesn't wipe.
Now I'll try TWRP install again.
EDIT 2: Okay, after restoring to stock, the TWRP install went fine.
Maybe it didn't like my elementalx kernel or the existing root. The OP did mention something about root conflicts, I guess it may prevent TWRP installs too? But now I have OS *and* TWRP.
And I'm getting "Unspecified Error" when trying to copy my EFS backup from /sdcard/twrp/backup to my local computer. I am able to copy other non-TWRP files though.
.
.
.
Does a full backup on Pixel include System Image and Vendor Image? I don't recall seeing these on other devices.
Or do I just back up boot, system and data like usual?
***Hey ya'll, don't forget to back up EFS at least once and copy it to your computers!
Yea! Worked perfect!!!
Would the flashable SuperSU v2.78 SR3 zip work?
Looked it up and because of conflicting init binaries between TWRP and the current root method, it just wouldn't work.
While we're still on or near the first page of the thread, I'd like to clarify the whole EFS backup thing.
It's completely unnecessary. You don't need to do it. But the option is there (so no one asks where it went!)
Both the modemst1 and modemst2 partitions are merely a caching area for your modem firmware. They do not contain sensitive data like IMEI, or anything important. You can wipe them and they will be regenerated from scratch! Have no fear, your IMEI cannot be destroyed through means of bad flashes!
The issue with these partitions however is that should they ever become corrupt, the modem firmware will panic and fail to load - this is why you see your IMEI missing in such a case. The modem firmware simply refused to load due to encountering corrupt data. By clearing your modemst partitions (writing zeros to them), your modem firmware would happily load and regenerate the partitions, bringing back full call support & a visible IMEI.
Okay, I have TWRP + OS working fine after restoring to stock (getting rid of kernel + root).
Now to just wait for custom ROM's to drop. Thanks guys.
The ability to restore EFS was pretty important on some older phones.
Yep just want to let ya guys know might want return to stock before doing this. Besides that all good. Good job TWRP team! :good:
CZ Eddie said:
Okay, I have TWRP + OS working fine after restoring to stock (getting rid of kernel + root).
Now to just wait for custom ROM's to drop. Thanks guys.
The ability to restore EFS was pretty important on some older phones.
Click to expand...
Click to collapse
Are you rerooting after getting TWRP to work? Have you tried a backup and restore yet?
kirschdog1 said:
Are you rerooting after getting TWRP to work? Have you tried a backup and restore yet?
Click to expand...
Click to collapse
FYI on OP - A SuperSU update will be required to allow TWRP and SuperSU to co-exist.
kirschdog1 said:
Are you rerooting after getting TWRP to work? Have you tried a backup and restore yet?
Click to expand...
Click to collapse
yes
no
I stubbornly flashed v2 root and got boot hang so I put the phone up for the night.
delete
CZ Eddie said:
yes
no
I stubbornly flashed v2 root and got boot hang so I put the phone up for the night.
Click to expand...
Click to collapse
Do we still flash root the same way after we install TWRP? Or is there an su zip to flash?
Hooray! Cheers!

[RECOVERY][UNOFFICIAL][Sanders] TWRP-3.2.1-r20 (64bit Supported!)

Unofficial TWRP for Moto G5S Plus (Sanders)​
Additional Features over Official TWRP:
Supports flashing of both 32bit and 64bit ROMs and Kernels.
OREO Images/ROMs support.
Decryption and Encryption support.
No SuperSU by default.
No TWRP app.
No HTC Dumlock cruft.
Updated pigz compressor (slightly faster and more tolerant of corruption).
NTFS support(Both Read and Write).
Covers more partitions for nandroid backup (OEM, FSG and FSC).
Experimental support for SD cards that are partitioned for partial adopted storage and partial removable storage.
Faster I/O performance.
Fixed Gapps/aroma freeze issues.
IMPORTANT!!! : READ INSTRUCTIONS CAREFULLY BEFORE PROCEEDING TO FLASHING PROCESS..!!
At first boot twrp will ask for "Swipe to allow modifications for /system" and if you choose to allow it system partition will get modified. So if you choose to reboot back to OS without performing anything in twrp, the OS won't boot (as verity check is enabled in stock OS/kernel) . To avoid this you have to flash either Magisk or flash any of the verity disabler zips available on xda.
Force encryption is enabled by default in stock OS and twrp will successfully decrypt /data at first boot if all goes well
If in case decryption doesn't go fine, twrp will popup a dialog box asking for password and that means decryption went wrong and you would need to wipe data once via twrp wipe options and reboot back to twrp for functioning of /data
Flashing Instructions:
Using Existing TWRP:
Reboot to recovery > Click on Install > Install Image > recovery > select recovery image and flash > reboot to recovery
Other Methods(Fastboot) :
Make sure you have unlocked bootloader
Reboot to bootloader
Enter following command in terminal: fastboot flash recovery twrp-****.img (if you want permanent flash) or fastboot boot twrp-****.img (if you want temporary boot)
Incase your device is encrypted (while coming from stock rom), Follow these steps to decrypt:
Reboot to recovery > cancel the password prompt > mount all partitions > Format Data/Userdata (on f2fs) > Reboot Recovery > Mount all partitions again > Flash Magisk > Reboot
Now you are free to use Stock ROM (Decrypted) or Flash any custom rom you want.
Download Links: https://www.androidfilehost.com/?w=files&flid=216298
TWRP Themes: Check 3rd post
Known Issues: None || Report if you find any.
XDA:DevDB Information
[RECOVERY][UNOFFICIAL][Sanders] TWRP-3.2.1-r20 (64bit Supported!), Tool/Utility for the Moto G5S Plus
Contributors
CheckYourScreen
Source Code: https://github.com/CheckYourScreen/twrp_device_motorola_sanders
Version Information
Status: Stable
Current Stable Version: r20
Stable Release Date: 2018-04-04
Created 2017-10-26
Last Updated 2018-04-04
|| Changelog ||
r20:
Fixed Encryption support on custom roms.
Updated kernel
Updated build fingerprint for latest bootloader support.
Reverted pigz changes.
Switched back to original twrp themes. (TWRP Themes can be found in 3rd post )
Various bug fixes and improvements.
r16:
Fixed compatibility with New Bootloader (C2.07-December patch)
Merged october patches in kernel.
Various twrp upstream patches and fixes.
Fixed remote wipe process (Earlier remote wipe issued from play account wasnt processed due to twrp)
r15:
Added 64bit Support (You can flash both 32bit/64bit roms or kernels with it).
Fixed Encryption Support! (No need to format data to decrypt and mount).
Updated to 3.2.1 upstream changes with full oreo support.
Remove android reboot during password check on multiple wrong inputs.
r9:
Fixed F2FS mount issues(You can flash magisk modules or SuperSu now).
Enabled NTFS Write Support (You can make backups on sdcard/pendrives formatted on NTFS).
Fixed size of various partitions.
Switched to LZMA compression to decrease size.
r7: Initial Public Release
|| Themes ||
Here are some of the twrp themes:
Preview images: https://photos.app.goo.gl/DLrfDseGzfxE8Uq93
Download link: https://androidfilehost.com/?w=files&flid=233551
:good:
Only one that has actually be working for me ever since I got the phone. Thank you for your efforts.
this seems to suffer from the same thing the stock rom/kernel suffers from, the weird f2fs bug that makes certain mounts fail. geneticengineer has shared a kernel that fixes this in stock rom , maybe you could get in touch with him about how he updated f2fs
Thank you for your work, this seems to work well on my device. If you would like to swap the kernel, I posted a newer firmware NPS26.116-45 here:https://forum.xda-developers.com/showpost.php?p=74325160&postcount=33
revengineer said:
Thank you for your work, this seems to work well on my device. If you would like to swap the kernel, I posted a newer firmware NPS26.116-45 here:https://forum.xda-developers.com/showpost.php?p=74325160&postcount=33
Click to expand...
Click to collapse
But its for xt1806 only i think. Not real help. The most user here are outside usa.
Schrotty35 said:
But its for xt1806 only i think. Not real help. The most user here are outside usa.
Click to expand...
Click to collapse
Well my guess is that the kernel in the present twrp is from the -26 firmware posted in the other thread. That firmware was US Retail also. The OP in the other thread states in can be used on other models. But I am not going to tell you that because I do not know. I have not found any other firmware for the sanders model.
Ae3NerdGod said:
this seems to suffer from the same thing the stock rom/kernel suffers from, the weird f2fs bug that makes certain mounts fail. geneticengineer has shared a kernel that fixes this in stock rom , maybe you could get in touch with him about how he updated f2fs
Click to expand...
Click to collapse
Afaik it doesnt affect TWRP, you just need to be on a custom kernel if you are running stock rom.
Twrp has nothing to do with it.
If you face any problem flashing anything then post a screenshot or log.
revengineer said:
Thank you for your work, this seems to work well on my device. If you would like to swap the kernel, I posted a newer firmware NPS26.116-45 here:https://forum.xda-developers.com/showpost.php?p=74325160&postcount=33
Click to expand...
Click to collapse
Schrotty35 said:
But its for xt1806 only i think. Not real help. The most user here are outside usa.
Click to expand...
Click to collapse
Stock kernel is same in both the firmwares.
-45 is just for US variant, i dont recommend you to even flash that firmware on other variants.
CheckYourScreen said:
Afaik it doesnt affect TWRP, you just need to be on a custom kernel if you are running stock rom.
Twrp has nothing to do with it.
If you face any problem flashing anything then post a screenshot or log.
Click to expand...
Click to collapse
but i have a custom stock kernel, and things that fail in TWRP work in flashfire or magiskmanager
its mostly magisk modules im having problems with, ill reproduce an error when i get the chance
Ae3NerdGod said:
but i have a custom stock kernel, and things that fail in TWRP work in flashfire or magiskmanager
its mostly magisk modules im having problems with, ill reproduce an error when i get the chance
Click to expand...
Click to collapse
Flash the magisk module via twrp > take screenshot when flashing completes > go to advance section of twrp and take recovery log > reboot system > send that screenshot and recovery log here.
CheckYourScreen said:
Flash the magisk module via twrp > take screenshot when flashing completes > go to advance section of twrp and take recovery log > reboot system > send that screenshot and recovery log here.
Click to expand...
Click to collapse
will do, it happens with every magisk package i try. they used to fail in stock too till i used geneticengineers kernel from telegram now they work
didnt know you could screenshot in recovery, i assume its the same buttons
Ae3NerdGod said:
will do, it happens with every magisk package i try. they used to fail in stock too till i used geneticengineers kernel from telegram now they work
didnt know you could screenshot in recovery, i assume its the same buttons
Click to expand...
Click to collapse
Yes, same buttons to take a screenshot in TWRP
TWRP backup is frozen at 13% completed. The progress bar is still showing its animation.
I unlocked the bootloader, and then rebooted. Android came up with the language selection screen. I powered off, connected the phone to the PC, and booted into TWRP (not flashed yet):
Code:
fastboot boot twrp-3.1.1-sanders-r7.img
I did not let TWRP format /data.
Then I started a backup, selecting all partitions, so that I could always go back after flashing TWRP and Magisk.
Does anyone know why backup is stuck at 13%? Last log line says "Backing up System..."
I tapped "Cancel" after two hours. That stopped the progress bar animation, but not the backup itself.
BTW: I used TWRP from this thread, the one in another thread freezes at the TWRP boot logo.
Edit: after two hours I killed the backup by powering down (the only way it seemed). On retry it froze at 21%.
Edit 2: Retried, this time backing up everything except system. No problem. I then tried to backup system. Frozen at 1%. What is the problem here?
Edit 3: Finally, a complete backup of system! Only one to go: system_image. But unfortunately that froze at 0%. Every subsequent try freezes at 1666MB (40%). The card has over 30GB free. I tried backup to USB-OTG, but that also froze.
gewe said:
TWRP backup is frozen at 13% completed. The progress bar is still showing its animation.
I unlocked the bootloader, and then rebooted. Android came up with the language selection screen. I powered off, connected the phone to the PC, and booted into TWRP (not flashed yet):
Code:
fastboot boot twrp-3.1.1-sanders-r7.img
I did not let TWRP format /data.
Then I started a backup, selecting all partitions, so that I could always go back after flashing TWRP and Magisk.
Does anyone know why backup is stuck at 13%? Last log line says "Backing up System..."
I tapped "Cancel" after two hours. That stopped the progress bar animation, but not the backup itself.
BTW: I used TWRP from this thread, the one in another thread freezes at the TWRP boot logo.
Edit: after two hours I killed the backup by powering down (the only way it seemed). On retry it froze at 21%.
Edit 2: Retried, this time backing up everything except system. No problem. I then tried to backup system. Frozen at 1%. What is the problem here?
Edit 3: Finally, a complete backup of system! Only one to go: system_image. But unfortunately that froze at 0%. Every subsequent try freezes at 1666MB (40%). The card has over 30GB free. I tried backup to USB-OTG, but that also froze.
Click to expand...
Click to collapse
Might be due to data partition being encrypted, you cant write anything in it without decrypting it first.
Format data and reboot recovery, then make the backup. You can flash magisk after taking the backup.
Btw r9 new release on its way with some really important changes
CheckYourScreen said:
Might be due to data partition being encrypted, you cant write anything in it without decrypting it first.
Format data and reboot recovery, then make the backup. You can flash magisk after taking the backup.
Btw r9 new release on its way with some really important changes
Click to expand...
Click to collapse
I was not trying to write the backup to the data partition, but to external SD card (tried OTG-USB as well without success).
I have flashed TWRP, formatted the data partition, and flashed Magisk. I have not tried to create a new backup yet. First I want to find out why Magisk does not pass the Safetynet check.
Can't wait to see what r9 brings. Thanks for your efforts. :good:
gewe said:
I was not trying to write the backup to the data partition, but to external SD card (tried OTG-USB as well without success).
I have flashed TWRP, formatted the data partition, and flashed Magisk. I have not tried to create a new backup yet. First I want to find out why Magisk does not pass the Safetynet check.
Can't wait to see what r9 brings. Thanks for your efforts. :good:
Click to expand...
Click to collapse
Magisk won't pass safety net with stock boot.img (kernel). Here is a modified kernel.
https://forum.xda-developers.com/showthread.php?p=73930507
After flashing new kernel Magisk passes no problem.
Sent by way of magic
lilcdroid said:
Magisk won't pass safety net with stock boot.img (kernel). Here is a modified kernel.
https://forum.xda-developers.com/showthread.php?p=73930507
After flashing new kernel Magisk passes no problem.
Sent by way of magic
Click to expand...
Click to collapse
When I flash this my WiFi stops working completely. I'm running aosp extended rom. I'm not sure if I can achieve battery life as good as I can on the stock ROM as I can on this one so im not sure what I should do about that..
Brycearuuni said:
When I flash this my WiFi stops working completely. I'm running aosp extended rom. I'm not sure if I can achieve battery life as good as I can on the stock ROM as I can on this one so im not sure what I should do about that..
Click to expand...
Click to collapse
Sorry I wasn't aware you weren't still on stock. That kernel will only work on stock. I would verify with the maintainer of AOSP extended ROM that the kernel is patched to work with Magisk.
Sent by way of magic

[TWRP][RECOVERY] Asus ZenPad 10 Z300M, Z301M & Z301MF (locked bootloader ok)

This is basically a copy of my Z380M TWRP thread adopted for the ZenPad 10. I decided to start a new one since the OP of justshaun's original recovery/rooting thread has gone stale, even as I had posted several new releases of TWRP over the months. Its instructions are also a little outdated. I've also compiled a version for the new Z301M(F) models and needed a place to post it. This is where I will be posting TWRP updates from now on.
In addition to this thread, referring to the Z380M TWRP thread and the original Z300M thread (links above) may be helpful. These models share the same hardware and software base, so most things that apply to one tablet also apply to the others.
DISCLAIMER
As usual, you do anything described in this post at your own risk. No one but you is responsible for any data loss, bricking or damage of your device.
REQUIREMENTS
Windows or Linux PC
SP Flash Tool version 5.1532 (only this version will bypass security checks)
MediaTek VCOM drivers (available through Windows Update)
ZenPad 10 scatter file for SPFT, attached (choose the one for your tablet)
Recovery image, attached (choose the one for your tablet)
ZenPad Z300M, Z301M or Z301MF tablet upgraded to Android N
This won't be a guide on how to use SP Flash Tool. There are plenty of good guides out there like this one on how to set up drivers, load scatter files, flash and make backups with SP Flash Tool. If you're not familiar with this software or how to flash MediaTek devices in general, please do your research before attempting this. I will just get straight to the specifics about the ZenPad 10.
FIRST TIME INSTALLATION
For a locked bootloader:
At this point you should have your tablet powered off, the drivers installed, all of your data backed up, and SP Flash Tool v5.1532's Download tab open and loaded with the tablet's scatter file. Open the download agent file DA_PL.bin, replacing the default MTK_AllInOne_DA.bin. (You can use the AllInOne DA if you want, but the procedure involves extra steps as described below.) Load the extracted TWRP recovery image for your device (twrp-3.2.1-0-z30*m.img) under the recovery partition line in the partition table. Click the Download button inside SPFT. Now just connect the USB cable to your tablet and your computer's USB port. It should start the download process automatically and disconnect when finished.
Alternative Method:
If you're using MTK_AllInOne_DA.bin, you have to hold the Volume Up key as you insert the cable, which puts the device into an emergency download mode. In addition, you will need to have the stock preloader*.bin file loaded inside SPFT for it to be able to communicate with your tablet. The preloader is available inside the official zip file download. Do not flash the preloader (untick the box) or any partitions other than recovery. You just need to have a valid bin file selected under the Preloader line.
For an unlocked bootloader:
If you have used the Asus unlock tool to unlock your device, you will still not be able to use fastboot flash to install a custom recovery. However, you can do a "hot boot" or a tethered boot of TWRP. This method doesn't require SP Flash Tool. Download the TWRP image, put your tablet in fastboot mode and connect to PC. Then run this command to boot TWRP dynamically:
fastboot boot twrp-3.2.1-0-z30*m.img
Once inside TWRP, flash twrp-3.2.1-0-z30*m.img to Recovery using Install -> Install Image. Then reboot to recovery. You may be able to use TWRP in the tethered boot mode, but that could result in glitches due to different parameters passed by the bootloader to the kernel. That's why flashing is recommended.
To update from your installed TWRP version to a new one, just transfer the image to your tablet, then boot to TWRP and install it by going to Install -> Install Image and flashing to Recovery.
START RECOVERY
With the tablet powered off, hold the Volume Up and Power keys together until you get to a menu where you can select "recovery". On the Z301M/Z301MF, that option is labeled Factory Reset. Use Vol. Up to scroll and Vol. Dn to select. If you have a locked bootloader, it will show a Yellow State message because the recovery is not signed by the OEM. Just press volume up to boot it. On the welcome screen of TWRP it will ask you about modifying the system partition, I suggest you go with Keep System Read-only. Doing otherwise will complicate your OTA updates.
WARNING: Never start the stock recovery from the bootloader menu on this device. It is programmed by the bootloader to instantly wipe your data without any warning. Also, be aware that Android installs the stock recovery at every normal boot cycle. So you either have to flash the TWRP every time you want to run it, or disable the automatic recovery installation in the stock firmware. Any kind of mod to the boot image will prevent the automatic recovery installation. If you're not sure which recovery you have installed, you can always do a 'adb reboot recovery' from Android without risk of data loss.
WARNING 2: Make sure you use the correct scatter file for your device (i.e. don't mix up the Z300 and Z301 files). For the initial flash, there is no check for scatter file correctness. If you use the wrong one, SP Flash Tool will alter and lock your GPT to that scatter file layout, possibly bricking your device. It will not be easy to restore it. Flashing with the correct scatter file later on will not work because Flash Tool will not allow you to use a different file than the one you used initially.
What works: Basically everything... access to major partitions, decrypted userdata partition, decrypted adoptable storage, external SD card, ADB, USB-OTG, touch interface, splash screen, installing stock Asus OTA/web FW updates
What doesn't work: (no known problems yet, but please report any)
Not guaranteed to work: factory reset
DOWNLOAD
SP Flash Tool v5.1532
Z300M Scatter file for all storage sizes (right click, Save link as...) -- do not use for other models
Z300M TWRP 3.2.1-0 image -- updated March 15, 2018
Z301M(F) series Scatter file for all storage sizes (right click, Save link as...) -- do not use for Z300M or other devices
Z301M TWRP 3.2.1-0 image -- updated March 13, 2018
Z301MF TWRP 3.2.3-0 image -- updated August 29, 2018
Development and experimental files
Source code
P.S. The thanks button doesn't bite.
Heya, thanks for the new thread..
Stupid question(coming from Samsung flashing)
Ive got Zenpad S3 10 P027, is this TRWP not ideal for this?
Currently, have some su (root) issues. Recovery shows Android icon chest with ! and says "No Command"
When running su in Terminal ADB via PC, says command not recognized.
Looks like I need to reflash recovery. When in TRWP (launched via fastboot boot twrp on PC) I flashed stock recovery but had system mounted read only. Could that be the problem?
Bro, I think you need to do some more homework on root, su, dm-verity, mods, etc. and read the instructions more carefully before applying these hacks. You are making a lot of simple mistakes and ending up shooting yourself in the foot for it. I don't think there's anything wrong with the Z500 TWRP. It can handle installing the stock firmware just fine. The problem is elsewhere. The unlock tool also works fine in TWRP as well in my testing.
The No Command screen is normal. That's been answered many times... you need to hold power+vol. up (or down) to get to the menu. There is no way the stock recovery image can be broken and still boot up.
The su thing, IDK what the problem is, but I'm sure if you install Magisk Manager and make your own patched image from your currently installed firmware, and fastboot-boot with it, you will have su functionality. Just like what it says in the unlock tool instructions.
Lastly and most important, never mount system in read-write mode, as I've repeated several times and exactly as it says in the directions:
7. At the TWRP welcome screen, do not select to modify the system partition and touch Keep System Read-only instead. Doing otherwise will render your tablet unbootable.
8. Mount system in TWRP (in read-only mode)
Click to expand...
Click to collapse
The only time you can mount it in read-write mode is when you are absolutely sure you have disabled dm-verity in your boot image.
I've successfully installed TWRP on Z301M using the instructions from the first post, but then I somehow managed to lose the system. Yes, I should have backed up like the OP suggests.
I thought I should be able to reinstall the original firmware downloaded from Asus (e.g. UL-ASUS_P028_1-WW-3.3.12.0-user.zip) but both the 'adb sideload' method and the TWRP failed to install that firmware zip. My device looks bricked. The only thing I can do is to boot into TWRP (I actually need to select Factory Reset on the bootloader screen to get into TWRP). The folder 'system' is empty.
Can anyone suggest what I am doing wrong when trying to restore the Asus firmware?
When I try to sideload the zip, setting TWRP in the sideload mode, the computer begins uploading but after a few seconds gives the message "Total xfer: 0.01x" and stops, while Android errors with "set boot part fail. can not open misc-sd".
When I install the firmware zip from TWRP it also starts installing fine but shortly gives the same error "set boot part fail. can not open misc-sd".
Thanks
@ahacker, first of all, thank you for the feedback on the Z301M platform. You are literally the first person to have said anything about that version of TWRP.
To see the files on system, you first have to mount the system partition. Did you do that? If not, I suggest mounting it read-only. If there was any corruption on it, then reinstalling the firmware should have fixed it. The "misc-sd" errors are normal. Pretty sure they happen on stock recovery too. The stock firmware does not have dm-verity enabled, so letting TWRP modify system to prevent overwriting recovery should not have caused any problems.
At which point did it stop booting? Also, did you use the scatter file from first post? And can you tell me if the touch screen works fine in TWRP on your tablet?
I'm not sure what the deal is with adb sideload. I don't think I've ever actually tried it....
diplomatic, thanks for replying!
diplomatic said:
[MENTION=4776997]
To see the files on system, you first have to mount the system partition. Did you do that?
Click to expand...
Click to collapse
I do mount the system partition. It appears empty. When I reboot into system TWRP says that the OS is not installed.
I don't remember the details of how I lost the system partition. First time I entered into TWRP it asked for a password, probably to mount some partition. I pressed cancel or something. Then I might have cleaned the caches. But I am sure I haven't wiped system. I might have pressed Factory Reset somewhere, because I don't have any data yet on the new tablet.
I would indeed try to mount the system read only. This is not the first Android system I rooted (maybe fifth), and I was always able to restore the system either from sideload or recovery. But here it seems Asus is making us jump extra hoops to do that.
diplomatic said:
[MENTION=4776997]
Reinstalling the firmware should have fixed it.
Click to expand...
Click to collapse
That seems to be my main problem now. I cannot reinstall the Asus firmware. It may look like I might be installing a wrong version, but I am positive that I have Z301M tablet. This is what I bought and what the boot-loader says. I download Z301M firmware from the Asus website (e.g.). So it must be a correct firmware.
diplomatic said:
[MENTION=4776997]
The "misc-sd" errors are normal. Pretty sure they happen on stock recovery too. The stock firmware does not have dm-verity enabled, so letting TWRP modify system to prevent overwriting recovery should not have caused any problems.
Click to expand...
Click to collapse
Thank you for the information.
diplomatic said:
[MENTION=4776997]
Also, did you use the scatter file from first post? Does the touch screen work fine in TWRP on that tablet?
Click to expand...
Click to collapse
Yes. I found that to be the only scatter file that worked. I tried scatter.txt from the firmware zip, but the Flash Tool refuses tio pick it up. TWRP seems to be working fine with touches working as expected.
diplomatic said:
[MENTION=4776997]
I'm not sure what the deal is with adb sideload. I don't think I've ever actually tried it....
Click to expand...
Click to collapse
This is the unbricking method described here. It probably does the same thing as the "Install Zip" from recovery, because the errors that both methods give are the same.
---------- Post added at 01:19 AM ---------- Previous post was at 12:57 AM ----------
Now system refuses to mount
ahacker said:
I don't remember the details of how I lost the system partition. First time I entered into TWRP it asked for a password, probably to mount some partition. I pressed cancel or something. Then I might have cleaned the caches. But I am sure I haven't wiped system. I might have pressed Factory Reset somewhere, because I don't have any data yet on the new tablet.
Click to expand...
Click to collapse
Er, the password should have been for decrypting your userdata. If you didn't have one set up, there might be something wrong there.... Or possibly just unformatted.
ahacker said:
That seems to be my main problem now. I cannot reinstall the Asus firmware. It may look like I might be installing a wrong version, but I am positive that I have Z301M tablet. This is what I bought and what the boot-loader says. I download Z301M firmware from the Asus website (e.g.). So it must be a correct firmware.
Click to expand...
Click to collapse
Yeah, that has to be the right one. The installation script has to match the model name reported by the recovery. Otherwise it would simply abort.
ahacker said:
Yes. I found that to be the only scatter file that worked. I tried scatter.txt from the firmware zip, but the Flash Tool refuses tio pick it up. TWRP seems to be working fine with touches working as expected.
Click to expand...
Click to collapse
Great! Guess my kernel patch was on the dot and the partition layout has not changed from the Z300.
ahacker said:
This is the unbricking method described here. It probably does the same thing as the "Install Zip" from recovery, because the errors that both methods give are the same.
Click to expand...
Click to collapse
When you installed the zip, did you unmount system completely? BTW, when you mentioned the errors, the installation does keep going for like 5 to 10 minutes afterwards, right?
If you still can't resurrect it, please post or send me the recovery & kernel log that has your installation attempt.
diplomatic said:
When you installed the zip, did you unmount system completely? BTW, when you mentioned the errors, the installation does keep going for like 5 to 10 minutes afterwards, right?
Click to expand...
Click to collapse
I've tried both ways, with and without system mounted, a few times. The installation would fail after something like 5 seconds.
diplomatic said:
If you still can't resurrect it, please post or send me the recovery & kernel log that has your installation attempt.
Click to expand...
Click to collapse
I think I am giving up on this cheap tablet. I cannot even format it in the Flash Tool: it says "To format code area is forbidden on this phone". Asus is forbidding too much for me to ever buy it again. Attached the logs.
Thanks, diplomatic
OK, found the problem. Check your PMs, ahacker.
diplomatic said:
OK, found the problem. Check your PMs, ahacker.
Click to expand...
Click to collapse
I have replied (twice), but the reply does not appear in my Sent Items. I hope it has reached you. If not, I'll paste the reply here, if you don't mind.
i not understand... i have Asus ZenPad 10 LTE Z301MFL.. a root method has been released ???
@diplomatic
Would this be compatible with Z0310M ? can't find anything for this damn model...
Hi, NeBouse,
Are you sure you have the correct information? It looks like just a misspelling of Z301M, aka P028....
I have z301m.
One thing that was a surprise for me is that the TWRP recovery flashed with the method described in the original post does not stick. You have to flash it each time you use it. If you are like me this information is important, because the original recovery plainly wipes your data without asking or warning.
After you have flashed TWRP on the device, to go to the recovery mode you have to chose "Factory Reset" in the bootloader. Then it will complain about wrong OS, which is the sign that flashing TWRP worked; choose 'yes'. The first thing you should do in TWRP is a ful nandroid backup. (Not listening the OP's advice about backing up when Installing TWRP with a wrong scatter file almost cost me the device. Thankfully diplomatic managed to remotely fix my problem, probably spending a lot of his personal time. The scatter file in the original post is a correct one now.)
Creating a nandroid backup in TWRP takes unusually long time, I even once decided that it hanged. Taking long time, like 10-30 minutes, for a full backup is normal.
Asus Z300M , Magisk 16.3 (beta) and FW 5.3.19 WW now works!
z301m, WW-3.3.12.0 firmware
For rooting I've installed in TWRP Magisk v15.3 (diplomatic warned against 16.x, someone else against 15.4) - link.
Installed in TWRP xPosed framework 88.2 - link, and xPosed Installer apk from within Android - link.
So far, so good.
What I've found is that TWRP seems to have problems with external sd cards (lots of fs corruption). I found it safer to unmount by hand by unticking the sd card checkbox in "Mount". Not very conclusive about this though.
Thanks, ahacker. Good feedback. Although to be fair, I didn't say to avoid Magisk 16.x. I said 16.0. I'm pretty sure whatever bug it had is already fixed in the latest version.
Now that you've installed root, TWRP will stick around on the emmc. The stock recovery only gets installed if you have the original unpatched boot image on it. I mean, this is not unique to these devices. That's been standard Android functionality since some 4.x or 5.x version. And this is essentially what's in the warning on the OP.
The backup I'm talking about in the installation method is done with the SP Flash Tool readback function. That will pull the partition tables and your device's "metadata" that's unique to your unit. I don't think nandroid covers that...
Oh, and what is this SD corruption you're talking about? What file system is it formatted in? Have you checked your card for errors in Windows?
Asus releases so many difference Z301M model, so I am curious if this also works on Z301MF model?
Notice Z300MF has the MTK8163BA (or MTK8163A?) CPU model while Z301M uses : 8163B
Anyone tested that already? Thanks.
my zenpad 10 has frp lock. it this a solution to remove the frp lock?
Pls help how i flash original software via fastboot ?????

[MOD] Decrypt /data for emui 8

Needed:
Unlocked Honor7x on emui 8 and twrp
I have tested this and found it working.
All you need to do is copy data/hw_init to your external sd
Then format data in twrp and flash the zip attached to this thread
Reboot
If it boots to system, then it's done
If it boots to erecovery and asks you to wipe data, then wipe data and boot to twrp
Make a data backup, format data, restore the back up you just made
Copy back hw_init from external sd to data
Reboot
Your device will be decrypted
more detailed instructions will follow
Sudeep Duhoon said:
Needed:
Unlocked Honor7x on emui 8 and twrp
I have tested this and found it working.
All you need to do is copy data/hw_init to your external sd
Then format data in twrp and flash the zip attached to this thread
Reboot
If it boots to system, then it's done
If it boots to erecovery and asks you to wipe data, then wipe data and boot to twrp
Make a data backup, format data, restore the back up you just made
Copy back hw_init from external sd to data
Reboot
Your device will be decrypted
more detailed instructions will follow
Click to expand...
Click to collapse
I did similar. I made almost same edits to fstab file in boot.img( removed verity, and "filencrypt") flashed modded boot.img and formatted /data. Phone boots normal, and twrp has full access to /data. But a side effect is developer options menu force closes when try to open it. Do you know why?
mrmazak said:
I did similar. I made almost same edits to fstab file in boot.img( removed verity, and "filencrypt") flashed modded boot.img and formatted /data. Phone boots normal, and twrp has full access to /data. But a side effect is developer options menu force closes when try to open it. Do you know why?
Click to expand...
Click to collapse
Can you post that boot.img? Or for emui 8 ramdisk or kernel img whichever is needed for oreo, this mod doesnt work for me
iGamer77z7 said:
Can you post that boot.img?
Click to expand...
Click to collapse
this is for emui 5 , android 7
It gave the trouble of crashing the settings app. so I did not continue using it.
USE AT YOUR OWN RISK.
copy the folder "/data/hw_init" before continuing.
Better way to apply this , instead of formatting in twrp, just factory reset in stock recovery. This way you do not wipe out the hw_init folder.
once done factory reset in stock recovery, plug in usb cable and select reboot from recovery screen. then hold volume down. Thais will reboot to fastboot.
Then "fastboot flash boot boot-decrypt.img"
mrmazak said:
this is for emui 5 , android 7
It gave the trouble of crashing the settings app. so I did not continue using it.
USE AT YOUR OWN RISK.
copy the folder "/data/hw_init" before continuing.
Better way to apply this , instead of formatting in twrp, just factory reset in stock recovery. This way you do not wipe out the hw_init folder.
once done factory reset in stock recovery, plug in usb cable and select reboot from recovery screen. then hold volume down. Thais will reboot to fastboot.
Then "fastboot flash boot boot-decrypt.img"
Click to expand...
Click to collapse
sorry I realized my mistake and edited my post, I was looking for an emui 8 solution, I'll keep trying unless you have an edited ramdisk or kernel img, not sure which one does force encrypt. Edit: Honestly I'm not on EMUI 8 currently, I am in the process of flashing gsi treble and wanted to decrpyt while my data was wiped.
EDIT: Got it, fastboot -w and factory reset in stock recovery did the trick along with flashing the included zip file
iGamer77z7 said:
sorry I realized my mistake and edited my post, I was looking for an emui 8 solution, I'll keep trying unless you have an edited ramdisk or kernel img, not sure which one does force encrypt. Edit: Honestly I'm not on EMUI 8 currently, I am in the process of flashing gsi treble and wanted to decrpyt while my data was wiped.
EDIT: Got it, fastboot -w and factory reset in stock recovery did the trick along with flashing the included zip file
Click to expand...
Click to collapse
How to backup data partition... please tell?

Development TWRP - Need Devs! {Already in quasifunctional state} TEST build posted. Need someone to pick this up and finish

** UNOFFICIAL A-TEAM RELEASE**
*******Testing ONLY*******
**testing has only been done on GN2200 July patch device but should atleast boot into twrp on other sec patch on GN2200 devices***
***Let us know if not***
*****HEED THE WARNING OF IMPENDING APOCALYPSE, DOOM, BOOTLOOPS , BRIMSTONE AND FIRE, AND ALSO TWRP ******
***NOBODY IS RESPONSIBLE FOR WHAT YOU DO WITH THIS EXCEPT YOU***
***DO NOT BUILD AND FLASH THIS UNLESS YOU KNOW EXACTLY WHAT YOUR DOING***
****DONT DO ANYTHING I SAY, I CANT BE HELD RESPONSIBLE FOR WHAT I SAY OR DO*****
**THIS IS AN ** UNOFICIAL RELEASE ** SO DONT GO CRYING TO ANYONE THAT YOU MADE YOURSELF AN EXPENSIVE PAPERWEIGHT IF YOU USE ANYTHING IN THIS POST***
********* THE RESPNSIBILITY LIES SOLELY UPON YOU***
***FLASHING IN CURRENT STATE DOES NOT BOOT INTO SYSTEM****
****READ EVERYTHING BEFORE YOU DO ANYTHING******
******ONLY POSTING THIS FOR DEV PURPOSES*******
******Huge THANKS to PizzaG for this!!!******
***Thanks to Eduardo as well for his contributions, he may still be working on his own release***
Am posting this with a copy/paste i posted in telegram group..
We need people with the knowledge/skills and experience to help get this TWRP finished AND/OR work out the bugs.
GitHub - PizzaG/recovery_device_oneplus_OP515AL1
Contribute to PizzaG/recovery_device_oneplus_OP515AL1 development by creating an account on GitHub.
github.com
*this is not ready for release but the source is here for anyone who can build upon it*
touch is not working
you cant fastboot boot on this device so DO NOT flash this to your device without a backup of your stock/current boot image
issues we are having is no touch, can't mount /data, and so far cant boot into system with the recovery installed so if you want to use it youll need to flash this to boot, use it for whatever and then flash stock boot back, if your magisk patched youll need to flash the backup of that patched boot image you made before flashing this in order to get back into your system....... i have sort of found a slight work around for having to keep flashing the boot partitions until someone can get this to boot by placing my current boot image on an sdcard along with the twrp, flash the twrp to the active boot partition, boot into twrp, install image and install your backed up boot image to the current slot, then go back to advanced and install twrp to ramdisk and select and install the twrp image to the ramdisk, if your magisk patched you need to flash magisk zip right now, you can adb shell into twrp to pull a copy of this boot image if you want and i have flashed my "twrp-ramdisk installed boot image" on the Slot that my system is on and stock/backup boot image to inactive slot because its the only way to boot back to system for now without reflashing the stock(backed up) boot image back to the slot. and reboot into bootloader, change active and reboot and your back into your system.... when you need twrp you can set active to the other slot, it will bootloop once into bootloader and choose recovery to get back to twrp... when done reboot to bootloader and set active back to the other slot and reboot into system.............otg mouse works, adb works, mtp works, some work has been done on the touch but thats still not working yet, everything seems to be mounting except data............. big shout out to PizzaG for this
***this is a very round-about way to get a currently buggy twrp on the device but if you have a usb-c adapter and mouse you can navigate twrp....***
PizzaG doesnt have the device and has spent more time than anyone could possibly ask someone to spend on this for free... I dont have the skills required yet to really work on this. I have tested as much as possible and here it is for those who can build and work on it. i dont recommend releasing in its current form because im sure alot of people will be complaining and bricking their devices. if you can build it im sure you can work on it and should have the skills to atleast recover and have the sense to make backups first.......
Thanks again to everyone who has already donated the valuable time working on this for us and to everyone who will follow and build upon this!
You can find the telegram group for our device here:
You can find the A-Team in telegram
Also FYI in case you missed the post about our kernel source, it can be found here:
GitHub - OnePlusOSS/android_kernel_msm-5.4_oneplus_sm6375 at oneplus/sm6375_r_12.0.1_oneplus_nord_n20_5g
Contribute to OnePlusOSS/android_kernel_msm-5.4_oneplus_sm6375 development by creating an account on GitHub.
github.com
If anyone with experience building twrp and especially for OnePlus devices needs a tester or any files from the device hit me up on telegram @PsYk0n4uT2 and I will do my best to provide whatever you need and test builds along with providing logs.
heres a compiled boot image from the above tree as of 10/02/2022.
**remeber it DOES NOT boot to system, this is twrp only, not installed into recovery ramdisk yet. so BACKUP YOUR STOCK(current) boot image FIRST**** you will have to flash your stock(current) boot image back to boot back into your system. you can sort of get around this by above mentioned method BUT here it is for the GN2200 anyways. working on my July patched device and my May patched device so it should work for other GN2200 sec patches too...
***BACKUP BACKUP BACKUP*****
also cant change active slot from twrp, must reboot to bootloader to change active slot
Heres TWRP installed to ramdisk on a july patched boot image. does not boot to system but since it doesnt you should still be able to use this on any patch for testing purposes.....
You can backup your boot image and flash your current boot image to inactive slot and flash this to active slot by selecting recovery from bootloader after it loops once.... use twrp then go back to bootloader and change active and reboot to get back into your system.
**BACKUP YOUR CURRENT BOOT IMAGE****
***DOES NOT BOOT TO SYSTEM**
***YOU WILL NEED YOUR CURRENT BOOT IMAGE TO BOOT YOUR SYSTEM< YOU SHOULD ALREADY HAVE A BACKUP OF YOUR STOCK IMAGE IN THE CASE THAT YOU ARE MAGISK PATCHED ALREADY< KEEP A COPY OF BOTH IN CASE YOU DECIDE TO WIPE DATA< YOU WILL NOT BOOT BACK INTO YOUR SYSTEM WITH A MAGISK PATCHED BOOT IMAGE IF YOU WIPE DATA*******
if someone can get their system to boot after installing the TWRP from post 4 or their own build after personal edits please post here how you were able to achieve the install and maintain booting into system..
currently twrp indicates that path to /mnt could not be found and cant mount /data .. i think if someone could fix this maybe some progress could be made
ScarletWizard said:
I wonder if TWRP will work for devices with a serial number defeicy
Click to expand...
Click to collapse
halfway working on mine, just isnt finished yet, we need someone who knows alot more about this than i do. another dev is working on twrp but needs a device. the serial wont affect anything else other than the oneplus care app and getting the unlock token..... other than that u have full functionality.... the one posted above needs ALOT of work to finish. no touch yet but it could work for SOME things....
I know C/C++ at a decent level, however; I don't have much experience with low level stuff (especially dealing with bootloaders and other specific proprietary android kernel stuff). If there is anything that needs testing, I am down for it since this is just a secondary phone for me and I won't be too upset if it explodes.
I'm going to attempt this
[ SOLUTION ] [ MTK ] to Fix Touch not Working on TWRP / Philz Due to Kernel Disabled Touch.
In this tutorial, i'm going to show how i managed to patch kernel to enable touch in recovery TWRP / Philz. WARNING : This worked fo...
factopea.blogspot.com
It's written for mtk device but might have similar enough instructions to port for qcom kernel,
But I believe this is what is needed to get the TWRP touch going
Is the trwp.fstab using the right version? Both have different
Code:
/dev/block/bootdevice/by-name/userdata /data f2fs noatime,nosuid,nodev,discard,inlinecrypt,reserve_root=32768,resgid=1065,fsync_mode=nobarrier latemount,wait,resize,check,formattable,fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized+wrappedkey_v0,keydirectory=/metadata/vold/metadata_encryption,metadata_encryption=aes-256-xts:wrappedkey_v0,quota,reservedsize=128M,checkpoint=fs
Try this instead in twrp.fstab
Code:
/data f2fs /dev/block/bootdevice/by-name/userdata flags=fileencryption=ice:aes-256-cts;wrappedkey;keydirectory=/metadata/vold/metadata_encryption
Techted89 said:
Is the trwp.fstab using the right version? Both have different
Code:
/dev/block/bootdevice/by-name/userdata /data f2fs noatime,nosuid,nodev,discard,inlinecrypt,reserve_root=32768,resgid=1065,fsync_mode=nobarrier latemount,wait,resize,check,formattable,fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized+wrappedkey_v0,keydirectory=/metadata/vold/metadata_encryption,metadata_encryption=aes-256-xts:wrappedkey_v0,quota,reservedsize=128M,checkpoint=fs
Try this instead in twrp.fstab
Code:
/data f2fs /dev/block/bootdevice/by-name/userdata flags=fileencryption=ice:aes-256-cts;wrappedkey;keydirectory=/metadata/vold/metadata_encryption
Click to expand...
Click to collapse
i just unpacked the twrp image with AIK and made the suggested edits and repacked, reflashed, same...... another person is working on twrp and has gotten much of the fstab corrected in their build but their keeping their source closed til they get it ready for release and is still very far from being finished with it and doesnt have much time to work on it right now so we are just kinda stuck waiting on someone that knows what their doing to help get this going. the other person has touch working on theirs so i know its possible i just dont know how long it will be before we see a beta even
Techted89 said:
Is the trwp.fstab using the right version? Both have different
Code:
/dev/block/bootdevice/by-name/userdata /data f2fs noatime,nosuid,nodev,discard,inlinecrypt,reserve_root=32768,resgid=1065,fsync_mode=nobarrier latemount,wait,resize,check,formattable,fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized+wrappedkey_v0,keydirectory=/metadata/vold/metadata_encryption,metadata_encryption=aes-256-xts:wrappedkey_v0,quota,reservedsize=128M,checkpoint=fs
Try this instead in twrp.fstab
Code:
/data f2fs /dev/block/bootdevice/by-name/userdata flags=fileencryption=ice:aes-256-cts;wrappedkey;keydirectory=/metadata/vold/metadata_encryption
Click to expand...
Click to collapse
also i see a recovery.fstab instead of twrp.fstab in /system/etc. is this what your referring to?
You need both from what iv read ,. TWRP.flags is a module that rewrites the stab at a certain point which may be the reason it's not compiling but I will post. Recovery.fstab is supposed to be a copy paste from the boot.img and gives the general mount partitions locations,. TWRP.fstab is mounted using the same partitions but different format/flag structure to be available to TWRP .
Techted89 said:
You need both from what iv read ,. TWRP.flags is a module that rewrites the stab at a certain point which may be the reason it's not compiling but I will post. Recovery.fstab is supposed to be a copy paste from the boot.img and gives the general mount partitions locations,. TWRP.fstab is mounted using the same partitions but different format/flag structure to be available to TWRP .
Click to expand...
Click to collapse
Interesting article above. Were you able to get that to work? I know it says MTK but seems like mechanism should be the same, or atleast I would assume anyways that the function would be very similar in the case of a flag. Was told you needed to use original kernel but then I couldn't get that to boot period. I'm out of my area of knowledge at this point but always willing to learn.
Also I tried messing around a little with the f stab and TWRP flags I was told that TWRP flags is pretty much the same as the twrp.fstab... also this build needs to have something added to the drivers I do believe that this is somehow related to USB touch it is a goodix gt9886 touch panel using the Samsung 9886 drivers. Maybe the init's need some help here as well.
I have the programming knowwledge that TWRP would require, but have not as of yet created one as my devices were typically readily complete before-hand. Once my device is back up, and running I am going to boot into Ubuntu and give it a go.
I need some excuse to have learned assembly x86, c, c++, Java, Python, and rust and have been eyeing learning scripting so it could be a fun side project assuming it is still incomplete as of the moment?
Is it normal for manufacturers to use components from other's in their builds? The kernel posted seemed to indicate at least a couple Samsung files included.
Well C is a guarantee possibly some C++ as well and definitely some sh scripting if you know rust and know how to attach it to C well enough that could add more possibilities I would imagine. The recovery is from my understanding in the boot image Android Image Kitchen would help you see it unmodified if that is the case.
I found a unofficial TWRP that flashes to the boot partition, and works pretty damn well, id have to say! I am not an experienced developer, I just like to flash around on my phone in my spare time.. Anyways here y'all go:
I am down while I got partitions backed up to the cloud.

Categories

Resources