A universal shell script designed for rooted Android 10+ devices to Disable Force Encryption (DFE) and convert Read-Only (RO) dynamic super partitions to Read-Write (RW).
This tool aims to simplify the process of making system partitions modifiable and disabling data encryption by handling the extraction, conversion, patching, and repacking of dynamic partitions automatically directly on the device.
Use this script at your own risk. Modifying the super partition or disabling encryption can result in bootloops, data loss, or a soft-bricked device. Always ensure you have a fallback method to recover your device (e.g., Fastboot, Custom Recovery, or a stock ROM flashing tool) and backup your important data before proceeding.
- Disable Force Encryption (DFE):
- Live patching of
fstaband.rcfiles acrossvendor,system, and other partitions. - Automatically patches boot image ramdisks (
boot,vendor_boot,init_boot). - Hides encrypted flags to prevent the system from re-encrypting
/data.
- Live patching of
- RO2RW (Read-Only to Read-Write):
- Dumps the existing
superpartition. - Extracts logical partitions (e.g.,
system,vendor,product). - Converts modern read-only file systems like EROFS and F2FS into read-write EXT4 images.
- Automatically handles EXT4 tuning if the partition is already EXT4 but mounted read-only.
- Repacks a new read-write capable
superpartition image.
- Dumps the existing
- Combined DFE + RO2RW: Run both procedures seamlessly in one go.
- Standalone Execution: Comes bundled with necessary binaries (
lpdump,lpmake,lpunpack,magiskboot,make_ext4fs,erofs, etc.) to run natively on Android via shell. - Workspace Flexibility: Select your working directory (Internal
/data, Internal Storage/sdcard, or an external MicroSD card) to ensure you have enough free space for operations. - Built-in Backup & Restore: Automatically backs up the original
superimage and provides an easy way to restore it if needed.
- Root Access: Magisk or KernelSU must be installed.
- Android 10+: Device must utilize dynamic partitions (
superpartition block). - Architecture: Supports
arm64andarm32devices (ensure the respectivearm64/arm32directories containing the binaries are placed next to the script). - Storage Space: You will need sufficient free storage to dump and rebuild the
superpartition. Usually, at least 10GB to 15GB of free space is recommended, depending on your device'ssuperpartition size.
-
Transfer Files to Device: Push the
dfe_ro2rw.shscript and the accompanyingarm64/arm32directories to your device. Using/data/local/tmpis highly recommended for speed and permission stability.adb push . /data/local/tmp/dfe_ro2rw adb shell -
Execute as Root: Gain root privileges and run the script.
su cd /data/local/tmp/dfe_ro2rw sh dfe_ro2rw.sh -
Follow the Interactive Menu: First, you will be prompted to choose a workspace storage location. Pick the one with the most free space.
Then, you will see the main menu:
============================================ DFE + RO2RW Tool ============================================ 1) Disable Force Encryption (DFE only) 2) RO2RW (convert super to read-write) 3) DFE + RO2RW (both) 4) Flash existing RW super image 5) Restore original super from backup 6) Exit ============================================Select your desired option.
- Option 1 (DFE only): Modifies your currently booted system to disable encryption. Reboots are recommended after completion. You may need to format data via recovery if you are transitioning from encrypted to decrypted for the first time.
- Option 2 (RO2RW): Creates a new
super_rw.imgfile but does not modify encryption. Once built, you can flash the image using Option 4 or manually via Fastboot (fastboot flash super super_rw.img). - Option 3 (DFE + RO2RW): Converts your system to RW and applies DFE patches simultaneously to the newly built image.
- Option 4 (Flash image): Scans the workspace for generated
super_rw.imgfiles and attempts to flash it viadd. (Note: Ifddfails due to locked partitions, you must reboot to fastboot/bootloader and flash manually). - Option 5 (Restore): Restores the
super_backup.imgcreated during Option 2 or 3.
- "Could not find super partition block device": Your device might not use standard dynamic partitions or the block mapping is non-standard.
- Out of Space/No space left on device: The process requires dumping the entire super partition (often 4GB-8GB) and rebuilding it. Use an external MicroSD card as the workspace if internal storage is full.
- Bootloop after flashing:
- Ensure you wiped
/data(Format Data) if you applied DFE on a previously encrypted device. - Re-flash the original super partition backup via Fastboot:
fastboot flash super super_backup.img.
- Ensure you wiped
This script utilizes concepts and tools from various community projects:
- DFE-NEO v2 by leegarchat
- SystemRW / RO2RW by lebigmac1
- SuperRW by munjeni
- Utilities like
magiskboot(topjohnwu),lpmake/lpunpack(AOSP/LonelyHacking), and standard Android build tools.