How to resolve Android get-app-links Returns State 1024?
Asked Answered
G

6

24

I can't get deep links to work on Android 13, I've followed every tutorial out there and can't get the app to simply start after entering the website.

I used the command in the android studio terminal:

adb shell pm get-app-links com.where44444.cleanbook

and it returns

  com.where44444.cleanbook:
    ID: 0892ecd5-a93b-4064-bb2c-5d6cae6e7ac6
    Signatures: [9D:F7:97:FE:92:94:1A:67:96:80:D4:07:84:F8:42:8E:96:50:2B:C2:2D:CC:19:AD:0F:CC:F1:A4:E0:72:39:BE]
    Domain verification state:
      cleanassistant.net: 1024
      www.cleanassistant.net: 1024

The documentation says

Error code of 1024 or greater

Custom error code that's specific to the device's verifier.

Double-check that you have established a network connection, and invoke the domain verification process again.

I am indeed connected to the internet both on laptop and phone.

Any help would be appreciated.

Gasconade answered 15/9, 2022 at 20:49 Comment(0)
C
20

I think the issue is you need to include that signature into your assetlinks.json. I see your file here:

https://cleanassistant.net/.well-known/assetlinks.json

It does not have the signature in your output: 9D:F7:97:FE:92:94:1A:67:96:80:D4:07:84:F8:42:8E:96:50:2B:C2:2D:CC:19:AD:0F:CC:F1:A4:E0:72:39:BE

Are doing a local build that is not signed by the Google Play store? We had the same problem, and the issue was that our assetlinks.json only included the Google Play certificate fingerprint, not the certificate fingerprint used when creating local builds (whether .aab or .apk). Once we added the local fingerprint to assetlinks.json, the app link successfully verified. Without that, we kept getting the 1024 error.

Your assetlinks.json is otherwise valid, as you can verify here:

https://digitalassetlinks.googleapis.com/v1/statements:list?source.web.site=https://cleanassistant.net&relation=delegate_permission/common.handle_all_urls

Cytotaxonomy answered 30/9, 2022 at 22:16 Comment(1)
It is means must upload .apk or .aab to playstore to make the domain verification verified ?Moat
O
13

The solution that worked for me was replacing my SHA256 fingerprint in my assetlinks.json with the Signature that's returned from

adb shell pm get-app-links com.package.name

Most of the documentation suggests using the fingerprint that's returned from your signing key:

keytool -list -v -keystore release-key.keystore -alias <alias> -storepass <password> -keypass <password>

But that didn't work for me because Google Play now seems to be signing my app even though when I generate the .aab in Android Studio, the local key is used. The inner workings of that I don't fully understand but I was getting the 1024 error for weeks.

Steps:

  1. Run adb shell pm get-app-links com.package.name
  2. That will return something like:
ID: a07e3734-cdbd-4389-946c-b9ebda8c3892
    Signatures: [00: .... the actual fingerprint ..... 00]
    Domain verification state:
      app.revillager.com: 1024
  1. Take that signature and paste that into your assetlinks.json:
{
 ...
 "sha256_cert_fingerprints": [
        "00: .... the actual fingerprint ..... 00"
      ]
 ...
}
  1. Push that file to your hosting service.
  2. Run the re-verify command, checking the status after 10 seconds (may have to do this multiple times):
adb shell pm verify-app-links --re-verify com.package.name
adb shell pm get-app-links com.package.name
  1. Once you see Domain verification state: com.package.name: verified, test this is working by using:
adb shell am start -a android.intent.action.VIEW -c android.intent.category.BROWSABLE -d "https://deeplinksite.com"

And that should launch the app on your device instead of in chrome.

Orabelle answered 8/5, 2023 at 20:50 Comment(2)
Isn't step 1 getting the hash from your local key as well? I thought you had to get the SHA from the Google Play Console.Nissensohn
@santeko: I have verified that my SHA 256 is same as the google play store signing but i still get 1024.Placentation
H
4

In our case we had indeed a missing signature in the assetlinks.json.

BUT, the file was agressively cached. Which caused the app not to re-verify once we fixed it.

After we stopped setting a cache header for the file and a force re-verify via

adb shell pm verify-app-links --re-verify com.example

We could indeed get it to work.

Hoey answered 20/3, 2023 at 11:27 Comment(1)
I had to wait a few minutes for it to reset/clear cache (using firebase hosting).Foramen
R
2

Helpful links to understand the all thing and debug these issues :

Also, you can monitor this in Google Play Console, in the Deep links menu. You can get some hints there.

In my case, the issue was geofencing enable to Europe for my domain, making it impossible for Google to verify links (because they seems to do it from USA), so I needed to disable it.

Rail answered 25/4, 2023 at 9:45 Comment(0)
V
0

If none of the suggestions work for you, and you have your phone or emulator connected to a proxy or VPN, The automatic verification won't work, resulting in a 1024 verification code.

You need to reinstall the app whilst not in the proxy or VPN so that the automatic verification is generated again OR you can run this command in Android Studio Terminal:

adb shell pm verify-app-links --re-verify [your app package name]

This fix the problem for me!

Visser answered 12/1 at 20:19 Comment(0)
H
0

To test locally you can also Long press app icon > App info > Open by default > Add link > Check the box > Add

Halicarnassus answered 12/4 at 17:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.