[英]How can I install the SQLite executable on an Android device?
I have an root application that reads the SQLite database of WhatsApp.我有一个根应用程序可以读取 WhatsApp 的 SQLite 数据库。 I'm using the sqlite
binary to execute the SQL query and I read the results into my app.我正在使用sqlite
二进制文件来执行 SQL 查询,并将结果读入我的应用程序。
Now, this all works fine but I've noticed that the SQLite executable seems to be missing on some devices especially the Galaxy S3 GT-I9300.现在,这一切正常,但我注意到某些设备上似乎缺少 SQLite 可执行文件,尤其是 Galaxy S3 GT-I9300。 (I can see this through my crash statistics.) (我可以通过我的崩溃统计数据看到这一点。)
My application also installs the sqlite3
executable onto the users phone.我的应用程序还将sqlite3
可执行文件安装到用户手机上。 The SQLite executable needs to be at /system/xbin/sqlite3
or /system/bin/sqlite3
. SQLite 可执行文件需要位于/system/xbin/sqlite3
或/system/bin/sqlite3
。 I've bundled the sqlite3
binary with my application in the assets
and my application unpacks the assets and copies it over to the correct location.我已将sqlite3
二进制文件与我的应用程序捆绑在assets
,我的应用程序解压缩资产并将其复制到正确的位置。 I extracted the sqlite3
binary from the Android emulator.我从 Android 模拟器中提取了sqlite3
二进制文件。
Now, I've been seeing errors that read that library file libncurses.so
is missing.现在,我一直看到读取库文件libncurses.so
丢失的错误。 On my phone that file is at /system/bin/libncurses.so
.在我的手机上,该文件位于/system/bin/libncurses.so
。
Now, should I also bundle the libncurses.so
file with my application?现在,我是否还应该将libncurses.so
文件与我的应用程序捆绑在一起? Is there anything else I would need to bundle?还有什么我需要捆绑的吗?
If there's a better way of getting sqlite3
on the device, I'll be glad to hear it.如果有更好的方法在设备上获取sqlite3
,我会很高兴听到的。
如果您想逃避依赖关系,只需使用静态链接的所有需要的库自己构建它。
Some searching on SO will result in a plethora of answers:对 SO 进行一些搜索会得到大量答案:
Here is one: Why do I get a "sqlite3: not found" error on a rooted Nexus One when I try to open a database using the adb shell?这是一个: 当我尝试使用 adb shell 打开数据库时,为什么在有根的 Nexus One 上出现“sqlite3:未找到”错误?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.