如何打开系统SQLiteDatabase [英] How to open system SQLiteDatabase
问题描述
我试图打开SMS数据库(对于检查员应用程序)与此code:
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);
但它引发异常:
11-02 18:18:50.889:E / AndroidRuntime(17226):产生的原因:
android.database.sqlite.SQLiteException:无法打开数据库文件
11-02 18:18:50.889: E/AndroidRuntime(17226): Caused by: android.database.sqlite.SQLiteException: unable to open database file
我可以从亚行外壳打开它。
是否有可能打开这个分贝RW?或者,也许这是可能只有当我有root权限?
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?
推荐答案
您不能,除非你的code与超级用户访问运行打开别人的数据库。许多应用程序提供 内容提供商允许限制访问他们的从code数据。
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.
这篇关于如何打开系统SQLiteDatabase的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!