leegarchat / dfe-neo-v2

32 stars 6 forks source link

Disable Force Encryption Native Early Override (DFE NEO v2)

Forum Discussions:

Disabling Encryption for Android /data

Description

DFE-NEO v2 is a script designed to disable forced encryption of the /userdata partition on Android devices. It is intended to facilitate easy switching between ROMs and access to data in TWRP without requiring data formatting or deletion of important user files, such as ./Download, ./DCIM, and others located in the device's internal memory.

Usage

At the moment, the script can only be used as an installation file via TWRP.

  1. Install dfe-neo.zip.
  2. Select the desired configuration.
  3. After successful installation, if your data is encrypted, you need to format the data:
    • Go to the TWRP "Wipe" menu.
    • Select "format data".
    • Confirm the operation by entering "yes".

Note

Attention: Before using the script, make sure you understand how it works and backup your data to prevent data loss.

Pros and Cons of Disabling /data Encryption

Pros

Cons

It is important to carefully weigh all the pros and cons before deciding to disable data encryption on your device. Security and usability should be balanced depending on your needs and the threats you face.

DFE-Neo Script Operation:

First Stage:

  1. Determining Firmware Slot: The script determines which suffix/slot the firmware should boot into.

  2. Repartitioning: Necessary for determining the correct slot. After this, any zip files can be installed without having to reboot TWRP after installing a new firmware.

  3. TWRP Bypass: Sets the suffix TWRP should boot into if a new firmware is installed.

Second Stage:

  1. Checking for DFE-Neo v2: Checks if DFE-Neo v2 is installed. If installed, the script offers to remove DFE or install it again.

  2. Setting Arguments: Arguments are set by the user or read from the NEO.config file.

Third Stage:

  1. Mounting vendor partition of the boot firmware: The script mounts the vendor partition of the boot firmware.

  2. Copying files from /vendor/etc/init/hw: All files from the specified directory are copied to a temporary folder.

  3. *Modifying fstab and .rc files*: .rc files and fstab are modified according to parameters from NEO.config.

  4. Creating ext4 image with modified files: An ext4 image with modified files from the temporary folder is created.

Fourth Stage:

  1. Writing inject_neo.img to vendor_boot/boot: inject_neo.img is written to vendor_boot/boot of the opposite suffix or current slot and suffix.

  2. Checking boot suffixes: Checks for the presence of ramdisk.cpio and fisrt_stage_mount fstab file.

  3. Modifying fisrt_stage_mount: fisrt_stage_mount file is modified by adding a new mount point.

Optional Actions:

This is a general description of how the DFE-Neo script operates. It performs a series of steps to prepare and modify the system to ensure the correct execution of the firmware installation and update procedure on the device.

Used Binaries