一个个卸载软件,弹出卸载软件提示好麻烦,现在特作出下列方法,可以静默卸载
静默安装敬请期待。。。。
//下面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();
}
}
分享到:
相关推荐
setup factory 安装前静默卸载
ArcGIS9.3.1命令行静默卸载程序
此为ps静默卸载
详情见:Android 静默安装和静默卸载(系统层) http://blog.csdn.net/zhouyuanjing/article/details/78507606 安装: Intent intent = new Intent("android.intent.action.SILENT_PACKAGE_INSTALL"); intent.putExtra...
静默批量卸载安卓非内置App源码,传统的安卓应用卸载会直接转跳到系统的应用详情界面点击卸载才能一个个的卸载,本例子卸载应用的时候不需要弹出应用管理界面直接静默卸载手机非内置应用,用户体验良好并且支持选择...
需要framework.jar包。调用方法:Intent intent =new Intent(this,MyService.class); intent.putExtra("package",packet.getPackagename()); startService(intent);
实现android静默安装和卸载,代码一年前就写了,看到群里有人要,就贴出来,需要root权限,由于我写的是安装鲁大师,路径是sd卡根目录,实际测试的时候需要修改文件名,和包名之类的
在android设备root或者应用内置为系统应用时,可以实现静默安装和卸载。 PackageUtils.java中有提供了静默安装和卸载的方法。
android 实现自我自动静默卸载 妈妈再也不用担心我是流氓了 部分手机安装失败。本人三星i9108可以 小米安装失败。不知道为什么。同个程序。可能是小米没root,但是代码里面没有涉及root相关的 。只是修改了应用权限 ...
静默卸载.cmd
通过AIDL调用Android源码静默安装卸载APK....
Android 静默安装和静默卸载 功能实现示例代码 实现从2.2到最新4.4.2版本系统 覆盖包括三星 HTC LG 以及中华酷联等绝大多数手机上静默安装功能的实现。 有需要改功能的可以下载验证,省去自己的研究时间。
实现android静默安装,注意:手机需root
前提:android设备需已root 详情请看: http://xiaxveliang.blog.163.com/blog/static/2970803420146223547873/
手工建库: 1.写参数文件,创建实例: vi $ORACLE_HOME/dbs/initorcl.ora 写入以下内容: compatible=10.2.0.1 instance_name=orcl db_name=orcl sga_target=500M sga_max_size=500M job_queue_processes=10 ...
安卓开发之通过调用adb实现静默安装卸载demo
Android10.0 静默安装、卸载接口