element-android icon indicating copy to clipboard operation
element-android copied to clipboard

Fixing Android 12 url deeplinks

Open ouchadam opened this issue 3 years ago • 6 comments

Draft as this relies on a element.io change which is tracked by this Ops request, https://github.com/matrix-org/matrix-ansible-private/issues/5223 (internal link)

Fixes https://github.com/vector-im/element-android/issues/5748

Type of change

  • [ ] Feature
  • [x] Bugfix
  • [ ] Technical
  • [ ] Other :

Content

Fixes #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 #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
  • [x] Emulator
  • OS version(s):

ouchadam avatar Jun 01 '22 15:06 ouchadam

Unit Test Results

146 files  ±0  146 suites  ±0   2m 33s :stopwatch: +26s 236 tests ±0  236 :heavy_check_mark: ±0  0 :zzz: ±0  0 :x: ±0  788 runs  ±0  788 :heavy_check_mark: ±0  0 :zzz: ±0  0 :x: ±0 

Results for commit c7f91269. ± Comparison against base commit e18146a0.

github-actions[bot] avatar Jun 01 '22 16:06 github-actions[bot]

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

ouchadam avatar Jun 01 '22 16:06 ouchadam

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)

ouchadam avatar Jul 04 '22 13:07 ouchadam

Warnings
:warning:

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

:warning:

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

:warning:

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

:warning:

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

:warning:

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

:warning:

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

:warning:

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

:warning:

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

:warning:

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

:warning:

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

:warning:

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

:warning:

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

:warning:

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

:warning:

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

:warning:

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

:warning:

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

Generated by :no_entry_sign: dangerJS against 4e068a10e4178a100137e290ca86a5937f8c7ea4

ElementBot avatar Sep 13 '22 08:09 ElementBot

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

sonarqubecloud[bot] avatar Sep 13 '22 12:09 sonarqubecloud[bot]

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

ouchadam avatar Sep 14 '22 17:09 ouchadam

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

AndrewBedscastle avatar Apr 07 '23 15:04 AndrewBedscastle

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

bmarty avatar May 02 '24 14:05 bmarty