Razor Storm
Razor Storm

Reputation: 12326

Is there a way to access (read/write from) a specific application's sqlite database from the OS?

I am modifying the android OS slightly and wish to access a specific app's sqlite database.

I know that the location is stored at /data/data/your.applications.package/databases, however, is there a way to load the database into the sqliteDatabase connector from outside the context of the actual app?

Upvotes: 0

Views: 80

Answers (2)

CommonsWare
CommonsWare

Reputation: 1006614

however, is there a way to load the database into the sqliteDatabase connector from outside the context of the actual app?

Yes, if the code trying to open the database has read and write permissions to the database file. In that case, just use open() on SQLiteDatabase.

So, an app running as root could do this, but an ordinary other app cannot, for obvious security reasons.

even if I am trying to access from the kernel?

Since the kernel does not run Dalvik, you would not be able to open the database in the manner I described above.

Upvotes: 1

Anurag Ramdasan
Anurag Ramdasan

Reputation: 4330

I do not think it is possiblle. It is fundamental to the security model of Android. http://developer.android.com/intl/de/guide/topics/security/security.html

The other database must have a published ContentProvider implemented on it for you to be able to access its data. then you can try this http://androidforums.com/application-development/65082-accessing-database-another-application-using-content-provider.html

Upvotes: 0

Related Questions