-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathapp.config.ts
More file actions
187 lines (184 loc) · 5.32 KB
/
Copy pathapp.config.ts
File metadata and controls
187 lines (184 loc) · 5.32 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
import { execSync } from "child_process";
import type { ExpoConfig } from "expo/config";
const PROFILE = process.env.EAS_BUILD_PROFILE;
const COMMIT = execSync("git rev-parse --short HEAD").toString().trim();
// 仅在构建时生效,与 JS 层的 IS_DEV 无关
const IS_DEV = !PROFILE || PROFILE === "development";
// 测试包体允许访问任意 HTTP 地址
const ALLOW_UNRESTRICTED_HTTP =
!PROFILE || PROFILE === "development" || PROFILE === "preview";
const config: ExpoConfig = {
name: IS_DEV ? "掌上吾理 Dev" : "掌上吾理 Pro",
slug: "iwut",
version: "0.3.23",
runtimeVersion: {
policy: "appVersion",
},
updates: {
url: "https://expo.tokenteam.net/api/updates/019da0ce-9cda-76dc-b440-0c6a45d38292/manifest",
checkAutomatically: "ON_LOAD",
...(PROFILE && {
requestHeaders: {
"expo-channel-name": PROFILE,
},
}),
...(!IS_DEV && {
codeSigningCertificate: "./assets/certificate.pem",
codeSigningMetadata: {
keyid: "main",
alg: "rsa-v1_5-sha256",
},
}),
},
platforms: ["ios", "android"],
orientation: "portrait",
icon: "./assets/images/icon.png",
scheme: "iwut",
userInterfaceStyle: "automatic",
ios: {
bundleIdentifier: IS_DEV ? "dev.tokenteam.iwut.dev" : "dev.tokenteam.iwut",
supportsTablet: true,
infoPlist: {
ITSAppUsesNonExemptEncryption: false,
NSSupportsLiveActivities: true,
NSLocationWhenInUseUsageDescription:
"用于在连接校园网时读取当前 Wi-Fi 相关信息并完成网络认证",
NSAppTransportSecurity: ALLOW_UNRESTRICTED_HTTP
? {
NSAllowsArbitraryLoads: true,
}
: {
NSAllowsArbitraryLoadsInWebContent: true,
NSAllowsLocalNetworking: true,
NSExceptionDomains: {
"whut.edu.cn": {
NSExceptionAllowsInsecureHTTPLoads: true,
NSIncludesSubdomains: true,
},
"223.5.5.5": {
NSExceptionAllowsInsecureHTTPLoads: true,
NSIncludesSubdomains: false,
},
"172.30.21.100": {
NSExceptionAllowsInsecureHTTPLoads: true,
NSIncludesSubdomains: false,
},
},
},
},
entitlements: {
"com.apple.security.application-groups": ["group.dev.tokenteam.iwut"],
"keychain-access-groups": [
"$(AppIdentifierPrefix)dev.tokenteam.iwut.wlan",
],
},
},
android: {
package: IS_DEV ? "dev.tokenteam.iwut.dev" : "dev.tokenteam.iwut",
adaptiveIcon: {
backgroundColor: "#FFFFFF",
foregroundImage: "./assets/images/android-icon-foreground.png",
backgroundImage: "./assets/images/android-icon-background.png",
monochromeImage: "./assets/images/android-icon-monochrome.png",
},
},
locales: {
en: "./assets/locales/app-meta-en.json",
},
plugins: [
...(IS_DEV ? ["expo-dev-client"] : []),
"expo-router",
"expo-font",
"expo-status-bar",
"expo-web-browser",
"expo-asset",
"expo-image",
[
"expo-camera",
{
cameraPermission: "用于扫一扫功能扫描二维码,识别并导入分享内容",
},
],
"expo-secure-store",
"expo-sharing",
"expo-background-task",
[
"expo-localization",
{
supportedLocales: {
ios: ["zh-Hans", "en"],
android: ["zh-Hans", "en"],
},
},
],
[
"expo-splash-screen",
{
image: "./assets/images/icon.png",
imageWidth: 200,
backgroundColor: "#FFFFFF",
},
],
[
"expo-build-properties",
{
android: {
buildArchs: ["arm64-v8a"],
useLegacyPackaging: true,
enableMinifyInReleaseBuilds: true,
enableShrinkResourcesInReleaseBuilds: true,
usesCleartextTraffic: ALLOW_UNRESTRICTED_HTTP,
extraMavenRepos: [
"https://maven.cnb.cool/TokenTeam/android-deps/-/packages/",
],
},
},
],
[
"@sentry/react-native/expo",
{
url: "https://sentry.io/",
organization: "tokenteam",
project: "iwut",
useNativeInit: true,
disableAutoUpload: IS_DEV,
options: {
dsn: "https://0f066a713018f1ebe6c9b498f5883714@o4512173031227392.ingest.us.sentry.io/4512173035552768",
enabled: !IS_DEV,
environment: PROFILE ?? "development",
enableAutoSessionTracking: false,
enableNativeCrashHandling: !IS_DEV,
enableNdk: !IS_DEV,
tracesSampleRate: 0,
},
experimental_android: {
enableAndroidGradlePlugin: true,
includeProguardMapping: true,
autoUploadProguardMapping: true,
uploadNativeSymbols: true,
autoUploadNativeSymbols: true,
includeNativeSources: false,
includeSourceContext: false,
},
},
],
"@bacons/apple-targets",
"./plugins/with-gradle-props.js",
...(ALLOW_UNRESTRICTED_HTTP
? []
: ["./plugins/with-network-security-config.js"]),
],
experiments: {
typedRoutes: true,
reactCompiler: true,
},
extra: {
router: {},
eas: {
projectId: "db91117d-c051-4555-a16b-7a996823672e",
},
commit: COMMIT,
},
owner: "tokenteam",
};
export default config;