0

I want to get my room/sqlite database off a phone. The app is downloaded from the Google Play store as an internal test and the manifest has these settings:

    android:allowBackup="false"
    android:fullBackupOnly="false"

I have read a few posts and ran this:

adb backup  -f backup.ab  com.myco.myapp

Which produced a file with 47 bytes. Seems low, but...

I then tried this:

dd if=backup.ab bs=4K iflag=skip_bytes skip=24 | openssl zlib -d > backup.tar

But got:

dd: bs: illegal numeric value
openssl:Error: 'zlib' is an invalid command.

So I tried:

java -jar ./abe.jar unpack backup.ab backup.tar

but when I try to open the tar file I get:

Unable to expand "backup.tar". It is an unsupported format.

The AppDatabase instance is:

instance = Room.databaseBuilder(context.getApplicationContext(),
                    AppDatabase.class, "user-database")
                    .fallbackToDestructiveMigration()
                    .addCallback(roomCallback)
                    .addMigrations(MIGRATION_1_2, MIGRATION_2_3, MIGRATION_3_4, MIGRATION_8_9, MIGRATION_9_10, MIGRATION_10_11)
                    .build();

The I am connected to the phone using a usb and it have developer settings on.

From what I have gathered here you cannot adb backup when the developer settings are false.

I have tried:

adb -d shell "run-as com.myco.myapp cat /data/data/com.myco.myapp/databases/user-database"> data.db

but get:

run-as: package not debuggable: com.myco.myapp

Will I be able to do this given it is not a debuggable app and the allowBackup is false?

lcj
  • 1,355
  • 16
  • 37
  • "How to get a database off my phone with allowBackup=false and package not debuggable" -- other than by rooting your device, this should not be possible. If it is, that's a substantial security flaw. – CommonsWare Jan 30 '22 at 22:17
  • I guess I need to root the phone. I've never done that before but will look it up. – lcj Jan 30 '22 at 23:32

0 Answers0