Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
445 views
in Technique[技术] by (71.8m points)

youtube - Android : Open google play dialog from my app

From Android Youtube app when I click on the advertising, there is a dialog of the Google Play and you can install the app from the dialog.
With a Activity monitor I found this parameters:
1 - com.android.vending
2 - com.google.android.finsky.activities.InlineAppDetailsDialog

I tried to set a Uri "market://details?id=example.package", but nothing is succeded.

This is a dialog that open when I click the advertising.

enter image description here

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Based on your findings and the help of fellow Android developers, I've concluded that this feature of Play Store app is exclusive for select Google's partners. The conclusion is based on the decompiled code of com.google.android.finsky.activities.InlineAppDetailsDialog, which includes a switch that checks for the calling package's application ID and signature. Only authorized apps are allowed to show this dialogue.

Here's part of the decompiled code:

switch (string2.hashCode()) {
            case 714499313: {
                if (!string2.equals("com.facebook.katana")) break;
                n2 = 0;
                break;
            }
            case 419128298: {
                if (!string2.equals("com.facebook.wakizashi")) break;
                n2 = 1;
                break;
            }
            case -649684660: {
                if (!string2.equals("flipboard.app")) break;
                n2 = 2;
                break;
            }
            case 1249065348: {
                if (!string2.equals("com.kakao.talk")) break;
                n2 = 3;
                break;
            }
            case 1153658444: {
                if (!string2.equals("com.linkedin.android")) break;
                n2 = 4;
                break;
            }
            case -583737491: {
                if (!string2.equals("com.pinterest")) break;
                n2 = 5;
                break;
            }
            case -928396735: {
                if (!string2.equals("com.test.overlay")) break;
                n2 = 6;
                break;
            }
            case 10619783: {
                if (!string2.equals("com.twitter.android")) break;
                n2 = 7;
                break;
            }
            case 1835489205: {
                if (!string2.equals("ru.yandex.weatherplugin")) break;
                n2 = 8;
                break;
            }
            case 19680841: {
                if (!string2.equals("ru.yandex.yandexnavi")) break;
                n2 = 9;
                break;
            }
            case 19650874: {
                if (!string2.equals("ru.yandex.yandexmaps")) break;
                n2 = 10;
                break;
            }
            case 1663191933: {
                if (!string2.equals("ru.yandex.yandexbus")) break;
                n2 = 11;
                break;
            }
            case 636981927: {
                if (!string2.equals("ru.yandex.metro")) break;
                n2 = 12;
                break;
            }
            case 647779725: {
                if (!string2.equals("ru.yandex.searchplugin")) break;
                n2 = 13;
                break;
            }
            case -143313792: {
                if (!string2.equals("ru.yandex.test.promolib")) break;
                n2 = 14;
                break;
            }
            case -2075712516: {
                if (!string2.equals("com.google.android.youtube")) break;
                n2 = 15;
                break;
            }
            case 1387611572: {
                if (!string2.equals("com.google.android.youtube.tv")) break;
                n2 = 16;
                break;
            }
            case 886484461: {
                if (!string2.equals("com.google.android.apps.youtube.kids")) break;
                n2 = 17;
                break;
            }
            case 1386399663: {
                if (!string2.equals("com.google.android.apps.youtube.gaming")) break;
                n2 = 18;
                break;
            }
            case 1713433253: {
                if (!string2.equals("com.google.android.apps.youtube.music")) break;
                n2 = 19;
                break;
            }
            case 1252744364: {
                if (!string2.equals("com.google.android.apps.youtube.creator")) break;
                n2 = 20;
                break;
            }
            case 304833084: {
                if (!string2.equals("com.google.android.apps.youtube.vr")) break;
                n2 = 21;
                break;
            }
            case 1712832578: {
                if (!string2.equals("com.google.android.apps.youtube.mango")) break;
                n2 = 22;
                break;
            }

When attempting to launch this activity from a test app, I get the following logs:

06-09 10:44:30.100 5180-5180/? W/Finsky: [2] com.google.android.finsky.activities.InlineAppDetailsDialog.onCreate(88): Called from untrusted package.

So it seems that at least as of writing this answer, it is not possible to do what you want. Let's hope that this feature will be open for 3rd parties in the future.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...