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

fix(android/app): Cleanup AndroidManifest handling of *.kmp #10624

Merged
merged 1 commit into from
Feb 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 7 additions & 28 deletions android/KMAPro/kMAPro/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@
<data
android:mimeType="application/octet-stream"
android:scheme="content" />
<data
android:mimeType="application/x-keyman-package"
android:scheme="content" />
Comment on lines +106 to +108
Copy link
Member

Choose a reason for hiding this comment

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

Should we add a application/zip mime type? Given .kmp will be sniffed as a zip file.

Suggested change
<data
android:mimeType="application/x-keyman-package"
android:scheme="content" />
<data
android:mimeType="application/x-keyman-package"
android:scheme="content" />
<data
android:mimeType="application/zip"
android:scheme="content" />

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm, I tried adding application/zip but then we'll need additional code handling in the engine to expect .zip files instead of strictly .kmp files.

Copy link
Member

Choose a reason for hiding this comment

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

Feature for another day then

</intent-filter>

<!--
Expand All @@ -121,19 +124,7 @@

<data android:scheme="file" />
<data android:host="*" />

<!--
Work around Android's ugly primitive PatternMatcher
implementation that can't cope with finding a . early in
the path unless it's explicitly matched.
-->
<data android:pathPattern=".*\\.kmp" />
<data android:pathPattern=".*\\..*\\.kmp" />
<data android:pathPattern=".*\\..*\\..*\\.kmp" />
<data android:pathPattern=".*\\..*\\..*\\..*\\.kmp" />
<data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.kmp" />
<data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\.kmp" />
<data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\.kmp" />
<data android:pathPattern="/.*\\.kmp" />
Copy link
Member

Choose a reason for hiding this comment

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

Can we use android:pathSuffix=".kmp" instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From https://developer.android.com/guide/topics/manifest/data-element

pathSuffix has an API prereq

pathSuffix and pathAdvancePattern were introduced in API level 31.

Copy link
Member

Choose a reason for hiding this comment

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

The "/" at the start shouldn't be needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, the slash is what the Play Store is flagging:

Add a "/" to the beginning of the android:path attribute in the tag. The attribute might also be android:pathPrefix or android:pathPattern.

😕

Copy link
Member

Choose a reason for hiding this comment

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

ugh I see

</intent-filter>

<!--
Expand All @@ -154,19 +145,7 @@
<data android:scheme="file" />
<data android:host="*" />
<data android:mimeType="*/*" />

<!--
Work around Android's ugly primitive PatternMatcher
implementation that can't cope with finding a . early in
the path unless it's explicitly matched.
-->
<data android:pathPattern=".*\\.kmp" />
<data android:pathPattern=".*\\..*\\.kmp" />
<data android:pathPattern=".*\\..*\\..*\\.kmp" />
<data android:pathPattern=".*\\..*\\..*\\..*\\.kmp" />
<data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.kmp" />
<data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\.kmp" />
<data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\.kmp" />
<data android:pathPattern="/.*\\.kmp" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
Expand All @@ -177,11 +156,11 @@
<!-- http:// and https:// protocols -->
<data
android:host="*"
android:pathPattern=".*\\.kmp"
android:pathPattern="/.*\\.kmp"
android:scheme="http" />
<data
android:host="*"
android:pathPattern=".*\\.kmp"
android:pathPattern="/.*\\.kmp"
android:scheme="https" />
</intent-filter>

Expand Down
Loading