Android常见错误汇总
xception e) {
Log.v(Error, Error in if。);
}
}
public static void copyFile(InputStream in, OutputStream out) throws IOException {
Log.v(Coping, copyFiling.);
byte[] buffer = new byte[1024];
int read;
while ((read = in.read(buffer)) != -1) {
Log.v(read:, + read);
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(exit\n);
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权限
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)
