gpt4 book ai didi

android - 验证 assetlinks.json 给出 ERROR_CODE_MALFORMED_CONTENT

转载 作者:行者123 更新时间:2023-11-30 00:16:32 29 4
gpt4 key购买 nike

我正在尝试在我的网络服务器上设置一个 assetlinks.json 文件,以指示深层链接应由移动应用程序处理,并且登录凭据应在网站和 Android 8 上的移动设备之间共享。

我在我的开发服务器 ( https://devtesting.narrpr.com/.well-known/assetlinks.json ) 上托管了 assetlinks.json 文件。

[{
"relation": ["delegate_permission/common.get_login_creds"],
"target": {
"namespace": "web",
"site": "https://devtesting.narrpr.com/"
}
},
{
"relation": ["delegate_permission/common.get_login_creds", "delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "com.rpr.mobile",
"sha256_cert_fingerprints": [
"D3:7B:D8:D7:47:AF:08:2E:BA:EF:02:96:8C:F2:3A:1A:46:F9:B0:81:E9:E3:6D:BA:01:3C:00:59:95:39:8D:21"
]
}
}
]

当我执行 this url 时测试它,它给出了一个错误:

{
"maxAge": "599.999999890s",
"debugString": "********************* ERRORS *********************\n* Error: invalid_argument: Could not parse statement list (not valid JSON): \\357\\273\\277[{\\r\\n\\t\\t\\\"relation\\\": [\\\"delegate_permission/common.get_login_creds\\\"],\\r\\n\\t\\t\\\"target\\\": {\\r\\n\\t\\t\\t\\\"namespace\\\": \\\"web\\\",\\r\\n\\t\\t\\t\\\"site\\\": \\\"https://devtesting.narrpr.com/\\\"\\r\\n\\t\\t}\\r\\n\\t},\\r\\n\\t{\\r\\n\\t\\t\\\"relation\\\": [\\\"delegate_permission/common.get_login_creds\\\", \\\"delegate_permission/common.handle_all_urls\\\"],\\r\\n\\t\\t\\t\\\"target\\\": {\\r\\n\\t\\t\\t\\t\\\"namespace\\\": \\\"droid\\\",\\r\\n\\t\\t\\t\\t\\\"package_name\\\": \\\"com.rpr.mobile\\\",\\r\\n\\t\\t\\t\\t\\\"sha256_cert_fingerprints\\\": [\\r\\n\\t\\t\\t\\t\\t\\\"D3:7B:D8:D7:47:AF:08:2E:BA:EF:02:96:8C:F2:3A:1A:46:F9:B0:81:E9:E3:6D:BA:01:3C:00:59:95:39:8D:21\\\"\\r\\n\\t\\t\\t\\t]\\r\\n\\t\\t\\t}\\r\\n\\t}\\r\\n] [0] while fetching Web statements from https://devtesting.narrpr.com./.well-known/assetlinks.json (which is equivalent to 'https://devtesting.narrpr.com/.well-known/assetlinks.json') using download from the web (ID 1).\n********************* INFO MESSAGES *********************\n* Info: No statements were found that match your query\n",
"errorCode": [
"ERROR_CODE_MALFORMED_CONTENT"
]
}

在调试行中它说它不是有效的 json,但是 jsonlint 不这么认为。知道我做错了什么吗?

最佳答案

通过 Android Studio(而不是手动)生成 assetlinks.json 文件后,它开始工作。不确定是我错过了内容还是 Windows 文本编码的问题。

[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "com.rpr.mobile",
"sha256_cert_fingerprints":
["D3:7B:D8:D7:47:AF:08:2E:BA:EF:02:96:8C:F2:3A:1A:46:F9:B0:81:E9:E3:6D:BA:01:3C:00:59:95:39:8D:21"]
}
},
{
"relation": ["delegate_permission/common.get_login_creds"],
"target": {
"namespace": "web",
"site": "https://devtesting.narrpr.com"
}
},
{
"relation": ["delegate_permission/common.get_login_creds"],
"target": {
"namespace": "android_app",
"package_name": "com.rpr.mobile",
"sha256_cert_fingerprints":
["D3:7B:D8:D7:47:AF:08:2E:BA:EF:02:96:8C:F2:3A:1A:46:F9:B0:81:E9:E3:6D:BA:01:3C:00:59:95:39:8D:21"]
}
}]

关于android - 验证 assetlinks.json 给出 ERROR_CODE_MALFORMED_CONTENT,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47162756/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com