gpt4 book ai didi

Android applinks 在已发布的版本中不起作用,但在本地安装中可以正常工作

转载 作者:行者123 更新时间:2023-12-03 17:11:19 27 4
gpt4 key购买 nike

我有一个 game那是使用applinks。从我的计算机运行调试和发布版本时,应用链接工作正常,但不适用于从 Google Play 下载的版本。使用 Google Play 版本时,我会收到一个对话框,询问应该打开链接的应用程序。
我使用“App Signing by Google Play”并了解发布 APK 由 Google 签名并且具有不同的签名。我已将 Google Play 上列出的应用签名证书中的 SHA-256 证书指纹添加到我的 assetlinks.json因此它包含来自本地和 Google Play 版本的指纹。
我还从 Google Play 下载了一个派生的 APK,并确保指纹与assetlinks.json 文件中的指纹匹配。
这是一个示例 URL,在 Android 中单击该 URL 时应打开应用程序,它适用于本地构建,但不是在 Google Play 版本中。相反,我得到一个对话框,询问哪个应用程序应该打开链接。
https://letsdraw.fun/ec?parent=Z0ibN7m-H8jO1jCiMRQtY23VTpKjnIch
我正在从实时发布版本的 logcat 中写出 SHA256 指纹,以仔细检查它是否正确,一切看起来都很好。
原始签名 APK 和 Google Play 签名 APK 可从 here 下载.这两个 APK 都是从 Google Play 下载的,一个是“原始的”,一个是“派生的”,所以除了签名之外它们应该是相同的。有趣的是,它们的尺寸略有不同。 11,590,297 字节与 11,601,619 字节。
查看 adb shell dumpsys package domain-preferred-apps 的输出原始签名的apk是

  Package: com.scribble.exquisitecorpse
Domains: letsdraw.fun scribble-cloud.appspot.com scribble-cloud-v24-test-dot-scribble-cloud.appspot.com
Status: always : 200000000
而 Google Play 签名的 apk 是
  Package: com.scribble.exquisitecorpse
Domains: letsdraw.fun scribble-cloud.appspot.com scribble-cloud-v24-test-dot-scribble-cloud.appspot.com
Status: ask
使用@ymindstorm 提到的测试页面进行测试时
https://developers.google.com/digital-asset-links/tools/generator
我收到消息

Success! Host letsdraw.fun grants app deep linking tocom.scribble.exquisitecorpse.


您对可能导致这种情况的原因有什么建议吗?
更新:
我现在已将此作为错误报告给 Google,因为我无法弄清楚发生了什么。
https://issuetracker.google.com/issues/162564916

最佳答案

我得到了 Google 的帮助最终......这不是一个错误。
构建过程正在从 network_security_config.xml 合并到主机中。文件,所以即使 AndroidManifest.xml指定的文件:

        <intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:host="letsdraw.fun" android:pathPrefix="/ec" android:scheme="https" />
<data android:host="letsdraw.fun" android:pathPrefix="/restore" android:scheme="https" />
</intent-filter>
构建过程中的文件也指定了其他主机:
        <intent-filter
android:autoVerify="true">

<action
android:name="android.intent.action.VIEW" />

<category
android:name="android.intent.category.DEFAULT" />

<category
android:name="android.intent.category.BROWSABLE" />

<data
android:scheme="http"
android:host="scribble-cloud-v24-test-dot-scribble-cloud.appspot.com"
android:pathPrefix="/ec" />

<data
android:scheme="https"
android:host="scribble-cloud.appspot.com"
android:pathPrefix="/ec" />

<data
android:scheme="https"
android:host="letsdraw.fun"
android:pathPrefix="/ec" />

<data
android:scheme="https"
android:host="letsdraw.fun"
android:pathPrefix="/restore" />
</intent-filter>
this它声明的页面

Only if the system finds a matching Digital Asset Links file for allhosts in the manifest does it then establish your app as the defaulthandler for the specified URL patterns.


问题是我的测试主机没有返回相同的 assetlinks.json文件作为其他主机。
构建您的 APK 后,使用 IntelliJ 或 Android Studio 转到 Build | Analyze Apk并打开刚刚构建的 APK 以检查您的主机是否正确以及 assetlinks.json文件正在返回正确的签名。
为什么要像这样合并 list 文件?希望我们能找到 here!

关于Android applinks 在已发布的版本中不起作用,但在本地安装中可以正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62976824/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com