expo-build-properties 0.9.0 → 0.10.0
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.
- package/CHANGELOG.md +10 -0
- package/README.md +1 -1
- package/build/android.d.ts +1 -0
- package/build/android.js +23 -1
- package/build/androidQueryUtils.d.ts +26 -0
- package/build/androidQueryUtils.js +39 -0
- package/build/pluginConfig.d.ts +54 -0
- package/build/pluginConfig.js +29 -0
- package/build/withBuildProperties.js +1 -0
- package/package.json +2 -2
- package/src/android.ts +28 -0
- package/src/androidQueryUtils.ts +42 -0
- package/src/pluginConfig.ts +87 -0
- package/src/withBuildProperties.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,16 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 0.10.0 — 2023-10-17
|
|
14
|
+
|
|
15
|
+
### 🎉 New features
|
|
16
|
+
|
|
17
|
+
- Add `android.manifestQueries` to allow adding and modifying the `<queries>` tag in the App Manifest. ([#24619](https://github.com/expo/expo/pull/24619) by [@alanjhughes](https://github.com/alanjhughes))
|
|
18
|
+
|
|
19
|
+
## 0.9.1 — 2023-09-04
|
|
20
|
+
|
|
21
|
+
_This version does not introduce any user-facing changes._
|
|
22
|
+
|
|
13
23
|
## 0.9.0 — 2023-07-28
|
|
14
24
|
|
|
15
25
|
_This version does not introduce any user-facing changes._
|
package/README.md
CHANGED
|
@@ -46,4 +46,4 @@ Contributions are very welcome! Please refer to guidelines described in the [con
|
|
|
46
46
|
[docs-main]: https://github.com/expo/expo/blob/main/docs/pages/versions/unversioned/sdk/build-properties.mdx
|
|
47
47
|
[docs-stable]: https://docs.expo.dev/versions/latest/sdk/build-properties/
|
|
48
48
|
[contributing]: https://github.com/expo/expo#contributing
|
|
49
|
-
[config-plugins]: https://docs.expo.dev/
|
|
49
|
+
[config-plugins]: https://docs.expo.dev/config-plugins/introduction
|
package/build/android.d.ts
CHANGED
|
@@ -20,3 +20,4 @@ export declare const withAndroidPurgeProguardRulesOnce: ConfigPlugin;
|
|
|
20
20
|
*/
|
|
21
21
|
export declare function updateAndroidProguardRules(contents: string, newProguardRules: string | null, updateMode: 'append' | 'overwrite'): string;
|
|
22
22
|
export declare const withAndroidCleartextTraffic: ConfigPlugin<PluginConfigType>;
|
|
23
|
+
export declare const withAndroidQueries: ConfigPlugin<PluginConfigType>;
|
package/build/android.js
CHANGED
|
@@ -3,10 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.withAndroidCleartextTraffic = exports.updateAndroidProguardRules = exports.withAndroidPurgeProguardRulesOnce = exports.withAndroidProguardRules = exports.withAndroidFlipper = exports.withAndroidBuildProperties = void 0;
|
|
6
|
+
exports.withAndroidQueries = exports.withAndroidCleartextTraffic = exports.updateAndroidProguardRules = exports.withAndroidPurgeProguardRulesOnce = exports.withAndroidProguardRules = exports.withAndroidFlipper = exports.withAndroidBuildProperties = void 0;
|
|
7
7
|
const config_plugins_1 = require("expo/config-plugins");
|
|
8
8
|
const fs_1 = __importDefault(require("fs"));
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const androidQueryUtils_1 = require("./androidQueryUtils");
|
|
10
11
|
const fileContentsUtils_1 = require("./fileContentsUtils");
|
|
11
12
|
const { createBuildGradlePropsConfigPlugin } = config_plugins_1.AndroidConfig.BuildProperties;
|
|
12
13
|
exports.withAndroidBuildProperties = createBuildGradlePropsConfigPlugin([
|
|
@@ -191,3 +192,24 @@ function setUsesCleartextTraffic(androidManifest, value) {
|
|
|
191
192
|
}
|
|
192
193
|
return androidManifest;
|
|
193
194
|
}
|
|
195
|
+
const withAndroidQueries = (config, props) => {
|
|
196
|
+
return (0, config_plugins_1.withAndroidManifest)(config, (config) => {
|
|
197
|
+
if (props.android?.manifestQueries == null) {
|
|
198
|
+
return config;
|
|
199
|
+
}
|
|
200
|
+
const { manifestQueries } = props.android;
|
|
201
|
+
// Default template adds a single intent to the `queries` tag
|
|
202
|
+
const defaultIntents = config.modResults.manifest.queries.map((q) => q.intent ?? []).flat() ?? [];
|
|
203
|
+
const additionalQueries = {
|
|
204
|
+
package: (0, androidQueryUtils_1.renderQueryPackages)(manifestQueries.package),
|
|
205
|
+
intent: [...defaultIntents, ...(0, androidQueryUtils_1.renderQueryIntents)(manifestQueries.intent)],
|
|
206
|
+
};
|
|
207
|
+
const provider = (0, androidQueryUtils_1.renderQueryProviders)(manifestQueries.provider);
|
|
208
|
+
if (provider != null) {
|
|
209
|
+
additionalQueries.provider = provider;
|
|
210
|
+
}
|
|
211
|
+
config.modResults.manifest.queries = [additionalQueries];
|
|
212
|
+
return config;
|
|
213
|
+
});
|
|
214
|
+
};
|
|
215
|
+
exports.withAndroidQueries = withAndroidQueries;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { PluginConfigTypeAndroidQueriesIntent } from './pluginConfig';
|
|
2
|
+
export declare function renderQueryProviders(data?: string | string[]): {
|
|
3
|
+
$: {
|
|
4
|
+
'android:authorities': string;
|
|
5
|
+
};
|
|
6
|
+
} | undefined;
|
|
7
|
+
export declare function renderQueryPackages(data: string | string[]): {
|
|
8
|
+
$: {
|
|
9
|
+
'android:name': string;
|
|
10
|
+
};
|
|
11
|
+
}[];
|
|
12
|
+
export declare function renderQueryIntents(queryIntents?: PluginConfigTypeAndroidQueriesIntent[]): {
|
|
13
|
+
action: {
|
|
14
|
+
$: {
|
|
15
|
+
'android:name': string;
|
|
16
|
+
};
|
|
17
|
+
}[];
|
|
18
|
+
data: {
|
|
19
|
+
$: {};
|
|
20
|
+
}[];
|
|
21
|
+
category: {
|
|
22
|
+
$: {
|
|
23
|
+
'android:name': string;
|
|
24
|
+
};
|
|
25
|
+
}[];
|
|
26
|
+
}[];
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.renderQueryIntents = exports.renderQueryPackages = exports.renderQueryProviders = void 0;
|
|
4
|
+
function renderQueryProviders(data) {
|
|
5
|
+
const dataStr = Array.isArray(data) ? data.join(';') : data;
|
|
6
|
+
return dataStr ? { $: { 'android:authorities': dataStr } } : undefined;
|
|
7
|
+
}
|
|
8
|
+
exports.renderQueryProviders = renderQueryProviders;
|
|
9
|
+
function renderQueryPackages(data) {
|
|
10
|
+
return (Array.isArray(data) ? data : [data]).filter(Boolean).map((datum) => ({
|
|
11
|
+
$: {
|
|
12
|
+
'android:name': datum,
|
|
13
|
+
},
|
|
14
|
+
}));
|
|
15
|
+
}
|
|
16
|
+
exports.renderQueryPackages = renderQueryPackages;
|
|
17
|
+
function renderQueryIntents(queryIntents) {
|
|
18
|
+
return (queryIntents?.map((intent) => {
|
|
19
|
+
const { data, category, action } = intent;
|
|
20
|
+
return {
|
|
21
|
+
action: [
|
|
22
|
+
{
|
|
23
|
+
$: {
|
|
24
|
+
'android:name': `android.intent.action.${action}`,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
data: (Array.isArray(data) ? data : [data]).filter(Boolean).map((datum) => ({
|
|
29
|
+
$: Object.entries(datum ?? {}).reduce((prev, [key, value]) => ({ ...prev, [`android:${key}`]: value }), {}),
|
|
30
|
+
})),
|
|
31
|
+
category: (Array.isArray(category) ? category : [category]).filter(Boolean).map((cat) => ({
|
|
32
|
+
$: {
|
|
33
|
+
'android:name': `android.intent.category.${cat}`,
|
|
34
|
+
},
|
|
35
|
+
})),
|
|
36
|
+
};
|
|
37
|
+
}) ?? []);
|
|
38
|
+
}
|
|
39
|
+
exports.renderQueryIntents = renderQueryIntents;
|
package/build/pluginConfig.d.ts
CHANGED
|
@@ -99,6 +99,13 @@ export interface PluginConfigTypeAndroid {
|
|
|
99
99
|
* @see [Android documentation](https://developer.android.com/guide/topics/manifest/application-element#usesCleartextTraffic)
|
|
100
100
|
*/
|
|
101
101
|
usesCleartextTraffic?: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Specifies the set of other apps that an app intends to interact with. These other apps are specified by package name,
|
|
104
|
+
* by intent signature, or by provider authority.
|
|
105
|
+
*
|
|
106
|
+
* @see [Android documentation](https://developer.android.com/guide/topics/manifest/queries-element)
|
|
107
|
+
*/
|
|
108
|
+
manifestQueries?: PluginConfigTypeAndroidQueries;
|
|
102
109
|
}
|
|
103
110
|
/**
|
|
104
111
|
* Interface representing available configuration for iOS native build properties.
|
|
@@ -248,6 +255,53 @@ export interface PluginConfigTypeAndroidPackagingOptions {
|
|
|
248
255
|
*/
|
|
249
256
|
doNotStrip?: string[];
|
|
250
257
|
}
|
|
258
|
+
export interface PluginConfigTypeAndroidQueries {
|
|
259
|
+
/**
|
|
260
|
+
* Specifies a single app that your app intends to access. This other app might integrate with your app, or your app might use services that the other app provides.
|
|
261
|
+
*/
|
|
262
|
+
package: string[];
|
|
263
|
+
/**
|
|
264
|
+
* Specifies an intent filter signature. Your app can discover other apps that have matching <intent-filter> elements.
|
|
265
|
+
* These intents have restrictions compared to typical intent filter signatures.
|
|
266
|
+
*
|
|
267
|
+
* @see [Android documentation](https://developer.android.com/training/package-visibility/declaring#intent-filter-signature) for details
|
|
268
|
+
*/
|
|
269
|
+
intent?: PluginConfigTypeAndroidQueriesIntent[];
|
|
270
|
+
/**
|
|
271
|
+
* Specifies one or more content provider authorities. Your app can discover other apps whose content providers use the specified authorities.
|
|
272
|
+
* There are some restrictions on the options that you can include in this <provider> element, compared to a typical <provider> manifest element. You may only specify the android:authorities attribute.
|
|
273
|
+
*/
|
|
274
|
+
provider?: string[];
|
|
275
|
+
}
|
|
276
|
+
export interface PluginConfigTypeAndroidQueriesIntent {
|
|
277
|
+
/**
|
|
278
|
+
* A string naming the action to perform. Usually one of the platform-defined values, such as ACTION_SEND or ACTION_VIEW
|
|
279
|
+
*/
|
|
280
|
+
action?: string;
|
|
281
|
+
/**
|
|
282
|
+
* A description of the data associated with the intent.
|
|
283
|
+
*/
|
|
284
|
+
data?: PluginConfigTypeAndroidQueriesData;
|
|
285
|
+
/**
|
|
286
|
+
* Provides an additional way to characterize the activity handling the intent,
|
|
287
|
+
* usually related to the user gesture or location from which it's started.
|
|
288
|
+
*/
|
|
289
|
+
category?: string | string[];
|
|
290
|
+
}
|
|
291
|
+
export interface PluginConfigTypeAndroidQueriesData {
|
|
292
|
+
/**
|
|
293
|
+
* Specify a URI scheme that is handled
|
|
294
|
+
*/
|
|
295
|
+
scheme?: string;
|
|
296
|
+
/**
|
|
297
|
+
* Specify a URI authority host that is handled
|
|
298
|
+
*/
|
|
299
|
+
host?: string;
|
|
300
|
+
/**
|
|
301
|
+
* Specify a MIME type that is handled
|
|
302
|
+
*/
|
|
303
|
+
mimeType?: string;
|
|
304
|
+
}
|
|
251
305
|
/**
|
|
252
306
|
* @ignore
|
|
253
307
|
*/
|
package/build/pluginConfig.js
CHANGED
|
@@ -53,6 +53,35 @@ const schema = {
|
|
|
53
53
|
networkInspector: { type: 'boolean', nullable: true },
|
|
54
54
|
extraMavenRepos: { type: 'array', items: { type: 'string' }, nullable: true },
|
|
55
55
|
usesCleartextTraffic: { type: 'boolean', nullable: true },
|
|
56
|
+
manifestQueries: {
|
|
57
|
+
required: ['package'],
|
|
58
|
+
type: 'object',
|
|
59
|
+
properties: {
|
|
60
|
+
package: { type: 'array', items: { type: 'string' }, minItems: 1, nullable: false },
|
|
61
|
+
intent: {
|
|
62
|
+
type: 'array',
|
|
63
|
+
items: {
|
|
64
|
+
type: 'object',
|
|
65
|
+
properties: {
|
|
66
|
+
action: { type: 'string', nullable: true },
|
|
67
|
+
data: {
|
|
68
|
+
type: 'object',
|
|
69
|
+
properties: {
|
|
70
|
+
scheme: { type: 'string', nullable: true },
|
|
71
|
+
host: { type: 'string', nullable: true },
|
|
72
|
+
mimeType: { type: 'string', nullable: true },
|
|
73
|
+
},
|
|
74
|
+
nullable: true,
|
|
75
|
+
},
|
|
76
|
+
category: { type: 'array', items: { type: 'string' }, nullable: true },
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
nullable: true,
|
|
80
|
+
},
|
|
81
|
+
provider: { type: 'array', items: { type: 'string' }, nullable: true },
|
|
82
|
+
},
|
|
83
|
+
nullable: true,
|
|
84
|
+
},
|
|
56
85
|
},
|
|
57
86
|
nullable: true,
|
|
58
87
|
},
|
|
@@ -14,6 +14,7 @@ const withBuildProperties = (config, props) => {
|
|
|
14
14
|
config = (0, android_1.withAndroidBuildProperties)(config, pluginConfig);
|
|
15
15
|
config = (0, android_1.withAndroidProguardRules)(config, pluginConfig);
|
|
16
16
|
config = (0, android_1.withAndroidCleartextTraffic)(config, pluginConfig);
|
|
17
|
+
config = (0, android_1.withAndroidQueries)(config, pluginConfig);
|
|
17
18
|
// Assuming `withBuildProperties` could be called multiple times from different config-plugins,
|
|
18
19
|
// the `withAndroidProguardRules` always appends new rules by default.
|
|
19
20
|
// That is not ideal if we leave generated contents from previous prebuild there.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-build-properties",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Config plugin to customize native build properties on prebuild",
|
|
5
5
|
"main": "build/withBuildProperties.js",
|
|
6
6
|
"types": "build/withBuildProperties.d.ts",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"expo": "*"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "da25937e2a99661cbe5eb60ca1d8d6245fc96a50"
|
|
44
44
|
}
|
package/src/android.ts
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
import fs from 'fs';
|
|
10
10
|
import path from 'path';
|
|
11
11
|
|
|
12
|
+
import { renderQueryIntents, renderQueryPackages, renderQueryProviders } from './androidQueryUtils';
|
|
12
13
|
import { appendContents, purgeContents } from './fileContentsUtils';
|
|
13
14
|
import type { PluginConfigType } from './pluginConfig';
|
|
14
15
|
|
|
@@ -238,3 +239,30 @@ function setUsesCleartextTraffic(
|
|
|
238
239
|
|
|
239
240
|
return androidManifest;
|
|
240
241
|
}
|
|
242
|
+
|
|
243
|
+
export const withAndroidQueries: ConfigPlugin<PluginConfigType> = (config, props) => {
|
|
244
|
+
return withAndroidManifest(config, (config) => {
|
|
245
|
+
if (props.android?.manifestQueries == null) {
|
|
246
|
+
return config;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
const { manifestQueries } = props.android;
|
|
250
|
+
|
|
251
|
+
// Default template adds a single intent to the `queries` tag
|
|
252
|
+
const defaultIntents =
|
|
253
|
+
config.modResults.manifest.queries.map((q) => q.intent ?? []).flat() ?? [];
|
|
254
|
+
|
|
255
|
+
const additionalQueries: AndroidConfig.Manifest.ManifestQuery = {
|
|
256
|
+
package: renderQueryPackages(manifestQueries.package),
|
|
257
|
+
intent: [...defaultIntents, ...renderQueryIntents(manifestQueries.intent)],
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
const provider = renderQueryProviders(manifestQueries.provider);
|
|
261
|
+
if (provider != null) {
|
|
262
|
+
additionalQueries.provider = provider;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
config.modResults.manifest.queries = [additionalQueries];
|
|
266
|
+
return config;
|
|
267
|
+
});
|
|
268
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { PluginConfigTypeAndroidQueriesIntent } from './pluginConfig';
|
|
2
|
+
|
|
3
|
+
export function renderQueryProviders(data?: string | string[]) {
|
|
4
|
+
const dataStr = Array.isArray(data) ? data.join(';') : data;
|
|
5
|
+
return dataStr ? { $: { 'android:authorities': dataStr } } : undefined;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function renderQueryPackages(data: string | string[]) {
|
|
9
|
+
return (Array.isArray(data) ? data : [data]).filter(Boolean).map((datum) => ({
|
|
10
|
+
$: {
|
|
11
|
+
'android:name': datum,
|
|
12
|
+
},
|
|
13
|
+
}));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function renderQueryIntents(queryIntents?: PluginConfigTypeAndroidQueriesIntent[]) {
|
|
17
|
+
return (
|
|
18
|
+
queryIntents?.map((intent) => {
|
|
19
|
+
const { data, category, action } = intent;
|
|
20
|
+
return {
|
|
21
|
+
action: [
|
|
22
|
+
{
|
|
23
|
+
$: {
|
|
24
|
+
'android:name': `android.intent.action.${action}`,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
data: (Array.isArray(data) ? data : [data]).filter(Boolean).map((datum) => ({
|
|
29
|
+
$: Object.entries(datum ?? {}).reduce(
|
|
30
|
+
(prev, [key, value]) => ({ ...prev, [`android:${key}`]: value }),
|
|
31
|
+
{}
|
|
32
|
+
),
|
|
33
|
+
})),
|
|
34
|
+
category: (Array.isArray(category) ? category : [category]).filter(Boolean).map((cat) => ({
|
|
35
|
+
$: {
|
|
36
|
+
'android:name': `android.intent.category.${cat}`,
|
|
37
|
+
},
|
|
38
|
+
})),
|
|
39
|
+
};
|
|
40
|
+
}) ?? []
|
|
41
|
+
);
|
|
42
|
+
}
|
package/src/pluginConfig.ts
CHANGED
|
@@ -122,6 +122,13 @@ export interface PluginConfigTypeAndroid {
|
|
|
122
122
|
* @see [Android documentation](https://developer.android.com/guide/topics/manifest/application-element#usesCleartextTraffic)
|
|
123
123
|
*/
|
|
124
124
|
usesCleartextTraffic?: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Specifies the set of other apps that an app intends to interact with. These other apps are specified by package name,
|
|
127
|
+
* by intent signature, or by provider authority.
|
|
128
|
+
*
|
|
129
|
+
* @see [Android documentation](https://developer.android.com/guide/topics/manifest/queries-element)
|
|
130
|
+
*/
|
|
131
|
+
manifestQueries?: PluginConfigTypeAndroidQueries;
|
|
125
132
|
}
|
|
126
133
|
|
|
127
134
|
/**
|
|
@@ -279,6 +286,56 @@ export interface PluginConfigTypeAndroidPackagingOptions {
|
|
|
279
286
|
doNotStrip?: string[];
|
|
280
287
|
}
|
|
281
288
|
|
|
289
|
+
export interface PluginConfigTypeAndroidQueries {
|
|
290
|
+
/**
|
|
291
|
+
* Specifies a single app that your app intends to access. This other app might integrate with your app, or your app might use services that the other app provides.
|
|
292
|
+
*/
|
|
293
|
+
package: string[];
|
|
294
|
+
/**
|
|
295
|
+
* Specifies an intent filter signature. Your app can discover other apps that have matching <intent-filter> elements.
|
|
296
|
+
* These intents have restrictions compared to typical intent filter signatures.
|
|
297
|
+
*
|
|
298
|
+
* @see [Android documentation](https://developer.android.com/training/package-visibility/declaring#intent-filter-signature) for details
|
|
299
|
+
*/
|
|
300
|
+
intent?: PluginConfigTypeAndroidQueriesIntent[];
|
|
301
|
+
/**
|
|
302
|
+
* Specifies one or more content provider authorities. Your app can discover other apps whose content providers use the specified authorities.
|
|
303
|
+
* There are some restrictions on the options that you can include in this <provider> element, compared to a typical <provider> manifest element. You may only specify the android:authorities attribute.
|
|
304
|
+
*/
|
|
305
|
+
provider?: string[];
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export interface PluginConfigTypeAndroidQueriesIntent {
|
|
309
|
+
/**
|
|
310
|
+
* A string naming the action to perform. Usually one of the platform-defined values, such as ACTION_SEND or ACTION_VIEW
|
|
311
|
+
*/
|
|
312
|
+
action?: string;
|
|
313
|
+
/**
|
|
314
|
+
* A description of the data associated with the intent.
|
|
315
|
+
*/
|
|
316
|
+
data?: PluginConfigTypeAndroidQueriesData;
|
|
317
|
+
/**
|
|
318
|
+
* Provides an additional way to characterize the activity handling the intent,
|
|
319
|
+
* usually related to the user gesture or location from which it's started.
|
|
320
|
+
*/
|
|
321
|
+
category?: string | string[];
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
export interface PluginConfigTypeAndroidQueriesData {
|
|
325
|
+
/**
|
|
326
|
+
* Specify a URI scheme that is handled
|
|
327
|
+
*/
|
|
328
|
+
scheme?: string;
|
|
329
|
+
/**
|
|
330
|
+
* Specify a URI authority host that is handled
|
|
331
|
+
*/
|
|
332
|
+
host?: string;
|
|
333
|
+
/**
|
|
334
|
+
* Specify a MIME type that is handled
|
|
335
|
+
*/
|
|
336
|
+
mimeType?: string;
|
|
337
|
+
}
|
|
338
|
+
|
|
282
339
|
const schema: JSONSchemaType<PluginConfigType> = {
|
|
283
340
|
type: 'object',
|
|
284
341
|
properties: {
|
|
@@ -317,6 +374,36 @@ const schema: JSONSchemaType<PluginConfigType> = {
|
|
|
317
374
|
extraMavenRepos: { type: 'array', items: { type: 'string' }, nullable: true },
|
|
318
375
|
|
|
319
376
|
usesCleartextTraffic: { type: 'boolean', nullable: true },
|
|
377
|
+
|
|
378
|
+
manifestQueries: {
|
|
379
|
+
required: ['package'],
|
|
380
|
+
type: 'object',
|
|
381
|
+
properties: {
|
|
382
|
+
package: { type: 'array', items: { type: 'string' }, minItems: 1, nullable: false },
|
|
383
|
+
intent: {
|
|
384
|
+
type: 'array',
|
|
385
|
+
items: {
|
|
386
|
+
type: 'object',
|
|
387
|
+
properties: {
|
|
388
|
+
action: { type: 'string', nullable: true },
|
|
389
|
+
data: {
|
|
390
|
+
type: 'object',
|
|
391
|
+
properties: {
|
|
392
|
+
scheme: { type: 'string', nullable: true },
|
|
393
|
+
host: { type: 'string', nullable: true },
|
|
394
|
+
mimeType: { type: 'string', nullable: true },
|
|
395
|
+
},
|
|
396
|
+
nullable: true,
|
|
397
|
+
},
|
|
398
|
+
category: { type: 'array', items: { type: 'string' }, nullable: true },
|
|
399
|
+
},
|
|
400
|
+
},
|
|
401
|
+
nullable: true,
|
|
402
|
+
},
|
|
403
|
+
provider: { type: 'array', items: { type: 'string' }, nullable: true },
|
|
404
|
+
},
|
|
405
|
+
nullable: true,
|
|
406
|
+
},
|
|
320
407
|
},
|
|
321
408
|
nullable: true,
|
|
322
409
|
},
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
withAndroidPurgeProguardRulesOnce,
|
|
7
7
|
withAndroidFlipper,
|
|
8
8
|
withAndroidCleartextTraffic,
|
|
9
|
+
withAndroidQueries,
|
|
9
10
|
} from './android';
|
|
10
11
|
import { withIosBuildProperties, withIosDeploymentTarget } from './ios';
|
|
11
12
|
import { PluginConfigType, validateConfig } from './pluginConfig';
|
|
@@ -22,6 +23,7 @@ export const withBuildProperties: ConfigPlugin<PluginConfigType> = (config, prop
|
|
|
22
23
|
|
|
23
24
|
config = withAndroidProguardRules(config, pluginConfig);
|
|
24
25
|
config = withAndroidCleartextTraffic(config, pluginConfig);
|
|
26
|
+
config = withAndroidQueries(config, pluginConfig);
|
|
25
27
|
// Assuming `withBuildProperties` could be called multiple times from different config-plugins,
|
|
26
28
|
// the `withAndroidProguardRules` always appends new rules by default.
|
|
27
29
|
// That is not ideal if we leave generated contents from previous prebuild there.
|