try {
Runtime rt = Runtime.getRuntime();
Process pcs = rt.exec("ls -l /data");
BufferedReader br = new BufferedReader(new InputStreamReader(pcs
.getInputStream()));
String line = null;
while ((line = br.readLine()) != null) {
Log.e("line","line="+line);
}
br.close();
pcs.waitFor();
int ret = pcs.exitValue();
Log.e("ret","ret="+ret);
} catch (Exception e) {
Log.e("Exception", "Exception", e);
}
"ret = 0"만 인쇄하십시오. 올바른 경로를 인쇄하는 방법은 무엇입니까?android/data 폴더에 액세스 할 수 없습니까?
이것은 도움이되지 않습니다. 앱에 의해 생성 된 프로세스는 앱과 동일한 사용자 ID로 실행되므로 동일한 권한을가집니다. 물론 "su"루트 심과 같은 setuid 프로세스를 호출하지 않는 한. –