在Android应用程序来编辑只读文件挂载R / W系统 [英] Mount R/W system in android application to edit Read Only files

查看:182
本文介绍了在Android应用程序来编辑只读文件挂载R / W系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎么能在我的应用程序,编辑文件/系统/目录?

How can i within my application, to edit a file in /system/ Directory?

我必须使系统R / W写?

I have to make the system R/W write?

我已经试过:

process = Runtime.getRuntime().exec("su");
os = new DataOutputStream(process.getOutputStream());
os.writeBytes("mount -o remount,rw /system\n");
os.writeBytes("exit\n");
os.flush();
process.waitFor();

和很多很多很多人,都没有成功。

and many many many others, without success.

如果有人能帮助我,我非常AP preciated吧! :) 另外,如果我终于成功了,它将适用于所有扎根电话? 或者在某些手机是不同的?

If anybody can help me, i greatly appreciated it! :) Also, if i finally made it, it will apply to all rooted phones? Or in some phones it's different?

推荐答案

我使用的:

    os.writeBytes("mount -o remount rw /system/\n"); 
    //instead of a comma, I have a space. 
    //When I tried it with a comma, mine didn't work either.

这使我能够顺利安装。

And that allows me to successfully mount.

如果您之后退出的权利,当然这是行不通的。你必须要保持相同的进程中,并使用Linux命令编辑文件。

If you exit right after that, of course it will not work. You have to stay within the same process and use the linux commands to edit the file.

我不知道如何编辑这些文件,但我建议使用Google如何做事的Linux终端,然后把正确的code。在 os.writeBytes(code_HERE );

I have no idea how to edit the files, but I suggest googling how to do things in linux terminal, and then putting the proper code in os.writeBytes("CODE_HERE");

不过,只要在安装过程来讲,我不知道是否该命令将工作普遍。这可能只是幸运的是我的设备上运行。

Though, as far as the mounting process is concerned, I don't know if that command will work universally. It may just fortunately work on my device.

编辑:
我现在用RootTools:<一href="http://$c$c.google.com/p/roottools/downloads/list">http://$c$c.google.com/p/roottools/downloads/list
这里是Wiki页面:
HTTP://$c$c.google.com/p/roottools/w/list


I now use RootTools: http://code.google.com/p/roottools/downloads/list
And here is the Wiki page:
http://code.google.com/p/roottools/w/list

不过,我现在使用:

RootTools.remount(file, mountType);
//For example:
RootTools.remount("/system/", "rw");

我认为是普遍的。

I believe that is universal

这篇关于在Android应用程序来编辑只读文件挂载R / W系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆