[Xiaomi Poco F3 / Xiaomi Mi 11X / Redmi K40] LeeGarChat:
DFE ( Disable Forced Encryption )

MFP ( Multi Functions Patch, Universal script to install any ROM via TWRP )

MakeRW ( Gives system partitions permission to edit system files + increases the size of partitions. "Improved similar SystemRW" )​

To begin with, I will say that this script is primarily intended for installing any type of ROM via TWRP.

You fill in the arguments in the desired file, flash the script in TWRP, it will install everything without additional manipulations, it can also be used as a complete analogue of SystemRW (MAKERW), in my script the sections expand to the maximum, and there is the ability to use it separately as DFE ( Disabling Forced Encryption ), so that the memory is not encrypted and, for example, when changing the ROM, you would not necessarily need to format the / data partition, also in this case your data is not encrypted and TWRP will not ask for a password to change user data (access to internal memory), so to some extent, your data can all be safely pulled out in case the phone is stolen

Let's get started

First you need to download the script, the latest version is always available on SourceForge, the weight of the script is about 40mb

There are also truncated versions of MFP, intended only as a DFE/MAKERW script ( 4.6mb )

After you have downloaded it, you need to download the ROM you want to install, Recovery (optional, you can use the RECOVERY REFLASH function) works one-on-one as the function of the same name built into TWRP/OFOX/SHRP for A/B devices that do not have a special Recovery partition ), additional archives if you need Magisk, Gapps, Firmware, custom kernel, etc.

Now I will show you the arguments.txt setting which is always present inside MFP.zip using short videos as an example

An example of adding a recovery file, this file can be in both img and zip formats (for zip format, recovery.img must be inside the archive)

In this example, I add a recovery with the full path to the file. Video on Google Photo (click)

Spoiler content hidden.

In this example, I add a recovery without the full path to the file (works for all other arguments), in this case you need to put the file in the MFP folder. Video on Google Photo (click)

Spoiler content hidden.

Here I add a ROM and set it against FLASH RECOVERY and FLASH ROM "yes" telling the script that - YES, please flash these two files. Video on Google Photo (click)

Spoiler content hidden.

Also, the path does not have to start like in my examples, it may differ for you, in any case, my script tries to align the path to the state /sdcard/..,. you can also do it manually to avoid problems Video on Google Photo (click) , for OTG instead of /sdcard/ it will be /usb_otg/

Spoiler content hidden.

I also add additional .zip for installation, both with and without the full path, and I also write that FLASH ADDITIONAL ZIPS "yes" telling the script that these additional files need to be flashed. Video on Google Photo (click)

Spoiler content hidden.

Another example, I specify to the script in the DFE and MAKERW line parameters - "yes" as I need it, and for example I set RECOVERY REFLASH as - "yes" Video on Google Photo (click)

Note: if the RECOVERY REFLASH and FLASH RECOVERY options are both set to "yes", then in this case the priority will be given to the RECOVERY FLASH option if the archive or img exists and the path to it is specified, if the path is specified but the file does not exist, then there will be an error and the script will crash, if the path is not specified and the option is set to yes, then the option will be reset and will be NO

Spoiler content hidden.

Now consider 1 function, if the name of the .zip MFP contains the word ARGOUT <- exactly in capital letters, then in this case you tell the script that you need to read the parameters from argmunets.txt which is outside the .zip, and you need to put it in the same folder where MFP.zip "Video on Google Photo (click)" I did it first of all for faster debugging, I can safely go into the recovery, and upload the modified arguments.txt through the computer, without changing the archive, also in this case there is access to changing parameters directly from TWRP/OFOX/SHRP using the built-in text editing utility ( nano )

Spoiler content hidden.

Well, just like what I said earlier, you can use this script to use DFE or MAKERW on an already installed system. Video on Google Photo (click)

This also works for installing additional .zips

Spoiler content hidden.

Now you need to go to Recovery:

1. Just flash the MFP archive

2. If you use DFE after installing without errors, do format data (note, if you are in TWRP from VASI, then you need to reboot TWRP to format data) if you have not used dfe before (your data / data is encrypted), if you update firmware, then you do not need to do the format if the data has already been decrypted, after changing the firmware - it is recommended to make wipe data, you do not need to do this when updating the firmware

3. Do a reboot into the system and enjoy it

Notes:​

If you have a system installed in which fstab.sm8250 is present, and you use DFE, then the patch will make additional masking and the system will think that your data is encrypted (for example, with hentaios ) the data will actually be decrypted, but in the settings there will be an inscription they say encrypted.

If fstab.sm8250 is found, then TWRP from VASI will be automatically installed, if "yes" is set to RECOVERY REFLASH or FLASH RECOVERY with the specified path to the recovery file, this is the only TWRP that can work with these kernel sources, such protection from a fool

For the script to work correctly, I checked for free space on the device, for installing a ROM it is 24GB of memory, for a single MAKERW it is 15 ~ GB of space

If you only need DFE, then if a write-only (RO) system is detected, then the MAKERW patch will be applied

There is support for installing DFE / MAKERW via adb sideload, in this case you need to edit arguments.txt inside the archive.

If you use AOSP/LineageOS/hentaiOS recovery - adb sideload, then in the case of RO systems, you first need to flash only MAKERW, reboot the recovery, and only then flash DFE

If you use TWRP / OFOX / SHRP - adb sideload patch functionality is not limited

All ROM formats known to me at the moment are supported, in case new formats appear, you need to let me know, I will add support in the new version

There is also a video demonstration of the script

List of changes - Telegraph

You can thank me by donating a cup of coffee - PayPal

Code link to - GitHub

Download latest version - SourceForge