Tool that helps with checking if an Android application has successfully completed the "App Link Verification" process for Android App Links.
You can see more info about this process here.
This tool supports 6 operation modes:
list-all
: simple enumeration, lists all deep links registered by the application regardless of formatlist-applinks
: lists all Android App Links registered by the applicationverify-applinks
: for each App Link, displays checklist with each of the necessary steps for verification, indicates if they've been completed successfullyadb-test
: usesadb
to open all of the application's App Links and allows you to check if they're being automatically opened by the intended applicationbuild-poc
: creates an HTML page with links to all of the registered Android App Links, in order to simplify the process of testing their verification processlaunch-poc
: sends the HTML page created on the previus mode to a connected device (viaadb
), and opens it with Chrome
It also supports 3 additional flags:
clear
: removes the decompiled directory after executionverbose
: prints additional information about the executionci-cd
: ideal for running in CI/CD pipelines, exits with1
if any of the App Links are not correctly verified; automatically runs withclear
andverbose
flags
python3 -m pip install -r requirements.txt
Important Notes
- If you want to provide an
.apk
file instead of theAndroidManifest.xml
andstrings.xml
, then you need to have apktool installed and accessible on the$PATH
; - If you want to use the
adb-test
orlaunch-poc
operation modes, you need to have adb installed and accessible on the$PATH
; - If you want to use the
verify-applinks
operation mode or if you want to be able to install the package on the device, you must use the-apk
option instead of the manifest+strings file combination. - If you want to use the
verify-applinks
operation mode, you need to have keytool installed and accessible on the$PATH
; - If you want to use the
adb-test
,launch-poc
orverify-applinks
operation modes you must specify the-p
option.
~ python3 Android-App-Link-Verification-Tester/deeplink_analyser.py --help
usage: deeplink_analyser.py [-h] [-apk FILE] [-m FILE] [-s FILE] -op OP
[-p PACKAGE] [-v] [-c]
optional arguments:
-h, --help show this help message and exit
-apk FILE Path to the APK (required for `verify-applinks`
operation mode)
-m FILE, --manifest FILE
Path to the AndroidManifest.xml file
-s FILE, --strings FILE
Path to the strings.xml file
-op OP, --operation-mode OP
Operation mode: "list-all", "list-applinks", "verify-
applinks", "build-poc", "launch-poc", "adb-test".
-p PACKAGE, --package PACKAGE
Package identifier, e.g.: "com.myorg.appname"
(required for some operation modes)
-v, --verbose Verbose mode
--clear Whether or not the script should delete the decompiled
directory after running (default: False)
--ci-cd Ideal for running in CI/CD pipelines (default: False)
~ python3 Android-App-Link-Verification-Tester/deeplink_analyser.py \
-op list-all \
-apk <path-to-apk>
~ python3 Android-App-Link-Verification-Tester/deeplink_analyser.py \
-op list-applinks \
-m <path-to-android-manifest> \
-s <path-to-strings-file>
Note that the strings.xml file is typically under /res/values/strings.xml
.
~ python3 Android-App-Link-Verification-Tester/deeplink_analyser.py \
-op verify-applinks \
-apk <path-to-apk> \
-p <package-name>
Note that you can also specify the -v
flag to print the entire DAL file.
An example output for the Twitter Android app would be:
~ python3 Android-App-Link-Verification-Tester/deeplink_analyser.py \
-apk com.twitter.android_2021-10-22.apk \
-p com.twitter.android \
-op verify-applinks
[...]
The APK's signing certificate's SHA-256 fingerprint is:
0F:D9:A0:CF:B0:7B:65:95:09:97:B4:EA:EB:DC:53:93:13:92:39:1A:A4:06:53:8A:3B:04:07:3B:C2:CE:2F:E9
[...]
Checking http://mobile.twitter.com/.*
✓ includes autoverify=true
✓ includes VIEW action
✓ includes BROWSABLE category
✓ includes DEFAULT category
✓ DAL verified
Relations:
- [Standard] delegate_permission/common.get_login_creds
- [Standard] delegate_permission/common.handle_all_urls
- [Custom] delegate_permission/common.use_as_origin
Checking http://twitter.com/.*
✓ includes autoverify=true
✓ includes VIEW action
✓ includes BROWSABLE category
✓ includes DEFAULT category
✓ DAL verified
Relations:
- [Standard] delegate_permission/common.get_login_creds
- [Standard] delegate_permission/common.handle_all_urls
- [Custom] delegate_permission/common.use_as_origin
[...]
Read more about relation strings here: https://developers.google.com/digital-asset-links/v1/relation-strings
~ python3 Android-App-Link-Verification-Tester/deeplinks_analyser.py \
-op adb-test \
-apk <path-to-apk> \
-p <package-name>
Note that the package was not installed on the phone previously, so the script installed the APK using adb
.
~ python3 Android-App-Link-Verification-Tester/deeplink_analyser.py \
-op build-poc \
-m <path-to-android-manifest> \
-s <path-to-strings-file>
~ python3 Android-App-Link-Verification-Tester/deeplink_analyser.py \
-op launch-poc \
-apk <path-to-apk> \
-p <package-name>
As a result, your Android device should display something like this:
Then, you can manually click on each of the links: if the OS prompts you to choose between Chrome and one or more apps, then the App Link Verification process is not correctly implemented.