I’m trying to open the SMS db (for censor app) with this code:
SQLiteDatabase db = SQLiteDatabase.openDatabase("/data/data/com.android.providers.telephony/databases/mmssms.db", null, SQLiteDatabase.OPEN_READWRITE);
but it raises exception:
11-02 18:18:50.889: E/AndroidRuntime(17226): Caused by:
android.database.sqlite.SQLiteException: unable to open database file
I can open it from the ADB shell.
Is it possible to open this db for rw? Or maybe it’s possible only if I have root permissions?
You can’t open someone else’s database unless your code is running with superuser access. Content Providers are offered by many applications to allow restricted access to their data from your code.