diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 00a4cce..d8ef02c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,7 +21,8 @@ jobs: - name: Build APKs run: | - flutter build apk && flutter build apk --split-per-abi + flutter build apk --flavor normal && flutter build apk --split-per-abi --flavor normal + for file in app-*normal*.apk*; do mv "$file" "${file//-normal/}"; done rm ./build/app/outputs/flutter-apk/*.sha1 ls -l ./build/app/outputs/flutter-apk/ diff --git a/android/app/build.gradle b/android/app/build.gradle index d013381..e8d09aa 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -58,6 +58,19 @@ android { versionName flutterVersionName } + flavorDimensions "flavor" + + productFlavors { + normal { + dimension "flavor" + applicationIdSuffix "" + } + fdroid { + dimension "flavor" + applicationIdSuffix ".fdroid" + } + } + buildTypes { release { diff --git a/assets/translations/tr.json b/assets/translations/tr.json index 3071bc9..a969e57 100644 --- a/assets/translations/tr.json +++ b/assets/translations/tr.json @@ -37,7 +37,7 @@ "addApp": "Uygulama Ekle", "appSourceURL": "Uygulama Kaynak URL'si", "error": "Hata", - "add": "Ekle" + "add": "Ekle", "searchSomeSourcesLabel": "Ara (Bazı Kaynaklar Yalnızca)", "search": "Ara", "additionalOptsFor": "{} İçin Ek Seçenekler", @@ -226,7 +226,7 @@ "requiresCredentialsInSettings": "Bu, ek kimlik bilgilerine ihtiyaç duyar (Ayarlar'da)", "checkOnStart": "Başlangıçta güncellemeleri kontrol et", "tryInferAppIdFromCode": "Uygulama kimliğini kaynak kodundan çıkarma girişimi", - "removeOnExternalUninstall": "Harici kaldırmada otomatik olarak kaldırılan uygulamalar" + "removeOnExternalUninstall": "Harici kaldırmada otomatik olarak kaldırılan uygulamalar", "pickHighestVersionCode": "Otomatik olarak en yüksek sürüm kodlu APK'yi seç", "checkUpdateOnDetailPage": "Uygulama detay sayfasını açarken güncellemeleri kontrol et", "disablePageTransitions": "Sayfa geçiş animasyonlarını devre dışı bırak", @@ -241,7 +241,7 @@ "customLinkFilterRegex": "Özel APK Bağlantı Filtresi Düzenli İfade ile (Varsayılan '.apk$')", "appsPossiblyUpdated": "Uygulama Güncellemeleri Denendi", "appsPossiblyUpdatedNotifDescription": "Kullanıcıya bir veya daha fazla uygulamanın arka planda potansiyel olarak güncellendiğini bildiren bildirim", - "xWasPossiblyUpdatedToY": "{} muhtemelen {} sürümüne güncellendi." + "xWasPossiblyUpdatedToY": "{} muhtemelen {} sürümüne güncellendi.", "enableBackgroundUpdates": "Arka plan güncellemelerini etkinleştir", "backgroundUpdateReqsExplanation": "Arka plan güncellemeleri tüm uygulamalar için mümkün olmayabilir.", "backgroundUpdateLimitsExplanation": "Arka plan kurulumunun başarısı, Obtainium'un açıldığında ancak belirlenebilir.", @@ -258,7 +258,7 @@ "autoExportOnChanges": "Değişikliklerde otomatik olarak dışa aktar", "filterVersionsByRegEx": "Sürümleri Düzenli İfade ile Filtrele", "trySelectingSuggestedVersionCode": "Önerilen sürüm kodunu seçmeyi dene", - "dontSortReleasesList": "API'den sıralama düzenini koru" + "dontSortReleasesList": "API'den sıralama düzenini koru", "reverseSort": "Ters sıralama", "debugMenu": "Hata Ayıklama Menüsü", "bgTaskStarted": "Arka plan görevi başladı - günlükleri kontrol et.", @@ -274,10 +274,10 @@ "downloadingXNotifChannel": "{} İndiriliyor", "completeAppInstallationNotifChannel": "Uygulama Kurulumu Tamamlandı", "checkingForUpdatesNotifChannel": "Güncellemeler Kontrol Ediliyor", - "onlyCheckInstalledOrTrackOnlyApps": "Yalnızca yüklü ve Yalnızca İzleme Uygulamalarını güncelleme" -"removeAppQuestion": { - "one": "Uygulamayı Kaldır?", - "other": "Uygulamaları Kaldır?" + "onlyCheckInstalledOrTrackOnlyApps": "Yalnızca yüklü ve Yalnızca İzleme Uygulamalarını güncelleme", + "removeAppQuestion": { + "one": "Uygulamayı Kaldır?", + "other": "Uygulamaları Kaldır?" }, "tooManyRequestsTryAgainInMinutes": { "one": "Çok fazla istek (hız sınırlı) - {} dakika sonra tekrar deneyin", @@ -290,7 +290,7 @@ "bgCheckFoundUpdatesWillNotifyIfNeeded": { "one": "Arka plan güncelleme kontrolü {} güncelleme buldu - gerektiğinde kullanıcıyı bilgilendirecek", "other": "Arka plan güncelleme kontrolü {} güncelleme buldu - gerektiğinde kullanıcıyı bilgilendirecek" - } + }, "apps": { "one": "{} Uygulama", "other": "{} Uygulamalar" @@ -327,4 +327,4 @@ "one": "{} ve 1 diğer uygulama muhtemelen güncellendi.", "other": "{} ve {} daha fazla uygulama muhtemelen güncellendi." } -} +} \ No newline at end of file diff --git a/build.sh b/build.sh index 76fcdde..26dc8b9 100755 --- a/build.sh +++ b/build.sh @@ -7,8 +7,11 @@ trap "cd "$CURR_DIR"" EXIT if [ -z "$1" ]; then git fetch && git merge origin/main && git push # Typically run after a PR to main, so bring dev up to date fi -rm ./build/app/outputs/flutter-apk/* 2>/dev/null # Get rid of older builds if any -flutter build apk && flutter build apk --split-per-abi # Build (both split and combined APKs) +rm ./build/app/outputs/flutter-apk/* 2>/dev/null # Get rid of older builds if any +flutter build apk --flavor normal && flutter build apk --split-per-abi --flavor normal # Build (both split and combined APKs) +for file in ./build/app/outputs/flutter-apk/app-*normal*.apk*; do mv "$file" "${file//-normal/}"; done +flutter build apk --flavor fdroid -t lib/main_fdroid.dart && # Do the same for the F-Droid flavour + flutter build apk --split-per-abi --flavor fdroid -t lib/main_fdroid.dart for file in ./build/app/outputs/flutter-apk/*.sha1; do gpg --sign --detach-sig "$file"; done # Generate PGP signatures rsync -r ./build/app/outputs/flutter-apk/ ~/Downloads/Obtainium-build/ # Dropoff in Downloads to allow for drag-drop into Flatpak Firefox cd ~/Downloads/Obtainium-build/ # Make zips just in case (for in-comment uploads) diff --git a/lib/app_sources/html.dart b/lib/app_sources/html.dart index 13dcdd8..f6dab8a 100644 --- a/lib/app_sources/html.dart +++ b/lib/app_sources/html.dart @@ -140,7 +140,7 @@ class HTML extends AppSource { ] ]; overrideVersionDetectionFormDefault('noVersionDetection', - disableStandard: true, disableRelDate: true); + disableStandard: false, disableRelDate: true); } @override diff --git a/lib/main.dart b/lib/main.dart index 4d973de..89a2f83 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -19,7 +19,7 @@ import 'package:easy_localization/src/easy_localization_controller.dart'; // ignore: implementation_imports import 'package:easy_localization/src/localization.dart'; -const String currentVersion = '0.14.32'; +const String currentVersion = '0.14.33'; const String currentReleaseTag = 'v$currentVersion-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES @@ -42,9 +42,12 @@ List> supportedLocales = const [ MapEntry(Locale('cs'), 'Česky'), MapEntry(Locale('sv'), 'Svenska'), MapEntry(Locale('nl'), 'Nederlands'), + MapEntry(Locale('vi'), 'Tiếng Việt'), + MapEntry(Locale('tr'), 'Türkçe'), ]; const fallbackLocale = Locale('en'); const localeDir = 'assets/translations'; +var fdroid = false; final globalNavigatorKey = GlobalKey(); @@ -133,20 +136,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 diff --git a/lib/pages/import_export.dart b/lib/pages/import_export.dart index f99efb5..d98255f 100644 --- a/lib/pages/import_export.dart +++ b/lib/pages/import_export.dart @@ -214,7 +214,8 @@ class _ImportExportPageState extends State { ); }); if (selectedUrls != null && selectedUrls.isNotEmpty) { - var errors = await appsProvider.addAppsByURL(selectedUrls); + var errors = await appsProvider.addAppsByURL(selectedUrls, + sourceOverride: source); if (errors.isEmpty) { // ignore: use_build_context_synchronously showMessage( diff --git a/lib/providers/apps_provider.dart b/lib/providers/apps_provider.dart index d4085d6..ae0e992 100644 --- a/lib/providers/apps_provider.dart +++ b/lib/providers/apps_provider.dart @@ -1217,9 +1217,11 @@ class AppsProvider with ChangeNotifier { super.dispose(); } - Future>> addAppsByURL(List urls) async { + Future>> addAppsByURL(List urls, + {AppSource? sourceOverride}) async { List results = await SourceProvider().getAppsByURLNaive(urls, - alreadyAddedUrls: apps.values.map((e) => e.app.url).toList()); + alreadyAddedUrls: apps.values.map((e) => e.app.url).toList(), + sourceOverride: sourceOverride); List pps = results[0]; Map errorsMap = results[1]; for (var app in pps) { diff --git a/lib/providers/source_provider.dart b/lib/providers/source_provider.dart index 5736027..f31aa80 100644 --- a/lib/providers/source_provider.dart +++ b/lib/providers/source_provider.dart @@ -706,7 +706,8 @@ class SourceProvider { // Returns errors in [results, errors] instead of throwing them Future> getAppsByURLNaive(List urls, - {List alreadyAddedUrls = const []}) async { + {List alreadyAddedUrls = const [], + AppSource? sourceOverride}) async { List apps = []; Map errors = {}; for (var url in urls) { @@ -714,7 +715,7 @@ class SourceProvider { if (alreadyAddedUrls.contains(url)) { throw ObtainiumError(tr('appAlreadyAdded')); } - var source = getSource(url); + var source = sourceOverride ?? getSource(url); apps.add(await getApp( source, url, diff --git a/pubspec.lock b/pubspec.lock index 7ab0e9f..9bc0922 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -46,10 +46,10 @@ packages: dependency: transitive description: name: archive - sha256: "7e0d52067d05f2e0324268097ba723b71cb41ac8a6a2b24d1edf9c536b987b03" + sha256: "7b875fd4a20b165a3084bd2d210439b22ebc653f21cea4842729c0c30c82596b" url: "https://pub.dev" source: hosted - version: "3.4.6" + version: "3.4.9" args: dependency: transitive description: @@ -110,10 +110,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" connectivity_plus: dependency: "direct main" description: @@ -174,10 +174,10 @@ packages: dependency: transitive description: name: dbus - sha256: "6f07cba3f7b3448d42d015bfd3d53fe12e5b36da2423f23838efc1d5fb31a263" + sha256: "365c771ac3b0e58845f39ec6deebc76e3276aa9922b0cc60840712094d9047ac" url: "https://pub.dev" source: hosted - version: "0.7.8" + version: "0.7.10" device_info_plus: dependency: "direct main" description: @@ -246,10 +246,10 @@ packages: dependency: "direct main" description: name: file_picker - sha256: "903dd4ba13eae7cef64acc480e91bf54c3ddd23b5b90b639c170f3911e489620" + sha256: "4e42aacde3b993c5947467ab640882c56947d9d27342a5b6f2895b23956954a6" url: "https://pub.dev" source: hosted - version: "6.0.0" + version: "6.1.1" flutter: dependency: "direct main" description: flutter @@ -320,10 +320,10 @@ packages: dependency: "direct main" description: name: flutter_markdown - sha256: "8afc9a6aa6d8e8063523192ba837149dbf3d377a37c0b0fc579149a1fbd4a619" + sha256: "35108526a233cc0755664d445f8a6b4b61e6f8fe993b3658b80b4a26827fc196" url: "https://pub.dev" source: hosted - version: "0.6.18" + version: "0.6.18+2" flutter_plugin_android_lifecycle: dependency: transitive description: @@ -346,10 +346,10 @@ packages: dependency: "direct main" description: name: fluttertoast - sha256: "474f7d506230897a3cd28c965ec21c5328ae5605fc9c400cd330e9e9d6ac175c" + sha256: dfdde255317af381bfc1c486ed968d5a43a2ded9c931e87cbecd88767d6a71c1 url: "https://pub.dev" source: hosted - version: "8.2.2" + version: "8.2.4" hsluv: dependency: "direct main" description: @@ -450,10 +450,10 @@ packages: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" mime: dependency: transitive description: @@ -578,10 +578,10 @@ packages: dependency: transitive description: name: petitparser - sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 + sha256: eeb2d1428ee7f4170e2bd498827296a18d4e7fc462b71727d111c0ac7707cfa6 url: "https://pub.dev" source: hosted - version: "5.4.0" + version: "6.0.1" platform: dependency: transitive description: @@ -594,10 +594,10 @@ packages: dependency: transitive description: name: plugin_platform_interface - sha256: da3fdfeccc4d4ff2da8f8c556704c08f912542c5fb3cf2233ed75372384a034d + sha256: f4f88d4a900933e7267e2b353594774fc0d07fb072b47eedcd5b54e1ea3269f8 url: "https://pub.dev" source: hosted - version: "2.1.6" + version: "2.1.7" pointycastle: dependency: transitive description: @@ -610,10 +610,10 @@ packages: dependency: "direct main" description: name: provider - sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f + sha256: "9a96a0a19b594dbc5bf0f1f27d2bc67d5f95957359b461cd9feb44ed6ae75096" url: "https://pub.dev" source: hosted - version: "6.0.5" + version: "6.1.1" share_plus: dependency: "direct main" description: @@ -674,10 +674,10 @@ packages: dependency: transitive description: name: shared_preferences_web - sha256: d762709c2bbe80626ecc819143013cc820fa49ca5e363620ee20a8b15a3e3daf + sha256: "7b15ffb9387ea3e237bb7a66b8a23d2147663d391cafc5c8f37b2e7b4bde5d21" url: "https://pub.dev" source: hosted - version: "2.2.1" + version: "2.2.2" shared_preferences_windows: dependency: transitive description: @@ -727,26 +727,26 @@ packages: dependency: transitive description: name: sqflite_common - sha256: "1b92f368f44b0dee2425bb861cfa17b6f6cf3961f762ff6f941d20b33355660a" + sha256: bb4738f15b23352822f4c42a531677e5c6f522e079461fd240ead29d8d8a54a6 url: "https://pub.dev" source: hosted - version: "2.5.0" + version: "2.5.0+2" stack_trace: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: @@ -775,10 +775,10 @@ packages: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.6.1" timezone: dependency: transitive description: @@ -815,10 +815,10 @@ packages: dependency: transitive description: name: url_launcher_ios - sha256: "4ac97281cf60e2e8c5cc703b2b28528f9b50c8f7cebc71df6bdf0845f647268a" + sha256: bba3373219b7abb6b5e0d071b0fe66dfbe005d07517a68e38d4fc3638f35c6d3 url: "https://pub.dev" source: hosted - version: "6.2.0" + version: "6.2.1" url_launcher_linux: dependency: transitive description: @@ -863,10 +863,10 @@ packages: dependency: transitive description: name: uuid - sha256: b715b8d3858b6fa9f68f87d20d98830283628014750c2b09b6f516c1da4af2a7 + sha256: df5a4d8f22ee4ccd77f8839ac7cb274ebc11ef9adcce8b92be14b797fe889921 url: "https://pub.dev" source: hosted - version: "4.1.0" + version: "4.2.1" vector_math: dependency: transitive description: @@ -879,10 +879,10 @@ packages: dependency: transitive description: name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 url: "https://pub.dev" source: hosted - version: "0.1.4-beta" + version: "0.3.0" webview_flutter: dependency: "direct main" description: @@ -911,18 +911,18 @@ packages: dependency: transitive description: name: webview_flutter_wkwebview - sha256: af6f5ab05918070b33507b0d453ba9fb7d39338a3256c23cf9433dc68100774a + sha256: accdaaa49a2aca2dc3c3230907988954cdd23fed0a19525d6c9789d380f4dc76 url: "https://pub.dev" source: hosted - version: "3.9.3" + version: "3.9.4" win32: dependency: transitive description: name: win32 - sha256: "350a11abd2d1d97e0cc7a28a81b781c08002aa2864d9e3f192ca0ffa18b06ed3" + sha256: "7c99c0e1e2fa190b48d25c81ca5e42036d5cac81430ef249027d97b0935c553f" url: "https://pub.dev" source: hosted - version: "5.0.9" + version: "5.1.0" win32_registry: dependency: transitive description: @@ -943,10 +943,10 @@ packages: dependency: transitive description: name: xml - sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" + sha256: af5e77e9b83f2f4adc5d3f0a4ece1c7f45a2467b695c2540381bac793e34e556 url: "https://pub.dev" source: hosted - version: "6.3.0" + version: "6.4.2" yaml: dependency: transitive description: @@ -956,5 +956,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.1.0 <4.0.0" - flutter: ">=3.13.0" + dart: ">=3.2.0 <4.0.0" + flutter: ">=3.16.0" diff --git a/pubspec.yaml b/pubspec.yaml index 6c7cb05..ce353b8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 0.14.32+226 # When changing this, update the tag in main() accordingly +version: 0.14.33+226 # When changing this, update the tag in main() accordingly environment: sdk: '>=3.0.0 <4.0.0'