Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/383.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/226.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java android删除应用程序不工作_Java_Android_Root - Fatal编程技术网

Java android删除应用程序不工作

Java android删除应用程序不工作,java,android,root,Java,Android,Root,我在根手机上授予了超级用户权限,但是,如果我触发了删除所需应用程序的意图,仍然只对不在系统上但用于系统应用程序的应用程序有效,则会生成一条消息,表明应用程序未正确卸载。如何到达它 Process process; process = Runtime.getRuntime().exec("su"); DataOutputStream os = new

我在根手机上授予了超级用户权限,但是,如果我触发了删除所需应用程序的意图,仍然只对不在系统上但用于系统应用程序的应用程序有效,则会生成一条消息,表明应用程序未正确卸载。如何到达它

                        Process process; 
                        process = Runtime.getRuntime().exec("su");


                        DataOutputStream os = new DataOutputStream(process.getOutputStream());
                        os.writeBytes("mount -o remount rw /system/\n");  
                       os.flush();  

                        Intent uninstallIntent = new Intent(Intent.ACTION_PACKAGE_REMOVED); //ACTION_DELETE
                        uninstallIntent.setData(Uri.parse("package:" + llistaApps.get(idApp)));
                        uninstallIntent.setAction(Intent.ACTION_VIEW); 
                        uninstallIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);  
                        getApplicationContext().startActivity(uninstallIntent);
1) 超级用户权限对应用程序本身没有任何影响,它只允许它以root用户身份启动本机帮助程序可执行文件

                        Process process; 
                        process = Runtime.getRuntime().exec("su");


                        DataOutputStream os = new DataOutputStream(process.getOutputStream());
                        os.writeBytes("mount -o remount rw /system/\n");  
                       os.flush();  

                        Intent uninstallIntent = new Intent(Intent.ACTION_PACKAGE_REMOVED); //ACTION_DELETE
                        uninstallIntent.setData(Uri.parse("package:" + llistaApps.get(idApp)));
                        uninstallIntent.setAction(Intent.ACTION_VIEW); 
                        uninstallIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);  
                        getApplicationContext().startActivity(uninstallIntent);
2) 它不启用任何android权限,因为这是一个在linux而不是android级别上运行的概念,而且它不适用于应用程序本身

                        Process process; 
                        process = Runtime.getRuntime().exec("su");


                        DataOutputStream os = new DataOutputStream(process.getOutputStream());
                        os.writeBytes("mount -o remount rw /system/\n");  
                       os.flush();  

                        Intent uninstallIntent = new Intent(Intent.ACTION_PACKAGE_REMOVED); //ACTION_DELETE
                        uninstallIntent.setData(Uri.parse("package:" + llistaApps.get(idApp)));
                        uninstallIntent.setAction(Intent.ACTION_VIEW); 
                        uninstallIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);  
                        getApplicationContext().startActivity(uninstallIntent);
3) 这个问题有许多重复项

1)超级用户权限对应用程序本身没有任何影响,它只允许它以root用户身份启动本机帮助程序可执行文件

                        Process process; 
                        process = Runtime.getRuntime().exec("su");


                        DataOutputStream os = new DataOutputStream(process.getOutputStream());
                        os.writeBytes("mount -o remount rw /system/\n");  
                       os.flush();  

                        Intent uninstallIntent = new Intent(Intent.ACTION_PACKAGE_REMOVED); //ACTION_DELETE
                        uninstallIntent.setData(Uri.parse("package:" + llistaApps.get(idApp)));
                        uninstallIntent.setAction(Intent.ACTION_VIEW); 
                        uninstallIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);  
                        getApplicationContext().startActivity(uninstallIntent);
2) 它不启用任何android权限,因为这是一个在linux而不是android级别上运行的概念,而且它不适用于应用程序本身

                        Process process; 
                        process = Runtime.getRuntime().exec("su");


                        DataOutputStream os = new DataOutputStream(process.getOutputStream());
                        os.writeBytes("mount -o remount rw /system/\n");  
                       os.flush();  

                        Intent uninstallIntent = new Intent(Intent.ACTION_PACKAGE_REMOVED); //ACTION_DELETE
                        uninstallIntent.setData(Uri.parse("package:" + llistaApps.get(idApp)));
                        uninstallIntent.setAction(Intent.ACTION_VIEW); 
                        uninstallIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);  
                        getApplicationContext().startActivity(uninstallIntent);

3) 这个问题有许多重复项

那么,如何获得删除系统应用程序的权限呢?或者尝试作为系统应用程序安装(这是一个不同的问题,有重复项),或者在
su
下使用粗糙的
rm
,它也有许多重复项。没有经验的人也不应该尝试这两种方法。那么,如何获得删除系统应用程序的权限呢?要么尝试作为系统应用程序安装(这是一个不同的问题,有重复项),要么粗暴地使用
su
下的
rm
,它也有许多重复项。没有经验的人也不应该尝试这两种方法。
                        Process process; 
                        process = Runtime.getRuntime().exec("su");


                        DataOutputStream os = new DataOutputStream(process.getOutputStream());
                        os.writeBytes("mount -o remount rw /system/\n");  
                       os.flush();  

                        Intent uninstallIntent = new Intent(Intent.ACTION_PACKAGE_REMOVED); //ACTION_DELETE
                        uninstallIntent.setData(Uri.parse("package:" + llistaApps.get(idApp)));
                        uninstallIntent.setAction(Intent.ACTION_VIEW); 
                        uninstallIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);  
                        getApplicationContext().startActivity(uninstallIntent);