#!/system/bin/sh TOOLSDIR=/tools echo "- Disable Force Encryption" echo "- Author: Leegarchat , Jesus2025" echo "- Processing..." # List of valid device names: VALID_DEVICES="b5q dm1q dm2q dm3q gts9 gts9wifi gts9p gts9pwifi gts9u gts9uwifi q5q" # Detect the device name: DEVICE_NAME=$(getprop ro.product.device) # Check if the detected device is in the list of valid devices if ! echo "$VALID_DEVICES" | grep -w "$DEVICE_NAME" > /dev/null; then echo "Error: This script is intended for one of the following devices: $VALID_DEVICES, but detected '$DEVICE_NAME'" exit 1 fi # Install Disable Force Encryption patch: if ! twrp install "$TOOLSDIR/dfe-neo-v2.zip"; then echo "Error: Failed to install dfe-neo-v2.zip" exit 1 fi # Install Boot repack patch: if ! twrp install "$TOOLSDIR/boot_repack.zip"; then echo "Error: Failed to install boot_repack.zip" exit 1 fi # Wipe Dalvik/ART cache: if ! twrp wipe dalvik; then echo "Error: Failed to wipe Dalvik/ART cache" exit 1 fi # Wipe Cache partition: if ! twrp wipe cache; then echo "Error: Failed to wipe cache partition" exit 1 fi # Instructions: echo "- If you're flashing for the first time" echo "(on an encrypted device)," echo "please manually format the data partition." echo "" echo "- If you're doing a dirty flash" echo "(reinstalling or updating without wiping)," echo "there's no need to format the data partition." # End message: echo "- Finished!" echo "- Please do manual reboot !" exit 0