diff --git a/android/app/build.gradle b/android/app/build.gradle index d013381..6765d49 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -58,6 +58,19 @@ android { versionName flutterVersionName } + flavorDimensions "flavor" + + productFlavors { + github { + dimension "flavor" + applicationIdSuffix "" + } + fdroid { + dimension "flavor" + applicationIdSuffix ".fdroid" + } + } + buildTypes { release { diff --git a/lib/main.dart b/lib/main.dart index 4d973de..631eade 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -45,6 +45,7 @@ List> supportedLocales = const [ ]; const fallbackLocale = Locale('en'); const localeDir = 'assets/translations'; +var fdroid = false; final globalNavigatorKey = GlobalKey(); @@ -133,20 +134,22 @@ class _ObtainiumState extends State { logs.add('This is the first ever run of Obtainium.'); // If this is the first run, ask for notification permissions and add Obtainium to the Apps list Permission.notification.request(); - appsProvider.saveApps([ - App( - obtainiumId, - 'https://github.com/ImranR98/Obtainium', - 'ImranR98', - 'Obtainium', - currentReleaseTag, - currentReleaseTag, - [], - 0, - {'includePrereleases': true}, - null, - false) - ], onlyIfExists: false); + if (!fdroid) { + appsProvider.saveApps([ + App( + obtainiumId, + 'https://github.com/ImranR98/Obtainium', + 'ImranR98', + 'Obtainium', + currentReleaseTag, + currentReleaseTag, + [], + 0, + {'includePrereleases': true}, + null, + false) + ], onlyIfExists: false); + } } if (!supportedLocales .map((e) => e.key.languageCode) diff --git a/lib/main_fdroid.dart b/lib/main_fdroid.dart new file mode 100644 index 0000000..7fb8a28 --- /dev/null +++ b/lib/main_fdroid.dart @@ -0,0 +1,6 @@ +import 'main.dart' as m; + +void main() async { + m.fdroid = true; + m.main(); +} \ No newline at end of file