0

I made a backup of app data in a rooted device with

tar -czvf example.app.back.tar.gz /data/data/com.example.app/

And after decompress the tar in other rooted devices with

cd /
tar -xvf example.app.back.tar.gz /data/data/com.example.app/

The app get this data working after I did

chmod -R 777 /data/data/com.example.app/

and when I reboot its like a factory reset ,all the app data is gone and the apk that can be installed only in sd and when reboot again the app are deleted and the start wizard appears agains

I think that the tar command create a /data folder or mess in some way the mount points

Maybe I omit in the example some flags in the tar command that i originally typed

The destination device have Android 4.1.1

9
  • 1
    You didn't take care for the permissions. The app might have been assigned a different userID on the other device. No idea why you backup/restore like that – where adb backup -noapk (and its restore) would have addressed the same action in a more safe way.
    – Izzy
    Jul 31, 2017 at 14:17
  • Umm, isn't the title misleading? The body doesn't explain how the data partition became read only.
    – Firelord
    Jul 31, 2017 at 14:19
  • @Firelord that rigth I will change the title Jul 31, 2017 at 14:23
  • @Izzy How I fix permisions , i think I mess with the full /data Jul 31, 2017 at 14:34
  • If it was just that single app: Uninstall it, remove that data folder (in case it remains). Then repeat backup/restore in a proper way: First install the app on the target device, then adb restore it's data from what you captured with adb backup -noapk -f app_data.ab com.package.name (where com.package.name is the app's package name – usually the same as the directory name you've dealt with before). If it broke more, factory-reset will be a last resort – especially if you really dealt "with the full /data".
    – Izzy
    Jul 31, 2017 at 14:38

1 Answer 1

0

Well, good job for running chmod after untar-ing. You, however, missed the most important thing: file owner/group.

If you look into /data/system/uiderrors.txt, you'll find a bunch of information like this:

1970/01/01 00:00: Package jackpal.androidterm uid has changed from 0 to 10001, old data erased.

I've already answered a question before about Android applications' UIDs. A factory reset would have made you lose more data than you have already lost now. As Izzy pointed out, you didn't take care about file permission owner/group, as the app might have been assigned a different UID on the other device, and all its data were erased by Package Installer.

You may want to take a look at my answer and restore file owner from /data/system/packages.list manually. As far as I can tell everything will be fine after that.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .