about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/bundle-deploy-eas-update.yml4
-rw-r--r--app.config.js1
-rw-r--r--plugins/withAndroidManifestLaunchModePlugin.js17
3 files changed, 20 insertions, 2 deletions
diff --git a/.github/workflows/bundle-deploy-eas-update.yml b/.github/workflows/bundle-deploy-eas-update.yml
index 039b4150a..a684f525f 100644
--- a/.github/workflows/bundle-deploy-eas-update.yml
+++ b/.github/workflows/bundle-deploy-eas-update.yml
@@ -307,11 +307,11 @@ jobs:
       - name: ⬇️ Restore Cache
         id: get-base-commit
         uses: actions/cache@v4
-        if: ${{ inputs.channel == 'testflight' }}
+        if: ${{ inputs.channel != 'testflight' && inputs.channel != 'production' }}
         with:
           path: most-recent-testflight-commit.txt
           key: most-recent-testflight-commit
 
       - name: ✏️ Write commit hash to cache
-        if: ${{ inputs.channel == 'testflight' }}
+        if: ${{ inputs.channel != 'testflight' && inputs.channel != 'production' }}
         run: echo ${{ github.sha }} > most-recent-testflight-commit.txt
diff --git a/app.config.js b/app.config.js
index eafacc6cc..0c3588c67 100644
--- a/app.config.js
+++ b/app.config.js
@@ -204,6 +204,7 @@ module.exports = function (config) {
         ],
         './plugins/withAndroidManifestPlugin.js',
         './plugins/withAndroidManifestFCMIconPlugin.js',
+        './plugins/withAndroidManifestLaunchModePlugin.js',
         './plugins/withAndroidStylesWindowBackgroundPlugin.js',
         './plugins/withAndroidStylesAccentColorPlugin.js',
         './plugins/withAndroidSplashScreenStatusBarTranslucentPlugin.js',
diff --git a/plugins/withAndroidManifestLaunchModePlugin.js b/plugins/withAndroidManifestLaunchModePlugin.js
new file mode 100644
index 000000000..45ab9aeb7
--- /dev/null
+++ b/plugins/withAndroidManifestLaunchModePlugin.js
@@ -0,0 +1,17 @@
+const {withAndroidManifest} = require('expo/config-plugins')
+
+module.exports = function withAndroidManifestLaunchModePlugin(appConfig) {
+  return withAndroidManifest(appConfig, function (decoratedAppConfig) {
+    try {
+      const mainApplication =
+        decoratedAppConfig.modResults.manifest.application[0]
+      const mainActivity = mainApplication.activity.find(
+        elem => elem.$['android:name'] === '.MainActivity',
+      )
+      mainActivity.$['android:launchMode'] = 'singleTop'
+    } catch (e) {
+      console.error(`withAndroidManifestLaunchModePlugin failed`, e)
+    }
+    return decoratedAppConfig
+  })
+}