FORUMS
Remove All Ads from XDA

[Guide] How to get rid of force encryption/dm-verity on Huawei MediaPad T3 10 (AGS-W0

105 posts
Thanks Meter: 51
 
By Thanostsak, Senior Member on 17th September 2018, 01:32 PM
Post Reply Email Thread
I was frustrated by the huawei encryption and decided to get rid of it once and for all.

At first I faced many bootloops but i finally figured out what was going on. Formatting user data through TWRP is not enough because after booting the device, encryption is still there. This happens because the kernel encrypts the device when booting up. Simply modifying the boot.img file to remove file encryption also doesn't work because you still boot into an already encrypted stock user data. So the answer was pretty obvious by now.
The trick is to format data using TWRP AND THEN boot to bootloader to flash a modified boot without encryption. So let's get to it.


How to create a modified boot.img without file encryption/dm-verity

1. Find and download your current firmware from Huawei Firmware Finder Dtabase (Team MT), or from a source that you trust. (Using a firmware with different cust version or a different update will most likely not work).
2. Download Huawei Update Extractor and use it to extract the stock boot.img file from UPDATE.APP
3. Download ASSAYYED_KITCHEN.
4. Place your stock boot.img file in the "WORK" folder of ASSAYYED_KITCHEN.
5. Launch ASSAYYED and select the 12th option (KERNEL/RECOVERY MENU) and then the 1st one (Unpacking Kernel).
6. The ASSAYYED options don't work for me so i did it manually. Go to your work folder and open the folder boot_unpacked\ramdisk.
7. You will see a file named "fstab.qcom", open it using WordPad.
8. Find the line:
Code:
/dev/block/bootdevice/by-name/userdata       /data        f2fs    nosuid,nodev,noatime,discard,inline_data,inline_xattr     wait,check,fileencryption
and delete ",fileencryption".It should now look like that:
Code:
/dev/block/bootdevice/by-name/userdata       /data        f2fs    nosuid,nodev,noatime,discard,inline_data,inline_xattr     wait,check
9. (This step is optional,follow it only if you also want dm-verity removed) Use the same method to remove dm-verity.
Code:
/dev/block/bootdevice/by-name/system    /system    ext4    ro,barrier=1    wait, verify
/dev/block/bootdevice/by-name/vendor    /vendor    ext4    ro,barrier=1    wait, verify
/dev/block/bootdevice/by-name/product   /product   ext4    ro,barrier=1    wait, verify
(Just delete the ",verify" part.)

10. Save the file.
11. Launch ASSAYYED and select the 12th option (KERNEL/RECOVERY MENU) and then the 2nd one (Packing Kernel).
12. Follow the instructions below to properly flash your modified boot.img and get rid of encryption.

Removing file encryption/dm-verity from the device

1. Unlock your device.
2. Flash this TWRP on AGS-W09 or the appropriate custom recovery for your device.
3. Boot to TWRP and FORMAT user data (note that it is very important to format data and not just wipe it). •WARNING• this will delete all your data!
4. Go back to the reboot menu of TWRP and select reboot booloader (it's important to not allow your device to boot into system yet).
5. Using fastboot, flash your modified boot.img that you created earlier.
6. Reboot your device (you might get a bootloop on the first boot but force rebooting your device again by holding the power button will fix that).
7. After booting up, your device should not be encrypted anymore.
8. You can now use the root method that you like to root your device and internal storage should be visible on TWRP. TWRP backup should also work normally.

How to fix Magisk modules not showing up on Magisk Manager (! /data/adb/magisk_merge.img mount failed error)
I am not going to get into the technical staff you can find more info here

Edit: As of Magisk 19.0, the following method becomes obsolete. Magisk modules should now work as expected without issues. This method now concerns those who want to stick to an older version of Magisk

1. Download f2fsfix-2018.9.2.zip provided by VR25 on the thread above.
2. Download all the magisk modules that you need to flash and place them on your device.
3. Download the latest Magisk uninstaller along with the latest installer.
4. Boot to TWRP and flash Magisk uninstaller. (If you don't have Magisk already installed, skip this step)
5. Wipe Davlik Cache.
6. Install the latest Magisk.
7. Wipe Davlik Cache.
8. Flash the "f2fsfix-2018.9.2.zip" immediately followed by your modules.
9. Reboot (it should take more than usual).
10. Open Magisk Manager and check your Modules. Hopefully they'll show as installed and function correctly.


Note: This method should also work on similar devices. Just make sure you know how to recover your device in case something goes wrong.
The Following 4 Users Say Thank You to Thanostsak For This Useful Post: [ View ] Gift Thanostsak Ad-Free
 
 
19th September 2018, 10:38 PM |#2  
TRS_80's Avatar
Member
Thanks Meter: 4
 
More
I can confirm this worked for me. I was able to run a full nandroid, but haven't tried to restore. Wasn't running any magisk modules, so haven't tried that part of the guide. Flashed Xposed in TRWP and installed greenify, etc Seems to be working. So far no errors. Be warned, this is like a restore. You'll be starting from scratch again.

Also thanks for the boot image trick Thanostsak. I couldn't find stock fimware for my version (AGS-L03) anywhere. He suggested to use the Magisk's boot image backup. Worked like a charm. Still looking for AGS-L03 stock if anyone has one, knows where to get one please post!
The Following User Says Thank You to TRS_80 For This Useful Post: [ View ] Gift TRS_80 Ad-Free
19th September 2018, 10:53 PM |#3  
Thanostsak's Avatar
OP Senior Member
Thanks Meter: 51
 
More
Quote:
Originally Posted by TRS_80

I can confirm this worked for me. I was able to run a full nandroid, but haven't tried to restore. Wasn't running any magisk modules, so haven't tried that part of the guide. Flashed Xposed in TRWP and installed greenify, etc Seems to be working. So far no errors. Be warned, this is like a restore. You'll be starting from scratch again.

Also thanks for the boot image trick Thanostsak. I couldn't find stock fimware for my version (AGS-L03) anywhere. He suggested to use the Magisk's boot image backup. Worked like a charm. Still looking for AGS-L03 stock if anyone has one, knows where to get one please post!

Glad it worked for you. Yes this is the downside. The device already comes with an encrypted userdata, so it needs to be formatted. So anything you do before that becomes obsolete. That's why this procedure is much more convenient when it happens after the unlock,when the userdata is wiped by the stock recovery to get a stock condition.
The Following User Says Thank You to Thanostsak For This Useful Post: [ View ] Gift Thanostsak Ad-Free
13th November 2018, 07:37 PM |#4  
Member
Flag sueZ-Zeus__assouaN-Naoussa__saiD-Dias
Thanks Meter: 44
 
More
AGS-L09 LTE
I just followed your detailed guide to my tablet and finished all the processes perfectly.
Working..Twrp, Magisk, removed encryption & verify from boot.img and from Data successfully.
A big THANKS for your guide, links and trick all in one post!!!!.
The Following User Says Thank You to spkprs For This Useful Post: [ View ] Gift spkprs Ad-Free
6th December 2018, 04:25 PM |#5  
Junior Member
Thanks Meter: 0
 
More
Thanks for the info.

I am new to android (but have jailbroken iOS for years).
I have received a Huawei MediaPad T3 AGS-W09 (AGS-W09C100B278) today.
I have managed to unlock and install TWRP 3.2.1 but also want to install SuperSU, but of course the filesystem is encrypted, which brings me here.

I have searched all over for Huawei MediaPad T3 AGS-W09 (AGS-W09C100B278) firmware which contains boot.img but cannot find it. Even the rom on the AGS-W09 thread on this forum doesnt contain the .img file. Am I missing something ?

Any help is appreciated.

Thanks again
6th December 2018, 07:20 PM |#6  
Thanostsak's Avatar
OP Senior Member
Thanks Meter: 51
 
More
Quote:
Originally Posted by mr_fingy

Thanks for the info.

I am new to android (but have jailbroken iOS for years).
I have received a Huawei MediaPad T3 AGS-W09 (AGS-W09C100B278) today.
I have managed to unlock and install TWRP 3.2.1 but also want to install SuperSU, but of course the filesystem is encrypted, which brings me here.

I have searched all over for Huawei MediaPad T3 AGS-W09 (AGS-W09C100B278) firmware which contains boot.img but cannot find it. Even the rom on the AGS-W09 thread on this forum doesnt contain the .img file. Am I missing something ?

Any help is appreciated.

Thanks again

I strongly suggest using Magisk to root your device instead of SuperSU. The good thing about Magisk is that everything happens systemlessly, so it doesn't matter if the kernel is encrypted in order of it to work. If you still want to use SuperSU though, my guide should provide all the info you need.
To answer your question you can find two OTA firmware updates for your device here. If that doesn't work (if the OTA updates don't include the boot.img file ) i will let you know how to use magisk to get a copy of your current boot.img
The Following User Says Thank You to Thanostsak For This Useful Post: [ View ] Gift Thanostsak Ad-Free
6th December 2018, 07:44 PM |#7  
Junior Member
Thanks Meter: 0
 
More
Quote:
Originally Posted by Thanostsak

I strongly suggest using Magisk to root your device instead of SuperSU. The good thing about Magisk is that everything happens systemlessly, so it doesn't matter if the kernel is encrypted in order of it to work. If you still want to use SuperSU though, my guide should provide all the info you need.
To answer your question you can find two OTA firmware updates for your device . If that doesn't work (if the OTA updates don't include the boot.img file ) i will let you know how to use magisk to get a copy of your current boot.img

Thanks for the info.
I have been looking down the Magisk avenue too.
My plan is, decrypt is then root it.

I did download those firmware files earlier but as you say, no .img files.

I have tried to follow a guide on youtube from rootjunky but got as far as running the info gathering piece to gather mount points, but it fell over. Don;t know if thats because I was using adb sideloading via TWRP .. ?
I attempted to run the commands from the batch file direct but no joy.

It would be really appreciated if you could point me to a guide to extract the img. It's my day 1 of this device and Android (already voided warranty from Amazon within 1 hour ha) but as I say, I have experience in most of what is needed from my iOS jailbreaking and bringing phones back from bootloops and the brink of bricks.

When you mention rooting with Magisk .. Can that be achieved in the state my device is in now, which is TWRP'd but encrypted ?

I also notice the "Ultimate Backup Tool, No Root Required" thread (cant put URL's yet as I'm a n00b member). Could that export my boot.img ?

I am done for today. I am working from home and it the device got delivered at 9:30 ish. I was hacking around with it all day and did about 20 min work. I'm fried now :-O

Thanks again
6th December 2018, 08:05 PM |#8  
Thanostsak's Avatar
OP Senior Member
Thanks Meter: 51
 
More
Quote:
Originally Posted by mr_fingy

Thanks for the info.
I have been looking down the Magisk avenue too.
My plan is, decrypt is then root it.

I did download those firmware files earlier but as you say, no .img files.

I have tried to follow a guide on youtube from rootjunky but got as far as running the info gathering piece to gather mount points, but it fell over. Don;t know if thats because I was using adb sideloading via TWRP .. ?
I attempted to run the commands from the batch file direct but no joy.

It would be really appreciated if you could point me to a guide to extract the img. It's my day 1 of this device and Android (already voided warranty from Amazon within 1 hour ha) but as I say, I have experience in most of what is needed from my iOS jailbreaking and bringing phones back from bootloops and the brink of bricks.

When you mention rooting with Magisk .. Can that be achieved in the state my device is in now, which is TWRP'd but encrypted ?

I also notice the "Ultimate Backup Tool, No Root Required" thread (cant put URL's yet as I'm a n00b member). Could that export my boot.img ?

I am done for today. I am working from home and it the device got delivered at 9:30 ish. I was hacking around with it all day and did about 20 min work. I'm fried now :-O

Thanks again

I get what you are saying. Going from iOS to android is a big step. Since the firmware files don't contain the boot.img and having in mind that you want to decrypt, getting a boot.img file is a must.
There are ways to get the boot.img without root but the ones i tried don't work. But there is an easy way that i know of that requires installing Magisk. When you flash Magisk from TWRP it roots your device. However, apart from rooting it also creates a backup of your boot.img in case something goes wrong.
Decrypting requires formatting your device, so Magisk will be removed too. So its only purpose for now is to provide you with a boot.img file.

Here is what you need to do
1. Download the latest magisk installer from the magisk threat
2. Save the file in your SD card (internal storage is encrypted)
3. Flash the Magisk installer from TWRP
4. Boot your device and navigate to /data
5. There should be a stock boot_xxx.img.gs file in there. Copy it to your storage, move it to a computer and extract it. You should get a boot.img file that you could use to decrypt.
6. Follow my guide to decrypt the boot.img and then flash it from bootloader
7. Since your device is now formatted from the decryption, you can choose the root method that you like.
6th December 2018, 11:04 PM |#9  
Junior Member
Thanks Meter: 0
 
More
Quote:
Originally Posted by Thanostsak

I get what you are saying. Going from iOS to android is a big step. Since the firmware files don't contain the boot.img and having in mind that you want to decrypt, getting a boot.img file is a must.
There are ways to get the boot.img without root but the ones i tried don't work. But there is an easy way that i know of that requires installing Magisk. When you flash Magisk from TWRP it roots your device. However, apart from rooting it also creates a backup of your boot.img in case something goes wrong.
Decrypting requires formatting your device, so Magisk will be removed too. So its only purpose for now is to provide you with a boot.img file.

Here is what you need to do
1. Download the latest magisk installer from the magisk threat
2. Save the file in your SD card (internal storage is encrypted)
3. Flash the Magisk installer from TWRP
4. Boot your device and navigate to /data
5. There should be a stock boot_xxx.img.gs file in there. Copy it to your storage, move it to a computer and extract it. You should get a boot.img file that you could use to decrypt.
6. Follow my guide to decrypt the boot.img and then flash it from bootloader
7. Since your device is now formatted from the decryption, you can choose the root method that you like.


Makes total sense. I just installed Magisk now from SD, thing is, the only spare SD I had was 128MB !! So I dont know if the .img was saved correctly. I will look into it tomorrow. My other large SD is corrupted but I have a 32GB one in the dashcam I will use tomorrow.

That leads me to a question. Is the auto created .img saved on the card or the internal storage ? I am assuming its card but I could not see it.

Will look more tomorrow.

Thanks
6th December 2018, 11:18 PM |#10  
Thanostsak's Avatar
OP Senior Member
Thanks Meter: 51
 
More
Quote:
Originally Posted by mr_fingy

Makes total sense. I just installed Magisk now from SD, thing is, the only spare SD I had was 128MB !! So I dont know if the .img was saved correctly. I will look into it tomorrow. My other large SD is corrupted but I have a 32GB one in the dashcam I will use tomorrow.

That leads me to a question. Is the auto created .img saved on the card or the internal storage ? I am assuming its card but I could not see it.

Will look more tomorrow.

Thanks

It is actually on the internal storage. Now that you are rooted you can use a root file explorer to get it. (128mb should be enough for this task)
7th December 2018, 09:20 AM |#11  
Junior Member
Thanks Meter: 0
 
More
Quote:
Originally Posted by Thanostsak

It is actually on the internal storage. Now that you are rooted you can use a root file explorer to get it. (128mb should be enough for this task)

On it now before work
Extracted stock_boot_(IDremoved).img.gz which contains the img
Will run your guide against this img

---------- Post added at 09:20 AM ---------- Previous post was at 08:33 AM ----------

All done. Nice and easy
No issues other than sweaty palms on Huawei long boot screen after flash
No reboot loop and no Magisk errors

Much appreciated for the help
Post Reply Subscribe to Thread

Tags
dm-verity, encryption, huawei, magisk_merge.img mount failed, mediapad

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes