新闻中心

EEPW首页>嵌入式系统>设计应用> Android常见错误汇总

Android常见错误汇总

作者: 时间:2016-10-08 来源:网络 收藏

out.write(buffer, 0, read);

}

}

24.判断是否有root权限

[java] view plaincopyprint?

public static synchronized boolean getRootAhth()

{

Process process = null;

DataOutputStream os = null;

try

{

process = Runtime.getRuntime().exec(su);

os = new DataOutputStream(process.getOutputStream());

os.writeBytes(exitn);

os.flush();

int exitValue = process.waitFor();

if (exitValue == 0)

{

return true;

} else

{

return false;

}

} catch (Exception e)

{

Log.d(*** DEBUG ***, Unexpected error - Here is what I know:

+ e.getMessage());

return false;

} finally

{

try

{

if (os != null)

{

os.close();

}

process.destroy();

} catch (Exception e)

{

e.printStackTrace();

}

}

}

25.最简单的Root 模拟器的方法

启动一个模拟器,开始-运行-输入cmd,打开dos,依次输入

adb shell

mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system

cd /system/bin

cat sh > su

chmod 4755 su

su

即可获得root权限


上一页 1 2 3 下一页

关键词:

评论


相关推荐

技术专区

关闭