Что такое формат файла AB?
.ab files are associated with Android Debug Bridge (ADB), a debugging tool available for Android 4.0 and later. Files with the .ab extension store backup copies generated using the adb backup command directly from the command line.
An .ab file is a binary container. It opens with the plain-text magic string ANDROID BACKUP, then four newline-terminated ASCII header lines that declare the format version (1 through 5), a compression flag, and an encryption tag (none or AES-256). Everything after that header is a DEFLATE-compressed TAR archive - and, when a password is given, an AES-256-encrypted one, with the key derived via PBKDF2 and a master-key checksum stored in the header.
Android Debug Bridge allows users to create custom backups that may include all installed applications or only selected app data. By default an .ab file stores app data - settings, databases and cache files - but not the APK itself; add the -apk flag to adb backup to include the installer packages. Android Debug Bridge also offers a feature to restore from an .ab backup using adb restore.
Android Debug Bridge offers many different features beside the ability to create backup copies, such as:
- file and folder copy,
- device control,
- ability to run a Unix-like shell,
- application installer.
Note that adb backup was deprecated starting with Android 12 (2021). Many apps already opt out by setting android:allowBackup="false" in their manifest. The format is being superseded by cloud backup solutions such as Google One Auto Backup and the open-source Seedvault project.
Безопасность и защита
РИСК: MEDIUMAn .ab is data, not executable code, so the file itself does not run anything. The real concerns are privacy and recovery: an UNencrypted .ab exposes app databases, tokens and personal data to anyone with the file - always set a password when backing up, and store .ab files securely. If you encrypted it and forget the password, the AES-256 payload is effectively unrecoverable (there is no backdoor). Only restore .ab files you created yourself; restoring an unknown backup can write attacker-controlled data into your apps.
Детали формата
в двух словахПрограммы, открывающие файлы AB
Технические подробности
глубокая спецификация| Format type | Binary container - plain-text ASCII header followed by a DEFLATE-compressed TAR payload; optionally AES-256 encrypted |
| Magic bytes (ASCII) | `ANDROID BACKUP` at byte offset 0, followed by four newline-terminated ASCII header lines |
| Header fields | Magic line, format version number, compression flag (1 = DEFLATE), and encryption tag (`none` or `AES-256`) |
| Compression | DEFLATE / zlib; controlled by the compression flag in the header (1 = compressed, 0 = uncompressed) |
| Encryption | Optional AES-256 (CBC); password-derived key via PBKDF2; master-key blob with HMAC checksum stored in the header |
| Internal payload | Standard POSIX/ustar TAR archive; per-app content stored in `apps/<package>/` directory trees |
| Format versions | Versions 1-5; version 5 introduced a stronger AES-256 encryption header; the inner TAR format is consistent across all versions |
| MIME type | `application/octet-stream` |
| Typical file size | A few MB to several GB, depending on the number of backed-up apps and their user data |
| APK inclusion | App installer packages are excluded by default; use the `-apk` flag with `adb backup` to include them |
| App opt-out mechanism | Apps declaring `android:allowBackup="false"` in their manifest are automatically excluded from the backup |
| Deprecation status | `adb backup` deprecated since Android 12 (API level 31, 2021); functionality increasingly restricted on modern devices |
| Restore command | `adb restore <file.ab>` - symmetric counterpart to `adb backup`, reinstalls data to a connected Android device |
| Developer | Google / Android Open Source Project (AOSP) |
| Platform support | Created on an Android device via `adb`; host-side tools run on Windows, macOS and Linux |
| Выпущен | 2012 (Android 4.0 Ice Cream Sandwich, adb backup) |
| Последняя версия | Backup format version 5 (adds AES-256 encryption header); 'adb backup' deprecated since Android 12 (2021) |
| Открыть стандартное | Да · без роялти |
| Спецификация | android.googlesource.com |
Конвертации AB
Вопросы и ответы сообщества
спрошено пользователямиВопросов пока нет - станьте первым, кто спросит о файлах AB.