卸载android应用程序无需用户交互
问题描述:
我正在开发android系统应用程序。直接卸载另一个应用程序,无需用户交互。 我已经写的代码和平,卸载android应用程序无需用户交互
private void UninsallApp() {
Uri packageURI = Uri.parse("package:"+"com.example.shortcutcreation");
Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI);
startActivity(uninstallIntent);
}
能否请你帮我...
答
我得到了这个问题的解决方案。 我已经破解了代码AOSP框架水平(android.content.pm),并作为ploatform APK ... 最后的应用程序被悄悄卸载签署...
或
字符串CMD =“SH /系统/ bin/pm uninstall“+ packageName;
try {Process su = Runtime.getRuntime().exec("su");
DataOutputStream outputStream = new DataOutputStream(su.getOutputStream());
outputStream.writeBytes(cmd+"\n");
outputStream.flush();
outputStream.writeBytes("exit\n");
outputStream.flush();
su.waitFor();
} catch (IOException e) {
throw new RuntimeException(e);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
'直接卸载你希望能够做到这一点未经用户同意,而无需用户interaction.'另一个应用程序? – Nikola
是@Nikola,我正在做Android系统管理应用程序。 – Kumar
你知道这个monit的整个观点是为了防止你想要完成的活动吗? –