Skip to content

Snakeeyez248/RESCUE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‘οΈ RESCUE

Recovery Engine for Saving Critical User Elements

License Platform TWRP

A powerful TWRP backup tool compatible with Android-DataBackup
Backup your app data from TWRP recovery before flashing a new ROM
⚠️ Use at your own risk - always test on non-critical data first!

πŸ’‘ Quick Start: Boot TWRP β†’ Decrypt data β†’ Run /sdcard/help β†’ Follow prompts β†’ Copy backup to safe location before flashing ROM


🌟 Features

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

πŸ“₯ Installation

πŸ”· Option 1: KernelSU/Magisk Module (Recommended)

  1. Download rescue-v1.0.zip from Releases
  2. Open KernelSU/Magisk app
  3. Flash the ZIP file
  4. Reboot to TWRP recovery
  5. Go to Advanced then Terminal
  6. Run: /sdcard/help OR */help

πŸ”· Option 2: Portable (No Root Required)

  1. Download and extract the RESCUE folder
  2. Copy rescue folder to /sdcard/
  3. Copy /sdcard/rescue/help file to /sdcard/help
  4. Reboot to TWRP
  5. Go to Advanced then Terminal
  6. Run: /sdcard/help OR */help

⚠️ Important: Always backup your data before flashing any ROM or making system changes. This tool helps recover app data, but prevention is better than cure!


πŸš€ Usage Guide

In TWRP Recovery or via ADB:

Method 1: Using Helper (Recommended)

/sdcard/help OR */help

Method 2: Direct Execution

If Portable:

cd /sdcard/rescue
./rescue

If Installed in KernelSU/Magisk:

cd /data/adb/modules/rescue
./rescue

Method 3: Via PC (ADB + MTP Enabled in TWRP)

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.

Step-by-Step Process
  1. Boot to TWRP.
  2. 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.
  3. Open Terminal (Advanced β†’ Terminal).
  4. Run the script using one of the methods above.
  5. Follow prompts:
    • Change backup directory? y/n
    • Exclude system apps? y/n
    • Estimate backup size? y/n
    • Proceed with backup? y/n
⚠️ Critical: Backup Safety

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/USB

Why and When This Module Is Useful

This 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.


πŸ“ Backup Structure

  /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

πŸ”„ Restore Process

After flashing the ROM and setting up the device:

  1. Install the Android-DataBackup app (included in your backup folder)
  2. Grant root access when prompted
  3. Set the backup location to your copied backup folder
  4. Scan and select the apps you want to restore
  5. 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.

πŸ› οΈ Files Explained

  • rescue - Main backup script (brain of the tool)
  • exclude - System app filter list (customizable)
  • help - TWRP helper launcher script
  • module.prop - Module metadata (Magisk/KernelSU)
  • customize.sh - Installation script for module
  • DataBackup.apk - Android-DataBackup app (restore tool)
  • Restore-Guide.txt - Restore instructions and guide

βš™οΈ Customization

Edit Exclude List

Open the File

nano /sdcard/rescue/exclude

Add or Remove Packages

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 ;;
esac

Save and exit.


πŸ“‹ Requirements

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

Warnings

  • ⚠️ 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

Tips

  • πŸ’‘ Skip size estimation if urgent
  • πŸ’‘ Exclude system apps to reduce size
  • πŸ’‘ Use external SD for large backups
  • πŸ’‘ Keep multiple backups

🐞 Troubleshooting

  • Invalid choice:

    • Use y or n only in prompts
  • 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

🀝 Contributing

Contributions welcome:

  1. Fork repo
  2. Create branch
  3. Make changes
  4. Submit PR
  • Bug reports
  • Features
  • Docs
  • Code fixes

Credits:


πŸ“„ License

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!) πŸ˜„


⭐ Support

If RESCUE helps you:

  • Star repo
  • Share with friends
  • Leave feedback

Made with ❀️ by GhulamQadar

"Because losing data should never be an option."

About

Recovery Engine for Saving Critical User Elements - TWRP backup tool

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages