dfe 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #!/system/bin/sh
  2. TOOLSDIR=/tools
  3. echo "- Disable Force Encryption"
  4. echo "- Author: Leegarchat , Jesus2025"
  5. echo "- Processing..."
  6. # List of valid device names:
  7. VALID_DEVICES="b5q dm1q dm2q dm3q gts9 gts9wifi gts9p gts9pwifi gts9u gts9uwifi q5q"
  8. # Detect the device name:
  9. DEVICE_NAME=$(getprop ro.product.device)
  10. # Check if the detected device is in the list of valid devices
  11. if ! echo "$VALID_DEVICES" | grep -w "$DEVICE_NAME" > /dev/null; then
  12. echo "Error: This script is intended for one of the following devices: $VALID_DEVICES, but detected '$DEVICE_NAME'"
  13. exit 1
  14. fi
  15. # Check if tools directory exists
  16. if [ ! -d "$TOOLSDIR" ]; then
  17. echo "Warning: Tools directory '$TOOLSDIR' not found. Creating directory..."
  18. mkdir -p "$TOOLSDIR"
  19. fi
  20. # Install Disable Force Encryption patch:
  21. if [ -f "$TOOLSDIR/dfe-neo-v2.zip" ]; then
  22. if ! twrp install "$TOOLSDIR/dfe-neo-v2.zip"; then
  23. echo "Error: Failed to install dfe-neo-v2.zip"
  24. exit 1
  25. fi
  26. else
  27. echo "Warning: dfe-neo-v2.zip not found in $TOOLSDIR, skipping DFE patch installation"
  28. fi
  29. # Install Boot repack patch:
  30. if [ -f "$TOOLSDIR/boot_repack.zip" ]; then
  31. if ! twrp install "$TOOLSDIR/boot_repack.zip"; then
  32. echo "Error: Failed to install boot_repack.zip"
  33. exit 1
  34. fi
  35. else
  36. echo "Warning: boot_repack.zip not found in $TOOLSDIR, skipping boot repack installation"
  37. fi
  38. # Wipe Dalvik/ART cache:
  39. if ! twrp wipe dalvik; then
  40. echo "Error: Failed to wipe Dalvik/ART cache"
  41. exit 1
  42. fi
  43. # Wipe Cache partition:
  44. if ! twrp wipe cache; then
  45. echo "Error: Failed to wipe cache partition"
  46. exit 1
  47. fi
  48. # Instructions:
  49. echo "- If you're flashing for the first time"
  50. echo "(on an encrypted device),"
  51. echo "please manually format the data partition."
  52. echo ""
  53. echo "- If you're doing a dirty flash"
  54. echo "(reinstalling or updating without wiping),"
  55. echo "there's no need to format the data partition."
  56. # End message:
  57. echo "- Finished!"
  58. echo "- Please do manual reboot !"
  59. exit 0