Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing Android 12 url deeplinks #6225

Merged
merged 2 commits into from
May 2, 2024
Merged

Conversation

ouchadam
Copy link
Contributor

@ouchadam ouchadam commented Jun 1, 2022

Draft as this relies on a element.io change which is tracked by this Ops request, https://github.com/vector-im/sre-internal/issues/1382 (internal link)

Fixes #5748

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

Fixes matrix-org/matrix-ansible-private#5748 Android 12 being ineligible for URL deeplinks

Creates a separate intent-filter to enable the required autoVerify on the *.element.io urls

See verify site for more details

Motivation and context

To fix missing Android 12 URL deeplink

Screenshots / GIFs

// TODO relies on element.io's assetlinks.json to be updated

Tests

Follow steps in matrix-org/matrix-ansible-private#5748

or to manually check the verification...

Using an Android 12 emulator

Ensure links verification is enabled

adb shell am compat enable 175408749 im.vector.app.debug  

Reset link verifications for the given package id

adb shell pm set-app-links --package im.vector.app.debug 0 all 

Force the package id links to be verifed

adb shell pm verify-app-links --re-verify im.vector.app.debug 

Print the link verification of the package id

adb shell pm get-app-links im.vector.app.debug
  im.vector.app.debug:
    ID: 09a2698b-f577-4f38-a4a0-225af2aba897
    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: verified

Trigger a url

adb shell am start -a android.intent.action.VIEW -c android.intent.category.BROWSABLE -d "https://mobile.element.io/?hs_url=https%3A%2F%2Fmatrix-client.matrix.org%2F&is_url=https%3A%2F%2Fvec
tor.im%2F"

Tested devices

  • Physical
  • Emulator
  • OS version(s):

@github-actions
Copy link

github-actions bot commented Jun 1, 2022

Unit Test Results

146 files  ±0  146 suites  ±0   2m 33s ⏱️ +26s
236 tests ±0  236 ✔️ ±0  0 💤 ±0  0 ±0 
788 runs  ±0  788 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit c7f9126. ± Comparison against base commit e18146a.

@ouchadam
Copy link
Contributor Author

ouchadam commented Jun 1, 2022

Added blocked label whilst the element.io repo pull request is under review

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, hence I do not see the PR to update element.io website anymore (to see if it's been merged and deployed).

@ouchadam
Copy link
Contributor Author

ouchadam commented Jul 4, 2022

LGTM, hence I do not see the PR to update element.io website anymore (to see if it's been merged and deployed).

it's been replaced with an OPS ticket (was recommended in the tech internal room)

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:scheme="https" />
<data android:host="app.element.io" />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, hence I do not see the PR to update element.io website anymore (to see if it's been merged and deployed).

This is now unblocked as I've added https://element.io/.well-known/assetlinks.json via https://github.com/vector-im/element.io-website/pull/96

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the update! will rebase this PR

- urls must be verified in order for deeplinks to be enabled by the system
@ouchadam ouchadam marked this pull request as ready for review September 13, 2022 08:50
@ouchadam ouchadam force-pushed the feature/adm/android-12-deeplinks branch from c7f9126 to af59f65 Compare September 13, 2022 08:50
@ElementBot
Copy link

ElementBot commented Sep 13, 2022

Warnings
⚠️

vector/src/main/AndroidManifest.xml#L197 - Attribute autoVerify is only used in API level 23 and higher (current min is 21)

⚠️

vector/src/main/AndroidManifest.xml#L197 - Attribute autoVerify is only used in API level 23 and higher (current min is 21)

⚠️

vector/src/main/AndroidManifest.xml#L225 - Consider splitting data tag into multiple tags with individual attributes to avoid confusion

⚠️

vector/src/main/AndroidManifest.xml#L225 - Consider splitting data tag into multiple tags with individual attributes to avoid confusion

⚠️

vector/src/main/AndroidManifest.xml#L228 - Consider splitting data tag into multiple tags with individual attributes to avoid confusion

⚠️

vector/src/main/AndroidManifest.xml#L228 - Consider splitting data tag into multiple tags with individual attributes to avoid confusion

⚠️

vector/src/main/AndroidManifest.xml#L282 - Expecting android:screenOrientation="unspecified" or "fullSensor" for this activity so the user can use the application in any orientation and provide a great experience on Chrome OS devices

⚠️

vector/src/main/AndroidManifest.xml#L282 - Expecting android:screenOrientation="unspecified" or "fullSensor" for this activity so the user can use the application in any orientation and provide a great experience on Chrome OS devices

⚠️

vector/src/main/AndroidManifest.xml#L291 - Attribute supportsPictureInPicture is only used in API level 24 and higher (current min is 21)

⚠️

vector/src/main/AndroidManifest.xml#L291 - Attribute supportsPictureInPicture is only used in API level 24 and higher (current min is 21)

⚠️

vector/src/main/AndroidManifest.xml#L298 - Attribute supportsPictureInPicture is only used in API level 24 and higher (current min is 21)

⚠️

vector/src/main/AndroidManifest.xml#L298 - Attribute supportsPictureInPicture is only used in API level 24 and higher (current min is 21)

⚠️

vector/src/main/AndroidManifest.xml#L304 - Attribute supportsPictureInPicture is only used in API level 24 and higher (current min is 21)

⚠️

vector/src/main/AndroidManifest.xml#L304 - Attribute supportsPictureInPicture is only used in API level 24 and higher (current min is 21)

⚠️

vector/src/main/AndroidManifest.xml#L420 - Exported receiver does not require permission

⚠️

vector/src/main/AndroidManifest.xml#L420 - Exported receiver does not require permission

Generated by 🚫 dangerJS against 4e068a1

<category android:name="android.intent.category.BROWSABLE" />

<data android:scheme="https" />
<data android:host="*.element.io" />
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

captures all subdomains of element.io to avoid needing to host a assetlinks.json on every subdomain

@sonarcloud
Copy link

sonarcloud bot commented Sep 13, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@ouchadam ouchadam marked this pull request as draft September 14, 2022 17:05
@ouchadam
Copy link
Contributor Author

ouchadam commented Sep 14, 2022

converting back to draft, we'll need to create a list of all the deeplinks we support in order to know which domains to host the assetlinks.json

@AndrewBedscastle
Copy link

AndrewBedscastle commented Apr 7, 2023

Any progress on this?

I'd be extremely helpful to send inexperienced users to the app / correct room without telling them they need to approve the custom link schema at the app's settings screen (by doing this it also works on Android 12+)

At least the app.element.io scheme should work on Android 12+
I'd be happy to help but this can only be fixed by the play console admin / domain holder

@bmarty
Copy link
Member

bmarty commented May 2, 2024

OK, it's working, let's merge this.

@bmarty bmarty marked this pull request as ready for review May 2, 2024 14:49
@bmarty bmarty merged commit 305372c into develop May 2, 2024
@bmarty bmarty deleted the feature/adm/android-12-deeplinks branch May 2, 2024 14:58
@sbeach92
Copy link

#8850 Undoes this fix, as mobile.element.io url is now missing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants