相关疑难解决方法(0)

Android 应用程序链接在 Android 12 中不起作用,始终在浏览器中打开

我已将 assetlinks 文件托管到我们的域 https://ourdomain/.well-known/assetlinks.json 并且还使用https://developers.google.com/digital-asset-links/tools/generator和 android studio验证了这一点应用程序链接助手并从这两种方式获得了验证状态。但是当我共享调试 APK 进行测试时,它总是在浏览器中打开。我还尝试在应用程序商店上传并从那里下载进行测试,但它总是在浏览器中打开。

注意:对于调试构建,使用了我的笔记本电脑 SHA-256,一旦 Play 商店上的应用程序将托管资产链接文件上的 SHA(通过转到 Play 控制台中的应用程序仪表板然后发布管理 --> 应用程序签名获得 SHA-256)更改为我们的域 https ://ourdomain/.well-known/assetlinks.json

以下是清单文件中使用的代码。


     <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="https"
                android:host="abc.test.com" />
        </intent-filter>
Run Code Online (Sandbox Code Playgroud)

android deep-linking kotlin android-deep-link android-app-links

67
推荐指数
7
解决办法
6万
查看次数

默认情况下,应用程序链接在 Android 12 中无法打开。可能的 SHA256 问题

我已通过在此处上传 assetlinks.json 文件来设置深度链接

https://example.com/.well-known/assetlinks.json
Run Code Online (Sandbox Code Playgroud)

它在 Android 11 之前都可以正常工作。如果不是从 Playstore 下载的,它也可以在 Android 12 中工作(即从我的 android studio 或我从 android studio 制作的 apk 文件安装,即使我使用 Keystore 签署 apk 文件也能工作。)

在 Android 12 上从 Playstore 下载时,如果您进入应用程序设置 -> 默认打开 -> 在应用程序中打开的链接。我们可以看到我的域默认被禁用。我认为这与我在 assetlinks.json 中使用的 sha256 有关

我从 Android studio 中的 App Link Assistant 获取了 assetlinks.json。(我在生成 assetlinks 时也选择了密钥库文件)。

如果我去我的play console->Setup->App integrity->App signing

我可以在数字资产 Json 部分中看到不同的 Sha256(也在应用程序签名密钥证书部分中)

我可以在上传密钥证书部分看到我上传的 Sha256。

我的问题是我应该在 assetlinks.json 中使用哪种 sha256?

我在这里看到我应该同时使用两者。如果应该的话,如何将 sha256 添加到我的 assetlink.json 中。我可以将其添加为像这样的逗号分隔值吗?

[{
  "relation": ["delegate_permission/common.handle_all_urls"],
  "target": {
    "namespace": "android_app",
    "package_name": "com.example", …
Run Code Online (Sandbox Code Playgroud)

android deep-linking android-deep-link android-app-links

16
推荐指数
2
解决办法
3万
查看次数

在 Android 12 中运行深度链接需要进行哪些更改

我的应用程序的深度链接功能在 Android 11 上运行良好。但在 Android 12 中却不起作用。我检查并关注了几篇 StackOverflow 帖子和其他一些博客。但我在应用程序详细信息中未选中链接

在此输入图像描述

如果我手动检查它,深层链接就会起作用。

我尝试使用文档进行手动验证并收到legacy_failure错误。 https://developer.android.com/training/app-links/verify-site-associations#manual-verification

我也关注了这个网址https://doordash.engineering/2022/01/25/your-deep-links-might-be-broken-web-intents-and-android-12/comment-page-1/?unapproved= 40015&适度哈希=dc9e7df0845c5072330edc78f75ca497#comments

android deep-linking android-manifest android-deep-link android-12

7
推荐指数
1
解决办法
7252
查看次数

Android 12 上的 AppLinks - 仅打开浏览器

我有以下清单代码:

<activity
        android:name=".InterceptorActivity"
        android:launchMode="singleTask"
        android:parentActivityName=".HomeActivity"
        tools:ignore="UnusedAttribute"
        android:theme="@style/Theme.Startup"
        android:exported="true">

        <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="https"/>
            <data android:scheme="http"/>
            <data android:host="www.mysite.com"/>

            <data android:pathPrefix="/myPage"/>
            <data android:pathPrefix="/myFavourites"/>
       </intent-filter>
    </activity>
Run Code Online (Sandbox Code Playgroud)

assetlinks.json 看起来没问题并且上传正确。但所有应用程序链接仍然仅在浏览器中打开,我看到该应用程序支持该链接,但未选中。

另外命令“adb shell pm get-app-links”com.myapp.android”返回

com.myapp.android:
ID: 893......
Signatures: [13:03....DA]
Domain verification state:
  www.myapp.com: legacy_failure
Run Code Online (Sandbox Code Playgroud)

为什么?请帮忙。

android applinks android-12

6
推荐指数
1
解决办法
4213
查看次数