2

I have this old-ish Android app running on my Pixel4 w/Android12 phone, the app was last updated on 2018 and it clearly uses old API or whatever and the built-in backup functions are obsolete. It offers option to export its DB to a folder but it can only access /data/user/0/com.cooly.OilChangeSchedulePro/files folder (yes, I'm giving out the app name)

My question is how the heck I can take that file out of my phone? I do not have it rooted (and rooting will make it wipe, so no sense), please don't ask me to root the phone.

  1. tried using adb run-as package but then the package is not debuggable.
  2. tried to make the package debuggable by changing Manifest and repacking, but i cannot upgrade the app with my custom package.
  3. tried adb backup com.cooloy.OilChangeSchedulePro and it gets an empty backup, nothing inside.

Any other way I can access that folder on my phone and copy out my DB to be restored on other phone?

totalZero
  • 123
  • 4
  • Are you sure about the path /data/user/0/com/cooly.OilChangeSchedulePro, I would have expected com.cooly.OilChangeSchedulePro at the end (dot instead of slash after com. Also this is a strange path for a backup, as this path is never accessible by users. For `adb backup you can try to enable keyvalue option like shown i this answer for Chrome: https://android.stackexchange.com/a/232796/2241 – Robert Mar 15 '22 at 14:35
  • @Robert you were right, ,i fixed the path, my mistake! :) I will check that link you provided, thanks a lot! – totalZero Mar 15 '22 at 15:31
  • 1
    @Robert oh man, I just love you, adding -f to the backup (and nothing else) DID work indeed, I was able to get the backup and then just did a adb restore to the new phone and the app db was restored!!! Finally I was able to move that db, it was driving me crazy! If you want, add it as a solution and I will make sure it gets approved! :) – totalZero Mar 15 '22 at 15:45
  • Then it was just a typo on your side because the -f option should not change anything. Most likely you had a typo in the package name and therefore the created backup files was empty. – Robert Mar 15 '22 at 16:46

1 Answers1

1

If the app does not disallow backup in it's AndroidManifest.xml then you should able to retrieve the data using adb backup.

Some older apps make use of key/value storage which is not included in backup by default. To include this data change the adb backup command to:

adb backup -keyvalue -f oilchangesBackup.ab com.cooly.OilChangeSchedulePro

Just make sure to use the correct packageName of the app because if you make a typo the backup file will be empty.

Robert
  • 20,025
  • 6
  • 47
  • 66
  • 1
    I did another try just to make sure, and believeme, the -keyvalue DOES make the difference. Below is the proof (hard to read with no line breaks): adb backup -keyvalue com.cooloy.OilChangeSchedulePro -f test1 and adb backup com.cooloy.OilChangeSchedulePro -f test2 output two different files, one is empty and the other isnt. 4,007b test1 - 47b test2 ` – totalZero Mar 15 '22 at 16:54
  • @Smoke Then in the end it was the -keyvalue option. I updated the answer accordingly. – Robert Mar 15 '22 at 17:13