如何强制Google重新获取.well-known / assetlinks.json以修复我的Android App Link实现

时间:2019-04-04 07:28:07

标签: android

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

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

我已经检查了 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不同

P.S。 my-app-id,my-host,[my-site]等都是占位符。

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

1 个答案:

答案 0 :(得分:0)

  1. 以您为例,google缓存了SHA256,将采用最大限制     八天的时间来更新您的SHA256。只需更改网站名称     在下面给出的网址中,这将向您显示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服务缓存在您的   设备以及Google的服务器上,因此可能需要几天的时间   可以从您对Web服务器所做的任何更改中更新它们。和   SmartLock Chrome /应用登录共享需要下载您的APK   从Google的应用商店中获取。

相关问题