jensstein / oandbackup

backup manager for android
Other
539 stars 192 forks source link

Restore backup manually #266

Closed lightonflux closed 4 years ago

lightonflux commented 4 years ago

Hello,

a few weeks ago i created a backup with 0.3.5 on Android Pie. Now i tried to restore the files on another phone with Android Pie and noticed that the folders do not contain a zip or log file.

.
├── base.apk
├── databases
│   ├── notepad.db
│   └── notepad.db-journal
└── shared_prefs

oab/dk.jens.backup » tree
.
├── base.apk
├── dk.jens.backup
│   ├── files
│   │   └── oab-utils
│   └── shared_prefs
│       └── dk.jens.backup_preferences.xml
├── files
│   └── oab-utils
└── shared_prefs
    └── dk.jens.backup_preferences.xml

5 directories, 5 files

Can i use this to restore the apps? Or are important informations missing?

lightonflux commented 4 years ago
  1. Install apks via adb install
  2. Check user and group of the folder in /data/data
  3. Copy the tld.dev.app folder from the backup directory into the /data/data forlder (aka replace it). Then fix the permissions with chown
  4. Test the app.

Script to install all apks via adb:


shopt -s globstar
ls **/*.apk > apk-list.txt

while read p; do
  adb install "$p"
done < apk-list.txt```

How to make a script that gets user and group from the packages list:
https://stackoverflow.com/questions/4831095/how-to-reset-android-data-data-com-xxx-xxx-permissions-linux ← only run the generated list on folders of user apps from your backup!

And don't forget about the SELinux fix. `restorecon -R .`

BTW: this does not work for all apps. Some might crash because they didn't used /data/data

PS: if i forgot something, please tell me.