---
title: "android 文件 修改权限"
author: "44289533"
date: "2013-11-04T14:04:36Z"
tags: []
categories: ["移动开发"]
slug: "android"
draft: false
lastmod: "2013-11-04T14:05:37Z"
id: 1969667
url: "https://44289533.iteye.com/blog/1969667"
---

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