ITeye博客

android 文件 修改权限

44289533 · 2013-11-04 14:04 · 移动开发 · Markdown

//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;
	}

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。