我正在寻找一种方法来对我的应用程序进行编程以静默安装 APK 文件。我知道使用看起来像这样的代码启动的可能性:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(apkFile), "application/vnd.android.package-archive");
startActivity(intent);
但在安装开始之前,此代码会引发一个对话框,其中包含 APK 所需的权限,并且需要用户授权才能开始安装。
有没有办法跳过这个对话框?
有没有其他方法可以在运行时从我的代码安装应用程序,不需要用户交互?