【问题标题】:How to force Google to refetch .well-known/assetlinks.json in order to fix my Android App Link implementation如何强制 Google 重新获取 .well-known/assetlinks.json 以修复我的 Android App Link 实现
【发布时间】:2019-11-29 19:37:08
【问题描述】:

我已经使用 My Local APK 成功实现了 Android 应用链接,并且它可以正常工作。当我在 Google Play 商店中发布相同的 APK 时,我发现我需要使用 Google 提供的指纹更改我的 /.well-known/assetlinks.json 中的 SHA 256 指纹。所以我改变了它。不幸的是,谷歌似乎保留了旧的assetlinks.json 副本,这会破坏我的应用程序链接。

我已经检查过了 https://developers.google.com/digital-asset-links/tools/generator 它说 “未找到 [your-app] 的应用深层链接权限”

我已经检查过了 https://digitalassetlinks.googleapis.com/v1/statements:list?source.web.site=[my-site]&relation=delegate_permission/common.handle_all_urls 它显示了旧版本的assetlinks.json

我的 robots.txt

User-agent: *
Disallow:

我在目录/.well-known 中的.htaccess 文件

Require all granted
RewriteEngine Off


<FilesMatch "\.(txt)$">
    Require all granted
</FilesMatch>

<FilesMatch "\.(txt)$">
    Allow from all
</FilesMatch>

我的assetlinks.json

[{
  "relation": ["delegate_permission/common.handle_all_urls"],
  "target" : { "namespace": "android_app", "package_name": "my-app-id",
               "sha256_cert_fingerprints": ["my-sha-256-provided-by-gogole-play-console"] }
}]

https://digitalassetlinks.googleapis.com/v1/statements:list?source.web.site=[my-site]&relation=delegate_permission/common.handle_all_urls的结果

{
  "statements": [
    {
      "source": {
        "web": {
          "site": "https://my-host."
        }
      },
      "relation": "delegate_permission/common.handle_all_urls",
      "target": {
        "androidApp": {
          "packageName": "my-app-id",
          "certificate": {
            "sha256Fingerprint": "the-old-sha-256-fingerprint"
          }
        }
      }
    }
  ],
  "maxAge": "534347.929731888s",
  "debugString": "********************* ERRORS *********************\nNone!\n********************* INFO MESSAGES *********************\n* Info: The following statements were considered when processing the request:\n\n---\nSource: Web asset with site https://my-host. (which is equivalent to 'https://my-host')\nRelation: delegate_permission/common.handle_all_urls\nTarget: Android app asset with package name my-app-id and certificate fingerprint the-old-sha-256 \nWhere this statement came from:\n  Origin of the statement: Web asset with site https://my-host. (which is equivalent to 'https://my-host')\n  Include directives followed (in order):\n    \u003cNone\u003e\nMatches source query: Yes\nMatches relation query: Yes\nMatches target query: Yes\n\n--- End of statement list. ---\n\n\n"
}

the-old-sha-256 与我的实际assetlinks.json 中的 SHA 256 不同

附: my-app-id、my-host、[my-site] 等是占位符。

那么...如何强制 Google 读取我当前的assetlinks.json 而不是使用旧的缓存版本?

【问题讨论】:

  • 当你部署文件时它会改变;)
  • 你有没有得到这个答案?我现在自己也面临同样的问题
  • 各位有没有找到解决办法,我也遇到了同样的问题,有没有办法强制清除缓存?
  • 有没有人找到任何解决方案?我认为等待 8 天更改部署是不可接受的。

标签: android twa


【解决方案1】:
  1. 在您的情况下,谷歌缓存了您的 SHA256 并将采取最大限制 八天更新您的 SHA256。只需更改网站名称 在下面给出的 url 中,它将向您显示 google 拥有的 SHA256 密钥 被缓存。

https://digitalassetlinks.googleapis.com/v1/statements:list?source.web.site=https://www.your-website-name.com&relation=delegate_permission/common.handle_all_urls


assetlinks.json 文件也可能被 Play Services 缓存在您的 设备以及 Google 的服务器上,因此可能需要几天时间 它们会根据您对 Web 服务器所做的任何更改进行更新。和 SmartLock chrome/app 登录共享需要下载您的 APK 来自 Google 的应用商店。

【讨论】:

    猜你喜欢
    • 2017-02-21
    • 1970-01-01
    • 1970-01-01
    • 2022-01-07
    • 1970-01-01
    • 2011-11-28
    • 2023-03-05
    • 1970-01-01
    • 2021-09-13
    相关资源
    最近更新 更多