Comment by wodenokoto

5 years ago

To my very limited knowledge it is very common for iOS and android apps to store data in SQLite.

Is it possible to extract or change these databases?

I have a few (offline) apps on my phone that I’d love to append data to

As a sibling comment says, if you are on Android and have root access, it is very easy.

Just have a look at /data/data/appname/.

For example, this is what I copy to make backups of my contacts on my Android phone:

> # pwd

> /data/data/com.android.providers.contacts/databases

>> # ls -1

> calllog.db

> contacts2.db

> profile.db

This is a simple way for moving data around, restoring applications, performing backups, editing your data (if you know your way inside the app).

Beware of the selinux labels if you are moving files across different devices, as recent android version now run with selinux in enforcing mode.

Just be sure to adjust them (useful commands if you need a reference: ls -lZ, chcon, semanage).

For unjailbroken iOS the only way to extract these databases is to make an unencrypted device backup in iTunes (Finder in Catalina) and then look at the backup file. The backed up files won't be conveniently named but you can still find it.

It's possible on Android if you have root access, I think. Android is very serious about apps not accessing each other's data.

It's also super common on MacOS. According to lsof(1), my laptop has 95 sqlite .db files currently open; deduping by path shows 56 unique database files open at the moment.