Android INSTALL_PACKAGES权限和非PlayStore应用 [英] Android INSTALL_PACKAGES Permission and Non-PlayStore Apps

查看:349
本文介绍了Android INSTALL_PACKAGES权限和非PlayStore应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为Play商店准备我的应用程序,并计划将一个组件作为单独的安装程序包交付(因为我的客户无法恢复源代码,但是该应用程序已用他的密钥签名).我考虑了两种方法.我的需求就是这些:停用未知来源"的用户应该能够安装第二个应用程序.并且:永远不要将用户重定向到Google Play商店.

I'm preparing my app for the play store and plan to deliver one component as separate install package (since my customer can't recover the source code, but the app is signed with his key). I thought about two ways of doing that. My needs are just these: Users with "unknown sources" deactivated should be able to install the 2nd app. And: The user should never be redirected to Google Play store.

两个应用都是免费的.

  1. 我一直在寻找可以让我从Google Play下载其他APK并仅向用户显示安装屏幕以接受安装的解决方案.我想要一个解决方案,向PlayStore应用发送意向,并显示应用名称,权限和安装按钮.我什么都没找到.有人在这里有经验吗?

  1. I've looked up for solutions that would let me download an additional APK from Google Play and simply present the user an installation screen to acceppt the installation. I would like a solution, where I sent an intent to the PlayStore app and it displayed the app name, permissions and the install button. I've found nothing. Anyone any experience here?

我认为我可以将此附加应用程序打包到我所含应用程序的资产中.我需要将其写入文件系统,并向系统发送安装软件包的意图.问题:该应用程序未从Google Play加载,并且其来源未知.如果我使用PackageManager并安装了APK,INSTALL_PACKAGES权限是否允许我的应用程序在用户设备上安装此第二个应用程序(因为用户已经接受我的应用程序可以安装软件包)?

I thought I could package this additional app into the assets of my enclosing app. I'd need to write it to the file system and send the system an intent to install the package. Problem: The App was not loaded from Google play and with that it's source is unknown. If I used the PackageManager and let it install the APK, does the permission INSTALL_PACKAGES allow my app installing this 2nd app on a user's device (since the user already accepted that my app may install packages)?

我希望有人可以提供帮助.并先谢谢您.

I hope someone may help. And thank you in advance.

推荐答案

我的需求就是这些:停用未知来源"的用户应该能够安装第二个应用程序.并且:永远不要将用户重定向到Google Play商店.

My needs are just these: Users with "unknown sources" deactivated should be able to install the 2nd app. And: The user should never be redirected to Google Play store.

这种组合是不可能的,除非Android和/或Play商店存在重大安全漏洞.通过Play商店安装应用的唯一方法是通过Play商店应用.

This combination is impossible, barring a major security flaw in Android and/or the Play Store. The only way to install apps through the Play Store is via the Play Store app.

我想要一个解决方案,向PlayStore应用发送意向,并显示应用名称,权限和安装按钮.

I would like a solution, where I sent an intent to the PlayStore app and it displayed the app name, permissions and the install button.

该活动未导出.欢迎您使用market:// Uri将用户带到Play商店,他们可以在其中查看第二个应用程序,并自行决定是否下载并安装它.

That activity is not exported. You are welcome to use a market:// Uri to lead the user to the Play Store, where they can review this second app and decide, for themselves, whether or not to download and install it.

因为用户已经接受我的应用可以安装软件包

since the user already accepted that my app may install packages

您的应用程序无法直接安装软件包,除非使用固件签名密钥对其进行签名或将其安装在系统分区上(例如,由具有root权限的设备用户安装),因为这是保存INSTALL_PACKAGES的唯一方法允许.欢迎普通SDK应用程序创建ACTION_VIEWACTION_INSTALL_PACKAGE Intent来请求安装该应用程序,但是用户将需要启用未知来源".

Your app cannot install packages directly, unless it is signed with the firmware signing key or is installed on the system partition (e.g., by a rooted device user), as that is the only way that you can hold the INSTALL_PACKAGES permission. Ordinary SDK apps are welcome to create an ACTION_VIEW or ACTION_INSTALL_PACKAGE Intent to request that the app be installed, but the user will need "unknown sources" enabled.

这篇关于Android INSTALL_PACKAGES权限和非PlayStore应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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