yashsingh1/xdaforums huggingface dataset:
[Android Software Development] alecxs:
It patches fstabs whereever it finds, not limited to boot
[Android Software Development] chaoscreater:
Does it backup the partitions before patching?

I didn't know that it patches the nvdata partition, which I didn't make a backup of because TWRP can't see this partition for some reason. It was until after I switched to using OrangeFox that I could backup nvdata, but at that point it's already too late.

I'm using Xiaomi Redmi Note 9T and I've tried to find the nvdata.img from the official fastboot ROM, but it doesn't seem to have it....
[Android Software Development] alecxs:
TWRP excluded nvdata from twrp.fstab for reason, so user can't mess up with, but also no backup. only way to backup is adb pull.

quick search give posts #359 #382 #395 #419 #527 #762 remind me of some secontext issue with nvdata, not sure nvdata is excluded meanwhile.

Unfortunately there is no automatic backup, it's on your own responsibility.
[Android Software Development] Zackptg5:
So this may not come as a surprise to many of you but the situation hasn't changed here. I don't have any devices with fully functional TWRP and don't see that happening in the near future. I also no longer have a desire to disable encryption/verity on my devices so I won't be updating this mod anymore.

Anyone who wants to fork and update/modify is completely free to do so :)
[Android Software Development] crok.bic:
Thank you for your work!
[Android Software Development] der.lange:
This piece of software is a joy forever.......

It is working fine for my Sony Xperia XZ2P (latest stock: A10)

Thanks a lot!!!
[Android Software Development] chaoscreater:
I'm on a ROM with encryption disabled and I want to re-enable encryption on it. The "Encrypt Phone" setting in Android doesn't do anything, so I tried to use this to enable encryption. It shows keepforceencryption = true in the logs, but after I boot to System, it still shows the storage as decrypted instead of encrypted....
[Android Software Development] WoKoschekk:
Short answer: Format your data partition and enable encryption before you boot up the first time. The same way as disabling it.

You can't change the encryption flag on a running system which is already configured. This flag only tells your system what to do in case no flag has already been set (setting up your device or format data partition). On the other hand changing this flag also won't decrypt your data in case it's already encrypted. ;-)
[Android Software Development] chaoscreater:
Well, formatting DATA and reconfigure everything is the last thing I'd want.........I was hoping to avoid that.
[Android Software Development] WoKoschekk:
It takes a lot of time depending on how much data has to be encrypted. You should give this process a few hours to be completed.
[Android Software Development] WoKoschekk:
Android uses File-Based Encryption on newer OS versions and not the full disk encryption. So, every single data file stored on your device must run through this encryption process.
[Android Software Development] chaoscreater:
Well, all that did was reboot the phone, which appears to be doing something during the Android logo animation, then after about 10~20 seconds it boots to lockscreen. Tried this a few times already and it didn't do anything, phone still unecrypted.

Anyway, I've decided to keep my phone unecrypted. THe problem is, I can't get this .zip to decrypt my phone. The steps I took are:

1. Flash stock MIUI ROM

2. Flash the ForceDecryption.zip file

3. Format Data

Problem is, phone still shows storage as encrypted instead of unencrypted. I know I've done it before, but I just can't remember exactly how I did it....
[Android Software Development] WoKoschekk:
Since every Android device is being (force-)encrypted during first boot it should be encrypted after restoring the stock ROM. There is no need of any .zip to do that.
[Android Software Development] chaoscreater:
I'm not sure I understand what you mean. My point is that I'm now trying to make it unecrypted, not encrypted.
[Android Software Development] WoKoschekk:
You are right, I mixed up the terms...

You really did 'format data' and not just wiped it? The most common mistake when doing this.

Maybe Xiaomi requires some extra steps to be unencrypted? I wouldn't be surprised at Xiaomi.

A recovery.log would be helpful to figure it out.
[Android Software Development] chaoscreater:
Yeah, 100% formatted data and not wipe.

Here's the recovery log:

UPDATE:

So the interesting thing I found is that if I flash "Disable_Dm-Verity_ForceEncrypt_02.24.2020.zip", then when I reboot to System, it'll bootloop at the "Redmi" logo. It's not even reaching the Android boot animation at this point. However, if I use a older .zip version ("Disable_Dm-Verity_ForceEncrypt_11.02.2020.zip"), it'll boot straight to the Android setup wizard, but at that point the Storage is encrypted and not decrypted.

UPDATE 2:

OK, WTF I have no idea what I did differently this time, but I used the 02_24.2020 build again and I then flashed the stock Boot.img back (because I was boot-loop stuck at the Redmi logo) and now I can boot to Android system. I can now see my storage is unencrypted (YAY!). Now the next step is to figure out how to dirty flash a MIUI stock ROM over my existing one......I'm trying to upgrade from 12.5.5 to 12.5.7. On my 12.5.5 build, I have all my data there (unencrypted). On the new 12.5.7 that I just tested, I also have unencrypted storage, but this was a fresh new ROM flash, not a dirty flash on top of 12.5.5....
[Android Software Development] WoKoschekk:
TWRP was not able to mount /vendor as r/w to patch your /vendor/etc/fstab. This file stores your filesystem table and all mount flags. The /userdata's mountflag 'fileencryption=' should get overwritten to 'encryptable=' (or vice versa) to disable/enable device encryption.

But with a read-only /vendor this wasn't possible.

It's the

same

ROM build only a newer version? Then just flash it without wiping /data.
[Android Software Development] WoKoschekk:
Give me the exact buil no. of the ROM or a download link and I will patch the fstab file mnually for you. It takes only a few minutes.
[Android Software Development] WoKoschekk:
After that I will upload a patched raw image of vendor which can be flashed.
[Android Software Development] alecxs:
as already stated several times this is a one way road. there is a flag forceencrypt= which was deleted from fstab intentionally by flashing this zip. If you restore the flag or replace it with encryptable= yourself (FDE only as there is no pendant to FBE fileencryption=) you can encrypt device without factory reset. Also the "Encrypt Phone" setting becomes functional again.

but this zip makes no backup of fstab and will therefore not undo any changes. you can either restore whole vendor or boot partition (depending on your fstab location) or edit fstab with Notepad++ yourself

I wonder why you have TWRP in first place, isn't that perfect use case? backup your /data, do whatever you want (format/encrypt) and restore backup afterwards?
[Android Software Development] chaoscreater:
Hmm that's odd, I've made sure to mount vendor during the zip install and it didn't throw any errors? It looked like it did complete the job successfully? And it seems that the latest build (02_24.2020) actually did the job already. I mentioned in a previous post that my storage is now unencrypted.

Yes, it's the same ROM build but only a newer version. I did try to flash it without wiping data, but the problem is that it doesn't boot due to DATA being unencrypted. I think what's happening is that stock MIUI will always expect the DATA to be ENCRYPTED and because it's UNENCRYPTED, it doesn't boot. I had previously tried to flash the universal disable forceencrypt zip and thought that would do the job, but it didn't. I believe it is probably because I was using an older build (11/2/2020) instead of (02/24/2020)?

Yeah, I've backed up both vendor and boot and can restore them. I'll make sure to do this and then use Encrypt Phone, if I decide to re-encrypt the phone again......but this doesn't really sound like 1 way? If you can just restore the fsttab and then re-encrypt, then that sounds like a route back to encrypted.

Regarding TWRP, I'm not too sure what you mean......if DATA was decrypted and I took a TWRP backup of it, then that DATA partition will be decrypted. If I flash a brand new ROM, it'll be encrypted by default. If I then restore my DATA (unecrypted) partition back, phone wouldn't boot, because it's expecting an encrypted Data partition.

Also, the reason why I wanted to convert back to Encrypted in the first place was because TWRP now supports Data decryption for my phone. I can now backup my encrypted Data partition. The problem is that when I need to restore it, the phone doesn't boot. I'm not too sure on the specifics, but someone told me this:

Which basically means that if I want to backup and restore my Data partition, I need to keep it unencrypted. This is why I decided to stay decrypted again.
[Android Software Development] WoKoschekk:
yes, damn... I forgot about it! I thought the flag gets replaced by 'encryptable=' but it gets erased. So, you have to restore it manually. I always did it manually this way.
[Android Software Development] alecxs:
exactly. but the zip can't do it.

No. TWRP back up plain files only, not whole partition. It can restored to both, decrypted or unencrypted partition.

IMHO If your phone does not boot it must have other reason (dm-verity will deny booting if it detects TWRP) or you just impatient (not sure regarding FBE credentials, though)
[Android Software Development] chaoscreater:
It's not related to dm-verity.

If I take a TWRP backup of a ROM that is completely unencrypted, I can restore everything (including DATA) just fine. Phone boots just fine.

If I take a TWRP backup of a ROM that is encrypted and then I try to restore, phone won't boot and will just immediately auto boot to recovery. The only way to fix it is to format Data, OR flash the latest universal forceencrypt .zip (02/24/2020).
[Android Software Development] alecxs:
FBE or FDE? get a logcat and figure out the reason, I did it several times FDE and had no trouble
[Android Software Development] ReMiOS:
I want to root my Samsung S9+ (SM-G965F) phone whith a stock rom using TWRP and Magisk.

I am currently on Android 10 (Q) Build: QP1A.190711.020.G965FXXSHFUJJ2

I've read lots of info from xda and internet, but the needed steps are not clear to me.

Whitch DM-Verity, ForceEncrypt, Disk Quota Disabler should i use ?

Index of /

Option 1: no-verity-opt-encrypt-6.1.zip ( is this version depreciated ? )

https://zackptg5.com/android.php#disverfe

Option 2: Disable_Dm-Verity_ForceEncrypt_11.02.2020.zip

Post #1,280 from Zackptg5

Option 3: Disable_Dm-Verity_ForceEncrypt_07.04.2021.zip

has extra line in: anykernel.sh

++ last line ---> flash_dtbo;

Probably stand for "Device Tree Blob Overlay"

https://github.com/Zackptg5/Disable_Dm-Verity_ForceEncrypt

Option 4: Disable_Dm-Verity_ForceEncrypt-master.zip

What options should i choose for ForceEncrypt and Disk Quota ?

ForceEncrypt: i do not need my data to be encrypted, is this option for data or system files ?

The EFS remains encrypted regardless of this option ? ( EFS stands for Encrypted File System )

--> so should i use the forceencrypt (or fec) option

Disk Quota: Can someone please explain this option to me ?

--> so should i use the quota option on a stock ROM ?

Does the position or case of the options matter (first quota or first forceencrypt)

Disable_Dm-Verity_Quota_ForceEncrypt-master.zip

Disable_Dm-Verity_ForceEncrypt_Quota-master.zip

disable_dm-verity_forceencrypt_quota-master.zip

What order of installation is important ?

Flash TWRP Installer Zip

Reboot into TWRP

Install Magisk

Install RMM if needed

Flash Disable_Dm-Verity_ForceEncrypt_Quota-master.zip

or is this wrong ?

Off topic:

What Odin version should i use ?

Several guides use version Odin3-v3.13.1.zip,

but latest i've found is Odin3-v3.14.4.zip ( latest Stable version is Odin3-v3.14.1.zip )

I want to flash TWRP v3.60: twrp-3.6.0_9-1-star2lte.img

Is it neccesary to install the RTMM Bypass ? ( and ad what step in the procedure should i do this)

RMM_Bypass_v3_corsicanu.zip

How can i install Magisk ?

( S9/S9+ supported in Magisk v16.6 and above) :

Latest ZIP file in releases is: Magisk-v21.4.zip

Can i rename Magisk-v24.1.apk to Magisk-v24.1.zip and install this version

or should i install Magisk-v21.4.zip and upgrade to Magisk-v24.1.apk

( the files arm/magiskboot, arm/magiskinit and arm/magiskinit64 appear to be missing in v24.1 )

Should i install the OEM Root fix (and what is the purpose ) ?

G965_PIE_Root_for_OEM_issue_devices_V5.zip

N965F_Root_for_OEM_issue_devices.zip
[Android Software Development] alecxs:
+1 for reading the thread. anyway, if you want magisk you don't need any extras, it's either or. if you're planning to install twrp you can use any encryption disabler. head over to twrp support thread
[Android Software Development] ReMiOS:
Does this mean i don't need TWRP at all if i just want root access ?

( and also no disable_dm-verity_forceencrypt etc. or rmm-patch )

Will my system & data files be enrypted on the device ( if so how can i acces them )

In TWRP there's an option to backup the EFS. Is this also possible when rooted with Magisk ?
[Android Software Development] sjamie:
You get root access by flashing Magisk in a custom recovery like TWRP or OrangeFox Recovery. I don't believe it is possible to get root access without using a custom recovery.
[Android Software Development] ReMiOS:
I've used TWRP / Magisk before on Oreo but now i can't find out what exactly is needed for the S9+

According to this quide it also should work .. link: Magisk install on Samsung
[Android Software Development] alecxs:
TWRP not required. Magisk will preserve dm-verity by default for SAR system-as-root devices anyway. rmm-patch, multidisabler etc is not required by Magisk, but recommended for TWRP.

backup with Migrate. or dump whole partition from adb. for FDE encryption check mount for block device dm-0 (number will vary)

same or EFS, just check partition symlinks in /dev/block/.../by-name

adb shell su -c "cat /dev/block/dm-0 2> /dev/null" > userdata.img
[Android Software Development] ReMiOS:
Thanks !

Successfully installed Magisk and root access

Also made a EFS backup:

Windows PC: adb.exe shell

star2lte:/ $ su

star2lte:/ # mount|grep efs

/dev/block/sda3 on /mnt/vendor/efs type ext4 (rw,seclabel,nosuid,nodev,noatime,journal_checksum,noauto_da_alloc,i_version)

/dev/block/sda3 on /efs type ext4 (rw,seclabel,nosuid,nodev,noatime,journal_checksum,noauto_da_alloc,i_version)

star2lte:/ # dd if=/dev/block/sda3 of=/data/media/0/efs.img bs=512

40960+0 records in

40960+0 records out

20971520 bytes (20 M) copied, 0.476773 s, 42 M/s

star2lte:/ # tar -cvf /data/media/0/efs.tar /efs
[Android Software Development] ropedu:
Is this method still active? And what are the links for the zip files please
[Android Software Development] WoKoschekk:
why shouldn't it be like that?

surprisingly you'll find in post #1 a link called 'Download'.
[Android Software Development] csdragon-theOriginal:
Good morning!

I know that the terminal won't work when the system is encrypted...

But: isn't it normally better if the system was encrypted?

Sorry for my dumb question... but normally I thought that a encrypted system would be better than a none encrypted...
[Android Software Development] koyo:
Is there an updated alternative to this? This doesn't work for the Moto G Stylus 5G
[Android Software Development] WoKoschekk:
What's not working? Please provide a log including a detailed error description. Otherwise it's nearly impossible to help you. thx
[Android Software Development] kramer04:
Note9

Android 10

Now Universal DM-Verity is deprecated

is there a way to mount data and sdcard on TWRP recovery ?
[Android Software Development] kecodoc:
can someone please help, i am on android 11 oxygenos with 2 partitions A and B What do I need to do to not get the error ? Why is there a Deprecated message ?

Thank a lot
[Android Software Development] Eclyy:
Hi, i keep getting Error 1 whenever i try to flash both "Disable_Dm-Verity_ForceEncrypt.zip" and "no-verity-opt-encrypt-6.1.zip" file.

I have tried a few no-verity version files, 5.0, 5.1 and 6.1.

As for TWRP, i have tried 2 version, 3.5 and 3.6.1.

I am using Samsung Note 10+ (Exynos).

I hope that someone can help me as this is for work purpose, i wish to get the phone rooted asap.

Thank you~~

Recovery.log: https://www.mediafire.com/file/1bptostewppgcxf/recovery.log/file
[Android Software Development] Guan Yu:
cool
[Android Software Development] marka89:
Does this work for any Android phone?
[Android Software Development] thewhisper:
Yes, if the android version is bellow 12. No decryption in android 12 yet...
[Android Software Development] alecxs:
it does not work for devices where vendor partition is ext4-dedup shared blocks, unless you modified to make it rw ;)
[Android Software Development] sabotage154:
hello. does anyone here know why after i flash rmm fix, no-verity-opt-encrypt-6.1, magisk v21 my sensors on my s8 g950n stop working? i also noticed when i boot into twrp, twrp no longer can install any zips and it does not see any storage on my device. twrp is unable to install anything and all storages say 0 bytes even though the phone boots up.

i think this happended to me before with another samsung device and someone sent me a file to flash that fixed the issue. i think it was an selinux fix or something of the sort but i cant remember exactly.

here is my setup

S8 G950N

G950NKOU5DTF2

Flash TWRP-3.2.1-0.dreamlte.image.tar successfully via odin

boot into recovery

format data

boot into recovery again

flash RMM_Bypass_v3_corsicanu.zip

flash no-verify-opt-encrypt-6.1.zip

also tried with no-verify-opt-encrypt-5.1.zip

flash magisk -v21.0 zip

phone does get rooted. i am able to boot into system but sensors stop working. any help would be greatly appreciated.
[Android Software Development] Etrusco54:
Greetings,

I am not a modding expert and for this I would like to know if the Disable_Dm-Verity_ForceEncrypt_20210320 zip can be for me.

I have a Xiaomi Redmi Note 8T on which I would like to mount the Mi-Globe custom ROM in order to have all the advantages of a ROM based on MIUI and with automatic call recording working.

All the attempts made in the last month have failed miserably, the phone either goes into bootloop or automatically returns to recovery.

The same happens even if it starts from a stock ROM flashed via fastboot, then I install the recovery (TWRP or Orange Fox it makes no difference), then I install the MI-Globe zip. I format the data before and after the installation, or only before or only after or even without formatting the data but doing only the factory reset. I even tried to do a "dirty" installation that is without doing any wipe but the phone does not want to know, it goes into bootloop between the screen with the MIUI logo and the one with the Mi-Globe logo.

I would like to know if this Disable_Dm-Verity_ForceEncrypt_20210320 can solve my problem.

Reading the many posts it would seem that by disabling the Dm-Verity the installation of the Mi Globe could be successful but, as mentioned at the beginning, I am not an expert on the subject and before making my phone an ornament I would like more information.

I apologize for the length of the post and for any inaccuracies in the English translation, I use an online translator ;-)

Ferruccio
[Android Software Development] alecxs:
if your TWRP does not support mounting dynamic partitions rw - this zip can't do it's job
[Android Software Development] Etrusco54:
and how do i know?

I use the latest TWRP available for my smartphone, v. 3.6.2_9-0

Or can I use Orange Fox v. 11.1 stable

Thanks
[Android Software Development] alecxs:
mount -w /vendor
mount
[Android Software Development] Etrusco54:
Tell me if I'm wrong:

phone in fastboot, I connect it to the pc and from the terminal I send the commands you sent me?

thanks
[Android Software Development] Bouls:
Once I flash this zip and try to flash magisk.zip after it to root my device it fails. It shows me the following: !Installation failed!

! Unsupported boot image extra!

!Please restore back to stock boot!

Please help, I need this file because when I'm rooting without flashing this file before I'm not able to access internal storage in twrp
[Android Software Development] Madfrog22:
i have a question. my device was encrypted, and i installed this zip as instructed. when i booted to lineageos 18, safetynet doesnt pass. is this what causing me to unable to use banking apps?
[Android Software Development] prana_Sky:
I tried the code you surgested in recovery termanal. then flashed the Disable_Dm-Verity_ForceEncrypt_11.02.2020 but still the phone Unencrypted. you have any idea why it's not encrypting or am i missing something. ive tried so many sanarios. its not working. any ideas would be appreatiated. Thanks
[Android Software Development] alecxs:
all fine. zip is helper to keep phone unencrypted
[Android Software Development] prana_Sky:
thanks for reaching out!

im a bit confused. the problem im having is when im encrypted with a fresh rom (lineage) and return to recovery (orange fox) my files are encypted. what i would like is to be encypted but go into recovey and see my files. the only way its working so far is if im decrypted. so do you now how i could go about doing this. it driving me crazy. cheers

edit: just thought id add that i'v been encypted flashing roms on this device op5t since the phone came out and never had this issue but all of a sudden i flash lineage 19.1 and it playing funnys.

Edit: working now by flashing a newer orange fox recovery 12.1.zip for op5t
[Android Software Development] aygul12345:
This is not working on Android 12?
[Android Software Development] maxidax24:
Is it possible to execute this script somehow in adb?

And then flash the result through fastboot?