craft-native 0.0.203 → 0.0.204
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -52,6 +52,7 @@ export interface CraftAndroidConfig {
|
|
|
52
52
|
enableLocalNetwork?: boolean;
|
|
53
53
|
urlSchemes?: string[];
|
|
54
54
|
/** HTTPS hosts owned by the app; path rules are ordered, with `*` matching any path text. */
|
|
55
|
+
/** Ordered path rules: * matches zero or more characters, ? one, and ?* one or more. */
|
|
55
56
|
appLinks?: Array<{
|
|
56
57
|
host: string;
|
|
57
58
|
paths?: Array<{
|
|
@@ -7,6 +7,14 @@ import androidx.browser.customtabs.CustomTabsClient
|
|
|
7
7
|
import androidx.browser.customtabs.CustomTabsIntent
|
|
8
8
|
import org.json.JSONObject
|
|
9
9
|
|
|
10
|
+
/** Match the path wildcards supported by website association files. */
|
|
11
|
+
internal fun craftAppLinkPathMatches(pattern: String, path: String): Boolean {
|
|
12
|
+
val regex = pattern.split('*').joinToString(".*") { part ->
|
|
13
|
+
part.split('?').joinToString(".") { Regex.escape(it) }
|
|
14
|
+
}
|
|
15
|
+
return Regex("^$regex$").matches(path)
|
|
16
|
+
}
|
|
17
|
+
|
|
10
18
|
/** Ordered website path rules, also publishable as Android 15 dynamic App Links. */
|
|
11
19
|
internal object CraftAppLinks {
|
|
12
20
|
fun opensInBrowser(config: JSONObject?, uri: Uri): Boolean {
|
|
@@ -20,8 +28,7 @@ internal object CraftAppLinks {
|
|
|
20
28
|
for (ruleIndex in 0 until rules.length()) {
|
|
21
29
|
val rule = rules.optJSONObject(ruleIndex) ?: continue
|
|
22
30
|
val pattern = rule.optString("pattern")
|
|
23
|
-
|
|
24
|
-
if (Regex("^$regex$").matches(path)) return rule.optBoolean("exclude", false)
|
|
31
|
+
if (craftAppLinkPathMatches(pattern, path)) return rule.optBoolean("exclude", false)
|
|
25
32
|
}
|
|
26
33
|
return true
|
|
27
34
|
}
|
package/dist/cli.js
CHANGED
|
@@ -3424,7 +3424,7 @@ function pinCraftNativeDependency(packagePath, craftVersion) {
|
|
|
3424
3424
|
`);
|
|
3425
3425
|
}
|
|
3426
3426
|
// package.json
|
|
3427
|
-
var version = "0.0.
|
|
3427
|
+
var version = "0.0.204";
|
|
3428
3428
|
|
|
3429
3429
|
// bin/cli.ts
|
|
3430
3430
|
var spawnedFrom = process6.env[CRAFT_CLI_SPAWN_MARKER];
|
package/dist/index.cjs
CHANGED
package/dist/index.js
CHANGED