Official twrp app and TWRP backup - Huawei Mate 9 Questions & Answers

TWRP official app when searching for device doesn't have my device listed and TWRP manager can't detect Twrp does anyone know why this might be?
Also I'm having trouble backing up using twrp it fails with the error code 255? I've tried to unmount data change the time but still fails.

TWRP is not officially released for Mate 9, it's unofficial build/s.
And that error just mean you're encrypted, like Mate 9 is by default.
To remove encryption you'll have to Format - Format Data (This wipes everything including internal sdcard), after this you will have to flash SuperSU 2.82 SR3+, Magisk v14 (14.3+ doesn't remove encryption flag so it won't work without modifying Magisk source) or modify your boot image manually.
And then download and flash Public + HW zip for your firmware from http://pro-teammt.ru/firmware-database/

Related

TWRP always says 'permission denied' & filenames are completely different

Hi,
I have a Mate 9 , Build No. MHA-L09C432B182
Baseband is 21.516.00.00.010
Kernel: 4.1.18-g0ad0fb3
I unlocked bootloader, it is defenetely unlocked. I am able to install TWRP.
I installed twrp-3.0.2 and also twrp-3.1.0 versions but have same problems in both versions:
filenames/folder names in /sdcard (internal storage) are broken, I mean their original names are gone, all files and folders are named like imbj9yf1fATc4Tvm5zt+ and so on instead of Screenshots for example.
So I cannot find my supersu.zip but however I think it would not install, because of this error:
Also I cannot run a TWRP backup, it shows:
Backup started
Backup Folder /data/media/0/TWRP/Backups/UGM2171100001069/2017-07-21-13-11-39_NRD90M...
Can not create '/data/media/0/TWRP' folder (Permission denied)
Failed to make backup folder
I tried to CHMOD 755 this folder/path, did not work/help
Can anybody help me here?
Thx and best!
/data is encrypted by default using file based encryption. That's why you see those files in /sdcard (/data/media/0/). You can remove encryption by using Wipe - 'Format Data' button.
This will remove everything in /data including your files in /sdcard.
To flash stuff you can use an external SD card or remove encryption or flash this twrp: https://mega.nz/#!xg9hWbpJ!dNOWJVUuD_4JL8N8PiDXYsj3SnvaOfKxBndvWc_4wgo
and adb push (adb push file.zip /cache/file.zip) to /cache and flash from there. /cache is added as storage with that twrp.
If you want to remove encryption, flash official SuperSU 2.82 SR1: https://forum.xda-developers.com/apps/supersu/2014-09-02-supersu-v2-05-t2868133
Or Magisk 13.3: https://forum.xda-developers.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445
Both require at least twrp 3.1.0.
If you chose to remove encryption you will also have to flash public and HW zips after Format Data, because files in /data/hw_init are removed which are needed for themes to work and 'System Update' and a few Huawei apps.
Public zip for L09C432B182:
http://update.hicloud.com:8180/TDS/...55/f1/full/public/update_data_full_public.zip
Hw zip for L09C432B182: http://update.hicloud.com:8180/TDS/...04/v84355/f1/full/hw/eu/update_full_hw_eu.zip
Flash public first then hw. Both will give errors but install fine.
If you don't want to remove encryption you won't be able to backup /data.
If so use this SuperSU: https://mega.nz/#!18FW1QTQ!3DCA3KrIUSRqEu4L-expci4HcKtk6F25fE1u6ecJV9Q
Or magisk 13.3: https://mega.nz/#!I4FQzbyA!gBZelHmD3lGGwzGISUXkf7GQTUAq5i785d_qPHQOaVE
thanks for all your info.
Can you suggest what to do? Acutually I just want to install root to get titanium to work because I have older backups I want to look into to. After that I want to unroot again.
Not sure if i need encryption or if ishould decrypt now
Whats the best way for me now?
ante0 said:
/data is encrypted by default using file based encryption. That's why you see those files in /sdcard (/data/media/0/). You can remove encryption by using Wipe - 'Format Data' button.
This will remove everything in /data including your files in /sdcard.
To flash stuff you can use an external SD card or remove encryption or flash this twrp: https://mega.nz/#!xg9hWbpJ!dNOWJVUuD_4JL8N8PiDXYsj3SnvaOfKxBndvWc_4wgo
and adb push (adb push file.zip /cache/file.zip) to /cache and flash from there. /cache is added as storage with that twrp.
If you want to remove encryption, flash official SuperSU 2.82 SR1: https://forum.xda-developers.com/apps/supersu/2014-09-02-supersu-v2-05-t2868133
Or Magisk 13.3: https://forum.xda-developers.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445
Both require at least twrp 3.1.0.
If you chose to remove encryption you will also have to flash public and HW zips after Format Data, because files in /data/hw_init are removed which are needed for themes to work and 'System Update' and a few Huawei apps.
Public zip for L09C432B182:
http://update.hicloud.com:8180/TDS/...55/f1/full/public/update_data_full_public.zip
Hw zip for L09C432B182: http://update.hicloud.com:8180/TDS/...04/v84355/f1/full/hw/eu/update_full_hw_eu.zip
Flash public first then hw. Both will give errors but install fine.
If you don't want to remove encryption you won't be able to backup /data.
If so use this SuperSU: https://mega.nz/#!18FW1QTQ!3DCA3KrIUSRqEu4L-expci4HcKtk6F25fE1u6ecJV9Q
Or magisk 13.3: https://mega.nz/#!I4FQzbyA!gBZelHmD3lGGwzGISUXkf7GQTUAq5i785d_qPHQOaVE
Click to expand...
Click to collapse
thanks for all your info.
Can you suggest what to do? Acutually I just want to install root to get titanium to work because I have older backups I want to look into to. After that I want to unroot again.
Not sure if i need encryption or if ishould decrypt now
Whats the best way for me now?
tobyffm said:
thanks for all your info.
Can you suggest what to do? Acutually I just want to install root to get titanium to work because I have older backups I want to look into to. After that I want to unroot again.
Not sure if i need encryption or if ishould decrypt now
Whats the best way for me now?
Click to expand...
Click to collapse
Then don't bother with decryption.
So you basically just have to place the root of your choice (of the mega ones I linked, because the official ones will remove encryption in your boot image and you will boot loop if you flash the official ones) on an external SD or transfer to /cache with adb after flashing the linked twrp. Then flash root and you're good to go.
I think you can sideload root zip, I haven't tried it. But that's another possibility if you don't have an external SD.
ante0 said:
Then don't bother with decryption.
So you basically just have to place the root of your choice (of the mega ones I linked, because the official ones will remove encryption in your boot image and you will boot loop if you flash the official ones) on an external SD or transfer to /cache with adb after flashing the linked twrp. Then flash root and you're good to go.
I think you can sideload root zip, I haven't tried it. But that's another possibility if you don't have an external SD.
Click to expand...
Click to collapse
Yes, it worked, i flashed supersu and got root acccess now, thx very much.
About unrooting later on, i understand I need to download the full stock rom, create a dload folder and copy update.app into it and reboot phone to download mode. It then will install stock rom and stock recovery, correct?
Will this erase internal storage again same like when unlocking bootloader?
thx!
tobyffm said:
Yes, it worked, i flashed supersu and got root acccess now, thx very much.
About unrooting later on, i understand I need to download the full stock rom, create a dload folder and copy update.app into it and reboot phone to download mode. It then will install stock rom and stock recovery, correct?
Will this erase internal storage again same like when unlocking bootloader?
thx!
Click to expand...
Click to collapse
No need (dload doesn't work anyway, except for AL00C00B115 and L29C636B136). You can uninstall using the SuperSU app or manually by removing /data/SuperSU.apk and restoring stock boot image. Boot image can be extracted from update.app for your model using Huawei Update extractor. Same goes for recovery. If you want to lock bootloader you have to install an update/same build number, you could use Firmware Finder for that or this tool: https://forum.xda-developers.com/mate-9/how-to/guide-mate-9-flash-update-package-t3593108
In my experience it will not remove apps, but data seems to go poof (as in app settings and data). Unlocking bootloader again will remove apps though as it does a factory reset.
ante0 said:
/data is encrypted by default using file based encryption. That's why you see those files in /sdcard (/data/media/0/). You can remove encryption by using Wipe - 'Format Data' button.
This will remove everything in /data including your files in /sdcard.
To flash stuff you can use an external SD card or remove encryption or flash this twrp: https://mega.nz/#!xg9hWbpJ!dNOWJVUuD_4JL8N8PiDXYsj3SnvaOfKxBndvWc_4wgo
and adb push (adb push file.zip /cache/file.zip) to /cache and flash from there. /cache is added as storage with that twrp.
If you want to remove encryption, flash official SuperSU 2.82 SR1: https://forum.xda-developers.com/apps/supersu/2014-09-02-supersu-v2-05-t2868133
Or Magisk 13.3: https://forum.xda-developers.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445
Both require at least twrp 3.1.0.
If you chose to remove encryption you will also have to flash public and HW zips after Format Data, because files in /data/hw_init are removed which are needed for themes to work and 'System Update' and a few Huawei apps.
Public zip for L09C432B182:
http://update.hicloud.com:8180/TDS/...55/f1/full/public/update_data_full_public.zip
Hw zip for L09C432B182: http://update.hicloud.com:8180/TDS/...04/v84355/f1/full/hw/eu/update_full_hw_eu.zip
Flash public first then hw. Both will give errors but install fine.
If you don't want to remove encryption you won't be able to backup /data.
If so use this SuperSU: https://mega.nz/#!18FW1QTQ!3DCA3KrIUSRqEu4L-expci4HcKtk6F25fE1u6ecJV9Q
Or magisk 13.3: https://mega.nz/#!I4FQzbyA!gBZelHmD3lGGwzGISUXkf7GQTUAq5i785d_qPHQOaVE
Click to expand...
Click to collapse
hi,
thx for your last reply!
I am still on root status. I needed to decrypt now, thus I selected format data.
After that, files and folders are named correctly and I am able to create a backup.
I flashed public ziip, the other one was corrupt, mayve because of failed download, however as I understand it is not the reason why it always goes back to encryption, isn't it?
But: Once I reboot to Android and go back to recovery it is encrypted again?
My current problem is: I need to move a TWRP backup to internal storage and run TWRP restore feature from recovery, but it is encrypted. Once I format data it is decrypted but internal storage empty again. So I reboot to Android (because mounting from within TWRP does not work )and put TWRP backup folder to internsal storage, but then I go back to recovery and see it is encrypted again :S like driving in a circle ...
And I cannot put backup folder to external micro sd as it is too large for my small micro sd I have.
Do I need to flash a decrypted bootimage? If yes, which one?
Can you help me on this maybe?
tobyffm said:
hi,
thx for your last reply!
I am still on root status. I needed to decrypt now, thus I selected format data.
After that, files and folders are named correctly and I am able to create a backup.
I flashed public ziip, the other one was corrupt, mayve because of failed download, however as I understand it is not the reason why it always goes back to encryption, isn't it?
But: Once I reboot to Android and go back to recovery it is encrypted again?
My current problem is: I need to move a TWRP backup to internal storage and run TWRP restore feature from recovery, but it is encrypted. Once I format data it is decrypted but internal storage empty again. So I reboot to Android (because mounting from within TWRP does not work )and put TWRP backup folder to internsal storage, but then I go back to recovery and see it is encrypted again :S like driving in a circle ...
And I cannot put backup folder to external micro sd as it is too large for my small micro sd I have.
Do I need to flash a decrypted bootimage? If yes, which one?
Can you help me on this maybe?
Click to expand...
Click to collapse
'Format Data', flash official Magisk 13.3 or SuperSU 2.82 SR1 (mine from mega doesn't remove encryption), flash public zip, flash HW zip. It should now stay decrypted. You might have to go back to TWRP start screen after Format, then select 'Reboot' - 'Reboot Recovery' if it doesn't want to mount /data after Format.
Rebooting to system after formatting but not flashing magisk or supersu will encrypt again.
I can make a decrypted boot image if it doesn't want to stay decrypted.
ante0 said:
'Format Data', flash official Magisk 13.3 or SuperSU 2.82 SR1 (mine from mega doesn't remove encryption), flash public zip, flash HW zip. It should now stay decrypted. You might have to go back to TWRP start screen after Format, then select 'Reboot' - 'Reboot Recovery' if it doesn't want to mount /data after Format.
Rebooting to system after formatting but not flashing magisk or supersu will encrypt again.
I can make a decrypted boot image if it doesn't want to stay decrypted.
Click to expand...
Click to collapse
ok thx.
I redownloaded HW zip and checked md5 sum with the file from first attempt, same md5. However this is what i did:
Format data, tried to flash Magisk, but did not work, there was an error, this is why I flashed SuperSU 2.82 SR1 which worked with no errors. I flashed public zip right away, after that I flashed HW zip, but again, it did not work there were errors. However, encryption seems to be gone anyway. and yes, it keeps being decrypted.
I managed to get TWRP seeing an old TWRP Backup, which I pushed onto internal storage. I started restore of /data/ of that TWRP backup because I want to get the WhatsApp incl. data from data backup.
I booted up to Android and now I am faced with the next fuc*in problem: lock pattern of Dec 16. I cant remember and after few attemps devices is locked for 10 minutes, then for another 30 minutes ...
After google research it should be able to use Android device manager from a browser and to lock device and set a new pin/password to unlock the device. It is communicating as I can let the phone ring with no problem, but all how_tos show me this screen in android device manager interface
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Of course it is me, who dont get this mask to set a new pin/password ( (
I only can enter an optional phone no and message from browser
Any idea what to do?
Update: I extracted whatsapp from backup with nandroid manager app but it did not restore my data correctly, best way would be to get done the pattern problem when restopring the twrp backup
redaring locking bootloader again:
I went to your link https://forum.xda-developers.com/mate-9/how-to/guide-mate-9-flash-update-package-t3593108
they say to download file for own device here: http://hwmt.ru/hwmtsite/firmware-database/?firmware_model=
I only find:
DUK-L09C432B182
But mine is MHA-L09C432B182, can I go forward with DUK-L09C432B182 anyway? Actually I dont understand what to do, their description is curios.
tobyffm said:
ok thx.
I redownloaded HW zip and checked md5 sum with the file from first attempt, same md5. However this is what i did:
Format data, tried to flash Magisk, but did not work, there was an error, this is why I flashed SuperSU 2.82 SR1 which worked with no errors. I flashed public zip right away, after that I flashed HW zip, but again, it did not work there were errors. However, encryption seems to be gone anyway. and yes, it keeps being decrypted.
I managed to get TWRP seeing an old TWRP Backup, which I pushed onto internal storage. I started restore of /data/ of that TWRP backup because I want to get the WhatsApp incl. data from data backup.
I booted up to Android and now I am faced with the next fuc*in problem: lock pattern of Dec 16. I cant remember and after few attemps devices is locked for 10 minutes, then for another 30 minutes ...
After google research it should be able to use Android device manager from a browser and to lock device and set a new pin/password to unlock the device. It is communicating as I can let the phone ring with no problem, but all how_tos show me this screen in android device manager interface
Of course it is me, who dont get this mask to set a new pin/password ( (
I only can enter an optional phone no and message from browser
Any idea what to do?
Update: I extracted whatsapp from backup with nandroid manager app but it did not restore my data correctly, best way would be to get done the pattern problem when restopring the twrp backup
redaring locking bootloader again:
I went to your link https://forum.xda-developers.com/mate-9/how-to/guide-mate-9-flash-update-package-t3593108
they say to download file for own device here: http://hwmt.ru/hwmtsite/firmware-database/?firmware_model=
I only find:
DUK-L09C432B182
But mine is MHA-L09C432B182, can I go forward with DUK-L09C432B182 anyway? Actually I dont understand what to do, their description is curios.
Click to expand...
Click to collapse
L09C432B156 firmware: http://update.hicloud.com:8180/TDS/data/files/p3/s15/G1366/g104/v84355/f1/full/update.zip
L09C432B182 public data zip:
http://update.hicloud.com:8180/TDS/...55/f1/full/public/update_data_full_public.zip
L09C432B182 hw data zip:
http://update.hicloud.com:8180/TDS/...04/v84355/f1/full/hw/eu/update_full_hw_eu.zip
You might as well update to B190 while you're at it..
L09C432B190: http://update.hicloud.com:8180/TDS/data/files/p3/s15/G1366/g104/v89786/f1/full/update.zip
L09C432B190 public data zip:
http://update.hicloud.com:8180/TDS/...86/f1/full/public/update_data_full_public.zip
L09C432B190 hw data zip: http://update.hicloud.com:8180/TDS/...l/MHA-L09_hw_eu/update_full_MHA-L09_hw_eu.zip
Rename public data zip to update_data_public.zip.
Rename hw data zip to update_all_hw.zip
ok, to summarize:
1) I download these 3 files:
full update.zip:
L09C432B190: http://update.hicloud.com:8180/TDS/d...ull/update.zip
L09C432B190 public data zip:
http://update.hiclod.com:8180/TDS/d...ull_public.zip
L09C432B190 hw data zip:
http://update.hicloud.com:8180/TDS/d...-L09_hw_eu.zip
2) I extract recovery img file from update zip
3) I uninstall root from within super su app.
4) I rename zip files and flash public zip as well as hw zip from within twrp recovery
5) i put extraced recovery img to device by using "fastboot flash recovery "
Will it work like this? Or do I need to flash public and hw first and after that uninstall root from supersu?
and then in the end "fastboot oem lock" ? to get the bootloader locked and to switch off the boot message "your device cant be trusted" ?
and: I couldnt flash hw zip before as it ended up with errrors, is this why I dont have Search for updates in EMUI 5.0 anymore?
tobyffm said:
ok, to summarize:
1) I download these 3 files:
full update.zip:
L09C432B190: http://update.hicloud.com:8180/TDS/d...ull/update.zip
L09C432B190 public data zip:
http://update.hiclod.com:8180/TDS/d...ull_public.zip
L09C432B190 hw data zip:
http://update.hicloud.com:8180/TDS/d...-L09_hw_eu.zip
2) I extract recovery img file from update zip
3) I uninstall root from within super su app.
4) I rename zip files and flash public zip as well as hw zip from within twrp recovery
5) i put extraced recovery img to device by using "fastboot flash recovery "
Will it work like this? Or do I need to flash public and hw first and after that uninstall root from supersu?
and then in the end "fastboot oem lock" ? to get the bootloader locked and to switch off the boot message "your device cant be trusted" ?
and: I couldnt flash hw zip before as it ended up with errrors, is this why I dont have Search for updates in EMUI 5.0 anymore?
Click to expand...
Click to collapse
No. Follow the guide you linked, that's where you use those files.
https://forum.xda-developers.com/mate-9/how-to/guide-mate-9-flash-update-package-t3593108
You could relock but it will say Bootloader Relocked instead of Bootloader Lock.
And if you don't plan on updating to B190 using the guide I suggest you download public and HW Data for B182 and flash those in twrp.
Can cause problems otherwise.
Flash public first. They will give errors because you're not supposed to flash them in twrp, they're official Huawei zips that are flashed using stock recovery.
ante0 said:
No. Follow the guide you linked, that's where you use those files.
https://forum.xda-developers.com/mate-9/how-to/guide-mate-9-flash-update-package-t3593108
You could relock but it will say Bootloader Relocked instead of Bootloader Lock.
And if you don't plan on updating to B190 using the guide I suggest you download public and HW Data for B182 and flash those in twrp.
Can cause problems otherwise.
Flash public first. They will give errors because you're not supposed to flash them in twrp, they're official Huawei zips that are flashed using stock recovery.
Click to expand...
Click to collapse
OK and why i currently dont see menue point "search for updates" in EMUI 5.0 ? Maybe i will stay rooted as I see that xposed has now been released.
But I want to receive official OTAs anyway, but currently the full menue point for searching for updates is gone. Any idea?
tobyffm said:
OK and why i currently dont see menue point "search for updates" in EMUI 5.0 ? Maybe i will stay rooted as I see that xposed has now been released.
But I want to receive official OTAs anyway, but currently the full menue point for searching for updates is gone. Any idea?
Click to expand...
Click to collapse
Did you flash back public and HW Data for B182?
ante0 said:
Did you flash back public and HW Data for B182?
Click to expand...
Click to collapse
I was not sure which was the last I flashed during last days, B182 or B190.
However, just redownload B182 files and flashed, first public, then hw zip.
Rebooted device, "search for updates" is available again, thank you very much
But it says B182 is latest update, so OTA not available for me so far yet. How can I manually flash to latest version B190 without loosing 'Search for Update' section?
tobyffm said:
I was not sure which was the last I flashed during last days, B182 or B190.
However, just redownload B182 files and flashed, first public, then hw zip.
Rebooted device, "search for updates" is available again, thank you very much
But it says B182 is latest update, so OTA not available for me so far yet. How can I manually flash to latest version B190 without loosing 'Search for Update' section?
Click to expand...
Click to collapse
You can with that guide i linked a couple of posts back. You can't flash update.zip in twrp, you have to use that guide to flash it. It's pretty straightforward. Download HWOTA BASE, HWOTA WINDOWS and HWOTA MHA (Mate 9), extract all to the same folder (C:\hwota is a good location). Download the files for B190 i linked a couple of posts back. Rename public data zip to update_data_public.zip.
Rename hw data zip to update_all_hw.zip, place them and update.zip in the update folder, run bat (if windows) or sh (Linux) then do what the prompts say. When it asks pick same brand update, then script update folder. It will transfer files for you. Bootloader will be locked when you're done.
ante0 said:
You can with that guide i linked a couple of posts back. You can't flash update.zip in twrp, you have to use that guide to flash it. It's pretty straightforward. Download HWOTA BASE, HWOTA WINDOWS and HWOTA MHA (Mate 9), extract all to the same folder (C:\hwota is a good location). Download the files for B190 i linked a couple of posts back. Rename public data zip to update_data_public.zip.
Rename hw data zip to update_all_hw.zip, place them and update.zip in the update folder, run bat (if windows) or sh (Linux) then do what the prompts say. When it asks pick same brand update, then script update folder. It will transfer files for you. Bootloader will be locked when you're done.
Click to expand...
Click to collapse
Did like described, when it comes to "update should install automatically" it reboots into erecovery, but Software install failed!
The update package does not exists please download the package again
But all 3 files are within the script folder and named correctly i think, pls see my attached screenshot
tobyffm said:
Did like described, when it comes to "update should install automatically" it reboots into erecovery, but Software install failed!
The update package does not exists please download the package again
But all 3 files are within the script folder and named correctly i think, pls see my attached screenshot
Click to expand...
Click to collapse
Are they in the update folder? I think I see the update.bat file there.
Put them in the update folder (for example c:\hwota\update\)
ante0 said:
Are they in the update folder? I think I see the update.bat file there.
Put them in the update folder (for example c:\hwota\update\)
Click to expand...
Click to collapse
yes, that was my fault.
Put to update folder and run again, update was running and finished with 100%. phone rebooted loaded very long. Now android is broken. I see my background image, but cannot do anything it is like hanging hanging hanging, everyhting very slow, like it is loading much of information. rebooted phone and waited some more time. seems now it is working and I am on B190. Now, i have to unlock bootloader again and install supersu again =)
thx for your help so far.
btw: u dont have any solution for my previous posted problem with my twrp backup, dont you? restoring twrp backup ends up in lock screen with pattern which I cant remember. Android Device Manager from PC browser can communictae with the phone but it does not offer me to set a new pin. Do you have any other method in mind how I can go on?

[Solved] Any Possible way to have Magisk and any kind of data encryption in S7?

Hi,
I been searching for a way to encrypt the data partition with magisk and i didn't succeded at all. No matter if flash magisk in an already encrypted system (it says "using cache walkaround" but it gets stuck in the glowing samsung boot logo) or if i try to encrypt the terminal after having a magisk working system. I even tried to mark in magisk "Keep Forced Encryption" in MagiskManager with no success. It makes the system hang again in the boot secuence after reflashing magisk and rebooting.
I just want root in the stock firmware to be able to debloat and use titanium and a couple of apps.
Any way to have encrypted data and root in nougat?
Yes.
There are two requirements to support rooted stock firmware and encryption:
- You MUST use the stock kernel binary. Custom kernel binaries are blocked by TIMA, which handles encryption.
- You need to change "ro.config.tima" in the system build.prop to 0. This doesn't entirely disable TIMA, but seems to relax the encryption requirements a bit(less salting?) which will allow a modified ramdisk to work properly. It's slightly less secure, but still more secure than going unencrypted
Notes: You will need to wipe /data initially after making the build.prop change. You'll need to disable dm-verity after modifying /system. If you installed a custom kernel before you should reflash the entire firmware as the kernel installer likely deleted the TIMA trustlet binary. Some success was had before with getting custom kernels past TIMA by killing the TIMA service soon after boot, but this had the tendency to brick the data partition. Perhaps in future...
Edit: attached a flashable zip to make the build.prop change from TWRP
CurtisMJ said:
Yes.
There are two requirements to support rooted stock firmware and encryption:
- You MUST use the stock kernel binary. Custom kernel binaries are blocked by TIMA, which handles encryption.
- You need to change "ro.config.tima" in the system build.prop to 0. This doesn't entirely disable TIMA, but seems to relax the encryption requirements a bit(less salting?) which will allow a modified ramdisk to work properly. It's slightly less secure, but still more secure than going unencrypted
Notes: You will need to wipe /data initially after making the build.prop change. You'll need to disable dm-verity after modifying /system. If you installed a custom kernel before you should reflash the entire firmware as the kernel installer likely deleted the TIMA trustlet binary. Some success was had before with getting custom kernels past TIMA by killing the TIMA service soon after boot, but this had the tendency to brick the data partition. Perhaps in future...
Edit: attached a flashable zip to make the build.prop change from TWRP
Click to expand...
Click to collapse
Hey , thanks a lot for the info and the file . I learned more from it than 2 days on the internet struggling with this "issue"!
Actually I already tried another way and it worked!
I'll try to explain for the record.
I just installed TWRM and formated /data (not wiping. cause you have to write a file there afterwards) and from there I opened the terminal of TWRM and created /data/.magisk (as in magisk FAQ is explained) with KEEPFORCEENCRYPT=true in it . Then installed a rom (ambasadii's one with magisk 13.6 root ) and... that's it. it worked.
Afterwards i did a lot of automatic tasks of secure network daily backups since when you're encrypted it's kind of easy to f^ckup the system and lose everything and now I'm happy.
Probably i was lucky since the kernel probably is the stock one as you said in this ROM.
I still have to try more stuff to be sure everything is working and the data is safe (safe enough at least)
one question:
do you think it would work if i activate dm-verity or this firmware and or magisk modify the ramdisk (so it wont.) ?
forocarlos said:
Probably i was lucky since the kernel probably is the stock one as you said in this ROM.
I still have to try more stuff to be sure everything is working and the data is safe (safe enough at least)
one question:
do you think it would work if i activate dm-verity or this firmware and or magisk modify the ramdisk (so it wont.) ?
Click to expand...
Click to collapse
dm-verity likely won't work on a custom ROM(unless the ROM maker specifically re-signed it, but that's unlikely and bloody difficult). Making any changes to /system (including the build.prop tweak I mentioned!) will necessitate disabling it and there are a bunch of changes in custom Roms. Ambasadii's nougat ROM does indeed make use of the stock kernel and most likely has the TIMA prop already toggled. So an ideal setup I think. The data should be pretty solid provided the TIMA trustlet never goes missing(encryption keys basically self-destruct, which bricks the partition )
EDIT: You also might want to check in TWRP if the data was genuinely encrypted. Android generally won't complain if it isn't. If TWRP can mount it it isn't encrypted.
EDIT: You also might want to check in TWRP if the data was genuinely encrypted. Android generally won't complain if it isn't. If TWRP can mount it it isn't encrypted.
Click to expand...
Click to collapse
checked.
/data unmountable.
So wrapping things up:
- Magisk root
- CTC passed
- Encryption
- Custom Rom
- Lastest Nougat
:good::good::good::good::good:
the only thing left is figuring out how to update the rom without losing data or everything actually.
forocarlos said:
checked.
/data unmountable.
So wrapping things up:
- Magisk root
- CTC passed
- Encryption
- Custom Rom
- Lastest Nougat
:good::good::good::good::good:
the only thing left is figuring out how to update the rom without losing data or everything actually.
Click to expand...
Click to collapse
Hey, have you figured out a way of updating without losing data?
charliebigpot said:
Hey, have you figured out a way of updating without losing data?
Click to expand...
Click to collapse
Little late sorry, but if you keep the TIMA prop disabled you can flash the full firmware with HOME_CSC and it will keep the data. Just reflash twrp after it does the update(needs full reboot into stock recovery first to finish update) and flash the TIMA zip in this thread with a root zip.
Step-by-Step-Guide to a S7 with Nougat+Root+Magisk+Encryption
Hi there,
I am glad that there is a way to use Nougat, Root and Magisk on an encrypted S7. For the last months I have tried every so-called-solution (TWRP, CF-AutoRoot, reflash Stock boot.img, Helios' Stock kernel) but always ended up in bootloops or an unencrypted device.
Can someone provide me with a step-by-step-guide how to achieve a rooted-magisked-encrypted S7 running Nougat?f I am now running unrooted stock 7.0 with VIA CSC, Build G930FXXU1DQH9.
Thanks in advance!
A step by step for this would be great.
i tried several variations of the proposed methods and did not succeed in any way, please clarify
i tried these variations, and many many more:
flash stock
reboot
flash twrp
wipe system
format data
terminal: KEEPFORCEENCRYPT=true >> /data/.magisk
flash ambassadi rom, dirty flash, magisk root, wipe cache
reboot
set fingerprint & password + fast encrypt
bootloop
format data
wipe sys caches
terminal: KEEPFORCEENCRYPT=true >> /data/.magisk
flash ambassadi rom, clean, magisk root, wipe cache
reboot
set fingerprint & password
reboot
encrypt
bootloop
flash stock
reboot
set fingerprint&pw
reboot
flash twrp
tima
format data
magisk
no-veri opt enc
reboot
set up fingerprint + pw
reboot
encrypt
unsucessful but bootable
The most sucess i had with the stock rom, though i dont remember how exactly. I didnt take my password, which i suspect to be a verification error since the password was the right one
On the batman rom the ui hanged itself on first encrypted startup.
On ambassadi rom i got into bootloop every time.
Did i miss something??
Regarding stock rooted encryption there are some notes, in addition to the requirements in my post above(stock kernel etc):
- Samsung's encryption never handles post setup encryption that well. At least from my experience. You need to be encrypted from the get-go. This implies re-wiping data the moment you're finished flashing the custom ROM as TIMA won't encrypt unless the partition is blank(which it won't be with the leftover magisk config file).
- The TIMA prop must be changed before first boot. Data encrypted with prop in either state is incompatible with data encrypted during the other state. State "1" bootloops on rooting. State "0" allows it.
So for stock the step-by-step would be:
- Flash full stock and use CSC(NOT HOME_CSC), let it reboot to the initial setup screen. This is important to apply the CSC settings from the firmware package, which if not done will result in an unusable secure keyboard and cause various other issues.
- Flash TWRP
- Flash the TIMA prop zip in the post above
- Flash a verity disable zip which DOESN'T disable Force Encryption. For convenience I have attached a modified version which doesn't.
- Format /data
- Reboot into setup and run through the wizard.
- Reboot back to TWRP and flash a root solution like Magisk. Don't worry about force encryption now as the data partition should be encrypted already by this stage. Magisk should revert to the /cache workaround.
To update:
- Flash the latest full stock firmware package but this time use HOME_CSC
- Let it reboot into stock recovery and do the upgrade process.
- It should end up on the secure Startup page asking for your password. No password will work at this point because your data was encrypted in TIMA state "0".
- Reboot to download mode and flash TWRP.
- Reboot to TWRP
- Flash the TIMA prop and verity zips.
- Reboot into to Android (password should work now)
- Let it finish the upgrade.
- Reboot to TWRP and flash your root solution.
These are the basic processes which worked for me.
CurtisMJ said:
Regarding stock rooted encryption there are some notes, in addition to the requirements in my post above(stock kernel etc):
- Samsung's encryption never handles post setup encryption that well. At least from my experience. You need to be encrypted from the get-go. This implies re-wiping data the moment you're finished flashing the custom ROM as TIMA won't encrypt unless the partition is blank(which it won't be with the leftover magisk config file).
- The TIMA prop must be changed before first boot. Data encrypted with prop in either state is incompatible with data encrypted during the other state. State "1" bootloops on rooting. State "0" allows it.
So for stock the step-by-step would be:
- Flash full stock and use CSC(NOT HOME_CSC), let it reboot to the initial setup screen. This is important to apply the CSC settings from the firmware package, which if not done will result in an unusable secure keyboard and cause various other issues.
- Flash TWRP
- Flash the TIMA prop zip in the post above
- Flash a verity disable zip which DOESN'T disable Force Encryption. For convenience I have attached a modified version which doesn't.
- Format /data
- Reboot into setup and run through the wizard.
- Reboot back to TWRP and flash a root solution like Magisk. Don't worry about force encryption now as the data partition should be encrypted already by this stage. Magisk should revert to the /cache workaround.
These are the basic processes which worked for me.
Click to expand...
Click to collapse
when first reboot into TWRP wich option should get? "keep read only" or "allow modifications"?
if I select "allow mods" when I try to flash TIMA.prop file I get an error about mount\data
is it necesary to format data before?
thanks
xbizkuit said:
when first reboot into TWRP wich option should get? "keep read only" or "allow modifications"?
if I select "allow mods" when I try to flash TIMA.prop file I get an error about mount\data
is it necesary to format data before?
thanks
Click to expand...
Click to collapse
Actually the TIMA prop zip doesnt even need data. Not sure why I made it try to mount, but any error about mounting can probably be ignored. It modifies /system so you should swipe to allow.
CurtisMJ said:
Actually the TIMA prop zip doesnt even need data. Not sure why I made it try to mount, but any error about mounting can probably be ignored. It modifies /system so you should swipe to allow.
Click to expand...
Click to collapse
First of all, thanks for your reply and for your small guide
What I did was flash lastest full stock official rom from sammobile with odin and let it reboot to the initial setup screen
Reboot to download mode and then I flashed TWRP also with odin and reboot manually to recovery
When first time entered into recovery just selected "allow modifications"
After I flashed the TIMA prop zip and verity disable zip modified version
In both cases, I received error messages about mount/data on the screen but the installation seems to be complete
Finally format/data, reboot and complete the wizard and the installation
The last step, reboot again into recovery and flash magisk v14
At the end of this procedure, all seems ok, magisk is running, safetynet test is OK, superuser is OK and root apps with no problem
Also a couple of mods flashed with recovery (zero camera mod and sound mod by zubi) gave me error messages about format/data but both of them were done
So, the question is how can I check now if my phone encryption is OK and working ??
The only thing seems not work is the OTA firmware updates, it doesnt work, error message about modified phone
I tried to hide root with magisk for the apps in relation with the ota updates but no work for me
Is there any solution for that??
Thanks for all and very appreciated for your help
And sorry for my english hehe
xbizkuit said:
First of all, thanks for your reply and for your small guide
What I did was flash lastest full stock official rom from sammobile with odin and let it reboot to the initial setup screen
Reboot to download mode and then I flashed TWRP also with odin and reboot manually to recovery
When first time entered into recovery just selected "allow modifications"
After I flashed the TIMA prop zip and verity disable zip modified version
In both cases, I received error messages about mount/data on the screen but the installation seems to be complete
Finally format/data, reboot and complete the wizard and the installation
The last step, reboot again into recovery and flash magisk v14
At the end of this procedure, all seems ok, magisk is running, safetynet test is OK, superuser is OK and root apps with no problem
Also a couple of mods flashed with recovery (zero camera mod and sound mod by zubi) gave me error messages about format/data but both of them were done
So, the question is how can I check now if my phone encryption is OK and working ??
The only thing seems not work is the OTA firmware updates, it doesnt work, error message about modified phone
I tried to hide root with magisk for the apps in relation with the ota updates but no work for me
Is there any solution for that??
Thanks for all and very appreciated for your help
And sorry for my english hehe
Click to expand...
Click to collapse
If the recovery is giving errors about /data mount then the phone is encrypted. TWRP simply cannot work with Samsung encryption at all at the moment. Also: If there is no "Encrypt" option for the internal storage in the Security section of the settings app, then the device is encrypted(There may still be one for the external SD). There's no way I know of to fool OTA into working, I've always just fully flashed the latest firmware. Samsung firmware is really easy to get so I've never really looked into using OTAs to update. They'd probably fail horribly anyway due to the modified system in which case the OTA tool is probably correct to block the update. (Newer Android standard requires updates to be done via raw block writes so dm-verity remains intact. Could lead to corruption if done wrong...)
CurtisMJ said:
If the recovery is giving errors about /data mount then the phone is encrypted. TWRP simply cannot work with Samsung encryption at all at the moment. Also: If there is no "Encrypt" option for the internal storage in the Security section of the settings app, then the device is encrypted(There may still be one for the external SD). There's no way I know of to fool OTA into working, I've always just fully flashed the latest firmware. Samsung firmware is really easy to get so I've never really looked into using OTAs to update. They'd probably fail horribly anyway due to the modified system in which case the OTA tool is probably correct to block the update. (Newer Android standard requires updates to be done via raw block writes so dm-verity remains intact. Could lead to corruption if done wrong...)
Click to expand...
Click to collapse
OK so it seems my phone is finally encrypted and rooted!!!
anyway, I forgot about OTAs and I´ll continue installing updates manually,
so can I flash the full firmware with HOME_CSC without losing the data?
Only reflash TWRP after the update and flash the TIMA prop zip ???
Thank you very much for your help!!!
Thank you CurtisMJ! It finally works!
xbizkuit said:
OK so it seems my phone is finally encrypted and rooted!!!
anyway, I forgot about OTAs and I´ll continue installing updates manually,
so can I flash the full firmware with HOME_CSC without losing the data?
Only reflash TWRP after the update and flash the TIMA prop zip ???
Thank you very much for your help!!!
Click to expand...
Click to collapse
Whoops. Didn't see those were questions. Yes, full flash with HOME_CSC will keep data intact. The TIMA prop will need to be in state "0" to decrypt, so yes again, reflash TWRP and the TIMA and verity zips and you should be good. Just make sure to have "Auto Reboot" checked in Odin. It will do some stuff in stock recovery first (including a screen with "Erasing..." Don't worry! It's just cleaning up the working files in /cache ).
CurtisMJ said:
Whoops. Didn't see those were questions. Yes, full flash with HOME_CSC will keep data intact. The TIMA prop will need to be in state "0" to decrypt, so yes again, reflash TWRP and the TIMA and verity zips and you should be good. Just make sure to have "Auto Reboot" checked in Odin. It will do some stuff in stock recovery first (including a screen with "Erasing..." Don't worry! It's just cleaning up the working files in /cache ).
Click to expand...
Click to collapse
Thanks again mate!!!!!!
WyRM
Hello Guys
Do you think it would work also on Note8 ?
Im stuck on step when i flash 2 files via TWRP, it shows erros with cant mount Data because it is already encrypted somehow, it wouldnt be issue as you said as it does to system.
But when i finish the installation of the Firmware and came back to TWRP for flashing Root solution it is encrypted and cantbe flashed.
Any idea?
WyRmiE said:
Hello Guys
Do you think it would work also on Note8 ?
Im stuck on step when i flash 2 files via TWRP, it shows erros with cant mount Data because it is already encrypted somehow, it wouldnt be issue as you said as it does to system.
But when i finish the installation of the Firmware and came back to TWRP for flashing Root solution it is encrypted and cantbe flashed.
Any idea?
Click to expand...
Click to collapse
That sounds about right actually. The data is supposed to be already encrypted by the time you flash root. TWRP on the S7 and it appears any recent Samsung device cannot decrypt the stock ROMs encryption. The root solution should revert to using the cache workaround. Both Magisk and SuperSU support this setup. Just flash and ignore the /data mount errors.

TWRP unable to wipe or format `Failed to mount '/system' (Device or resource busy)`

I'm trying to install LineageOS and then GAPPS on my Pixel XL from TWRP recovery. I'll try to `Advance Wipe` the `/systems` directory and `Format Data`, but I continue to get multiple errors:
Code:
Failed to mount '/system' (Device or resource busy)
Code:
Failed to mount '/vendor' (Device or resource busy)
And
Code:
Unable to wipe 'System'
Code:
Unable to wipe '/system'
If I just continue with `adb sideload lineageos.zip` most of the time it stops about halfway (PowerShell shows `47%`) through and then TWRP shell shows:
Code:
Installing zip file '/sideload/package.zip'
Step 1/2
Step 2/2
I then try to `sideload` the `gapps.zip` file and get another error saying `/system` doesn't have enough space. I've tried sideloading several different gapps versions including their smallest `pico` zip fie of `91.39 MiB`.
I am able to then boot into LineageOS, but no GAPPS show and I'm not able to run any new apps installed via APK without them crashing.
My assumption is that I need to fully wipe `system` and format it, but I've been trying for two days now and still get the above `(Device or resource busy)` errors. Any help would be much appreciated!
Make sure you have the latest tools.
Latest TWRP for marlin is 3.3.0-0
Latest platform-tools is 29.0.1
Not sure what's the cause of this, but if you want to wipe and start fresh I think the best option is reflash the stock factory image that completely wipes everything and restores everything stock.
Then, you can retry wiping the device using the latest TWRP (currently, marlin is 3.3.1-0, the zip is 3.3.0-0, try just boot it and don't flash the zip), flash LOS and then gapps.
Also, as pointed by @post-mortem, make sure you are using the latest adb version when flashing the factory image, just to avoid any potential issue.
Don't use 3.3.1-0. Try 3.3.0-0. I had the same issue.
Why doesn't TWRP Team provide an answer as to why this happens? It appears to affect everyone with the latest official Pixel ROM.
Twrp is for Android pie and has trouble mounting stock Android 10. They have announced this on their website. This shouldn't matter since you're installing lineage. You don't need to wipe system before installing lineage because it installs into the inactive slot. You need to sideload lineage then reboot into recovery to switch slot's. The instructions are on the lineage website.
Did OP manage to solve this issue?

Fail to permanent install and access TWRP due to encryption

Recently I just downgraded my Mi Mix 2s to MIUI V9.6.4.0.ODGMIFD via Miflash and planning to stay on this (global) rom. However, after flashing the latest twrp from the official link (v3.1.1-1) it did not ask for the lockscreen password upon entering the interface and my files just showed up with random filenames.
After some reading, I suppose my device is encrypted and twrp did not let me to decrypt it (without asking for lockscreen password). The random filenames still happens even I remove the lockscreen password before flashing twrp meaning the device is still encrypted. Before I could do anything else (flashing zip files, making backups, etc) I must format data to remove the encryption, but twrp will disappear after I booted into system and did the initial phone configuration. Tried different versions (from 3.2.3-0 to 3.3.1-1) but to no avail. The only way I can retain twrp after booting into system is to flash Magisk zip right after formatting data, but if I enter twrp again the filenames are still in random characters as before and I couldn't do anything in it.
So my question is how can I properly install twrp into my device without having the encryption issues? Could it be the rom that caused the problem or did I missed out any steps that fails to disable the encryption? Thanks for your attention.
WannaFly3721 said:
Recently I just downgraded my Mi Mix 2s to MIUI V9.6.4.0.ODGMIFD via Miflash and planning to stay on this (global) rom. However, after flashing the latest twrp from the official link (v3.1.1-1) it did not ask for the lockscreen password upon entering the interface and my files just showed up with random filenames.
After some reading, I suppose my device is encrypted and twrp did not let me to decrypt it (without asking for lockscreen password). The random filenames still happens even I remove the lockscreen password before flashing twrp meaning the device is still encrypted. Before I could do anything else (flashing zip files, making backups, etc) I must format data to remove the encryption, but twrp will disappear after I booted into system and did the initial phone configuration. Tried different versions (from 3.2.3-0 to 3.3.1-1) but to no avail. The only way I can retain twrp after booting into system is to flash Magisk zip right after formatting data, but if I enter twrp again the filenames are still in random characters as before and I couldn't do anything in it.
So my question is how can I properly install twrp into my device without having the encryption issues? Could it be the rom that caused the problem or did I missed out any steps that fails to disable the encryption? Thanks for your attention.
Click to expand...
Click to collapse
Guess I've found a workaround for this by installing the OrangeFox recovery project (ofrp). For those who stuck at the same issue as mine this is what I did:
1. Flash twrp img through adb fastboot.
2. Format data to remove encryption.
3. Paste ofrp zip file into the device and flash it via twrp, which boots the phone into ofrp interface.
4. Paste the recovery zip file into the device and flash it via ofrp. Under setting - MIUI OTA it should show 'enabled' (for android 9 and above might need to uncheck disable dm-verity first according to ofrp page, but my rom is at android 8 so I left it checked as default before flashing).
5. Reboot to system and complete the initial configuration.
6. Reboot to recovery again and ofrp should remain installed. From there I was then able to perform a backup.
Btw, under phone settings it says my device is still encrypted although I can access to ofrp without having the encryption issue as in twrp (random filenames, cannot transfer files or create backups, etc). Anyhow I now have a working custom recovery on the stock rom, cheers.

How to reinstall Magisk/root after updating to MIUI 12.5.2?

I should have expected this but after updating to MIUI 12.5.2, Magisk/root is no longer installed and the Magisk App only offers the option to "Select and Patch a File" , which I understand requires a full wipe and I don't want to do that.
Orangefox is also corrupted. I can still boot to it but it doesn't prompt me for my encryption code, so it can't access the data partition. Maybe I can just reflash that but can I flash Magisk from there after that to restore root without having to wipe the phone?
So it appears that the problem is MIUI 12.5 (or any MIUI ROMS based on Android 11), prevent decryption working in recovery mode. https://wiki.orangefox.tech/en/guides/encryption
I tried flashing TWRP and that doesn't decrypt the storage and just shows gibberish filenames too.
So, if we can't decrypt in recovery mode, we can't make backups and we can't install Magisk to restore root to make backups with apps like Titanium, what are we supposed to do?

Categories

Resources