问题描述
我想打开另一个应用程序的数据库.我知道我必须具有root用户访问权限,但是看来root用户访问权限仅对shell命令有效.
I want to open the database of another app.I know I must have root-access, but it seems that root access is "only" for shell commands.
我想对数据库进行大量选择和插入.是否可以以root身份打开数据库,并在普通"应用程序中使用db-handle?
I want to make a lot of selects and some inserts into the database.Is it possible to open the db as root, and work with the db-handle in the "normal" app?
预先感谢
纤维
推荐答案
感谢所有答案!我认为唯一的办法就是做这样的事情:
thanks for all answers!I think the only way is to make something like this:
Process p = Runtime.getRuntime().exec("su sqlite3 -csv test.db \"select * from test\";");
然后,我必须使用cvs解析器解析OutputStream,....我希望我可以用更简单的方法来做,但是我看不到任何解决方案.
Then, I must parse the OutputStream with a cvs parser,....I hoped I can do it in a simpler way, but I see no solution.
也许我可以在应用程序目录中创建一个到文件的硬链接,但这非常危险,因为那样的话,一个数据库有两个".journal"文件.
Maybe I can create a hard link to a file in a directory of my app, but it is very dangerous, because in that way there are two ".journal" files for one db.
感谢帮助
纤维
这篇关于使用root访问权限在Android上打开另一个应用程序的sqlite数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!