A cross platform Audiobookshelf client for Android and iOS
Dart
Strip Google Play Core from F-Droid build
Barnabas4d3572097acd
diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.ktsindex 8d1150af..7519df10 100644--- a/android/app/build.gradle.kts+++ b/android/app/build.gradle.kts@@ -47,11 +47,17 @@ android {flavorDimensions += "distribution"productFlavors {+ // github + playstore keep the broad Flutter proguard keep. fdroid omits+ // it so R8 can strip Flutter's unused deferred-components manager, which+ // would otherwise drag proprietary Google Play Core class references into+ // the APK and fail F-Droid's scanner.create("github") {dimension = "distribution"+ proguardFiles("proguard-flutter-keep.pro")}create("playstore") {dimension = "distribution"+ proguardFiles("proguard-flutter-keep.pro")}// GMS-free build for F-Droid: no Chromecast, Wear bridge, or in-app updater.create("fdroid") {@@ -111,4 +117,11 @@ dependencies {add("githubImplementation", it)add("playstoreImplementation", it)}+}++// F-Droid build must ship no Google Play Core (proprietary; the Flutter engine+// pulls it in for deferred components, which Absorb doesn't use). Scoped to the+// fdroid flavor so the github/playstore builds are unchanged.+configurations.matching { it.name.startsWith("fdroid") }.configureEach {+ exclude(group = "com.google.android.play")}\ No newline at end of filediff --git a/android/app/proguard-flutter-keep.pro b/android/app/proguard-flutter-keep.pronew file mode 100644index 00000000..d1e8767e--- /dev/null+++ b/android/app/proguard-flutter-keep.pro@@ -0,0 +1,6 @@+# Broad Flutter keep, applied only to the github + playstore flavors (wired up+# in build.gradle.kts productFlavors). The fdroid flavor intentionally omits+# this so R8 can strip Flutter's unused deferred-components manager, which+# otherwise pulls proprietary Google Play Core class references into the APK and+# trips F-Droid's non-free scanner.+-keep class io.flutter.** { *; }diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.proindex 9777f2f5..c4c4d8d2 100644--- a/android/app/proguard-rules.pro+++ b/android/app/proguard-rules.pro@@ -1,5 +1,8 @@# Flutter--keep class io.flutter.** { *; }+# NOTE: the broad `-keep class io.flutter.** { *; }` lives in+# proguard-flutter-keep.pro and is applied only to the github + playstore+# flavors. The fdroid flavor deliberately omits it so R8 strips Flutter's+# unused deferred-components manager (which references proprietary Play Core).-keep class io.flutter.plugins.** { *; }# just_audiodiff --git a/fdroid/com.barnabas.absorb.yml b/fdroid/com.barnabas.absorb.ymlindex 9d5b3ead..4e70411b 100644--- a/fdroid/com.barnabas.absorb.yml+++ b/fdroid/com.barnabas.absorb.yml@@ -1,16 +1,3 @@-# DRAFT F-Droid metadata for the official fdroiddata repo.-# Copy to fdroiddata/metadata/com.barnabas.absorb.yml when opening the merge request.-#-# Modeled on current Flutter apps in fdroiddata (FluffyChat / LocalSend / Saber):-# F-Droid provides the Flutter SDK via `srclibs: flutter@stable`, the build runs-# `flutter build apk --flavor fdroid` in a `build:` block (NOT `gradle:`), and the-# Chromecast plugin is stripped in `prebuild:`.-#-# Bits to confirm against F-Droid CI on the first MR (flagged inline):-# - the Flutter version pin (3.44.0 = what Absorb is currently built with)-# - whether any `sudo:`/`ndk:` packages are needed (Absorb has no Rust/native-# desktop deps, so likely none — add if CI complains)-Categories:- MultimediaLicense: GPL-3.0-or-later@@ -34,31 +21,25 @@ Builds:- versionName: 1.8.92versionCode: 160commit: v1.8.92+ output: build/app/outputs/flutter-apk/app-fdroid-release.apksrclibs:- flutter@stableprebuild:- # Pin Flutter to the version Absorb is developed against.- git -C $$flutter$$ checkout -f 3.44.0- # Strip Chromecast (it needs Google Play Services): swap the GMS-free- # stubs into place and drop the plugin from pubspec. Do NOT delete- # pubspec.lock — a full re-resolve drifts flutter_carplay to an- # API-incompatible version and breaks the build.- mv lib/services/chromecast_service_stub.dart lib/services/chromecast_service.dart- mv lib/widgets/chromecast_button_stub.dart lib/widgets/chromecast_button.dart- sed -i '/flutter_chrome_cast:/d' pubspec.yaml- export PUB_CACHE=$(pwd)/.pub-cache- $$flutter$$/bin/flutter config --no-analytics- $$flutter$$/bin/flutter pub get+ scandelete:+ - .pub-cachebuild:- export PUB_CACHE=$(pwd)/.pub-cache- $$flutter$$/bin/flutter build apk --release --flavor fdroid- scandelete:- - .pub-cache- output: build/app/outputs/flutter-apk/app-fdroid-release.apk-# F-Droid signs with its own key (no reproducible-build setup), so F-Droid-# installs are independent of the GitHub/Play APK signatures.AutoUpdateMode: Version-UpdateCheckMode: Tags+UpdateCheckMode: Tags ^v\d+\.\d+\.\d+$+UpdateCheckData: pubspec.yaml|version:\s.+\+(\d+)|.|version:\s(.+)\+CurrentVersion: 1.8.92CurrentVersionCode: 160