@@ -134,6 +134,15 @@ android {
134134 isDefault = true
135135 buildConfigField " boolean" , " ANALYTICS_ENABLED" , " ${ hasGoogleServices} "
136136 }
137+ // Google Play build (K2GO-398). Same as standard (Firebase OK, crash reporting default on) but
138+ // with the in-app OTA self-updater OFF: Google Play forbids an app updating itself outside Play,
139+ // and Play delivers updates. REQUEST_INSTALL_PACKAGES (used only by the OTA updater) is removed in
140+ // src/play/AndroidManifest.xml. applicationId is unchanged: this is the same app via the Play channel.
141+ play {
142+ dimension " distribution"
143+ buildConfigField " boolean" , " ANALYTICS_ENABLED" , " ${ hasGoogleServices} "
144+ buildConfigField " boolean" , " OTA_ENABLED" , " false"
145+ }
137146 // F-Droid / fully-free build. No Firebase dependency is declared for it (see dependencies), so
138147 // the AAR cannot link. Analytics is off; crash reporting defaults OFF (opt-in), which fulfils the
139148 // F-Droid default that K2GO-401 deferred to this recipe.
@@ -146,6 +155,14 @@ android {
146155 }
147156 }
148157
158+ // K2GO-398: "standard" and "play" both ship Firebase Analytics, so they share the one Firebase
159+ // bridge (the only class that references the non-free AAR) from src/withFirebase instead of
160+ // duplicating it. "fdroid" keeps its own no-op twin in src/fdroid and links no Firebase.
161+ sourceSets {
162+ standard. java. srcDirs + = ' src/withFirebase/java'
163+ play. java. srcDirs + = ' src/withFirebase/java'
164+ }
165+
149166 packagingOptions {
150167 jniLibs {
151168 useLegacyPackaging true
@@ -233,7 +250,8 @@ android {
233250 def shortAbi = abi == null ? " universal" : abi. replace(" arm64-" , " " ). replace(" armeabi-" , " " )
234251 // K2GO-402: two flavors can share versionName+abi+buildType. Disambiguate the fdroid APK
235252 // with a "-fdroid" marker; keep the standard build's filename unchanged (CI expects it).
236- def flavorMark = variant. flavorName == " fdroid" ? " -fdroid" : " "
253+ def flavorMark = variant. flavorName == " fdroid" ? " -fdroid"
254+ : variant. flavorName == " play" ? " -play" : " "
237255 output. outputFileName = " K2Go-${ variant.versionName}${ flavorMark} -${ shortAbi} -${ variant.buildType.name} .apk"
238256 }
239257 }
@@ -303,6 +321,10 @@ dependencies {
303321 // standardImplementation ONLY: the fdroid flavor must not link this non-free AAR (F-Droid).
304322 standardImplementation platform(' com.google.firebase:firebase-bom:33.7.0' )
305323 standardImplementation ' com.google.firebase:firebase-analytics'
324+ // K2GO-398: the Play flavor carries the same Firebase as standard (Play allows it; the Data Safety
325+ // form must still declare it). firebase-bom aligns versions; firebase-analytics exposes the Java API.
326+ playImplementation platform(' com.google.firebase:firebase-bom:33.7.0' )
327+ playImplementation ' com.google.firebase:firebase-analytics'
306328
307329 // Local Module: Our C++ engine (Termux)
308330 implementation project(' :termux-core' )
0 commit comments