Open backup ab in android

Инструкция по распаковке

1. Скачайте по ссылке файл Архив с утилитой и разархивируйте его в папку для распакованных данных с простым и коротким именем(например, AB). В результате распаковки в папке появится файл консольной утилиты ab2tgz.exe — это конвертор в tar.gz.

2. Поместите в эту же папку полученный по ADB файл сохраненных данных backup.ab. Если он имеет другое имя, обязательно переименуйте его в backup.ab.

Примечание. Утилита будет искать только такой файл. Так сделано, чтобы не было проблем с длинными или недопустимыми (например, русскими) именами файлов).

3. Перейдите в папку AB (сделайте её текущей) и откройте командное окно Windows, набрав команду cmd

4. Запустите утилиту ab2tgz.exe

5. В результате работы утилиты в папке появится файл backup.tgz (или сообщения об ошибках в окне команд)

6. Откройте файл backup.tgz распаковщиком 7-ZIP или другим аналогичным

7. После первой распаковки появится файл tar-архива с именем backup.tar

8. После второй распаковки tar-архива образуется папка c именем APPS, в которой можно увидеть одну или несколько или много папок (по количеству сохраненых приложений) с данными приложений. В каждой папке для одного конкретного приложения (например, ru.fourpda.client) вложено несколько папок (A, R, F, SP), а также файл манифеста с именем _manifest.
Для большинства системных приложений папки отсутствуют, но файл манифеста всегда есть (в нем хранится подпись приложения).

Примечание. В архиваторе 7-ZIP при распаковке GZ будет появляться предупреждение об ошибке. Оно вызвано отсутствием в файле контрольной суммы, но на дальнейшее извлечение TAR-архива это не влияет.

Предупреждение. Консольная утилита распаковки скомпилирована и проверена на 32-разрядной Windows XP. Работоспособность на других версиях Windows не проверялась.

Источник

Как извлечь данные приложения из полной резервной копии, созданной с помощью «резервного копирования adb»?

Я выполнял резервное копирование своего Nexus 7 с помощью adb backup резервного копирования всех файлов в зашифрованную резервную копию. Я вижу, что вы можете восстановить из резервной копии с помощью adb restore , но это сотрет все мои существующие данные на устройстве.

Как именно я могу извлечь данные одного приложения из этого зашифрованного файла резервной копии?

Просто для справки других, вот некоторые сведения о формате файла .ab.

Файл Android Backup (* .ab) представляет собой сжатый файл TAR . Он сжимается с использованием алгоритма DEFLATE . Кроме того, может быть использовано шифрование AES . Это определяется при создании резервной копии, если вы вводите пароль, то резервная копия шифруется, в противном случае; нет шифрования, оно только сжато.

ЗАГОЛОВОК файла немного отличается от обычного архива DEFLATE. Он содержит информацию о резервной копии и выглядит следующим образом:

Первая строка — это «Волшебная» строка . Следующая строка — версия формата файла Android Backup. Следующая строка — логическое значение (true или false, 1 или 0), указывающее, сжат ли файл. Последняя строка — это тип шифрования. Этот пример не использует шифрование. Если был пароль, в строке было бы написано «AES-256». После этого идет шифрование. Если пароля нет, то запускается «архив» DEFLATE.

Он сжимается с помощью Java Deflater . Что, с точки зрения разработчика, вызывает проблемы, если вы хотите использовать что-то кроме Java для его извлечения. Я не смог найти ничего, что могло бы спустить это с помощью того же алгоритма, хотя все, что я нашел (например, C #), должно следовать «SPEC».

С учетом вышесказанного , существует проект с открытым исходным кодом под лицензией Apache 2.0, написанный Николаем Еленковым , который позволит вам извлечь .ab в файл tar.

Если вы не уверены, как на самом деле использовать это (что выходит за рамки этого ответа), следующая версия Droid Explorer v0.8.8.7 ( доступна здесь ) позволит вам сделать именно это, и даже больше, прямо из Explorer. Вы можете прочитать больше о функциях в моем блоге (да, я знаю, бесстыдный плагин. Я делаю это, когда это соответствует вопросу)

Читайте также:  Размер иконки для андроида

Источник

AnatomicJC / android-backup-apk-and-datas.md

Backup android app, data included, no root needed, with adb

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Fetch application APK

To get the list of your installed applications:

If you want to fetch all apk of your installed apps:

To fetch only one application, based of listed packages results:

Backup applications datas

To backup one application, with its apk:

To backup all datas at once:

To backup all datas in separated files:

First, you have to install the saved apk with adb:

Then restore the datas:

Extract content of adb backup file

You will need the zlib-flate binary. You will able to use it by installing the qpdf package.

Then, to extract your application backup:

Miscellaneous: remove non-wanted applications

Sometimes, you have already installed (but non wanted) apps when you buy an Android Smartphone. And you can’t uninstall these apps. So Bad. And some pre-installed app are not present on PlayStore. WTF.

You can remove them with this command, and root is not needed:

You can first disable them, then when you are sure, you can remove them.

To list disabled apps:

This comment has been minimized.

Copy link Quote reply

natevw commented Mar 13, 2021

For other platforms there’s some zlib alternatives in the thread here. E.g.:

This comment has been minimized.

Copy link Quote reply

davtur19 commented May 17, 2021

For those using adb on Windows with bash

This comment has been minimized.

Copy link Quote reply

jrd commented Jun 22, 2021

pm list packages could be replaced by cmd package list packages as the pm list is a deprecated alias and can go away at any version.

This comment has been minimized.

Copy link Quote reply

thebigsmileXD commented Aug 14, 2021

To back up your SD card or any other folder to a tar file, you can do
adb exec-out «cd /storage/sdcard0 && tar c * -» > sdcard.tar
where adb pull might fail due to the target file system not supporting case-sensitive file names etc.

This comment has been minimized.

Copy link Quote reply

ToniCipriani commented Sep 21, 2021

Powershell for individual package backup:

Mind you for encrypted devices (which is almost every one out there these days) you will be prompted for a password ever single time.

This comment has been minimized.

Copy link Quote reply

GuruGoat commented Sep 25, 2021

Powershell to get all .apk.
Inspired by @ToniCipriani’s script above!

This comment has been minimized.

Copy link Quote reply

berkes commented Nov 10, 2021

If the backup file is empty, and/or the backup command exits immediately, that may be caused by running this as non-root.

First, enable «root access» for «ADB» on your devise at Settings -> System -> Developer options.

Then restart the server as root: adb root . Now the backup commands can access the data and can actually back them up.

This comment has been minimized.

Copy link Quote reply

osamh757955 commented Nov 12, 2021

Can I transfer WhatsApp Business through adb without root
Unfortunately, I haven’t been able to do it yet

This comment has been minimized.

Copy link Quote reply

forianzsiga commented Nov 15, 2021 •

actually, for newer devices (for me Android 12, unencrypted device, and without enabling password for the backup) the backup creation give me an empty file. When I changed the extension from .adb to .ab, the backup went seamlessly. It might be something version dependent, but it may be just a typo by the publisher.

This comment has been minimized.

Copy link Quote reply

osamh757955 commented Nov 15, 2021

actually, for newer devices (for me Android 12, unencrypted device, and without enabling password for the backup) the backup creation give me an empty file. When I changed the extension from .adb to .ab, the backup went seamlessly. It might be something version dependent, but it may be just a typo by the publisher.

There are no spelling errors in the text because I can transfer the official WhatsApp by adb, but I need to download the version to an old version, but WhatsApp Business cannot make a backup Is there a version of WhatsApp Business that allows me to backup

Читайте также:  Проклятие монтесумы для андроид

This comment has been minimized.

Copy link Quote reply

thebigsmileXD commented Nov 15, 2021

I’d prefer if this gist would stay a collection of helpful commands, and not a support forum, kthxbai

This comment has been minimized.

Copy link Quote reply

osamh757955 commented Nov 15, 2021

I’d prefer if this gist would stay a collection of helpful commands, and not a support forum, kthxbai

I want to ask more

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

How to Backup Android without Root via ADB commands

If you have a number of devices and have a large amount of data which you want to backup then you must use Android Software Developer Kit (SDK) along with ADB commands which can easily backup your device with a single command. Following is a step to step guide on how to backup Android without Root.

Prerequisites:

You must install the following tools on your computer in order to proceed.

You can find the Android SDK in Android Studio.

Enabling USB Debugging

In order to establish a connection between your android device and Android SDK, you must have to set up your device. For this, you have to enable USB debugging. To enable USB debugging mode

  • Go to “Settings
  • Go to “Developer options
  • Some devices don’t show “Developer options”. If your device is also not showing this, you have to enable it. To enable Build number,
  • Go to “Settings
  • Tap “About device
  • Tap “Build number” seven times
  • Now you will see “Developer options” within “Settings”. Here you can see “USB debugging”. Mark the check box next to it to enable it.

Now establish a connection between your PC and android device via USB. Ensure that Android Studio is running on the PC.

Install Google USB Driver

Follow these steps to install Google USB Driver in Android Studio.

  • Open “Android Studio
  • Then click “Configure
  • A Configure window will open. Click “Android SDK Manager
  • Android SDK Manager will open. Scroll down and find “Google USB Driver”. Mark the check box next to “Google USB Driver
  • Now you are done. Click “Install” to complete the process

Test Android Debug Bridge (adb)

You must test Android Debug Bridge (ADB) to make sure that it is communicating with your device correctly without suspending. For that reason, locate the path where the SDK was installed. If you don’t know or remember the path,

  • Open “Android SDK Manager”. Here you can find the exact path at the top of it.
  • Open “Windows Explorer” and locate the path.
  • Now go to “Platform-tools” folder.
  • Now you have to open “Command Window”. For that, hold down the “Shift” key and right-click within that folder, and select the “Open Command Window
  • To make sure adb can communicate with your device without suspending, test it by entering the command “adb devices
  • The output of this command must be your device in the form of a long string of characters

Backup your Android Phone:

Now you are done with all the necessary steps to create a backup android without root. Enter the following command in the same “Command Window

adb backup -apk -shared -all -f C:\Users\NAME\backup.ab

Note: In the path that is given Name is the name of your Windows username

A new screen will appear on your device asking for the password. If you want to encrypt the backup, enter a password or just tap on “Back up my data” in case you don’t want to encrypt the backup. A backup will be created in the folder that was declared in the backup command.

The above-mentioned steps will help you to create a full backup of your Android device. Now if you want to restore the data, follow these steps.

Restore

Connect the device you want to restore. Enter the following command in “Command Window

adb restore C:\Users\NAME\backup.ab

Note: In the path that is given Name is the name of your Windows username.

These steps will restore the data.

Update: You can also use Helium App Sync and Backup app to backup android without root.

If you face any problem in backing up or in the process of restoring the backup, feel free to ask for the solutions in the comments. Also, share your successful experience of backing up android through this method

Читайте также:  Андроид не включается после падения

Источник

[GUIDE] How to enable adb backup for any app changing android:allowBackup

scandiun

Senior Member

Some applications can’t be backed up by adb backup because the option is disabled on the AndroidManifest.xml of the apk. To workaround this, it is required to set android:allowBackup to true in the AndroidManifest.xml .

The application I will be patching is Signal Private Messenger, which by default doesn’t allow adb backups (security reasons, I guess). Also, it’s an open source application:
Signal Private Messenger (Play Store)
Signal Private Messenger (GitHub)

CHECKING FLAG_ALLOW_BACKUP
The first step is to check if the flag FLAG_ALLOW_BACKUP is present. It can be done several ways, but the easiest one is to use System Info for Android or System Info Pro for Android to check the flags of any desired application. Of course using Windows or Linux you can use script to auto-check for any number of apks.
You will see that in the app «Signal Private Messenger» the flag is missing with the official version:

Analyst also displays FLAGS per app. In this screenshot you can see Signal already patched:

APK EASY TOOL (WINDOWS APPLICATION)
To decompile, compile and sign the modified apk, the APK Easy Tool is the best to go, all in one with no complication. It requires java SDK installed and «java» and «javac» to be present on your PATH:
[TOOL] APK Easy Tool v1.2 for Windows (GUI tool, friendly)

Once you’ve executed «APK Easy Tool v1.2.exe», go to Options and configure «Decompiled directory» and «Compiled directory». You can just hit «Setup directories for me» and the folders will be set automatically to default locations:

Then go to the main tab of the program and leave checked «Sign APK after compile». Hit «Select» on «APK File to work on» and Decompile:

Now on your «Decompiled APKs» folder (you can use directly the button on the main windows of the program), open the file AndroidManifest.xml with a text editor. Notepad++ is highly recommended.

Then replace
android:allowBackup =» false »
with
android:allowBackup =»true«

After that, save the file and close the text editor. Now go back to APK Easy Tool and hit Compile to build the modified version of Signal Private Messenger. It will be present on the «Compiled directory».

APK EDITOR PRO (ANDROID APPLICATION)
APK Editor Pro is the way to go if you want to edit the file directly on the smartphone. First, you need to get the Signal apk from the smartphone, with some app like APK Extractor Pro.

Open the extracted Signal apk with the apk editor and edit the AndroidManifest.xml. Save and it will automatically compile and sign the new version.

Note that APK Editor Pro is very prone to errors, so it’s highly recommender to use the APK Easy Tool instead. Just try and error.

REINSTALL APP
To install on android the patched apk, you must first uninstall your previous version, and this is because the key used to sign the apk is different. If you try to install one app itself with a different signing key, you will get this error: [INSTALL_FAILED_ALREADY_EXISTS]

Now you can see that FLAG_ALLOW_BACKUP is present:

There are some things to have in mind when using apks signed with unofficial keys:

  • The app will no be updated anymore automatically from Google Play Store or any other store, because you are using a custom key. You must surveil periodically the store where you get the updates, download the newer apk, patch it and update it. The developer may or may not modify flags with future updates.
  • You can uninstall the patched app at any time to reinstall the official one from Play Store, but you will lose app’s data if you don’t perform a valid backup before.
  • Signing keys have an expiration date. The one used by APK Easy Tool is valid for a lot of years so shouldn’t be a worry.
  • The apks generated by APK Easy Tool are not zipaligned, but they will work perfectly the same. The only difference is that they will consum a little more of RAM.
  • If you modify several apks, it’s better to use the same signing key for ease of updating.

OTHER METHODS AND LINKS
There are a lot of methods to decompile, edit, recompile, sign and zipalign apks. I will provide some useful links with other software and development information:

Источник

Оцените статью