Recovery Engine for Saving Critical User Elements
A powerful TWRP backup tool compatible with Android-DataBackup
Backup your app data from TWRP recovery before flashing a new ROM
π‘ Quick Start: Boot TWRP β Decrypt data β Run
/sdcard/helpβ Follow prompts β Copy backup to safe location before flashing ROM
| Feature | Description |
|---|---|
| π¦ Complete Backup | APK, Data, User, User_DE, OBB, Media (all 6 elements) |
| π ADB Compatible | Restore using Android-DataBackup app |
| π― Smart Filtering | Auto-exclude Google, MIUI, Xiaomi system apps |
| π Size Estimation | Know backup size before starting |
| πΎ Space Check | Prevents failed backups with storage validation |
| π§ Dual Mode | Works as module OR portable (no installation) |
| π± TWRP Optimized | Clean interface with progress tracking |
| β Strict Validation | No accidental data loss with y/n only input |
| π Auto-Include | Bundles DataBackup.apk + restore guide |
- Download
rescue-v1.0.zipfrom Releases - Open KernelSU/Magisk app
- Flash the ZIP file
- Reboot to TWRP recovery
- Go to Advanced then Terminal
- Run: /sdcard/help OR */help
- Download and extract the RESCUE folder
- Copy rescue folder to /sdcard/
- Copy /sdcard/rescue/help file to /sdcard/help
- Reboot to TWRP
- Go to Advanced then Terminal
- Run: /sdcard/help OR */help
/sdcard/help OR */help
If Portable:
cd /sdcard/rescue
./rescue
If Installed in KernelSU/Magisk:
cd /data/adb/modules/rescue
./rescue
If MTP is enabled in TWRP recovery, you can run the script directly from your PC:
If Portable:
adb shell "cd /sdcard/rescue && ./rescue"
If Installed in KernelSU/Magisk:
adb shell "cd /data/adb/modules/rescue && ./rescue"
Using Helper Script:
adb shell /sdcard/help
π‘ Tip: This method is useful if you prefer controlling the backup process from your PC while the device is in recovery mode.
- Boot to TWRP.
- Decrypt /data (enter PIN/Pattern when prompted).
β οΈ Warning: Ensure /data is properly decrypted; this tool won't work on recoveries without data decryption and may lead to incomplete or corrupted backups. - Open Terminal (Advanced β Terminal).
- Run the script using one of the methods above.
- Follow prompts:
- Change backup directory? y/n
- Exclude system apps? y/n
- Estimate backup size? y/n
- Proceed with backup? y/n
After completing the backup, IMMEDIATELY copy the /sdcard/DataBackup/ folder to an external location BEFORE flashing the ROM. This is essential because:
- Flashing a ROM will wipe the
/sdcard/partition - All backup data on internal storage will be lost permanently
- Back up to: External SD card, USB storage, or PC via ADB
# Example: Copy via ADB to PC
adb pull /sdcard/DataBackup/ C:\Backups\RESCUE-Backup\
# Or manually copy via TWRP's file manager to external SD/USBThis module is particularly useful when you encounter a bootloop after modifying system files that cannot be fixed by restoring stock images such as init_boot, boot, vendor_boot, or system, and the only way to resolve that bootloop is to reflash the ROM (stock or custom) and format all the data. While you can easily copy files from internal storage using custom recovery (like TWRP) or ADB tools, app data and settings often cannot be restored manually due to Android's permission restrictions. This tool was created after experiencing data loss in such a scenario, initially for personal use, and later shared on GitHub to help others avoid similar issues.
/sdcard/DataBackup/
βββ apps/
β βββ com.whatsapp/
β β βββ user_0/
β β βββ apk.tar
β β βββ data.tar
β β βββ user.tar
β β βββ user_de.tar
β β βββ obb.tar
β β βββ media.tar
β β βββ package_restore_config.json
β βββ ...
βββ DataBackup.apk
βββ Restore-Guide.txt
After flashing the ROM and setting up the device:
- Install the Android-DataBackup app (included in your backup folder)
- Grant root access when prompted
- Set the backup location to your copied backup folder
- Scan and select the apps you want to restore
- Start the restore process (may take 10-20 minutes depending on backup size)
For detailed instructions, follow the Restore-Guide.txt included in the module.
rescue- Main backup script (brain of the tool)exclude- System app filter list (customizable)help- TWRP helper launcher scriptmodule.prop- Module metadata (Magisk/KernelSU)customize.sh- Installation script for moduleDataBackup.apk- Android-DataBackup app (restore tool)Restore-Guide.txt- Restore instructions and guide
nano /sdcard/rescue/exclude
case "$package" in
# Remove this line to backup Google Play Services (Not Recommended)
# com.google.android.gms) return 0 ;;
# Add custom excludes
com.example.systemapp) return 0 ;;
esacSave and exit.
To Run:
- TWRP (or recovery with terminal support, tested with just TWRP)
- Decrypted /data
- Storage space (β₯ 1.5x data size)
- Root for module install (portable optional)
To Restore:
- Android-DataBackup app
- Root access
- Same Android version recommended
β οΈ Excluding system apps may lose system app data (like saved notes in pre-installed notes app)β οΈ Backup time varies by app count and sizeβ οΈ Verify backupsβ οΈ Copy backup to PC before flashing
- π‘ Skip size estimation if urgent
- π‘ Exclude system apps to reduce size
- π‘ Use external SD for large backups
- π‘ Keep multiple backups
-
Invalid choice:
- Use
yornonly in prompts
- Use
-
Backup stuck:
- Wait (large backups can take time)
- Check free storage with
df /sdcard/ - Check log:
cat /tmp/rescue-log.txt
-
Data decryption fails:
- Ensure correct PIN/Pattern entry
- Some custom ROMs may have incompatible encryption
-
Low storage during backup:
- Change backup directory to external SD or USB
- Exclude unnecessary system apps to reduce size
Contributions welcome:
- Fork repo
- Create branch
- Make changes
- Submit PR
- Bug reports
- Features
- Docs
- Code fixes
Credits:
- Author: GhulamQadar (Snakeeyez248)
- Inspiration:
- Backup structure and Restore tool Android-DataBackup by XayahSuSuSu
- Helping script to call main script from TWRP terminal Magisk Manager for Recovery Mode (mm)
- Personal experience with data loss
- AI Assistance: Qwen AI (code implementation)
This project is licensed under the MIT License - see the LICENSE file for details.
(Basically, do what you want with it, just don't blame me if it breaks something!) π
If RESCUE helps you:
- Star repo
- Share with friends
- Leave feedback
Made with β€οΈ by GhulamQadar
"Because losing data should never be an option."