TWRP Backup: различия между версиями

Материал из Home Wiki
Перейти к навигации Перейти к поиску
(Новая страница: «= Восстановление данных конкретного приложения = https://www.semipol.de/2016/07/30/android-restoring-apps-from-twrp-back…»)
 
 
(не показаны 2 промежуточные версии этого же участника)
Строка 39: Строка 39:
This is still not sufficient for the app to function properly again. If you try to launch the app now, chances are high that it complains about SQLite databases not being readable. This seems to be caused by SELinux, which is used by Android. The SELinux attributes of the files need to be restore, as described here:
This is still not sufficient for the app to function properly again. If you try to launch the app now, chances are high that it complains about SQLite databases not being readable. This seems to be caused by SELinux, which is used by Android. The SELinux attributes of the files need to be restore, as described here:
  restorecon -Rv /data/data/com.example.app
  restorecon -Rv /data/data/com.example.app
Finally, the app should be restored.
= Резервная копия =
# Перезаргужаем с клавишей sound+
# "Резервное копирование"
# # Выбор накопителя: micro sd
# "Свайп для начала" чтобы выполнить резервное копирование
# После создвния резервной копии сохранить её на компьютере через проводник
== Резервная копия apk ===
$ adb shell pm list packages | grep wah
package:com.wahoofitness.fitness
$ adb shell pm path com.wahoofitness.fitness
package:/data/app/com.wahoofitness.fitness-_w.../base.apk
$ adb pull /data/app/com.wahoofitness.fitness-_w.../base.apk
/data/app/com.wahoofitness.fitness-_w.../base.apk: 1 file pulled. 39.1 MB/s (100492561 bytes in 2.452s)

Текущая версия на 18:40, 9 сентября 2022

Восстановление данных конкретного приложения

https://www.semipol.de/2016/07/30/android-restoring-apps-from-twrp-backup.html

First of all - install application.

Backup of TWRP makes files like this:

boot.emmc.win
boot.emmc.win.md5
data.ext4.win000
data.ext4.win000.md5
data.ext4.win001
data.ext4.win001.md5
data.ext4.win002
data.ext4.win002.md5
data.info
recovery.log
system.ext4.win
system.ext4.win.md5
system.info

The app data is stored inside the data partition. So the first step is to extract this partition:

tar -xvf data.ext4.win000

Restart adb on the phone with root permissions:

adb root

Individual application data folders can be pushed to the telephone, e.g.:

adb push data/data/com.example.app /data/data/com.example.app

Android uses a single Unix user per application. First, the pushed files need to become owned bu the user of the application.

For this purpose, first the user id of the application needs to be found out. For this purpose the application needs to be installed already. On the phone, e.g. through adb shell do:

dumpsys package com.example.app | grep userId

This will print out the user id of the app, with which the files can be changed:

chown -R $id:$id /data/data/com.example.app

This is still not sufficient for the app to function properly again. If you try to launch the app now, chances are high that it complains about SQLite databases not being readable. This seems to be caused by SELinux, which is used by Android. The SELinux attributes of the files need to be restore, as described here:

restorecon -Rv /data/data/com.example.app

Finally, the app should be restored.

Резервная копия

  1. Перезаргужаем с клавишей sound+
  2. "Резервное копирование"
  3. # Выбор накопителя: micro sd
  4. "Свайп для начала" чтобы выполнить резервное копирование
  5. После создвния резервной копии сохранить её на компьютере через проводник

Резервная копия apk =

$ adb shell pm list packages | grep wah package:com.wahoofitness.fitness $ adb shell pm path com.wahoofitness.fitness package:/data/app/com.wahoofitness.fitness-_w.../base.apk $ adb pull /data/app/com.wahoofitness.fitness-_w.../base.apk /data/app/com.wahoofitness.fitness-_w.../base.apk: 1 file pulled. 39.1 MB/s (100492561 bytes in 2.452s)