How to Create an Encrypted ADB Backup of Your Android Device (No Root)

14 min read Learn a step‑by‑step method to make a password‑protected ADB backup of your Android phone without rooting, verify it, and restore when needed. October 11, 2026 02:30 How to Create an Encrypted ADB Backup of Your Android Device (No Root)

Why an Encrypted ADB Backup Matters

When you switch phones, perform a factory reset, or simply want a safety net, a full device backup is essential. The built‑in adb backup command can capture apps, app data, and shared storage without rooting. However, the raw .ab file is stored in clear text on your computer, which is a privacy risk if the backup falls into the wrong hands. Adding a password encrypts the file, turning it into a secure vault that only you can open.

Before You Start

  • Computer with ADB installed – Windows, macOS, or Linux. If you don’t have it, download the platform‑tools package from the Android developer site and add it to your system PATH.
  • USB cable – Use the cable that came with your phone; cheap data‑only cables sometimes fail to carry the debugging signal.
  • Enable Developer Options on the phone: Settings > About phone > tap "Build number" seven times.
  • Enable USB debugging: Settings > System > Advanced > Developer options > toggle "USB debugging" on.
  • Charge level: Keep the device above 50 % to avoid interruptions.
  • Enough free space on the computer for the backup (usually 1‑2 × the size of the data on the phone).
  • Optional – OpenSSL: If you plan to extract the backup contents, install OpenSSL (available via Homebrew, apt, or Windows binaries).

Take a quick full backup of the computer or copy the backup file to an external drive after you finish. Encrypted backups are safe, but a corrupted file is unrecoverable.

Step‑by‑Step: Create an Encrypted ADB Backup

  1. Connect the phone and verify the ADB link

    Plug the phone into the computer. Open a terminal (or Command Prompt) and run:

    adb devices

    You should see a line with your device serial number and the word device. If it says unauthorized, check the phone for a dialog asking to allow USB debugging and tap Allow.

  2. Decide what to back up

    The adb backup command accepts several flags:

    • -apk – include the APK files of installed apps.
    • -shared – include files from the shared storage (photos, downloads, etc.).
    • -all – back up all user apps; combine with -system to include system apps (rarely needed).
    • -nosystem – explicitly exclude system apps (default for most users).

    For a typical personal backup we recommend:

    -apk -shared -all -nosystem
  3. Run the backup command with encryption

    Enter the following, replacing mybackup.ab with a name you’ll recognize:

    adb backup -apk -shared -all -nosystem -f mybackup.ab

    Immediately after you press Enter, the phone will display a prompt:

    "Backup password (optional)" – type a strong password, then confirm it.

    Do NOT leave the password field blank; an empty password creates an unencrypted backup.

    When the backup finishes, the terminal will return to the prompt and the phone will show a Backup complete toast.

  4. Confirm the file size

    On your computer, run:

    ls -lh mybackup.ab

    The size should roughly match the amount of data you selected. If the file is suspiciously tiny (< 1 MB), the backup likely failed – repeat the process and watch the phone for any error dialogs.

Verify the Backup File

Even an encrypted backup can become corrupted during transfer. A quick integrity check saves you from a painful restore later.

  1. Check the ADB header

    Run the following to display the first few bytes of the file:

    head -c 12 mybackup.ab | hexdump -C

    You should see the ASCII string ANDROID BACKUP followed by the version number (e.g., 01). If the output is garbled, the file is not a valid ADB backup.

  2. Test decryption (optional)

    If you want to be absolutely sure the password works, attempt a quick extract (see the next section). The decryption step will prompt for the same password you set earlier.

Optional: Convert the .ab File to a Readable Archive

The .ab format is a custom Android container. Converting it to a standard .tar lets you peek inside without restoring the whole device.

  1. Extract the raw data

    Run:

    dd if=mybackup.ab bs=24 skip=1 of=backup.tar

    This strips the 24‑byte header that adb adds.

  2. If you used encryption, decrypt the tar

    Use OpenSSL to decrypt:

    openssl aes-256-cbc -d -in backup.tar -out backup_decrypted.tar -pass pass:YOUR_PASSWORD

    Replace YOUR_PASSWORD with the exact password you entered on the phone. The command will produce backup_decrypted.tar if the password matches.

  3. Inspect the contents

    Now you can list the archive without extracting:

    tar -tf backup_decrypted.tar | head

    You should see directories like apps/, shared/, and system/. This confirms the backup captured the expected data.

If the OpenSSL step fails with “bad decrypt”, double‑check the password and ensure you used the exact same case and symbols.

Restore an Encrypted Backup

Restoring follows the same command line pattern, but you must be careful not to overwrite data unintentionally.

  1. Connect the device and verify ADB

    Same as step 1 of the backup process: adb devices should list your phone.

  2. Initiate the restore

    Run:

    adb restore -f mybackup.ab

    The phone will display a prompt asking for the backup password. Enter the same password you used when creating the backup.

  3. Watch the progress

    A progress bar appears on the phone. Do not disconnect the cable until the toast says “Restore complete”.

  4. Re‑enable apps if needed

    After a restore, Android may show some apps as “disabled” because the system is still processing the restored data. Open Settings > Apps, locate any disabled apps, and tap “Enable”.

Troubleshooting Common Issues

  • Backup aborts with “ADB backup is not supported”
    This message appears on devices running Android 12+ that have disabled the legacy backup service. In that case, ADB backup cannot be used. Consider using adb pull for specific folders or a third‑party solution like TWRP (requires unlocking the bootloader).
  • Phone shows “Backup failed” after entering the password
    Most often the password contains characters that the ADB dialog cannot render (e.g., emojis). Use a password limited to ASCII letters, numbers, and common symbols.
  • Backup file is 0 KB or very small
    Check that you selected the correct flags. Omitting -shared will skip all media files, which can make the backup appear tiny. Re‑run with the full flag set.
  • Restoring says “Incorrect password” even though it’s the same
    ADB treats the password as UTF‑8. If you copied it from a password manager that uses a different encoding, re‑type it manually.
  • OpenSSL decryption reports “bad decrypt”
    Make sure you used the -d (decrypt) flag and that the backup.tar you passed is the one produced by dd. Also verify that the bs value (24) matches the header size for your Android version (some OEMs use 28 bytes).

When Not to Use ADB Backup

While ADB backup is convenient, it has limitations:

  • It cannot back up device‑encrypted data that is only accessible after the user unlocks the screen (e.g., certain messaging apps).
  • OEM‑specific “protected” apps (Google Play Services, system UI) are excluded unless you explicitly add -system, which may cause compatibility issues on restore.
  • On Android 12 and newer, many manufacturers have disabled the feature for security reasons.

For a truly complete image, consider flashing a custom recovery (TWRP) and making a NANDroid backup – but that requires an unlocked bootloader and is outside the scope of a no‑root tutorial.

With the steps above you now have a reliable, password‑protected backup of your Android device that you can store safely, verify at any time, and restore whenever you need. Keep the backup file in an encrypted cloud folder or on an external drive, and you’ll avoid the dreaded “I lost all my data” scenario.

User Comments (0)

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