Repository navigation
Expand file tree
/
Copy pathapp.config.js
More file actions
164 lines (159 loc) · 6.52 KB
/
Copy pathapp.config.js
File metadata and controls
164 lines (159 loc) · 6.52 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
const fs = require('node:fs');
const path = require('node:path');
const { execSync } = require('node:child_process');
const VERSION = fs.readFileSync(path.join(__dirname, 'VERSION'), 'utf8').trim();
let COMMIT = process.env.GITHUB_SHA || '';
if (!COMMIT) {
try {
COMMIT = execSync('git rev-parse --short HEAD', { cwd: __dirname, stdio: ['ignore', 'pipe', 'ignore'] })
.toString()
.trim();
} catch {
COMMIT = 'dev';
}
}
COMMIT = COMMIT.slice(0, 7);
// App Store Connect rejects a build whose CFBundleVersion it has already seen
// for this CFBundleShortVersionString, so this has to advance on every upload
// even when VERSION does not. CI passes the workflow run number; local builds
// fall back to 1 (never uploaded).
const IOS_BUILD_NUMBER = process.env.IOS_BUILD_NUMBER || '1';
// Apple team: prefixes the keychain groups the app shares with its
// notification service extension (plugins/ios-push). Not a secret.
const APPLE_TEAM_ID = process.env.APPLE_TEAM_ID || '8ZANF9LQ39';
// Which APNs host the device tokens belong to: TestFlight and App Store builds
// use production, simulators and development builds the sandbox.
const APS_ENVIRONMENT = process.env.APS_ENVIRONMENT === 'development' ? 'development' : 'production';
module.exports = {
expo: {
name: 'Bulwark Mobile',
slug: 'bulwark-mobile',
// mailto: lets Android/iOS offer the app for mail links in other apps;
// bulwarkmail: is the webmail's sign-in link (bulwarkmail://pair?...).
// org.bulwarkmail.mobile: is where Stalwart 1.0 sends the browser sign-in
// back: it registers public clients only with a scheme that has a dot.
// Android's manifest is maintained by hand and lists the same schemes.
scheme: ['bulwarkmobile', 'bulwarkmail', 'mailto', 'org.bulwarkmail.mobile'],
version: VERSION,
orientation: 'default',
icon: './assets/icon.png',
userInterfaceStyle: 'automatic',
newArchEnabled: true,
splash: {
image: './assets/splash-icon.png',
resizeMode: 'contain',
backgroundColor: '#ffffff',
dark: {
image: './assets/splash-icon.png',
backgroundColor: '#09090b',
},
},
ios: {
supportsTablet: true,
bundleIdentifier: 'org.bulwarkmail.mobile',
buildNumber: IOS_BUILD_NUMBER,
config: {
// Apple's ITSAppUsesNonExemptEncryption is NO when the encryption is
// exempt from export compliance *documentation*. PGP and S/MIME (#58)
// use standard algorithms from open-source libraries and the app is
// not on the French store, which needs no documentation: App Store
// Connect refuses an encryption declaration for it, so there is no
// ITSEncryptionExportComplianceCode, and YES without one fails upload
// validation (90592). Left out, every build waits for a manual answer
// and cannot go to the external TestFlight group.
usesNonExemptEncryption: false,
},
},
android: {
adaptiveIcon: {
foregroundImage: './assets/adaptive-icon.png',
backgroundColor: '#db2d54',
},
edgeToEdgeEnabled: true,
predictiveBackGestureEnabled: false,
package: 'com.anonymous.bulwarkmobile',
// The AsyncStorage database holds cached message bodies, the outbox and
// the account registry; the platform backup would ship all of it to the
// user's Google account. Credentials live in SecureStore (excluded by
// its own rules) but the mail cache must not leave the device either.
allowBackup: false,
},
web: {
favicon: './assets/favicon.png',
},
plugins: [
'expo-secure-store',
// WebCrypto for PGP and S/MIME (#58). On iOS it raises the deployment
// target (app and pods) to 16.4, the minimum Nitro modules build for;
// Android has nothing to set.
'react-native-quick-crypto',
'@react-native-community/datetimepicker',
'expo-localization',
[
'expo-camera',
{
cameraPermission:
'Bulwark Mail uses the camera to scan sign-in QR codes shown in webmail.',
// QR scanning never records audio; leaving the mic entry in would be
// an unexplained permission in App Review.
microphonePermission: false,
},
],
[
'expo-image-picker',
{
photosPermission:
'Bulwark Mail needs access to your photos so you can attach them to emails and set contact photos.',
// Only launchImageLibraryAsync is used - no in-app capture.
cameraPermission: false,
microphonePermission: false,
},
],
['./plugins/ios-push', { apsEnvironment: APS_ENVIRONMENT, teamId: APPLE_TEAM_ID }],
// TLS client certificates (#3): the iOS side of src/lib/client-cert.ts.
'./plugins/ios-client-cert',
// The iOS inbox widget (WidgetKit); src/widgets/ios.ts feeds it.
['./plugins/ios-widget', { teamId: APPLE_TEAM_ID }],
// The reading fonts (Settings > Accessibility > Font) for the app's
// text on iOS, found by the family names in the files
// (src/theme/reading-fonts.ts). iOS only: Android reads the same files
// from its hand-maintained assets/fonts, where the plugin would copy
// them onto themselves.
[
'expo-font',
{
ios: {
fonts: [
'AtkinsonHyperlegibleNext.ttf',
'AtkinsonHyperlegibleNext_bold.ttf',
'Lexend.ttf',
'Lexend_bold.ttf',
'OpenDyslexic.ttf',
'OpenDyslexic_bold.ttf',
].map((file) => `./android/app/src/main/assets/fonts/${file}`),
},
},
],
// Bundles the Involved sound calendar reminders (src/lib/calendar-
// notifications.ts) and new mail (plugins/ios-push) play on iOS.
// Android has it in res/raw.
[
'expo-notifications',
{
mode: APS_ENVIRONMENT,
sounds: ['./assets/sounds/involved_notification.wav'],
},
],
],
extra: {
commit: COMMIT,
// Settings → About → Source code. A modified build sets SOURCE_CODE_URL
// to where its own source is (AGPL §13); the default is upstream.
sourceCodeUrl: process.env.SOURCE_CODE_URL || 'https://github.com/bulwarkmail/native',
// src/lib/ios-push-shared.ts
iosSharedKeychainGroup: `${APPLE_TEAM_ID}.org.bulwarkmail.shared`,
iosAppKeychainGroup: `${APPLE_TEAM_ID}.org.bulwarkmail.mobile`,
apnsEnvironment: APS_ENVIRONMENT === 'development' ? 'sandbox' : 'production',
},
},
};