将文件复制到另一个软件包文件夹(root,su) [英] Copy files to another package folder (root, su)

查看:101
本文介绍了将文件复制到另一个软件包文件夹(root,su)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我的应用程序的程序包(com.my.package),我希望能够将某些文件(a.txt,b.txt和c.txt)复制到另一个程序包(data / data / com)。 another.package / files)。现在,我尝试了一些发现的事情,但没有任何效果。请问有帮助吗?

I have my application's package (com.my.package) and i'd like to be able to copy some files (a.txt, b.txt and c.txt) to another package (data/data/com.another.package/files). Now i've tried a few things i found, but none worked. Any help please?

推荐答案

您需要获取运行时并使用 cat

You need to get the Runtime and use the cat command.

Runtime.getRuntime().exec("su cat filepath1 > filepath2");

这篇关于将文件复制到另一个软件包文件夹(root,su)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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