dfe 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. # Install Disable Force Encryption patch:
  16. if ! twrp install "$TOOLSDIR/dfe-neo-v2.zip"; then
  17. echo "Error: Failed to install dfe-neo-v2.zip"
  18. exit 1
  19. fi
  20. # Install Boot repack patch:
  21. if ! twrp install "$TOOLSDIR/boot_repack.zip"; then
  22. echo "Error: Failed to install boot_repack.zip"
  23. exit 1
  24. fi
  25. # Wipe Dalvik/ART cache:
  26. if ! twrp wipe dalvik; then
  27. echo "Error: Failed to wipe Dalvik/ART cache"
  28. exit 1
  29. fi
  30. # Wipe Cache partition:
  31. if ! twrp wipe cache; then
  32. echo "Error: Failed to wipe cache partition"
  33. exit 1
  34. fi
  35. # Instructions:
  36. echo "- If you're flashing for the first time"
  37. echo "(on an encrypted device),"
  38. echo "please manually format the data partition."
  39. echo ""
  40. echo "- If you're doing a dirty flash"
  41. echo "(reinstalling or updating without wiping),"
  42. echo "there's no need to format the data partition."
  43. # End message:
  44. echo "- Finished!"
  45. echo "- Please do manual reboot !"
  46. exit 0