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);