首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

缄默卸载系统软件和第三方软件

2012-07-01 
静默卸载系统软件和第三方软件????? 一个个卸载软件,弹出卸载软件提示好麻烦,现在特作出下列方法,可以静默

静默卸载系统软件和第三方软件

????? 一个个卸载软件,弹出卸载软件提示好麻烦,现在特作出下列方法,可以静默卸载

静默安装敬请期待。。。。

?

????????? //下面3句是静默卸载系统软件命令
??????????? String busybox="mount -o remount rw /system";
???????? String chmod="chmod 777 /system/app/HtcTwitter.apk";
???????? uninstallapk="rm -r /system/app/HtcTwitter.apk";
????????
???????? //下面3句是静默卸载第三方软件命令
???????? String busybox1="mount -o remount rw /data";
???????? String chmod1="chmod 777 /data/app/com.yingyonghui.market-2.apk";
???????? uninstallapk1="pm uninstall com.yingyonghui.market";
????????
???????? chmodApk(busybox1,chmod1);

?

?

?

? /*
???? * 对要卸载的apk赋予权限
???? */
??? public void chmodApk(String busybox ,String chmod)
??? {
???? try {
????
?????? Process process = null;
???DataOutputStream os = null;

???process = Runtime.getRuntime().exec("su");
???os = new DataOutputStream(process.getOutputStream());
???os.writeBytes(busybox);
?????? ?os.flush();
?????? ?
?????? ?os.writeBytes(chmod);
?????? ?os.flush();
?????? ?
?????? ?os.close();
?????? } catch (Exception ex) {
?????????? ex.printStackTrace();
?????? }
??? }
???
???
??? /*
???? * 卸载apk
???? */
??? public void uninstallApk(String uninstallapk)
??? {
???? try {
????????
?????? Process process = null;
???DataOutputStream os = null;
???process = Runtime.getRuntime().exec("su");
???os = new DataOutputStream(process.getOutputStream());
?????? ?os.writeBytes(uninstallapk);
?????? ?os.flush();
?????? ?
?????? ?os.close();
?????? } catch (Exception ex) {
?????????? ex.printStackTrace();
?????? }
??? }

2 楼 心雨心 2012-03-12   你说的不好用是?

热点排行