如何以编程安装应用程序,而无需打开Play商店(如谷歌驱动器) [英] How to install applications programatically without opening Play Store (as Google Drive does)

查看:269
本文介绍了如何以编程安装应用程序,而无需打开Play商店(如谷歌驱动器)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天,谷歌驱动器的应用程序问我是否想安装新的应用程序床单和放大器;文档。

我已经接受了,期待它打开谷歌Play商店,所以我可以preSS安装。

它没有。它只是表明我与每个应用程序的权限,在弹出的确认安装,同样的,当你preSS上播放存储的任何应用程序安装出现。

我不知道可以这样做。

我们怎样才能重现一个应用程序这种行为:有一个按钮安装应用XPTO这并不需要打开谷歌Play商店?只是显示的权限对话框并继续通过Play商店安装吗?


更新:

对于那些downvoting,因为他们认为这是一样的其他问题......这不是!

在这种情况下,APK不是由谷歌驱动器的应用程序下载,然后进行安装。谷歌驱动器的通知的Play商店下载及放大器;安装。

这是我感兴趣的API。

要支持我的情况:在pressing 谷歌内部驱动器安装的应用程序,而无需打开Play商店,下载启动。在下载过程中我已经打开Play商店的检查和:

截图证明,这不是谷歌驱动器下载的APK和安装。这是Play商店。

解决方案

在日志谷歌驱动器显示负责告诉了谷歌Play商店安装的应用程序是该活动

<$p$p><$c$c>com.google.android.apps.docs/com.google.android.apps.docs.app.PhoneskyApplicationInstallerActivity

这,显然,讲述

<$p$p><$c$c>com.android.vending/com.google.android.finsky.billing.lightpurchase.LightPurchaseFlowActivity

要安装所需的软件包。

所以,从理论上说,人们可以创建一个意图

 意向意图=新的意图(com.android.vending.billing.PURCHASE);
intent.setClassName(com.android.vending
        com.google.android.finsky.billing.lightpurchase.LightPurchaseFlowActivity);
intent.putExtra(EXTRA_NAME,EXTRA_VALUE);
startActivityForResult(意向,0);
 

使用正确的额外价值,瞧!

但是,调用 LightPurchaseFlowActivity 非谷歌签署的应用程序失败,因为他们,再次明显(根据日志),检查调用包的签名:

  W / Finsky(13209):[1] LightPurchaseFlowActivity.setupFromExternalPurchaseIntent:从不受信任呼包。
 

所以,在那里,这不能在这个时刻来实现的。

Today the Google Drive app asked if I wanted to install the new apps Sheets & Docs.

I've accepted, expecting it to open Google Play Store so I could press install.

It didn't. It just showed me the popup with the permissions of each of the apps to confirm the installation, the same that appears when you press "Install" on any app on the Play Store.

I was not aware this could be done.

How can we reproduce this behavior in an app: have a button "Install App XPTO" which doesn't need to open Google Play Store? Just shows the permissions dialog and proceeds to install it via Play Store?


UPDATE:

For those downvoting because they think this is the same as other questions... It's not!

In this case, the APK is not downloaded by Google Drive app and then installed. Google Drive "tells" Play Store to download & install.

That's the API that I'm interested.

To support my case: after pressing INSIDE Google Drive to install the apps without opening Play Store, the download starts. During the download I've opened the Play Store to check and:

The screenshot proves that it isn't Google Drive downloading the APK and the installing it. It's the Play Store.

解决方案

The logs for Google Drive shows that activity responsible for "telling" the Google Play Store to install apps is

com.google.android.apps.docs/com.google.android.apps.docs.app.PhoneskyApplicationInstallerActivity

which, apparently, "tells"

com.android.vending/com.google.android.finsky.billing.lightpurchase.LightPurchaseFlowActivity

to install required packages.

So, theoretically, one could create an intent

Intent intent = new Intent("com.android.vending.billing.PURCHASE");
intent.setClassName("com.android.vending",
        "com.google.android.finsky.billing.lightpurchase.LightPurchaseFlowActivity");
intent.putExtra(EXTRA_NAME, EXTRA_VALUE);
startActivityForResult(intent, 0);

with correct extra values and voilà!

However, calling LightPurchaseFlowActivity from non-Google signed app is failing, because they are, again apparently (according to the logs), checking the calling package's signature:

W/Finsky(13209): [1] LightPurchaseFlowActivity.setupFromExternalPurchaseIntent: Called from untrusted package.

So, there, this can not be achieved at this moment.

这篇关于如何以编程安装应用程序,而无需打开Play商店(如谷歌驱动器)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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