From 181742b251767da6439fb3cd6045795a7fbca99d Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 2 May 2024 18:41:20 +0200 Subject: [PATCH] Add documentation and small script to test external deep links. --- docs/deeplink.md | 71 ++++++++++++++++++++++++++++++++++ tools/adb/deeplink_external.sh | 19 +++++++++ 2 files changed, 90 insertions(+) create mode 100644 docs/deeplink.md create mode 100755 tools/adb/deeplink_external.sh diff --git a/docs/deeplink.md b/docs/deeplink.md new file mode 100644 index 0000000000..1350b2f736 --- /dev/null +++ b/docs/deeplink.md @@ -0,0 +1,71 @@ +# Element X Android deeplink + + + +* [Introduction](#introduction) + * [Asset Links](#asset-links) + * [Supported links](#supported-links) +* [Developer tools](#developer-tools) + + + + +## Introduction + +Element X Android supports deep linking to specific screens in the application. This document explains how to use deep links in Element X Android. + +### Asset Links + +The asset links file is available at https://element.io/.well-known/assetlinks.json + +### Supported links + +Element Call link: +> https://call.element.io/Example + +Link to a user: +> https://app.element.io/#/user/@alice:matrix.org + +Link to a room by id or alias: +> https://app.element.io/#/room/!roomid:matrix.org +> https://app.element.io/#/room/#element-x-android:matrix.org + +Link to a room with a specific event: +> https://app.element.io/#/room/!roomid:matrix.org/$eventid + +Note that it will also work with other domain such as: +> https://mobile.element.io +> https://develop.element.io +> https://staging.element.io + +## Developer tools + +Using an Android 12 or higher emulator + +Ensure links verification is enabled +```bash +adb shell am compat enable 175408749 io.element.android.x.debug +``` + +Reset link verifications for the given package id +```bash +adb shell pm set-app-links --package io.element.android.x.debug 0 all +``` + +Force the package id links to be verified +```bash +adb shell pm verify-app-links --re-verify io.element.android.x.debug +``` + +Print the link verification of the package id +```bash +adb shell pm get-app-links io.element.android.x.debug +``` + +``` + io.element.android.x.debug: + ID: e2ece472-c266-4bf0-829c-be79959a6270 + Signatures: [B0:B0:51:DC:56:5C:81:2F:E1:7F:6F:3E:94:5B:4D:79:04:71:23:AB:0D:A6:12:86:76:9E:B2:94:91:97:13:0E] + Domain verification state: + *.element.io: 1024 +``` diff --git a/tools/adb/deeplink_external.sh b/tools/adb/deeplink_external.sh new file mode 100755 index 0000000000..c5a03c5f40 --- /dev/null +++ b/tools/adb/deeplink_external.sh @@ -0,0 +1,19 @@ +#! /bin/bash +# +# Copyright (c) 2024 New Vector Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +adb shell am start -a android.intent.action.VIEW -c android.intent.category.BROWSABLE \ + -d "https://app.element.io/#/room/!cuqHozLHNBgupgLMKN:matrix.org/%24LZDOueY3R8OD2ZYf8FLKtu95aF7imLBC3F5TIUj-4cc"