about summary refs log tree commit diff
diff options
context:
space:
mode:
authordan <dan.abramov@gmail.com>2024-12-19 04:00:27 +0000
committerGitHub <noreply@github.com>2024-12-19 04:00:27 +0000
commitc390c3278869df4df54b7831b515c91536cee4f0 (patch)
treedc6c28d8ae919df25aaf4614c54fb5b9f88487db
parentc2ca84c636fe022c92f0e0d6fdf54033ceeb80a7 (diff)
downloadvoidsky-c390c3278869df4df54b7831b515c91536cee4f0.tar.zst
Remove unreliable repository (#7176)
-rw-r--r--app.config.js1
-rw-r--r--plugins/withAndroidNoJitpackPlugin.js20
2 files changed, 21 insertions, 0 deletions
diff --git a/app.config.js b/app.config.js
index 630ea5ad8..1461b7b88 100644
--- a/app.config.js
+++ b/app.config.js
@@ -232,6 +232,7 @@ module.exports = function (config) {
         './plugins/withAndroidManifestFCMIconPlugin.js',
         './plugins/withAndroidStylesAccentColorPlugin.js',
         './plugins/withAndroidSplashScreenStatusBarTranslucentPlugin.js',
+        './plugins/withAndroidNoJitpackPlugin.js',
         './plugins/shareExtension/withShareExtensions.js',
         './plugins/notificationsExtension/withNotificationsExtension.js',
         './plugins/withAppDelegateReferrer.js',
diff --git a/plugins/withAndroidNoJitpackPlugin.js b/plugins/withAndroidNoJitpackPlugin.js
new file mode 100644
index 000000000..959eb1028
--- /dev/null
+++ b/plugins/withAndroidNoJitpackPlugin.js
@@ -0,0 +1,20 @@
+const {withProjectBuildGradle} = require('@expo/config-plugins')
+
+const jitpackRepository = "maven { url 'https://www.jitpack.io' }"
+
+module.exports = function withAndroidNoJitpackPlugin(config) {
+  return withProjectBuildGradle(config, config => {
+    if (!config.modResults.contents.includes(jitpackRepository)) {
+      throw Error(
+        'Expected to find the jitpack string in the config. ' +
+          'You MUST verify whether it was actually removed upstream, ' +
+          'or if the format has changed and this plugin no longer recognizes it.',
+      )
+    }
+    config.modResults.contents = config.modResults.contents.replaceAll(
+      jitpackRepository,
+      '',
+    )
+    return config
+  })
+}