diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index d48711e1..9d3d0f2d 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -12,9 +12,15 @@ jobs:
config:
- name: Release
lower: release
+ flavor: standard
- name: Debug
lower: debug
+ flavor: standard
+
+ - name: Release
+ lower: release
+ flavor: googlePlay
runs-on: ubuntu-latest
@@ -34,9 +40,19 @@ jobs:
- name: Fix gradle permissions
run: chmod +x ./gradlew
- - name: Build project
+ - name: Build project (standard)
+ if: ${{ matrix.config.flavor == 'standard' }}
run: |
- ./gradlew app:assemble${{ matrix.config.name }} \
+ ./gradlew app:assembleStandard${{ matrix.config.name }} \
+ -Pandroid.injected.signing.store.file="$HOME/release.keystore" \
+ -Pandroid.injected.signing.store.password="${{secrets.KEYSTORE_PASSWORD}}" \
+ -Pandroid.injected.signing.key.alias="${{secrets.KEY_ALIAS}}" \
+ -Pandroid.injected.signing.key.password="${{secrets.KEY_PASSWORD}}"
+
+ - name: Build project (Google Play)
+ if: ${{ matrix.config.flavor == 'googlePlay' }}
+ run: |
+ ./gradlew app:bundleGooglePlayRelease -PdisableAbiSplits \
-Pandroid.injected.signing.store.file="$HOME/release.keystore" \
-Pandroid.injected.signing.store.password="${{secrets.KEYSTORE_PASSWORD}}" \
-Pandroid.injected.signing.key.alias="${{secrets.KEY_ALIAS}}" \
@@ -44,35 +60,57 @@ jobs:
- name: Rename universal apk
id: rename_apk_universal
+ if: ${{ matrix.config.flavor == 'standard' }}
run: |
SHORT_SHA=${GITHUB_SHA::7}
- APK_PATH=${{github.workspace}}/app/build/outputs/apk/${{ matrix.config.lower }}/app-universal-${{ matrix.config.lower }}.apk
+ APK_PATH=${{github.workspace}}/app/build/outputs/apk/standard/${{ matrix.config.lower }}/app-standard-universal-${{ matrix.config.lower }}.apk
OUT_PATH=${{github.workspace}}/geode-launcher-${{ matrix.config.lower }}-$SHORT_SHA.apk
mv $APK_PATH $OUT_PATH
echo "path=$OUT_PATH" >> $GITHUB_OUTPUT
- name: Rename apk
id: rename_apk
+ if: ${{ matrix.config.flavor == 'standard' }}
run: |
SHORT_SHA=${GITHUB_SHA::7}
- APK_PATH=${{github.workspace}}/app/build/outputs/apk/${{ matrix.config.lower }}/app-armeabi-v7a-${{ matrix.config.lower }}.apk
+ APK_PATH=${{github.workspace}}/app/build/outputs/apk/standard/${{ matrix.config.lower }}/app-standard-armeabi-v7a-${{ matrix.config.lower }}.apk
OUT_PATH=${{github.workspace}}/geode-launcher-${{ matrix.config.lower }}-android32-$SHORT_SHA.apk
mv $APK_PATH $OUT_PATH
echo "path=$OUT_PATH" >> $GITHUB_OUTPUT
- name: Rename mappings
id: rename_mappings
- if: ${{ matrix.config.lower == 'release' }}
+ if: ${{ matrix.config.flavor == 'standard' && matrix.config.lower == 'release' }}
run: |
SHORT_SHA=${GITHUB_SHA::7}
- MAPPING_PATH=${{github.workspace}}/app/build/outputs/mapping/${{ matrix.config.lower }}/mapping.txt
+ MAPPING_PATH=${{github.workspace}}/app/build/outputs/mapping/standardRelease/mapping.txt
+ OUT_PATH=${{github.workspace}}/mapping-${{ matrix.config.lower }}-$SHORT_SHA.txt
+ mv $MAPPING_PATH $OUT_PATH
+ echo "path=$OUT_PATH" >> $GITHUB_OUTPUT
+
+ - name: Rename AAB
+ id: rename_aab
+ if: ${{ matrix.config.flavor == 'googlePlay' }}
+ run: |
+ SHORT_SHA=${GITHUB_SHA::7}
+ AAB_PATH=${{github.workspace}}/app/build/outputs/bundle/googlePlayRelease/app-googlePlay-release.aab
+ OUT_PATH=${{github.workspace}}/geode-launcher-${{ matrix.config.lower }}-$SHORT_SHA.aab
+ mv $AAB_PATH $OUT_PATH
+ echo "path=$OUT_PATH" >> $GITHUB_OUTPUT
+
+ - name: Rename AAB mappings
+ id: rename_aab_mappings
+ if: ${{ matrix.config.flavor == 'googlePlay' }}
+ run: |
+ SHORT_SHA=${GITHUB_SHA::7}
+ MAPPING_PATH=${{github.workspace}}/app/build/outputs/mapping/googlePlayRelease/mapping.txt
OUT_PATH=${{github.workspace}}/mapping-${{ matrix.config.lower }}-$SHORT_SHA.txt
mv $MAPPING_PATH $OUT_PATH
echo "path=$OUT_PATH" >> $GITHUB_OUTPUT
- name: Upload release build
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
- if: ${{ matrix.config.lower == 'release' }}
+ if: ${{ matrix.config.flavor == 'standard' && matrix.config.lower == 'release' }}
with:
name: geode-launcher-${{ matrix.config.lower }}
path: |
@@ -82,9 +120,18 @@ jobs:
- name: Upload debug build
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
- if: ${{ matrix.config.lower == 'debug' }}
+ if: ${{ matrix.config.flavor == 'standard' && matrix.config.lower == 'debug' }}
with:
name: geode-launcher-${{ matrix.config.lower }}
path: |
${{ steps.rename_apk_universal.outputs.path }}
${{ steps.rename_apk.outputs.path }}
+
+ - name: Upload Google Play build
+ uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
+ if: ${{ matrix.config.flavor == 'googlePlay' }}
+ with:
+ name: geode-launcher-google-play
+ path: |
+ ${{ steps.rename_aab.outputs.path }}
+ ${{ steps.rename_aab_mappings.outputs.path }}
\ No newline at end of file
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index 5e7cf21c..1f846526 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -39,7 +39,7 @@ android {
splits {
abi {
- isEnable = true
+ isEnable = !project.hasProperty("disableAbiSplits")
reset()
//noinspection ChromeOsAbiSupport. i'm sorry!
@@ -49,6 +49,21 @@ android {
}
}
+ flavorDimensions += "distribution"
+
+ productFlavors {
+ create("standard") {
+ dimension = "distribution"
+ isDefault = true
+ buildConfigField("boolean", "GOOGLE_PLAY_BUILD", "false")
+ }
+
+ create("googlePlay") {
+ dimension = "distribution"
+ buildConfigField("boolean", "GOOGLE_PLAY_BUILD", "true")
+ }
+ }
+
buildTypes {
release {
isMinifyEnabled = true
diff --git a/app/src/googlePlay/AndroidManifest.xml b/app/src/googlePlay/AndroidManifest.xml
new file mode 100644
index 00000000..c65e3e83
--- /dev/null
+++ b/app/src/googlePlay/AndroidManifest.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/geode/launcher/updater/ReleaseManager.kt b/app/src/main/java/com/geode/launcher/updater/ReleaseManager.kt
index bb6b4e9e..572959ad 100644
--- a/app/src/main/java/com/geode/launcher/updater/ReleaseManager.kt
+++ b/app/src/main/java/com/geode/launcher/updater/ReleaseManager.kt
@@ -331,6 +331,11 @@ class ReleaseManager private constructor(
}
private suspend fun getLatestLauncherUpdate(): DownloadableLauncherRelease? {
+ if (BuildConfig.GOOGLE_PLAY_BUILD) {
+ // don't check for updates on Google Play builds
+ return null
+ }
+
return try {
releaseRepository.getLatestLauncherRelease()
} catch (e: Exception) {
@@ -340,6 +345,8 @@ class ReleaseManager private constructor(
}
suspend fun checkLauncherUpdate() {
+ if (BuildConfig.GOOGLE_PLAY_BUILD) return
+
val launcherRelease = getLatestLauncherUpdate() ?: return
// unconditionally track it, we're not using it for checks and it might be good to have
@@ -356,6 +363,8 @@ class ReleaseManager private constructor(
}
fun checkCachedLauncherUpdate() {
+ if (BuildConfig.GOOGLE_PLAY_BUILD) return
+
val lastUpdate = PreferenceUtils.get(applicationContext)
.getString(PreferenceUtils.Key.LAST_LAUNCHER_UPDATE) ?: return
@@ -365,6 +374,12 @@ class ReleaseManager private constructor(
}
suspend fun downloadLatestLauncherUpdate(): Result {
+ if (BuildConfig.GOOGLE_PLAY_BUILD) {
+ return Result.failure(UnsupportedOperationException(
+ "Launcher updates are not supported on Google Play builds"
+ ))
+ }
+
val update = _availableLauncherUpdateDetails.value
?: getLatestLauncherUpdate()
?: return Result.failure(FileNotFoundException())