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

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

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

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



          //下面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();
       }
    }

声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2014年1月6日
下一篇 2014年1月6日

相关推荐