Android 设备上的静默安装
我已经接受了一段时间了,在 Android 上静默安装应用程序是不可能的——也就是说,让程序安装捆绑为 APK 的应用程序,而不提供标准操作系统安装提示并执行应用程序安装程序活动。但现在我已经拿到了 Appbrain 快速网络安装程序的副本,它正是这样做的。
这到底怎么可能? :D
I've accepted for a while now that it's impossible to silently install an application on Android - that is, to have a program install an application bundled as an APK without providing the standard OS installation prompt and going through the app installer activity. But now I've picked up a copy of the Appbrain fast web installer, and it does exactly this.
How on earth is this possible? :D
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我认为线索几乎就在我在常见问题解答。
我认为这与谷歌在终止开关中所做的非常相似。我假设终止开关是我设备上的一个应用程序,只是对我隐藏起来。当 Google 想要删除某个应用程序时,它会默默地卸载该应用程序,而无需征求我们的许可。我非常确定这个安全漏洞是他们造成的。现在我们只需要弄清楚...=D
I think the clue is pretty much in this statement I found here in the FAQ.
I presume this is very similar to what Google does in the kill switch. I am assuming that the kill switch is an application on my device, just hidden from me. When Google wants to remove an application, it silently uninstalls it without asking for our permission. I am very sure this security hole is of their making. Now we just need to figure that out... =D
您可以(以一种非常黑客的方式)使用 adb 静默安装应用程序。您必须启用 USB 调试,但只需将 APK 推送到 /data/app 即可。即:
adb push MyApp.apk /data/app
adb install MyApp.apk (更简洁的方式)
第二个命令可能会提示安装,我不记得了。
You can ( in a very hackish way ) install apps silently using adb. You have to enable USB Debugging, but just push the APK to /data/app. ie:
adb push MyApp.apk /data/app
adb install MyApp.apk (cleaner way)
The second command MAY prompt for an installation, I don't remember off the top of my head.
如果您可以弄清楚标准安装程序在安装时会执行哪些操作,则可以在您的应用程序中复制该行为,但是您的应用程序需要相当广泛的权限才能正确执行所有操作。
说真的,甚至不要尝试。
IF you can work out what the standard installer does when it installs, you can replicate that behaviour in your app, however yours would need quite extensive permissions to do everything properly.
Seriously, don't even try.