Android APK 的静默安装 [英] Android APK's Silent Installation

查看:37
本文介绍了Android APK 的静默安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种方法来编写我的应用程序以静默安装 APK 文件.我知道可以使用如下所示的代码启动:

I'm searching for a way to program my application to install silently an APK file. I'm aware about the possibility to launch with code that looks something like this:

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(apkFile), "application/vnd.android.package-archive");
startActivity(intent);   

但在安装开始之前,此代码会引发一个对话框,其中包含 APK 所需的权限,并且需要用户授权才能开始安装.

But before the installation starts, this code raises a dialog with the APK's required permissions, and needs user authorization to start the installation.

有什么办法可以跳过这个对话框吗?

Is there any way to skip this dialog?

有没有其他方法可以在运行时从我的代码安装应用程序,不需要用户交互?

Is there any other way to install an application during runtime from my code, that doesn't require user interaction?

推荐答案

没有.这是一件好事 - 这将为恶意软件和不需要的安装打开一扇(其他)大门.如果你介意我问,你为什么要这样做?让用户知道您想在他们的设备上安装某些东西有什么问题?

No. And that's a good thing - this would be an (other) open door to malware and unwanted installs. Why do you want to do that, if you mind me asking? What's wrong with letting users know that you want to install something on their device?

此外,这里有一些详细信息:Android 设备上的静默安装

Also, some details here: Silent installation on Android devices

最后,这对于有 root 权限的设备可能是可能的:如果你编写自己的安装程序,你可以完全绕过内置安装程序,并且有了 root 权限,你基本上可以做你想做的事.但我仍然认为这会严重破坏安全.

And finally, this might be possible for rooted devices: if you write your own installer, you can bypass completely the built-in installer, and with root privilege, you can basically do what you want. But I still think that would be a serious breach of security.

这篇关于Android APK 的静默安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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