2

Cannot verify app link for my app on android devices. Using example.com for domain, and com.example.app for app id instead of the real one.

  1. I can launch app by adb shell am start -W -a android.intent.action.VIEW -d https://example.com/ com.example.app
  2. launching with adb shell am start -W -a android.intent.action.VIEW -d https://example.com/, with just url, doesn't work and chrome opens with the link.
  3. App Info > Open by Default > Verified links for this com.example.app is empty and greyed out.
  4. adb shell pm get-app-links com.example.app returns/prints nothing
  5. Could not find any logs with adb logcat -e "(IntentFilterIntentOp|IntentFilterIntentSvc)" when installing this app, opening it, keeping it open for more than 20 secs, or re-verifying the app-link with adb shell pm verify-app-links -- re-verify
  6. curl https://example.com/.well-known/assetlinks.json -I returns the following output:
HTTP/1.1 200 OK
Date: Thu, 01 Jun 2023 09:05:51 GMT
Content-Type: application/json
Content-Length: 337
Connection: keep-alive
Strict-Transport-Security: max-age=63072000; includeSubdomains;
X-Content-Type-Options: nosniff
Last-Modified: Thu, 01 Jun 2023 08:40:55 GMT
ETag: "151-5fd0d65109bf8"
Accept-Ranges: bytes
Cache-Control: max-age=2592000
Expires: Sat, 01 Jul 2023 09:05:51 GMT
Vary: User-Agent
X-FRAME-OPTIONS: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Content-Security-Policy: default-src 'self' 'unsafe-inline' 'unsafe-eval' data: https: *.googleadservices.com *.doubleclick.net *.google.com *.googletagmanager.com *.gstatic.com *.googleapis.com *.facebook.net; frame-ancestors 'self'
Referrer-Policy: no-referrer
Feature-Policy: microphone 'none'; geolocation 'none'
Expect-CT: max-age=0
CF-Cache-Status: DYNAMIC
Set-Cookie: __cf_bm=wkXkFwgBEGc6Ghwu.9PHLwFccvVaqOaV0zj8WyBdDf0-1685610351-0-AeqBrPqaw4CpOpFKrWxzWbN7139MTi3/194uecclD0smsP++N2TXfshkdaoVy4FtqyWm1JfEkkKH3joUoPoU2HY=; path=/; expires=Thu, 01-Jun-23 09:35:51 GMT; domain=.example.com; HttpOnly; Secure; SameSite=None
Server: cloudflare
CF-RAY: 7d064c15bf09f44a-BOM

where the content of this assetlinks.json is below and the SHA256 signature matches with the signature of the key I use for building the release apk.

[
    {
        "relation": ["delegate_permission/common.handle_all_urls"],
        "target": {
            "namespace": "android_app",
            "package_name": "com.example.com",
            "sha256_cert_fingerprints": ["SO:ME:FA:KE:SH:A2:56:5C:57:D7:22:D4:ED:A3:C4:97:23:A2:4E:B0:30:93:A5:57:39:98:B1:E0:3E:03:64:73"]
        }
    }
]
  1. Running curl "https://digitalassetlinks.googleapis.com/v1/statements:list?source.web.site=https://example.com&relation=delegate_permission/common.handle_all_urls" returns the following json:
{
  "statements": [
    {
      "source": {
        "web": {
          "site": "https://example.com."
        }
      },
      "relation": "delegate_permission/common.handle_all_urls",
      "target": {
        "androidApp": {
          "packageName": "com.example.app",
          "certificate": {
            "sha256Fingerprint": "SO:ME:FA:KE:SH:A2:56:5C:57:D7:22:D4:ED:A3:C4:97:23:A2:4E:B0:30:93:A5:57:39:98:B1:E0:3E:03:64:73"
          }
        }
      }
    }
  ],
  "maxAge": "589172.377669267s"
}
  1. I get the below output only when I run adb shell pm get-app-links --user cur com.example.app
    User 0:
      Verification link handling allowed: true
      Selection state:
        Disabled:
          example.com
  1. I've also added a custom url scheme to the app manifest which works fine.

I am testing the app link on Android 13, Oneplus Nord 2, and an Android 12 device. I could not find any documentation where there was a discussion of a case with no output upon running adb shell pm get-app-links com.example.app.

Mushaheed Syed
  • 643
  • 10
  • 23

0 Answers0