-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathapp.config.ts
More file actions
389 lines (385 loc) · 13.3 KB
/
Copy pathapp.config.ts
File metadata and controls
389 lines (385 loc) · 13.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
const VERSION_CODE = 841
const VERSION = '1.44.1'
// Dev-client builds share the staging bundle id with release staging builds.
// A fractional suffix (e.g. "840.12") keeps their TestFlight build numbers
// unique while still sorting below the next release build number (841).
const IOS_BUILD_NUMBER_SUFFIX = process.env.IOS_BUILD_NUMBER_SUFFIX ?? ''
const ENV_PRESET = process.env.ENV_PRESET
const IS_LOCAL_ENV = ENV_PRESET === 'local'
const COMMIT_HASH = process.env.EAS_BUILD_GIT_COMMIT_HASH ?? 'local'
// // check if version is valid
// Schema.decodeSync(SemverString)(VERSION)
const presets = {
stage: {
enableHiddenFeatures: true,
apiPreset: 'stageEnv',
versionCode: VERSION_CODE,
semver: VERSION,
version: `${VERSION} (${VERSION_CODE})`,
packageName: 'it.vexl.nextstaging',
appName: 'Vexl (stage)',
googleServicesInfoPlistFile: './creds/GoogleService-stage-info.plist',
foregroundImage: './assets/android-front.png',
backgroundImage: './assets/android-back-stage.png',
monochromeImage: './assets/android-front.png',
icon: './assets/icon-stage.png',
hmacPassword:
'UHQyykWs4nE1Yn8IQi/lsz2QemK3zA+JIWdGll3PEtle9/aMMBvQk6kKgYkjyewTiK0ypuquBSBVJwuSiYs8FQ==',
commitHash: COMMIT_HASH,
iconV2: './assets/icon-stage.icon',
},
local: {
enableHiddenFeatures: true,
apiPreset: 'localEnv',
versionCode: VERSION_CODE,
semver: VERSION,
version: `${VERSION} (${VERSION_CODE})`,
packageName: 'it.vexl.nextstaging',
appName: 'Vexl (local)',
googleServicesInfoPlistFile: './creds/GoogleService-stage-info.plist',
foregroundImage: './assets/android-front.png',
backgroundImage: './assets/android-back-stage.png',
monochromeImage: './assets/android-front.png',
icon: './assets/icon-stage.png',
hmacPassword: 'VexlVexl',
commitHash: 'local',
iconV2: './assets/icon-stage.icon',
},
prod: {
enableHiddenFeatures: false,
apiPreset: 'prodEnv',
versionCode: VERSION_CODE,
version: `${VERSION} (${VERSION_CODE})`,
semver: VERSION,
packageName: 'it.vexl.next',
appName: 'Vexl',
googleServicesInfoPlistFile: './creds/GoogleService-Info.plist',
foregroundImage: './assets/android-front.png',
backgroundImage: './assets/android-back.png',
monochromeImage: './assets/android-front.png',
icon: './assets/icon.png',
hmacPassword:
'rv5AKXDcED4txmI5Nltz9eZFAHOI1VrLT3JWOpEZefE5uGInq53rfHkQLUIjaMUHv3hicbk/wtSKOfsNZ3aNNw==',
commitHash: COMMIT_HASH,
iconV2: './assets/icon.icon',
},
}
// @ts-expect-error there is fallback there.
const extra = presets[String(ENV_PRESET)] ?? presets.stage
export const SPLASH_ICON_SIZE = 685
export default {
'name': extra.appName,
'slug': 'vexl',
'version': VERSION,
'orientation': 'portrait',
'icon': extra.icon,
'userInterfaceStyle': 'automatic',
'jsEngine': 'hermes',
'scheme': 'app.vexl.it',
'platforms': ['ios', 'android'],
'updates': {
'fallbackToCacheTimeout': 0,
'url': 'https://u.expo.dev/dbcc5b47-6c4a-4faf-a345-e9cd8a680c32',
},
'assetBundlePatterns': ['**/*'],
'ios': {
buildNumber: `${VERSION_CODE}${IOS_BUILD_NUMBER_SUFFIX}`,
// 'icon': extra.iconV2, // Does not work due to this: https://github.com/expo/expo/issues/39782
'supportsTablet': false,
'bundleIdentifier': extra.packageName,
// Required by @bacons/apple-targets for signing the NSE extension target.
'appleTeamId': 'KQNTW88PVA',
'config': {
'usesNonExemptEncryption': false,
},
'infoPlist': {
'UIBackgroundModes': ['fetch', 'remote-notification', 'processing'],
'LSApplicationQueriesSchemes': ['itms-apps'],
'BGTaskSchedulerPermittedIdentifiers': ['com.transistorsoft.fetch'],
'CFBundleAllowMixedLocalizations': true,
'NSLocationWhenInUseUsageDescription':
'Vexl needs access to you location to show your position on the map. Location will never be share with anyone (even ourselves).',
// App Group shared with the notification service extension (NSE). Read
// at runtime by the vexl-nse-bridge local module and the NSE itself.
'VexlAppGroup': `group.${extra.packageName}.shared`,
// 'NSAppTransportSecurity': {'NSAllowsArbitraryLoads': true},
},
'googleServicesFile': extra.googleServicesInfoPlistFile,
'associatedDomains': [
'applinks:vexl.it',
'applinks:app.vexl.it',
'applinks:link.vexl.it',
'applinks:nextlink.vexl.it',
],
'privacyManifests': {
'NSPrivacyAccessedAPITypes': [
{
'NSPrivacyAccessedAPIType':
'NSPrivacyAccessedAPICategoryUserDefaults',
'NSPrivacyAccessedAPITypeReasons': ['CA92.1'],
},
],
},
'entitlements': {
'aps-environment':
process.env.NODE_ENV === 'development' ? 'development' : 'production',
// Shared container + keychain access group for the notification
// service extension (targets/vexl-nse). On iOS an app-group id is a
// valid keychain access group as-is, so one entitlement covers both.
'com.apple.security.application-groups': [
`group.${extra.packageName}.shared`,
],
},
},
'android': {
'versionCode': VERSION_CODE,
'softwareKeyboardLayoutMode': 'resize',
'adaptiveIcon': {
'foregroundImage': extra.foregroundImage,
'backgroundImage': extra.backgroundImage,
'monochromeImage': extra.monochromeImage,
},
'package': extra.packageName,
'googleServicesFile': './creds/google-services.json',
'intentFilters': [
{
// NDEF_DISCOVERED nfc action is not supported by expo app config
// wee need to change it in expo-plugin after
// from android.intent.action.NDEF_DISCOVERED -> android.nfc.action.NDEF_DISCOVERED
// see: expo-plugins/android-manifest-nfc-action-plugin.js
'action': 'NDEF_DISCOVERED',
'autoVerify': true,
'data': [
{
'scheme': 'https',
'host': 'app.vexl.it',
'pathPattern': '/link/.*',
},
],
'category': ['DEFAULT'],
},
{
'action': 'VIEW',
'autoVerify': true,
'data': [
{
'scheme': 'https',
'host': 'vexl.it',
'pathPattern': '.*',
},
{
'scheme': 'https',
'host': 'link.vexl.it',
'pathPattern': '.*',
},
{
'scheme': 'https',
'host': 'nextlink.vexl.it',
'pathPattern': '.*',
},
{
'scheme': 'https',
'host': 'app.vexl.it',
'pathPattern': '.*',
},
],
category: ['BROWSABLE', 'DEFAULT'],
},
],
permissions: ['READ_CONTACTS', 'READ_CALENDAR', 'WRITE_CALENDAR', 'NFC'],
blockedPermissions: [
'android.permission.READ_MEDIA_IMAGES',
'android.permission.READ_MEDIA_VIDEO',
],
},
'locales': {
'bg': '../../packages/localization/bg-infoPlist.json',
'cs': '../../packages/localization/cs-infoPlist.json',
'de': '../../packages/localization/de-infoPlist.json',
'en': '../../packages/localization/en-infoPlist.json',
'es': '../../packages/localization/es-infoPlist.json',
'fr': '../../packages/localization/fr-infoPlist.json',
'it': '../../packages/localization/it-infoPlist.json',
'ja': '../../packages/localization/ja-infoPlist.json',
'pl': '../../packages/localization/pl-infoPlist.json',
'pt': '../../packages/localization/pt-infoPlist.json',
'sk': '../../packages/localization/sk-infoPlist.json',
},
'owner': 'vexlit',
// Runtime version is a hash of the native project (dependencies, config
// plugins, native config). Updates only load into builds with a matching
// hash. See fingerprint.config.js for what is excluded from the hash.
'runtimeVersion': {
'policy': 'fingerprint',
},
'plugins': [
// Explicit registration to control the generated exp+vexl deep-link
// scheme. Only dev-client builds may register it — when left to the
// auto-applied plugin, store builds register it too and can hijack the
// PR-preview QR codes (iOS scheme resolution between two apps is
// undefined). IS_DEV_CLIENT_BUILD is set by the development build
// profile and by the PR-preview publish workflow; it affects the
// fingerprint, so dev clients and PR updates share a runtime that is
// distinct from release builds.
[
'expo-dev-client',
{addGeneratedScheme: Boolean(process.env.IS_DEV_CLIENT_BUILD)},
],
['react-native-libsodium', {}],
'expo-background-task',
[
'expo-navigation-bar',
{
enforceContrast: false,
style: 'light',
hidden: false,
},
],
[
'expo-notifications',
{
icon: './assets/notification_icon.png',
enableBackgroundRemoteNotifications: true,
},
],
'expo-localization',
[
'expo-image-picker',
{
'photosPermission':
'Vexl wants to access your photos in order to select a picture for your avatar.',
'cameraPermission':
'Vexl wants to access your camera in order to take a photo for your avatar or scan QR code to add other users to your Vexl network.',
'microphonePermission': false,
// Keep these values inline because Expo evaluates app config in Node,
// and it does not reliably resolve nested TypeScript workspace imports.
'colors': {
cropToolbarColor: '#FFFFFF',
cropToolbarIconColor: '#000000',
cropToolbarActionTextColor: '#000000',
cropBackButtonIconColor: '#000000',
cropBackgroundColor: '#FFFFFF',
},
'dark': {
'colors': {
cropToolbarColor: '#000000',
cropToolbarIconColor: '#FFFFFF',
cropToolbarActionTextColor: '#FFFFFF',
cropBackButtonIconColor: '#FFFFFF',
cropBackgroundColor: '#000000',
},
},
},
],
[
'expo-contacts',
{
'contactsPermission':
'Vexl needs access to your contacts to make your offers visible for them in a secure way. Phone number of contacts you select will be encrypted and uploaded to the server.',
},
],
[
'expo-calendar',
{
'calendarPermission':
'Vexl needs access to your calendar for scheduling trade meetings. Your data is kept private and only used for coordinating trades.',
},
],
[
'expo-build-properties',
{
'ios': {
'useFrameworks': 'static',
},
'android': {
'targetSdkVersion': 35,
'packagingOptions': {
'pickFirst': [
'lib/x86/libcrypto.so',
'lib/x86_64/libcrypto.so',
'lib/armeabi-v7a/libcrypto.so',
'lib/arm64-v8a/libcrypto.so',
],
},
},
},
],
[
'@sentry/react-native/expo',
{
'url': 'https://sentry.io/',
'project': 'vexl-app',
'organization': 'vexl',
},
],
...(IS_LOCAL_ENV
? ['./expo-plugins/android-manifest-local-cleartext-plugin.js']
: []),
'./expo-plugins/android-eas-signing-plugin.js',
'./expo-plugins/android-install-release-plugin.js',
'./expo-plugins/android-manifest-nfc-action-plugin.js',
'expo-font',
'expo-secure-store',
'expo-camera',
[
'react-native-capture-protection',
{
'captureType': 'base',
},
],
[
'expo-splash-screen',
{
'image': './assets/splash.png',
'imageWidth': SPLASH_ICON_SIZE,
'resizeMode': 'contain',
'backgroundColor': '#FCCD6C',
},
],
[
'react-native-maps',
{
'iosGoogleMapsApiKey': process.env.IOS_MAP_API_KEY,
'androidGoogleMapsApiKey': process.env.ANDROID_MAP_API_KEY,
},
],
// Links the local VexlNotificationCore Swift package to the VexlNSE
// target. MUST stay listed before @bacons/apple-targets: config-plugin
// mods run last-registered-first, so apple-targets (which creates the
// target) has to execute before this plugin's action can find it.
'./expo-plugins/with-nse-local-spm.js',
// Generates the iOS notification service extension target from
// targets/vexl-nse (rich chat notification previews).
'@bacons/apple-targets',
],
'extra': {
'eas': {
'projectId': 'dbcc5b47-6c4a-4faf-a345-e9cd8a680c32',
// Declares the notification service extension (targets/vexl-nse, Xcode
// target VexlNSE) to EAS. This project uses remote iOS credentials and
// CNG (ios/ is gitignored, regenerated by prebuild on every build), so
// EAS must know the extension exists before prebuild to generate and
// validate its provisioning profile and App Group entitlement. Bundle
// id and app group mirror targets/vexl-nse/expo-target.config.js and
// the ios.entitlements block above.
'build': {
'experimental': {
'ios': {
'appExtensions': [
{
'targetName': 'VexlNSE',
'bundleIdentifier': `${extra.packageName}.nse`,
'entitlements': {
'com.apple.security.application-groups': [
`group.${extra.packageName}.shared`,
],
},
},
],
},
},
},
},
...extra,
},
}