Skip to content

Commit 6f12ac9

Browse files
committed
feat: add App Center SDK
1 parent c600095 commit 6f12ac9

File tree

7 files changed

+450
-4
lines changed

7 files changed

+450
-4
lines changed

.github/workflows/android_build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ jobs:
5050
- name: Generate App APK
5151
run: |
5252
npm run build:release
53+
env:
54+
APP_CENTER_SECRET: ${{ secrets.APP_CENTER_SECRET }}
5355

5456
## sign generated apk
5557
- name: Sign APK

.github/workflows/android_release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ jobs:
5656
- name: Generate App APK
5757
run: |
5858
npm run build:release
59-
59+
env:
60+
APP_CENTER_SECRET: ${{ secrets.APP_CENTER_SECRET }}
61+
6062
## sign generated apk
6163
- name: Sign APK
6264
id: sign_app

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,7 @@ buck-out/
7272
web-build/
7373
dist/
7474

75-
# @end expo-cli
75+
# @end expo-cli
76+
77+
#secret
78+
android/app/src/main/assets/appcenter-config.json

android/app/src/main/res/values/strings.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22
<string name="app_name">cloudflare-ip-tester-app</string>
33
<string name="expo_splash_screen_resize_mode" translatable="false">contain</string>
44
<string name="expo_splash_screen_status_bar_translucent" translatable="false">false</string>
5+
<string name="appCenterCrashes_whenToSendCrashes" moduleConfig="true" translatable="false">DO_NOT_ASK_JAVASCRIPT</string>
6+
<string name="appCenterAnalytics_whenToEnableAnalytics" moduleConfig="true" translatable="false">ALWAYS_SEND</string>
57
</resources>

gen-app-center-config.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import fs from "fs";
2+
const appCenterFolderPath = "android/app/src/main/assets";
3+
4+
if (!fs.existsSync(appCenterFolderPath)) {
5+
fs.mkdirSync(appCenterFolderPath, { recursive: true });
6+
}
7+
fs.writeFileSync(
8+
appCenterFolderPath + "/appcenter-config.json",
9+
`{"app_secret": "${process.env.APP_CENTER_SECRET}"}`
10+
);

0 commit comments

Comments
 (0)