| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- #!/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
- # Check if tools directory exists
- if [ ! -d "$TOOLSDIR" ]; then
- echo "Warning: Tools directory '$TOOLSDIR' not found. Creating directory..."
- mkdir -p "$TOOLSDIR"
- fi
- # Install Disable Force Encryption patch:
- if [ -f "$TOOLSDIR/dfe-neo-v2.zip" ]; then
- if ! twrp install "$TOOLSDIR/dfe-neo-v2.zip"; then
- echo "Error: Failed to install dfe-neo-v2.zip"
- exit 1
- fi
- else
- echo "Warning: dfe-neo-v2.zip not found in $TOOLSDIR, skipping DFE patch installation"
- fi
- # Install Boot repack patch:
- if [ -f "$TOOLSDIR/boot_repack.zip" ]; then
- if ! twrp install "$TOOLSDIR/boot_repack.zip"; then
- echo "Error: Failed to install boot_repack.zip"
- exit 1
- fi
- else
- echo "Warning: boot_repack.zip not found in $TOOLSDIR, skipping boot repack installation"
- 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
|