Secure Encrypted Android Backup with ADB – No Root Required

13 min read Step‑by‑step guide to back up Android apps and user data with ADB, convert the backup to a portable format, encrypt it with OpenSSL, and restore safely – all without rooting your device. October 07, 2026 06:30 How to Create a Secure Encrypted Backup of Android Apps and Data Using ADB and Open‑Source Tools (No Root)

What problem does this tutorial solve?

Many Android users want a local, offline copy of their apps and personal data that cannot be read by anyone who gains access to the backup file. Cloud services are convenient but raise privacy concerns, and a plain adb backup file is stored in clear text. This guide shows you how to create a fully encrypted backup using only free, open‑source tools, without needing root access.

Before you start

  • PC requirements: Windows 10/11, macOS 10.15+, or a recent Linux distro.
  • Android version: The classic adb backup command works up to Android 11. On Android 12+ the command is still accepted but may omit some data; the tutorial notes the limitation.
  • USB cable: Use a good quality data cable and keep the phone charged above 50 %.
  • Backup destination: An external hard drive or encrypted cloud folder where you will store the final .enc file.

Back up any critical data elsewhere before you begin – the process does not delete anything, but a power loss during the backup could corrupt the temporary files.

Step 1 – Install the required tools on your computer

  1. Install the Android SDK Platform‑Tools (contains adb).
    • Windows: download the zip from the official Android developer site, extract to C:\platform-tools, and add that folder to your PATH.
    • macOS/Linux: use brew install android-platform-tools or sudo apt install android-tools-adb.
  2. Download Android Backup Extractor (abe.jar). Save the abe.jar file to a folder you can easily reference, e.g. ~/tools/abe.
  3. Install OpenSSL – most systems have it pre‑installed. Verify with openssl version. If missing, install via your package manager (brew install openssl, sudo apt install openssl, etc.).

All three tools are command‑line utilities; you will run them from a terminal (Command Prompt, PowerShell, Terminal, or any shell you prefer).

Step 2 – Enable Developer Options and USB debugging on the phone

  1. Open Settings → About phone.
  2. Tap Build number seven times until you see the message “You are now a developer”.
  3. Return to the main Settings page, then go to System → Developer options (the path may vary on Samsung, Xiaomi, etc.).
  4. Toggle USB debugging on. Confirm any security prompt that appears.
  5. Connect the phone to the PC with the USB cable. When prompted on the phone, choose File Transfer / Transfer files mode.
  6. A dialog “Allow USB debugging?” will appear. Check “Always allow from this computer” and tap OK.

If the dialog never appears, try a different USB port or cable, and ensure the phone’s screen is unlocked.

Step 3 – Verify the ADB connection

adb devices

The command should list a single device with the status device. If you see unauthorized, repeat the authorization step in Step 2.

Step 4 – Create a raw ADB backup

The Android platform still supports the legacy adb backup command. It creates a single .ab file that contains APKs, app data, and optionally shared storage (photos, downloads, etc.).

# Backup all user apps, their data, and shared storage to a file named backup.ab
adb backup -apk -shared -all -f backup.ab

Explanation of the flags:

  • -apk – include the APK files themselves (so you can reinstall without the Play Store).
  • -shared – include files from the shared storage (DCIM, Downloads, Music, …).
  • -all – back up every installed user app.
  • -f backup.ab – write the output to backup.ab in the current working directory.

After you run the command, the phone will display a “Full backup mode” screen asking you to set a password. Leave the password field empty** (just tap Back up my data)** – we will encrypt the file later with a stronger algorithm. If you set a password here, you would need to remember two passwords, which adds unnecessary complexity.

When the backup finishes, you will see a progress bar on the phone and a line like “Backup transport: backup” in the terminal.

Step 5 – Convert the .ab file to a standard .tar archive

The .ab format is a simple wrapper around a tar archive, optionally compressed and optionally encrypted. The open‑source abe.jar tool can unpack it.

# Convert backup.ab to backup.tar (no compression, no password)
java -jar abe.jar unpack backup.ab backup.tar

If you receive a java.lang.OutOfMemoryError, increase the Java heap size:

java -Xmx2g -jar abe.jar unpack backup.ab backup.tar

Now you have a regular tar file that can be inspected with any archive manager.

Step 6 – Encrypt the tar archive with OpenSSL

We will use AES‑256‑CBC, a widely supported symmetric cipher. OpenSSL will ask for a passphrase; choose a strong, memorable one.

# Encrypt backup.tar to backup.tar.enc
openssl enc -aes-256-cbc -salt -in backup.tar -out backup.tar.enc

Explanation:

  • -aes-256-cbc – the cipher.
  • -salt – adds a random salt to protect against dictionary attacks.
  • -in and -out – specify input and output files.

After you type the command, OpenSSL will prompt twice for the passphrase. **Do NOT forget this passphrase** – without it the backup is unrecoverable.

Step 7 – Verify the encrypted backup

It is good practice to test decryption before you delete the original .tar file.

# Decrypt to a temporary file
openssl enc -d -aes-256-cbc -in backup.tar.enc -out test.tar
# List the contents of the tar to ensure it is intact
tar -tf test.tar | head

If the tar command lists a hierarchy of apps/ and shared/ folders, the encryption/decryption cycle worked.

Once verified, securely delete the unencrypted backup.tar (and the original backup.ab if you no longer need it) using a tool that overwrites the file, e.g. shred -u backup.tar on Linux or a third‑party secure‑delete utility on Windows.

Step 8 – Restoring the encrypted backup

When you need to bring the data back to a device (the same phone after a factory reset or a new device), follow these steps in reverse.

  1. Copy backup.tar.enc to the computer where you have OpenSSL and abe.jar.
  2. Decrypt the file:
openssl enc -d -aes-256-cbc -in backup.tar.enc -out backup.tar
  1. Re‑wrap the tar as an .ab file (ADB expects this format):
java -jar abe.jar pack backup.tar backup.ab
  1. Connect the target phone, enable USB debugging, and run:
adb restore backup.ab

The phone will display a “Restore backup” prompt. Tap Restore my data. If the original backup was created with a password (which we avoided), you would be asked to type it now.

Alternative method for Android 12+ (when adb backup is limited)

Starting with Android 12, Google deprecated the full‑device backup capability for security reasons. You can still back up individual apps that expose a run-as shell (debuggable apps) or use the adb pull command on public directories.

  1. Identify the package name of the app you want to back up (e.g., com.example.myapp) using adb shell pm list packages | grep myapp.
  2. Attempt to pull its data folder:
    adb shell "run-as com.example.myapp tar -czf /data/local/tmp/myapp.tar.gz /data/data/com.example.myapp"
    If the command succeeds, the app is debuggable and you can retrieve the archive:
    adb pull /data/local/tmp/myapp.tar.gz .
  3. Encrypt the resulting myapp.tar.gz with OpenSSL as described in Step 6.

This approach is manual and must be repeated for each app, but it works on newer Android versions without relying on the deprecated adb backup command.

Troubleshooting common issues

  • Device not listed by adb devices – Ensure USB debugging is on, the cable is data‑capable, and the phone is unlocked. Restart the ADB server with adb kill-server && adb start-server.
  • Backup stops unexpectedly – ADB may time out on large shared storage. Increase the timeout by setting the environment variable ADB_SERVER_SOCKET=localhost:5037 or split the backup: run adb backup -apk -all -f apps.ab and adb backup -shared -f shared.ab separately, then combine later.
  • OpenSSL reports “bad decrypt” – You likely entered the wrong passphrase. Remember that OpenSSL is case‑sensitive and does not tolerate leading/trailing spaces.
  • java –jar abe.jar throws “Invalid backup format” – The .ab file may be corrupted. Verify its size matches the expected output and re‑run the backup.
  • Restoration fails with “Error 5” – The target device may have a newer Android version that rejects certain app data. In that case, restore only the APKs (adb install -r *.apk) and manually copy user files.

Safety warnings and best practices

  • Never store the unencrypted .tar or .ab files on a cloud service without additional encryption. Even though they contain no passwords, they expose personal photos, messages, and app settings.
  • Keep the encryption passphrase in a password manager. Losing it means the backup is permanently unreadable.
  • Test your backup periodically. Run the decryption and tar -tf check at least once every few months to ensure the file has not degraded.
  • When moving the backup to a new device, verify the Android version compatibility. Some system apps cannot be restored on a different OEM device.
  • Securely delete intermediate files. Use tools that overwrite the data (e.g., sdelete on Windows, shred on Linux).

Putting it all together – a quick checklist

  1. Install adb, abe.jar, and openssl on your PC.
  2. Enable USB debugging on the phone.
  3. Run adb backup -apk -shared -all -f backup.ab.
  4. Convert: java -jar abe.jar unpack backup.ab backup.tar.
  5. Encrypt: openssl enc -aes-256-cbc -salt -in backup.tar -out backup.tar.enc.
  6. Verify decryption and delete the plaintext files securely.
  7. Store backup.tar.enc on an encrypted external drive or a trusted cloud vault.
  8. When needed, reverse the process: decrypt → pack → adb restore.

Following this workflow gives you a portable, password‑protected backup that you control end‑to‑end, without ever rooting the device.

Final thoughts

While Android’s built‑in backup service is convenient, it keeps your data in Google’s cloud. The method described here lets you keep a snapshot of your apps and personal files in your own hands, protected by strong AES‑256 encryption. Because the process relies only on official, open‑source tools, it works on virtually any Android phone and can be scripted for regular backups. Remember to keep your encryption key safe, verify backups occasionally, and delete any temporary, unencrypted copies. With these habits, you’ll have peace of mind that your Android data stays private and recoverable whenever you need it.

User Comments (0)

Add Comment
We'll never share your email with anyone else.