[Q]How to encrypt internal storage (Android O)? - Huawei Mate 9 Questions & Answers

Hi all!
Today i had to reset my phone (Magisk's fault) and therefore i installed Android O (with Funky Huawei -> should be a clean installation).
Bootloader is unlocked, TWRP and SuperSU is installed, but the internal storage is encrypted... TWRP file explorer shows random hashed files in internal storage and TWRP backup is not possible (createTarFork() ... Error: 255).
How can i decrypt my internal storage?
Is there also a decrypted boot image like before?
Hope anyone can help me...
Best regards,
Florian

So I went back to Nougat and B198 to encrypt the data partition...
But I am still interested in encrypting Android 8 for future updates.
Is there a way o do yet?

htcdesire-hd said:
So I went back to Nougat and B198 to encrypt the data partition...
But I am still interested in encrypting Android 8 for future updates.
Is there a way o do yet?
Click to expand...
Click to collapse
Yes. /vendor/etc/fstab.hi3660
Open file in a text editor (root enabled) and change:
'fileencryption=aes-256-xts:aes-256-cts' to 'encryptable'
Save file. Now you should be able to decrypt. You can remove verity and avb flags as well in that fstab.
To encrypt again, add the fileencryption flag back again and reboot.

ante0 said:
Yes. /vendor/etc/fstab.hi3660
Open file in a text editor (root enabled) and change:
'fileencryption=aes-256-xts:aes-256-cts' to 'encryptable'
Save file. Now you should be able to decrypt. You can remove verity and avb flags as well in that fstab.
To encrypt again, add the fileencryption flag back again and reboot.
Click to expand...
Click to collapse
can i make it? is it neccessary? And im running oreo b361, if i want to make decyript, will i format my phone?

mavera said:
can i make it? is it neccessary? And im running oreo b361, if i want to make decyript, will i format my phone?
Click to expand...
Click to collapse
Yes, no, partially.
You do need root. Decrypting, in my opinion, is not necessary. It's only good if you want to backup /data (I'd use titanium backup). Decrypt will format /data, which essentially is your phone. That's where all userdata is kept (all playstore apps, data, etc etc) so I would back those up using titanium backup or Huawei backup, then copy sdcard as well.

@ante0 thank you for your answer!
I made the experience that root apps are not working properly (changes in data partition are not permanently and will be lost after a reboot) when the data partition is not decrypted...

htcdesire-hd said:
@ante0 thank you for your answer!
I made the experience that root apps are not working properly (changes in data partition are not permanently and will be lost after a reboot) when the data partition is not decrypted...
Click to expand...
Click to collapse
Hmm. Then something else is wrong. Data is only encrypted, but it's not protected by avb or verity, so it shouldn't revert at all.
What were you changing if you remember?

ante0 said:
Hmm. Then something else is wrong. Data is only encrypted, but it's not protected by avb or verity, so it shouldn't revert at all.
What were you changing if you remember?
Click to expand...
Click to collapse
E.g. I removed the WhatsApp shutter sound file (/system/media/audio/ui/camera_click.otg) but after rebooting with encryption the file was there again and with decryption everything worked... This happened about a year ago and therefore I have always been decrypting until now...
Is there a disadvantage if the phone is decrypted?

htcdesire-hd said:
E.g. I removed the WhatsApp shutter sound file (/system/media/audio/ui/camera_click.otg) but after rebooting with encryption the file was there again and with decryption everything worked... This happened about a year ago and therefore I have always been decrypting until now...
Is there a disadvantage if the phone is decrypted?
Click to expand...
Click to collapse
/system is protected by verity though, if you didn't remove the verity flag it does revert things.
No real disadvantage. You still need to unlock bootloader after updating (might not be needed when you go oreo to oreo, my bootloader stayed intact when I went from B329 to b361), which requires formatting data. So you still need to redo the decryption when you update.

ante0 said:
/system is protected by verity though, if you didn't remove the verity flag it does revert things.
No real disadvantage. You still need to unlock bootloader after updating (might not be needed when you go oreo to oreo, my bootloader stayed intact when I went from B329 to b361), which requires formatting data. So you still need to redo the decryption when you update.
Click to expand...
Click to collapse
Ok thank you for your answer! I will try to remove verity flag and keep the phone encrypted, when Oreo is officially released.
EDIT:
I upgraded to Android 8 and rooted my Mate 9 and everything seems to work now. I did not test the decryption so far...

ante0 said:
Yes. /vendor/etc/fstab.hi3660
Open file in a text editor (root enabled) and change:
'fileencryption=aes-256-xts:aes-256-cts' to 'encryptable'
Save file. Now you should be able to decrypt. You can remove verity and avb flags as well in that fstab.
To encrypt again, add the fileencryption flag back again and reboot.
Click to expand...
Click to collapse
My device is rooted, but i can not write into system partition ("/system/app mover" app shows an error that it can't remound /system)...
How can i enable writing to the /system partition?
By removing the verity flag in fstab? How do i manage to do that?

ante0 said:
Yes. /vendor/etc/fstab.hi3660
Open file in a text editor (root enabled) and change:
'fileencryption=aes-256-xts:aes-256-cts' to 'encryptable'
Save file. Now you should be able to decrypt. You can remove verity and avb flags as well in that fstab.
To encrypt again, add the fileencryption flag back again and reboot.
Click to expand...
Click to collapse
Hi ante0,
As I am total noob on this matter, just one question to make sure:
Do I remove the whole fileencryption=....-cts part and replace it with the text encryptable?
Regards,

Dioky said:
Hi ante0,
As I am total noob on this matter, just one question to make sure:
Do I remove the whole fileencryption=....-cts part and replace it with the text encryptable?
Regards,
Click to expand...
Click to collapse
Yes.
wait,check,fileencryption=aes-256-xts:aes-256-cts
Should say
wait,check,encryptable
Or you can just remove it so it just says
wait,check

Troubles again and sweet victory
ante0 said:
Yes.
wait,check,fileencryption=aes-256-xts:aes-256-cts
Should say
wait,check,encryptable
Or you can just remove it so it just says
wait,check
Click to expand...
Click to collapse
It worked, but I ran into trouble again: bootloop.
This time it was my bad because I forgot to re-flash update_data_public.zip and update_all_hw.zip after the Format Data... :cyclops:
When I realised the mistake I made, I tried to make up for it by TWRP-flashing both files.
During flashing I got a few errors in red text that frightend me.
In hindsight I should have neglected them, but I tried to reflash and from that on I ran into trouble.
Because I wanted to have a nice clean install, I decided to return to base and reflash the whole stock ROM with HWOTA8 procedure.
Next I started to look around on the net for another more experiences. That led my to the German Firedance1961.
He wrote an elegant script for the latest Oreo build 363, which automates some tweaks during the flashing process.
As ante0 suggested, that script indeed does leave blank after 'wait,check'
It adds a GPS tweak, SuperSU v2.82, Busybox, AdAway, some theme-options and decrypts DATA partition that stays decrypted after reboot. All in one go.
The process for those interested:
Needed:
Unlocked bootloader.
Steps:
1. Put update_data_public.zip and update_all_HW.zip from the L09/L29B363 ROM together with the Firedance FSTAB-mod script in the root of your external SD-card;
2. Flash TWRP 3.2.1-0 Oreo with Fastboot
3. Boot into TWRP and perform Format DATA. STAY IN TWRP and return to TWRP Install menu;
4. Now flash in this order:
I. update_data_public.zip;​II. updata_all_hw.zip;​You'll see some red errors during the process. Don't worry.
III. Firedance FSTAB-mod script.​From this moment on you can backup DATA partition in TWRP.
5. Wipe cache and Dalvic
6. Reboot, done.
Regards,

will try that Firedance, got same problem with encryption

Firedance FSTAB-mod script - link is dead or file removed.

Related

FlashFire with HTC One A9?

Anyone used ChainFire's FlashFire with the One A9?
I've used it for backups successfully but have yet to restore anything with it (a little squeamish to do so :silly.
And I'll just add, if anyone has used it and could offer any tips or procedures that would be great.
FlashFire usage is straightforward, at least for me. I haven't flashed anything dangerous with it directly (bootloader, radio) yet.
It has handled flashing backups of system, boot, recovery, and even the 1.57.617.41 ota flawlessly.
Special thanks to @Chainfire!
Sent from my HTC One A9 using XDA Free mobile app
CSnowRules said:
FlashFire usage is straightforward, at least for me. I haven't flashed anything dangerous with it directly (bootloader, radio) yet.
It has handled flashing backups of system, boot, recovery, and even the 1.57.617.41 ota flawlessly.
Special thanks to @Chainfire!
Sent from my HTC One A9 using XDA Free mobile app
Click to expand...
Click to collapse
Were you already rooted? I'm rooted and xposed and want to update via flashfire. will it work?
theNdroid said:
Were you already rooted? I'm rooted and xposed and want to update via flashfire. will it work?
Click to expand...
Click to collapse
Of course. Root is required to use FlashFire. I use Xposed as well, and I've had no problems updating via FlashFire.
CSnowRules said:
FlashFire usage is straightforward, at least for me. I haven't flashed anything dangerous with it directly (bootloader, radio) yet.
It has handled flashing backups of system, boot, recovery, and even the 1.57.617.41 ota flawlessly.
Click to expand...
Click to collapse
Just for my edification, flashing a firmware update like 1.57.617.41 will wipe my data partition, correct?
eelpout said:
Just for my edification, flashing a firmware update like 1.57.617.41 will wipe my data partition, correct?
Click to expand...
Click to collapse
No not at all. Flashing the OTA will not wipe your data. I've done the .41 and .52 OTAs via FlashFire.
***Warning--if you're not currently encrypted, flashing the OTA will update your boot partition, so be sure to use the preserve recovery option in FlashFire and reboot to TWRP to patch your boot image, or your device will encrypt data on first boot.***
CSnowRules said:
No not at all. Flashing the OTA will not wipe your data. I've done the .41 and .52 OTAs via FlashFire.
***Warning--if you're not currently encrypted, flashing the OTA will update your boot partition, so be sure to use the preserve recovery option in FlashFire and reboot to TWRP to patch your boot image, or your device will encrypt data on first boot.***
Click to expand...
Click to collapse
meaning, flash this A9 boot image patcher from TWRP?
Or does using the EverRoot SuperSU option patch the boot image for us on the A9 (and then does one check "preserve recovery" using that or not)?
This can all get a bit confusing.
eelpout said:
meaning, flash this A9 boot image patcher from TWRP?
Or does using the EverRoot SuperSU option patch the boot image for us on the A9 (and then does one check "preserve recovery" using that or not)?
This can all get a bit confusing.
Click to expand...
Click to collapse
Yes, that's one way to disable forceencrypt. You could also flash the latest SuperSU or Magisk. Either one will disable forceencrypt by default. Of course, if your data is already encrypted, you won't have a problem, but I'd assume that you would like to have root, so I'd recommend SuperSU or Magisk+phh root.
CSnowRules said:
Yes, that's one way to disable forceencrypt. You could also flash the latest SuperSU or Magisk. Either one will disable forceencrypt by default. Of course, if your data is already encrypted, you won't have a problem, but I'd assume that you would like to have root, so I'd recommend SuperSU or Magisk+phh root.
Click to expand...
Click to collapse
i'm already unecrypted and rooted, but on firmware from last year. just trying to find the most efficient way to bring things up to date.
eelpout said:
i'm already unecrypted and rooted, but on firmware from last year. just trying to find the most efficient way to bring things up to date.
Click to expand...
Click to collapse
Ok, this post will go a bit off topic. That being said, I can offer two courses of action. I take no responsibility for anything in this post.
Safest--almost no risk (my personal preference)
1. Backup your data partition, including internal SD via TWRP to ext SD or USB OTG drive. Flash the latest RUU from HTC. Boot stock and apply OTAs until there are no more updates available. Fastboot flash the latest TWRP, and finally restore your data and flash the latest SuperSU via TWRP. Reboot your fully updated, rooted A9 with all your data still intact.
A little risky and untested to my knowledge--could result in a hard brick if something partially fails. FLASHING BOOTLOADERS IN FLASHFIRE IS STILL ALPHA FOR HTC DEVICES!!! This may work with s-on...but may require s-off.
Your system partition must have never been mounted r/w for this to work.
2. Download the OTA zips for your phone from the first update available to the latest and the latest SuperSU and TWRP. Use FlashFire to do everything in one shot. Select allow flashing bootloaders in FlashFire settings, select your OTAs for installation from oldest to newest (don't select restore boot and recovery), select TWRP and SuperSU for installation, disable everroot and preserve recovery. Cross your fingers and timidly press flash... If all is successful, you should have the same end result as option 1.
I STRONGLY recommend the first method, but if you're feeling lucky and decide to try the second method, please share how it goes, since this post is FlashFire related and this would be the ultimate test of FlashFire for our devices.
For me, I've found that though TWRP backups take more time, and DON'T preserve internal storage, it's still the most reliable and consistent way to backup especially for OTAs.
I've previously tried FlashFire restore but it doesn't seem to restore internal storage as claimed; deal-breaker.
The real problem is we want OTA automation to:
1) disable lock-screen (pattern or fingerprint) so emergency restore of /data don't fail to unlock after boot
2) restore OEM recovery
3) flash OTA and let it do its things of updating /system, /boot, etc
4) reflash SuperSU before normal system boot so /boot doesn't try to re-encrypt /data
5) restore whatever the original recovery was
6) boot
The problem always is catching the step between 3 -> 4 in some automated way. If the OTA goes all the way through, /data is encrypted and so time is wasted to go back to recovery after full-boot, wipe /data, restore /data, lost internal storage contents and PICTURES. If pattern-lock / finger-print lock is not disabled (1), you won't be able to get past the lock screen as it won't recognize the correct lock-pattern nor fingerprint. Solution is to adb shell in, and move/delete some files as root. PITA and I don't think FlashFire does this.
If you did manually restore /data, then /data is corrupted for some apps that use it such as Waze, LINE, KakaoTalk, Whatsapp, etc where they can't write to their data directories anymore. A reinstall of the app is the only way to fix it.
NuShrike said:
For me, I've found that though TWRP backups take more time, and DON'T preserve internal storage, it's still the most reliable and consistent way to backup especially for OTAs.
I've previously tried FlashFire restore but it doesn't seem to restore internal storage as claimed; deal-breaker.
The real problem is we want OTA automation to:
1) disable lock-screen (pattern or fingerprint) so emergency restore of /data don't fail to unlock after boot
2) restore OEM recovery
3) flash OTA and let it do its things of updating /system, /boot, etc
4) reflash SuperSU before normal system boot so /boot doesn't try to re-encrypt /data
5) restore whatever the original recovery was
6) boot
The problem always is catching the step between 3 -> 4 in some automated way. If the OTA goes all the way through, /data is encrypted and so time is wasted to go back to recovery after full-boot, wipe /data, restore /data, lost internal storage contents and PICTURES. If pattern-lock / finger-print lock is not disabled (1), you won't be able to get past the lock screen as it won't recognize the correct lock-pattern nor fingerprint. Solution is to adb shell in, and move/delete some files as root. PITA and I don't think FlashFire does this.
If you did manually restore /data, then /data is corrupted for some apps that use it such as Waze, LINE, KakaoTalk, Whatsapp, etc where they can't write to their data directories anymore. A reinstall of the app is the only way to fix it.
Click to expand...
Click to collapse
The solution for problem 1 can be handled in TWRP. The files can be deleted via TWRP's file manager or the built in terminal, which may be easier for some people.
Also, the solution for the corrupted data and internal SD is to create an image of the data partition (just like the system image backup option). This can be done via dd in TWRP or adb. It requires a large amount of storage and it takes longer, but I've had to do it, since I use VIP Access by Symantec for work. A normal file based backup in TWRP breaks that app. This also keeps the pin/fingerprint data intact.
If we could have that implemented in a user friendly manner, that would be great, but I'm sure CaptainThrowback and Chainfire both have bigger issues to deal with. I could probably figure out a solution, but the work wouldn't be worth it for my own benefit, since I'm fluent with the Linux command line.

Root, TWRP and Flashing

I recently got an S7 (Exynos) SM-G930F and decided to root it. So I went with the typical CF-Auto-Root method... I used the latest ODIN with the correct auto root file and everything went well. I have root.
But then I noticed that I didn't have any recovery, so I installed TWRP Manager from the Play Store and flashed recovery with that. Everything works fine except for not having access to backup /Data, this was expected.
But despite everything pretty much working, I've read on a few threads here that I was supposed to wipe my phone after flashing TWRP. Now I've also read the TWRP install thread which doesn't mention anything about wiping my device, but it does offer another method of rooting the S7... Flash TWRP first using ODIN, then flash SuperSU and dm-verity/force encryption disabler.
So I have a couple of questions.
In the TWRP guides it mentions this: "By swiping right, you will trigger dm-verity, and if you don't follow the next step you will be unable to boot!". I've never had this issue, does CF-Auto-Root or SuperSU resolve this issue?
Do I need to install the dm-verity/force encryption disabler?
If I do have to wipe my device, am I going for a standard (factory reset) wipe? Advanced wipe (if so, which partitions?) or format data?
Unless there's another way to gain full access to all partitions in order to perform a complete nandroid backup (including data)?
Basically, once I've completely backed up the S7 I'd like to install the Xposed Framework. Will installing this lose any data?
d3adm8n said:
I recently got an S7 (Exynos) SM-G930F and decided to root it. So I went with the typical CF-Auto-Root method... I used the latest ODIN with the correct auto root file and everything went well. I have root.
But then I noticed that I didn't have any recovery, so I installed TWRP Manager from the Play Store and flashed recovery with that. Everything works fine except for not having access to backup /Data, this was expected.
But despite everything pretty much working, I've read on a few threads here that I was supposed to wipe my phone after flashing TWRP. Now I've also read the TWRP install thread which doesn't mention anything about wiping my device, but it does offer another method of rooting the S7... Flash TWRP first using ODIN, then flash SuperSU and dm-verity/force encryption disabler.
So I have a couple of questions.
In the TWRP guides it mentions this: "By swiping right, you will trigger dm-verity, and if you don't follow the next step you will be unable to boot!". I've never had this issue, does CF-Auto-Root or SuperSU resolve this issue?
Do I need to install the dm-verity/force encryption disabler?
If I do have to wipe my device, am I going for a standard (factory reset) wipe? Advanced wipe (if so, which partitions?) or format data?
Unless there's another way to gain full access to all partitions in order to perform a complete nandroid backup (including data)?
Basically, once I've completely backed up the S7 I'd like to install the Xposed Framework. Will installing this lose any data?
Click to expand...
Click to collapse
Of course you are going to want to flash .zips through your Recovery, but as you have recognised there is the DM-Verification that will stop you doing so. In order to get rid of the encryption you will have to firstly have to Factory Reset but as you know this will also delete all apps and data that you have on your Internal Storage.
Then, you need to flash a .zip called 'no-verity-encryption-opt' and this will apply a patch onto your boot so you can flash unknown images and zips through.
If you can't find this no verity zip, leave me your email and I'll try and send it to you.
Good luck!
Also, installing the Xposed Framework will not cause you to lose any of your data.
AzzyC said:
Of course you are going to want to flash .zips through your Recovery, but as you have recognised there is the DM-Verification that will stop you doing so. In order to get rid of the encryption you will have to firstly have to Factory Reset but as you know this will also delete all apps and data that you have on your Internal Storage.
Then, you need to flash a .zip called 'no-verity-encryption-opt' and this will apply a patch onto your boot so you can flash unknown images and zips through.
If you can't find this no verity zip, leave me your email and I'll try and send it to you.
Good luck!
Also, installing the Xposed Framework will not cause you to lose any of your data.
Click to expand...
Click to collapse
Thanks for the info.
I may have already done this, I honestly can't remember. Is there any way to check if I've already installed no-verity-encryption-opt? Because I am already able to install zips in Recovery, so far I've installed a SuperSU update and AdAway. Although I do get a fair amount of 'Failed/Unable to mount /data' messages which may suggest that these zip installs didn't actually work.
I guess I still need to factory reset? And I guess that also means rooting again and installing no-verity-encryption-opt, then finally Xposed?
d3adm8n said:
Thanks for the info.
I may have already done this, I honestly can't remember. Is there any way to check if I've already installed no-verity-encryption-opt? Because I am already able to install zips in Recovery, so far I've installed a SuperSU update and AdAway. Although I do get a fair amount of 'Failed/Unable to mount /data' messages which may suggest that these zip installs didn't actually work.
I guess I still need to factory reset? And I guess that also means rooting again and installing no-verity-encryption-opt, then finally Xposed?
Click to expand...
Click to collapse
I had the same error message you are facing right now. Can you let me know what values you see when you view the Data, System and Cache partition, after clicking on 'Partition Options' - If you're on the latest TWRP you can take screenshots by hitting the Power and Vol Down.
^^^IGNORE^^^
No factory reset required. Basically, the file system of your Data partition is incorrect and that is why it can't be mounted on to.
Go to 'Wipe'->'Advanced Wipe'->Click on the Data box->'Partition Options'->(You may be seeing values like 0mb for most of the information displayed and why you can't mount to it; if you are not let me know!)->'Change File System'->(Try out different File Systems until you being to see true values for the sizes, but avoid using EXT2 and EXT3 if you can)
Doing all this you will be able to Mount to your Data partition, however your OS will be deleted! So get your phone into Download mode, open up Odin program on your PC, and flash a Bootloader (BL) and your phone will be fine.
Then flash the 'no-verity-encryption-opt.zip' and then your SU Binary and Xposed Framework etc.
Good luck again Buddy!
---------- Post added at 05:41 PM ---------- Previous post was at 05:12 PM ----------
Wait Install the No-verity zip first then, then flash a BL
AzzyC said:
I had the same error message you are facing right now. Can you let me know what values you see when you view the Data, System and Cache partition, after clicking on 'Partition Options' - If you're on the latest TWRP you can take screenshots by hitting the Power and Vol Down.
^^^IGNORE^^^
No factory reset required. Basically, the file system of your Data partition is incorrect and that is why it can't be mounted on to.
Go to 'Wipe'->'Advanced Wipe'->Click on the Data box->'Partition Options'->(You may be seeing values like 0mb for most of the information displayed and why you can't mount to it; if you are not let me know!)->'Change File System'->(Try out different File Systems until you being to see true values for the sizes, but avoid using EXT2 and EXT3 if you can)
Doing all this you will be able to Mount to your Data partition, however your OS will be deleted! So get your phone into Download mode, open up Odin program on your PC, and flash a Bootloader (BL) and your phone will be fine.
Then flash the 'no-verity-encryption-opt.zip' and then your SU Binary and Xposed Framework etc.
Good luck again Buddy!
---------- Post added at 05:41 PM ---------- Previous post was at 05:12 PM ----------
Wait Install the No-verity zip first then, then flash a BL
Click to expand...
Click to collapse
Hey man, i'm having that problem.
I want to root my phone but i am not able to acess Internal Storage, on twrp its showing 0mb.
I did what you says in this post but i always have caught in ''Encrypetd phone'' or something like this.
What are the steps? 1- format data (then deletOS) and then? Can you help me please?

Huawei Mate 9 Magisk v14.0 auf v15.X

Hello,
I own the Huawei Mate 9 with the firmware from fRomFuture B197.
Rooted with Magisk v14.0. For some time now I keep getting update messages, from v15.0, v15.1 or last from v15.2.
The Magisk app is the latest.
My problem: When I go to update, I can patch the boot image file or choose Install Directly. No matter what I do of both, it works so far that the phone starts and so on. But if I go into TWRP purely, the internal memory is encrypted, even after such an update, always the Google Account out, and I have to log in again.
does anyone know the problem? Where do I go best, so that the v15.2 is out, but synonymous all sorts of data, apps and so is retained? What do the advanced options in the Magisk app (maintaining Force encryption or maintaining AVB 2.0 / dm-verity) mean?
Thank you
laptop45307 said:
Hello,
I own the Huawei Mate 9 with the firmware from fRomFuture B197.
Rooted with Magisk v14.0. For some time now I keep getting update messages, from v15.0, v15.1 or last from v15.2.
The Magisk app is the latest.
My problem: When I go to update, I can patch the boot image file or choose Install Directly. No matter what I do of both, it works so far that the phone starts and so on. But if I go into TWRP purely, the internal memory is encrypted, even after such an update, always the Google Account out, and I have to log in again.
does anyone know the problem? Where do I go best, so that the v15.2 is out, but synonymous all sorts of data, apps and so is retained? What do the advanced options in the Magisk app (maintaining Force encryption or maintaining AVB 2.0 / dm-verity) mean?
Thank you
Click to expand...
Click to collapse
If you have a sdcard, use that and place Magisk15.2.zip on it, then install in TWRP.
You are encrypted, that's why you can't find it. Maintain force encrypt means it won't turn off encryption in fstab. Maintain AVB/dm-verity means it won't remove the verity/avb flags in fstab.
You don't really need to worry about encryption if you use an sdcard. Verity could be good to remove if you want to edit /vendor, /system or /product partitions.
If you flash through TWRP it will remove encryption and dm-verity. Though encryption is not removed on Mate 9 because it's not looking for File-encryption, only forceencrypt.
The reason being that the Pixel phones lose support when the File-encryption flag is removed, so the dev of magisk removed it.
And if you wanted to remove encryption you need to Wipe - Format Data in twrp, which wipes /data so you should back up before you do it.
Only benefit of decrypting is the ability to backup the /data partition. If you don't plan on doing that you can stay encrypted.
And being sd int decrypted, Magisk deletes the Google account and data, so after that you will have to install everything again ... it has happened to me like this 2 times
Health2
Enviado desde mi MHA-L29 mediante Tapatalk

How to backup & restore Android 9/P/Pie with TWRP?

Because on https://twrp.me/google/googlepixel.html it says:
Decrypting Android 9.0 Pie when using a PIN / pattern / password does not work yet. We do not have an ETA for fixing decrypt. Restoring a backup made with an alpha using RC1 may result in loss of data including internal storage. If you need your backups from those versions, restore the backup using alpha2, then install RC1 and run a new backup with RC1.
Click to expand...
Click to collapse
I just flashed the official Android 9/P/Pie release (it did not fix the randomly dying microphone issue) and I want to do a full nandroid backup before I take my Pixel into UBreakIFix for a $0-80 fix because they require a locked bootloader and factory reset.
So do nandroid backups work or not?
SOLVED!
Answering my own question...
roirraW "edor" ehT said:
Since internal storage, where user apps and user and system app data are stored can't be decrypted, you'd definitely have to at least disable the pin/pattern/password, although you should confirm that doing so makes the storage readable in TWRP - it should.
Click to expand...
Click to collapse
According to this person, you must disable pin/pattern/password in order to decrypt the file system and allow nandroid backup & restore.
However, I just did a fastboot boot TWRP.img and it prompted me with my unlock pattern, and then it said "Data successfully decrypted". I checked, and I have access to the filesystem, and it even mounted to my connected laptop. So I'm testing this out. Backups completed successfully. I'll be trying a restore soon.
Archangel said:
The overwhelming response to what areas to tick when you back up has been system, boot, vendor and data,,,no images just the partitions. But that struggle is still on going LOL.
Click to expand...
Click to collapse
Backup & restore these 4 partitions (no images):
System, Boot, Vendor, and Data
(Note: for system and vendor you have to uncheck "mount system as readonly")
UPDATE:
Restoring my System and Vendor TWRP backups caused boot to hang at the G logo with an endless progress bar below the G.
However, doing a fastboot flash of System and Vendor factory images then restoring only my TWRP Data backup successfully restored my phone!
Except for one issue: fingerprints don't work. I think I may have screwed myself here by not disabling pin/pattern/password when I did the backup. For some reason TWRP had no problem decrypting then. But now, trying to restore, TWRP can't decrypt unless I disable pin/pattern/pass. It wont let me delete my old fingerprints or set new ones. Trying to unlock with fingerprint, it either doesn't respond at all or says "Fingerprint hardware not available"
UPDATE 2:
Followed instructions to clear the fingerprint data: [Guide] Delete fingerprint profils via TWRP. Everything is perfectly restored now! (Note: if you disable pin/pattern/pass before backup, you shouldn't need to do this)

Forgot pin to decrypt volume on Lineage

Last year I installed LineageOS on a S9+ (now discontinued) and I encrypted the device. Now I have completely forgotten the pin to decrypt it, so it returns a message which states it will wipe all my data after some failed attempts. How to solve this problem before it's too late? Can I reset the attempts count, change the pin or backup the encrypted data?
The good news is I can access TWRP (v3.4.0) recovery mode. I read some tutorials, but I shouldn't remove decryption by cleaning the partition. Unlike normal boot, can I try to decrypt it as many times as I want, until I retrieve the pin, without worrying about my data being automatically erased? What if normal boot won't recognize the correct pin after recovering/changing it from TWRP? Do you know any terminal commands to execute the above tasks?
casxa said:
Last year I installed LineageOS on a S9+ (now discontinued) and I encrypted the device. Now I have completely forgotten the pin to decrypt it, so it returns a message which states it will wipe all my data after some failed attempts. How to solve this problem before it's too late? Can I reset the attempts count, change the pin or backup the encrypted data?
The good news is I can access TWRP (v3.4.0) recovery mode. I read some tutorials, but I shouldn't remove decryption by cleaning the partition. Unlike normal boot, can I try to decrypt it as many times as I want, until I retrieve the pin, without worrying about my data being automatically erased? What if normal boot won't recognize the correct pin after recovering/changing it from TWRP? Do you know any terminal commands to execute the above tasks?
Click to expand...
Click to collapse
Go into TWRP.
Click the file manager.
Now go to data/system and find "locksettings.db" and delete it.
Reboot phone and see if pin is gone. If not.
Beck to TWRP. Back into data/system. And delete all of these and anything else that starts with "locksettings" that I forgot.
"gatekeeper.password.key
-gatekeeper.pattern.key
-locksettings.db
-locksettings.db-shm
-locksettings.db-wa
Reboot and pin should be gone.
Look into these as well.
[Solution] How to Delete Your Android Security PIN & PATTERN
This guide will walk you through deleting your security PIN via several methods. This guide is for those who have forgotten your security PIN and cannot do a Google reset for some reason. Have restored your phone from an old backup that had a...
forum.xda-developers.com
[Tool][Tested]Remove lockscreen password/pin
Hi Guys, I know it's a frustrating situation when your phone reject your lockscreen password. There are some solutions and I had made a flashable zip which will make the task easier for you instead of deleting the files yourself. This has been...
forum.xda-developers.com
andybones said:
Go into TWRP.
Click the file manager.
Now go to data/system and find "locksettings.db" and delete it.
Reboot phone and see if pin is gone. If not.
Beck to TWRP. Back into data/system. And delete all of these and anything else that starts with "locksettings" that I forgot.
"gatekeeper.password.key
-gatekeeper.pattern.key
-locksettings.db
-locksettings.db-shm
-locksettings.db-wa
Reboot and pin should be gone.
Look into these as well.
[Solution] How to Delete Your Android Security PIN & PATTERN
This guide will walk you through deleting your security PIN via several methods. This guide is for those who have forgotten your security PIN and cannot do a Google reset for some reason. Have restored your phone from an old backup that had a...
forum.xda-developers.com
[Tool][Tested]Remove lockscreen password/pin
Hi Guys, I know it's a frustrating situation when your phone reject your lockscreen password. There are some solutions and I had made a flashable zip which will make the task easier for you instead of deleting the files yourself. This has been...
forum.xda-developers.com
Click to expand...
Click to collapse
The /data folder doesn't list any files
casxa said:
The /data folder doesn't list any files
Click to expand...
Click to collapse
That's weird..
Are you rooted?
andybones said:
That's weird..
Are you rooted?
Click to expand...
Click to collapse
Should be. I don't remember any time I unrooted it after Lineage installation. Can I try to install magisk via twrp (even without installing the manager first, since I can't access the os) or will it override the data?
casxa said:
Should be. I don't remember any time I unrooted it after Lineage installation. Can I try to install magisk via twrp (even without installing the manager first, since I can't access the os) or will it override the data?
Click to expand...
Click to collapse
You can flash the Magisk.apk in TWRP and it won't remove any data.
Then do a reboot from TWRP bavk into TWRP and then you should be rooted and should be able to see data/ partition now.
I'd flash the newest 25.2, and you can flash the .apk in TWRP.
Releases · topjohnwu/Magisk
The Magic Mask for Android. Contribute to topjohnwu/Magisk development by creating an account on GitHub.
github.com
andybones said:
You can flash the Magisk.apk in TWRP and it won't remove any data.
Then do a reboot from TWRP bavk into TWRP and then you should be rooted and should be able to see data/ partition now.
I'd flash the newest 25.2, and you can flash the .apk in TWRP.
Releases · topjohnwu/Magisk
The Magic Mask for Android. Contribute to topjohnwu/Magisk development by creating an account on GitHub.
github.com
Click to expand...
Click to collapse
I tried to flash the Magisk apk
Code:
adb sideload Magisk-v25.2.apk
But it had no effect.
casxa said:
I tried to flash the Magisk apk
Code:
adb sideload Magisk-v25.2.apk
But it had no effect.
Click to expand...
Click to collapse
Curious why sideload instead of just hitting install button?
But can you Screenshot me what is shows in the TWRP file manager.
(after the successful flash of Magisk, you'd need at least 1 reboot from TWRP to TWRP before taking effect)
andybones said:
Curious why sideload instead of just hitting install button?
But can you Screenshot me what is shows in the TWRP file manager.
(after the successful flash of Magisk, you'd need at least 1 reboot from TWRP to TWRP before taking effect)
Click to expand...
Click to collapse
Even that method didn't work. I put the apk (renamed to zip) and clicked on "Install" and rebooted. Nothing.
The file manager still shows nothing inside data folder.
casxa said:
Even that method didn't work. I put the apk (renamed to zip) and clicked on "Install" and rebooted. Nothing.
The file manager still shows nothing inside data folder.
Click to expand...
Click to collapse
Very strange, it should flash as .apk.
But I can't think of any reason why nothing is showing in /data.
Sorry man.
Hopefully someone with more experience can help out.

Categories

Resources