Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 471
Alex Charles Avatar asked Sep 05 '25 02:09

Alex Charles


2 Answers

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

like image 121
Brian Avatar answered Sep 07 '25 20:09

Brian


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.

like image 45
santeko Avatar answered Sep 07 '25 19:09

santeko