|
31 | 31 | See |
32 | 32 | : https://g.co/appindexing/applinks |
33 | 33 | Implementation |
34 | | -: [Source Code](https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:lint/libs/lint-checks/src/main/java/com/android/tools/lint/checks/AppLinksAutoVerifyDetector.java) |
| 34 | +: [Source Code](https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:lint/libs/lint-checks/src/main/java/com/android/tools/lint/checks/AppLinksAutoVerifyDetector.kt) |
35 | 35 | Tests |
36 | | -: [Source Code](https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:lint/libs/lint-tests/src/test/java/com/android/tools/lint/checks/AppLinksAutoVerifyDetectorTest.java) |
| 36 | +: [Source Code](https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:lint/libs/lint-tests/src/test/java/com/android/tools/lint/checks/AppLinksAutoVerifyDetectorTest.kt) |
37 | 37 | Copyright Year |
38 | 38 | : 2015 |
39 | 39 |
|
|
43 | 43 |
|
44 | 44 | Here is an example of lint warnings produced by this check: |
45 | 45 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text |
46 | | -AndroidManifest.xml:12:Error: This host does not support app links to |
47 | | -your app. Checks the Digital Asset Links JSON file: |
48 | | -http://example.com/.well-known/assetlinks.json [AppLinksAutoVerify] |
| 46 | +AndroidManifest.xml:12:Warning: HTTP request for Digital Asset Links |
| 47 | +JSON file https://links.dropbox.com/.well-known/assetlinks.json fails. |
| 48 | +HTTP response code: 301 [AppLinksAutoVerify] |
49 | 49 |
|
50 | | - android:host="example.com" |
51 | | - -------------------------- |
| 50 | + android:host="links.dropbox.com" |
| 51 | + -------------------------------- |
52 | 52 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
53 | 53 |
|
54 | 54 | Here is the source file referenced above: |
|
57 | 57 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers |
58 | 58 | <?xml version="1.0" encoding="utf-8"?> |
59 | 59 | <manifest xmlns:android="http://schemas.android.com/apk/res/android" |
60 | | - package="com.example.helloworld" > |
| 60 | + package="com.dropbox.links" > |
61 | 61 |
|
62 | 62 | <application |
63 | 63 | android:allowBackup="true" |
|
66 | 66 | <intent-filter android:autoVerify="true"> |
67 | 67 | <action android:name="android.intent.action.VIEW" /> |
68 | 68 | <data android:scheme="http" |
69 | | - android:host="example.com" |
| 69 | + android:host="links.dropbox.com" |
70 | 70 | android:pathPrefix="/gizmos" /> |
71 | 71 | <category android:name="android.intent.category.DEFAULT" /> |
72 | 72 | <category android:name="android.intent.category.BROWSABLE" /> |
|
78 | 78 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
79 | 79 |
|
80 | 80 | You can also visit the |
81 | | -[source code](https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:lint/libs/lint-tests/src/test/java/com/android/tools/lint/checks/AppLinksAutoVerifyDetectorTest.java) |
| 81 | +[source code](https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:lint/libs/lint-tests/src/test/java/com/android/tools/lint/checks/AppLinksAutoVerifyDetectorTest.kt) |
82 | 82 | for the unit tests for this check to see additional scenarios. |
83 | 83 |
|
84 | 84 | The above example was automatically extracted from the first unit test |
85 | | -found for this lint check, `AppLinksAutoVerifyDetector.testInvalidPackage`. |
| 85 | +found for this lint check, `AppLinksAutoVerifyDetector.testRedirect`. |
86 | 86 | To report a problem with this extracted sample, visit |
87 | 87 | https://issuetracker.google.com/issues/new?component=192708. |
88 | 88 |
|
|
0 commit comments