Skip to content
Closed
Show file tree
Hide file tree
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
46 changes: 38 additions & 8 deletions android/KMAPro/kMAPro/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -209,16 +209,46 @@
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data
android:host="keyman-staging.com"
android:scheme="http"
android:pathPrefix="/keyboards/install" />
<!-- Our servers' initial folder represents a language code. -->
<data android:host="keyman-staging.com" />
<data android:scheme="http" />
<!-- Matches 2-letter language folders specifically. -->
<data android:pathPattern="/.._*/keyboards/install/.*" />
<!-- Matches 2-letter language folders specifically. -->
<data android:pathPattern="/..._*/keyboards/install/.*" />
<!-- Matches 4-letter language folders specifically. -->
<data android:pathPattern="/...._*/keyboards/install/.*" />
<!-- Matches 5-letter language folders specifically. -->
<data android:pathPattern="/....._*/keyboards/install/.*" />
<!-- Matches 6-letter language folders specifically. -->
<data android:pathPattern="/......_*/keyboards/install/.*" />
<!-- Matches 7-letter language folders specifically. -->
<data android:pathPattern="/......._*/keyboards/install/.*" />
</intent-filter>

<data
android:host="keyman.com"
android:scheme="https"
android:pathPrefix="/keyboards/install" />
<intent-filter android:priority="50" android:autoVerify="true">
<!-- KMAPro should also be able to handle /keyboards/install links and convert to /go/package/download -->
<action android:name="android.intent.action.VIEW" />

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

<!-- Our servers' initial folder represents a language code. -->
<data android:host="keyman.com" />
<data android:scheme="https" />
<!-- Must rely on the .._* pattern when targetSdk < 31 -->
<!-- Matches 2-letter language folders specifically. -->
<data android:pathPattern="/.._*/keyboards/install/.*" />
<!-- Matches 3-letter language folders specifically. -->
<data android:pathPattern="/..._*/keyboards/install/.*" />
<!-- Matches 4-letter language folders specifically. -->
<data android:pathPattern="/...._*/keyboards/install/.*" />
<!-- Matches 5-letter language folders specifically. -->
<data android:pathPattern="/....._*/keyboards/install/.*" />
<!-- Matches 6-letter language folders specifically. -->
<data android:pathPattern="/......_*/keyboards/install/.*" />
<!-- Matches 7-letter language folders specifically. -->
<data android:pathPattern="/......._*/keyboards/install/.*" />
</intent-filter>

</activity>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public final class KMPLink {
public static final String KMP_PRODUCTION_HOST = "keyman.com";
public static final String KMP_STAGING_HOST = "keyman.com"; // #7227 disabling: "keyman-staging.com";

private static final String KMP_INSTALL_KEYBOARDS_PATTERN_FORMATSTR = "^http(s)?://(%s|%s)/keyboards/install/([^\\?/]+)(\\?(.+))?$";
private static final String KMP_INSTALL_KEYBOARDS_PATTERN_FORMATSTR = "^http(s)?://(%s|%s)/[^/]*/keyboards/install/([^\\?/]+)(\\?(.+))?$";
private static final String installPatternFormatStr = KMString.format(KMP_INSTALL_KEYBOARDS_PATTERN_FORMATSTR,
KMP_PRODUCTION_HOST,
KMP_STAGING_HOST);
Expand Down