如何卸载Android应用程序与root权限? [英] How to uninstall Android App with root permissions?

查看:195
本文介绍了如何卸载Android应用程序与root权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写的东西卸载(删除)一个应用程序,并有现在的APK似乎要删除的问题,但应用程序是不是真的从手机中删除。

据推测是被删除的应用程序仍然存在于发射器应用程序的抽屉。我可以打开应用程序,但它的力量关闭应用程序。

我测试了一个自己的应用程序(现有的/数据/应用程序,而不是/系统/应用程序)。 随着systemapps我没有测试。

下面的code:

 私人无效delApp(){
    字符串deleteCMD =RM+ packageInfo.applicationInfo.sourceDir;


    处理的过程;
    尝试
    {
        流程=调用Runtime.getRuntime()EXEC(素)。
        DataOutputStream类OS =新DataOutputStream类(process.getOutputStream());
        os.writeBytes(安装邻重新装载,RW -t RFS的/ dev / stl5 /系统; \ N);
        os.writeBytes(deleteCMD +\ N);
        os.writeBytes(安装邻重新装载,RO -t RFS的/ dev / stl5 /系统; \ N);
        os.flush();

    }
    赶上(IOException异常E)
    {
        e.printStackTrace();
    }



}
 

解决方案

我弄不太清楚你为什么这样做不行的东西,也许别人可以阐明一些轻。

您可以尝试:

 时卸载com.package.name
 

而不是你的 RM /封装/ DIR /路径方法

我不知道,在适用于应用程序/系统/应用程序目录,但是。

此外,一起来看看:<一href="http://stackoverflow.com/questions/3339390/application-launcher-icon-is-not-deleted-from-home-screen-when-uninstalling-andr">Application从主屏幕上卸载的Andr​​oid应用时,启动器图标不会被删除

I wrote something to uninstall (delete) an App and have now the problem that the apk seems to be deleted but the app is not really deleted from phone..

The supposedly deleted app still exists in the launchers app drawer. And I can open the app, but it force closes the app.

I tested the procedure with an own App (existing at /data/app, not /system/app). With systemapps I didn't test.

Here the code:

private void delApp() {
    String deleteCMD = "rm " + packageInfo.applicationInfo.sourceDir;


    Process process;
    try 
    {
        process = Runtime.getRuntime().exec("su");
        DataOutputStream os = new DataOutputStream(process.getOutputStream());
        os.writeBytes("mount -o remount,rw -t rfs /dev/stl5 /system; \n");          
        os.writeBytes(deleteCMD+"; \n");
        os.writeBytes("mount -o remount,ro -t rfs /dev/stl5 /system; \n");
        os.flush();

    } 
    catch (IOException e) 
    {
        e.printStackTrace();
    }      



}

解决方案

I don't rightly know why what you're doing does not work, maybe someone else can shed some light on that.

You could try:

pm uninstall com.package.name

instead of your rm /package/dir/path method

I'm not sure if that works on apps in the /system/app directory, however.

Also, take a look at: Application launcher icon is not deleted from Home screen when uninstalling android app

这篇关于如何卸载Android应用程序与root权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆