示例将应用关联扩大到域名下的所有 URL
原文依据:5 处Android 关联声明使用 handle_all_urls 且 intent filter 没有限定路径;iOS AASA 同时使用通配路径 “*” 和 “/*”。照搬后,应用会声明处理该域名下远超示例详情页的链接。
如果域名还承载登录、付款、管理后台或其他产品页面,这些链接可能被意外导入应用。应用若未安全处理相应路径和参数,用户可能看到错误流程或依据非预期深链采取操作。
该风险有源码支持。若用户原样替换占位符并部署这些关联文件,Android 的声明要求处理该应用与域名的所有 URL,且 intent filter 未限制路径;iOS 配置也使用覆盖全部路径的通配符。这可能使本应只处理详情页的应用接管该域名下其他链接。用户可要求作者将 Android intent filter 和两种站点关联文件限制到实际需要的路径,并确认是否确实需要全域关联。
```xml<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" android:host="yourdomain.com" /> <data android:scheme="https" /></intent-filter>```查看另外 4 个位置
```json[{ "relation": ["delegate_permission/common.handle_all_urls"], "target": { "namespace": "android_app", "package_name": "com.yourcompany.yourapp", "sha256_cert_fingerprints": ["YOUR_SHA256_FINGERPRINT"] }}]``````json{ "applinks": { "apps": [], "details": [{ "appIDs": ["TEAM_ID.com.yourcompany.yourapp"], "paths": ["*"], "components": [{"/": "/*"}] }] }}```[{ "relation": ["delegate_permission/common.handle_all_urls"], "target": { "namespace": "android_app", "package_name": "com.yourcompany.yourapp", "sha256_cert_fingerprints": ["YOUR_SHA256_FINGERPRINT"] } "apps": [], "details": [{ "appIDs": ["TEAM_ID.com.yourcompany.yourapp"], "paths": ["*"], "components": [{"/": "/*"}] }] }