1.添加intent-filter
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
<data android:pathPrefix="/myownpersonaldomain.com" />
</intent-filter>
2.生成assetlinks.json,然后放到域名/.well-known/assetlinks.json
[
{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "packagename",
"sha256_cert_fingerprints": [
"3A:------:84"
]
}
}
]
注意不是挂了vpn就能成功,必须Googleplay能正确连上
命令
//获取单个的applink信息
adb shell pm get-app-links packagename
//全部
adb shell dumpsys package d
错误范例
com.alpha.lagouapk:
ID: 89f2f531-f6cc-464c-981f-190cbf1f4caa
Signatures: [80:B8:16:12:74:5D:5F:4F:01:61:31:8E:67:A7:A5:7A:E9:2B:E6:63:C2:07:BF:E9:FF:85:0F:A6:96:79:03:5F]
Domain verification state:
lgimg.com: 1024
User all:
Verification link handling allowed: true
Selection state:
Disabled:
lgimg.com
这里的Domain verification 如果是1024说明没成功
正确范例
com.ss.android.article.lite:
ID: 5040c820-d1f7-4e25-8e30-f3c663bdd46c
Signatures: [51:82:AE:3B:1B:85:33:7B:B1:82:CF:24:88:24:49:F8:44:47:DE:D1:8E:29:6A:74:7A:9F:6A:0A:26:22:51:2E]
Domain verification state:
m.toutiao.com: verified
s.zjurl.cn: verified
z.toutiao.com: verified
User all:
Verification link handling allowed: true
Selection state:
Disabled:
m.toutiao.com
s.zjurl.cn
z.toutiao.com