android 文件 修改权限
程序员文章站
2022-06-12 16:55:26
...
//shPath = /system/bin/sh
//shellCommand = chmod 0777 路径
public static int executeShell(String shellCommand) {
int success = 0;
try {
Process pid = null;
String[] cmd = { shPath, "-c", shellCommand };
// Shell命令を執行
pid = Runtime.getRuntime().exec(cmd);
if (pid != null) {
pid.waitFor();
} else {
}
success = 1;
} catch (Exception e) {
}
return success;
}
上一篇: AI发布网站部署笔记
下一篇: 古老黄酒驱寒且疗疾