android 后台截屏核心代码
发布日期:2021-08-28 19:37:46 浏览次数:6 分类:技术文章

本文共 912 字,大约阅读时间需要 3 分钟。

hot3.png

 
RootCommand("su -c 'screencap /mnt/sdcard/screenaaa.png' && adb pull /sdcard/screenaaa.png") ;/**	 * 应用程序运行命令获取 Root权限,设备必须已破解(获得ROOT权限)	 * 	 * @param command	 *            命令:String apkRoot="chmod 777 "+getPackageCodePath();	 *            RootCommand(apkRoot);	 * @return 应用程序是/否获取Root权限	 */	private boolean RootCommand(String command) {		Process process = null;		DataOutputStream os = null;		try {			process = Runtime.getRuntime().exec("su");			os = new DataOutputStream(process.getOutputStream());			os.writeBytes(command + "\n");			os.writeBytes("exit\n");			os.flush();			process.waitFor();		} catch (Exception e) {			Log.d("*** DEBUG ***", "ROOT REE" + e.getMessage());			return false;		} finally {			try {				if (os != null) {					os.close();				}				process.destroy();			} catch (Exception e) {			}		}		Log.d("*** DEBUG ***", "Root SUC ");		return true;	}

转载于:https://my.oschina.net/lhjtianji/blog/372157

转载地址:https://blog.csdn.net/weixin_33969116/article/details/92059923 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:公共资源优化感悟
下一篇:一种基于WebDAV的收藏夹同步解决方案

发表评论

最新留言

留言是一种美德,欢迎回访!
[***.207.175.100]2024年04月20日 01时38分50秒