mirror of
				https://github.com/ImranR98/Obtainium.git
				synced 2025-10-25 03:43:46 +02:00 
			
		
		
		
	Compare commits
	
		
			5 Commits
		
	
	
		
			v0.14.8-be
			...
			v0.14.10-b
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 8ba0a0a776 | ||
|  | 73ed0cea88 | ||
|  | 58a378d212 | ||
|  | 553307ba70 | ||
|  | 78f73a9049 | 
| @@ -252,6 +252,7 @@ | ||||
|     "intermediateLinkNotFound": "Link intermediário não encontrado", | ||||
|     "exemptFromBackgroundUpdates": "Isento de atualizações em segundo plano (se ativadas)", | ||||
|     "bgUpdatesOnWiFiOnly": "Desative atualizações em segundo plano quando não estiver em WiFi", | ||||
|     "autoSelectHighestVersionCode": "Auto-select highest versionCode APK", | ||||
|     "removeAppQuestion": { | ||||
|         "one": "Remover App?", | ||||
|         "other": "Remover Apps?" | ||||
|   | ||||
| @@ -249,6 +249,7 @@ | ||||
|    "verifyLatestTag": "Verify the 'latest' tag", | ||||
|    "exemptFromBackgroundUpdates": "Exempt from background updates (if enabled)", | ||||
|    "bgUpdatesOnWiFiOnly": "Disable background updates when not on WiFi", | ||||
|    "autoSelectHighestVersionCode": "Auto-select highest versionCode APK", | ||||
|    "removeAppQuestion": { | ||||
|       "one": "Želite li ukloniti aplikaciju?", | ||||
|       "other": "Želite li ukloniti aplikacije?" | ||||
|   | ||||
| @@ -249,6 +249,7 @@ | ||||
|     "verifyLatestTag": "Überprüfe das 'latest' Tag", | ||||
|     "exemptFromBackgroundUpdates": "Ausschluss von Hintergrundaktualisierungen (falls aktiviert)", | ||||
|     "bgUpdatesOnWiFiOnly": "Hintergrundaktualisierungen deaktivieren, wenn kein WLAN vorhanden ist", | ||||
|     "autoSelectHighestVersionCode": "Auto-select highest versionCode APK", | ||||
|     "removeAppQuestion": { | ||||
|         "one": "App entfernen?", | ||||
|         "other": "Apps entfernen?" | ||||
|   | ||||
| @@ -252,6 +252,7 @@ | ||||
|     "intermediateLinkNotFound": "Intermediate link not found", | ||||
|     "exemptFromBackgroundUpdates": "Exempt from background updates (if enabled)", | ||||
|     "bgUpdatesOnWiFiOnly": "Disable background updates when not on WiFi", | ||||
|     "autoSelectHighestVersionCode": "Auto-select highest versionCode APK", | ||||
|     "removeAppQuestion": { | ||||
|         "one": "Remove App?", | ||||
|         "other": "Remove Apps?" | ||||
|   | ||||
| @@ -249,6 +249,7 @@ | ||||
|     "verifyLatestTag": "Verify the 'latest' tag", | ||||
|     "exemptFromBackgroundUpdates": "Exempt from background updates (if enabled)", | ||||
|     "bgUpdatesOnWiFiOnly": "Disable background updates when not on WiFi", | ||||
|     "autoSelectHighestVersionCode": "Auto-select highest versionCode APK", | ||||
|     "removeAppQuestion": { | ||||
|         "one": "¿Eliminar Aplicación?", | ||||
|         "other": "¿Eliminar Aplicaciones?" | ||||
|   | ||||
| @@ -249,6 +249,7 @@ | ||||
|     "verifyLatestTag": "Verify the 'latest' tag", | ||||
|     "exemptFromBackgroundUpdates": "Exempt from background updates (if enabled)", | ||||
|     "bgUpdatesOnWiFiOnly": "Disable background updates when not on WiFi", | ||||
|     "autoSelectHighestVersionCode": "Auto-select highest versionCode APK", | ||||
|     "removeAppQuestion": { | ||||
|         "one": "برنامه حذف شود؟", | ||||
|         "other": "برنامه ها حذف شوند؟" | ||||
|   | ||||
| @@ -249,6 +249,7 @@ | ||||
|     "verifyLatestTag": "Verify the 'latest' tag", | ||||
|     "exemptFromBackgroundUpdates": "Exempt from background updates (if enabled)", | ||||
|     "bgUpdatesOnWiFiOnly": "Disable background updates when not on WiFi", | ||||
|     "autoSelectHighestVersionCode": "Auto-select highest versionCode APK", | ||||
|     "removeAppQuestion": { | ||||
|         "one": "Supprimer l'application ?", | ||||
|         "other": "Supprimer les applications ?" | ||||
|   | ||||
| @@ -248,6 +248,7 @@ | ||||
|     "verifyLatestTag": "Ellenőrizze a „legújabb” címkét", | ||||
|     "exemptFromBackgroundUpdates": "Mentes a háttérben történő frissítések alól (ha engedélyezett)", | ||||
|     "bgUpdatesOnWiFiOnly": "Tiltsa le a háttérben frissítéseket, ha nincs Wi-Fi-n", | ||||
|     "autoSelectHighestVersionCode": "Auto-select highest versionCode APK", | ||||
|     "removeAppQuestion": { | ||||
|         "one": "Eltávolítja az alkalmazást?", | ||||
|         "other": "Eltávolítja az alkalmazást?" | ||||
|   | ||||
| @@ -249,6 +249,7 @@ | ||||
|     "verifyLatestTag": "Verify the 'latest' tag", | ||||
|     "exemptFromBackgroundUpdates": "Exempt from background updates (if enabled)", | ||||
|     "bgUpdatesOnWiFiOnly": "Disable background updates when not on WiFi", | ||||
|     "autoSelectHighestVersionCode": "Auto-select highest versionCode APK", | ||||
|     "removeAppQuestion": { | ||||
|         "one": "Rimuovere l'app?", | ||||
|         "other": "Rimuovere le app?" | ||||
|   | ||||
| @@ -250,6 +250,7 @@ | ||||
|     "verifyLatestTag": "'latest'タグを確認する", | ||||
|     "exemptFromBackgroundUpdates": "バックグラウンドアップデートを行わない (有効な場合)", | ||||
|     "bgUpdatesOnWiFiOnly": "WiFiを使用していない場合,バックグラウンドアップデートを無効にする", | ||||
|     "autoSelectHighestVersionCode": "Auto-select highest versionCode APK", | ||||
|     "removeAppQuestion": { | ||||
|         "one": "アプリを削除しますか?", | ||||
|         "other": "アプリを削除しますか?" | ||||
|   | ||||
| @@ -255,6 +255,7 @@ | ||||
|     "verifyLatestTag": "Zweryfikuj najnowszy tag", | ||||
|     "exemptFromBackgroundUpdates": "Wyklucz z uaktualnień w tle (jeśli są włączone)", | ||||
|     "bgUpdatesOnWiFiOnly": "Wyłącz aktualizacje w tle, gdy nie ma połączenia z Wi-Fi", | ||||
|     "autoSelectHighestVersionCode": "Auto-select highest versionCode APK", | ||||
|     "removeAppQuestion": { | ||||
|         "one": "Usunąć aplikację?", | ||||
|         "few": "Usunąć aplikacje?", | ||||
|   | ||||
| @@ -249,6 +249,7 @@ | ||||
|     "verifyLatestTag": "Verify the 'latest' tag", | ||||
|     "exemptFromBackgroundUpdates": "Exempt from background updates (if enabled)", | ||||
|     "bgUpdatesOnWiFiOnly": "Disable background updates when not on WiFi", | ||||
|     "autoSelectHighestVersionCode": "Auto-select highest versionCode APK", | ||||
|     "removeAppQuestion": { | ||||
|         "one": "Удалить приложение?", | ||||
|         "other": "Удалить приложения?" | ||||
|   | ||||
| @@ -250,6 +250,7 @@ | ||||
|     "verifyLatestTag": "验证“Latest”标签", | ||||
|     "exemptFromBackgroundUpdates": "Exempt from background updates (if enabled)", | ||||
|     "bgUpdatesOnWiFiOnly": "Disable background updates when not on WiFi", | ||||
|     "autoSelectHighestVersionCode": "Auto-select highest versionCode APK", | ||||
|     "removeAppQuestion": { | ||||
|         "one": "是否删除应用?", | ||||
|         "other": "是否删除应用?" | ||||
|   | ||||
| @@ -26,14 +26,10 @@ class Aptoide extends AppSource { | ||||
|   @override | ||||
|   Future<String?> tryInferringAppId(String standardUrl, | ||||
|       {Map<String, dynamic> additionalSettings = const {}}) async { | ||||
|     return (await getLatestAPKDetails(standardUrl, additionalSettings)).version; | ||||
|     return (await getAppDetailsJSON(standardUrl))['package']; | ||||
|   } | ||||
|  | ||||
|   @override | ||||
|   Future<APKDetails> getLatestAPKDetails( | ||||
|     String standardUrl, | ||||
|     Map<String, dynamic> additionalSettings, | ||||
|   ) async { | ||||
|   Future<Map<String, dynamic>> getAppDetailsJSON(String standardUrl) async { | ||||
|     var res = await sourceRequest(standardUrl); | ||||
|     if (res.statusCode != 200) { | ||||
|       throw getObtainiumHttpError(res); | ||||
| @@ -50,12 +46,20 @@ class Aptoide extends AppSource { | ||||
|     if (res2.statusCode != 200) { | ||||
|       throw getObtainiumHttpError(res); | ||||
|     } | ||||
|     var appDetails = jsonDecode(res2.body)?['nodes']?['meta']?['data']; | ||||
|     String appName = appDetails?['name'] ?? tr('app'); | ||||
|     String author = appDetails?['developer']?['name'] ?? name; | ||||
|     String? dateStr = appDetails?['updated']; | ||||
|     String? version = appDetails?['file']?['vername']; | ||||
|     String? apkUrl = appDetails?['file']?['path']; | ||||
|     return jsonDecode(res2.body)?['nodes']?['meta']?['data']; | ||||
|   } | ||||
|  | ||||
|   @override | ||||
|   Future<APKDetails> getLatestAPKDetails( | ||||
|     String standardUrl, | ||||
|     Map<String, dynamic> additionalSettings, | ||||
|   ) async { | ||||
|     var appDetails = await getAppDetailsJSON(standardUrl); | ||||
|     String appName = appDetails['name'] ?? tr('app'); | ||||
|     String author = appDetails['developer']?['name'] ?? name; | ||||
|     String? dateStr = appDetails['updated']; | ||||
|     String? version = appDetails['file']?['vername']; | ||||
|     String? apkUrl = appDetails['file']?['path']; | ||||
|     if (version == null) { | ||||
|       throw NoVersionError(); | ||||
|     } | ||||
|   | ||||
| @@ -3,6 +3,7 @@ import 'dart:convert'; | ||||
| import 'package:easy_localization/easy_localization.dart'; | ||||
| import 'package:html/parser.dart'; | ||||
| import 'package:http/http.dart'; | ||||
| import 'package:obtainium/components/generated_form.dart'; | ||||
| import 'package:obtainium/custom_errors.dart'; | ||||
| import 'package:obtainium/providers/source_provider.dart'; | ||||
|  | ||||
| @@ -11,6 +12,12 @@ class FDroid extends AppSource { | ||||
|     host = 'f-droid.org'; | ||||
|     name = tr('fdroid'); | ||||
|     canSearch = true; | ||||
|     additionalSourceAppSpecificSettingFormItems = [ | ||||
|       [ | ||||
|         GeneratedFormSwitch('autoSelectHighestVersionCode', | ||||
|             label: tr('autoSelectHighestVersionCode')) | ||||
|       ] | ||||
|     ]; | ||||
|   } | ||||
|  | ||||
|   @override | ||||
| @@ -37,7 +44,8 @@ class FDroid extends AppSource { | ||||
|   } | ||||
|  | ||||
|   APKDetails getAPKUrlsFromFDroidPackagesAPIResponse( | ||||
|       Response res, String apkUrlPrefix, String standardUrl) { | ||||
|       Response res, String apkUrlPrefix, String standardUrl, | ||||
|       {bool autoSelectHighestVersionCode = false}) { | ||||
|     if (res.statusCode == 200) { | ||||
|       List<dynamic> releases = jsonDecode(res.body)['packages'] ?? []; | ||||
|       if (releases.isEmpty) { | ||||
| @@ -47,8 +55,12 @@ class FDroid extends AppSource { | ||||
|       if (latestVersion == null) { | ||||
|         throw NoVersionError(); | ||||
|       } | ||||
|       List<String> apkUrls = releases | ||||
|           .where((element) => element['versionName'] == latestVersion) | ||||
|       Iterable<dynamic> latestReleases = | ||||
|           releases.where((element) => element['versionName'] == latestVersion); | ||||
|       if (latestReleases.length > 1 && autoSelectHighestVersionCode) { | ||||
|         latestReleases = [latestReleases.first]; | ||||
|       } | ||||
|       List<String> apkUrls = latestReleases | ||||
|           .map((e) => '${apkUrlPrefix}_${e['versionCode']}.apk') | ||||
|           .toList(); | ||||
|       return APKDetails(latestVersion, getApkUrlsFromUrls(apkUrls), | ||||
| @@ -68,7 +80,9 @@ class FDroid extends AppSource { | ||||
|     return getAPKUrlsFromFDroidPackagesAPIResponse( | ||||
|         await sourceRequest('https://$host/api/v1/packages/$appId'), | ||||
|         'https://$host/repo/$appId', | ||||
|         standardUrl); | ||||
|         standardUrl, | ||||
|         autoSelectHighestVersionCode: | ||||
|             additionalSettings['autoSelectHighestVersionCode'] == true); | ||||
|   } | ||||
|  | ||||
|   @override | ||||
|   | ||||
| @@ -3,8 +3,13 @@ import 'package:obtainium/custom_errors.dart'; | ||||
| import 'package:obtainium/providers/source_provider.dart'; | ||||
|  | ||||
| class IzzyOnDroid extends AppSource { | ||||
|   late FDroid fd; | ||||
|  | ||||
|   IzzyOnDroid() { | ||||
|     host = 'android.izzysoft.de'; | ||||
|     fd = FDroid(); | ||||
|     additionalSourceAppSpecificSettingFormItems = | ||||
|         fd.additionalSourceAppSpecificSettingFormItems; | ||||
|   } | ||||
|  | ||||
|   @override | ||||
| @@ -20,7 +25,7 @@ class IzzyOnDroid extends AppSource { | ||||
|   @override | ||||
|   Future<String?> tryInferringAppId(String standardUrl, | ||||
|       {Map<String, dynamic> additionalSettings = const {}}) async { | ||||
|     return FDroid().tryInferringAppId(standardUrl); | ||||
|     return fd.tryInferringAppId(standardUrl); | ||||
|   } | ||||
|  | ||||
|   @override | ||||
| @@ -29,10 +34,12 @@ class IzzyOnDroid extends AppSource { | ||||
|     Map<String, dynamic> additionalSettings, | ||||
|   ) async { | ||||
|     String? appId = await tryInferringAppId(standardUrl); | ||||
|     return FDroid().getAPKUrlsFromFDroidPackagesAPIResponse( | ||||
|     return fd.getAPKUrlsFromFDroidPackagesAPIResponse( | ||||
|         await sourceRequest( | ||||
|             'https://apt.izzysoft.de/fdroid/api/v1/packages/$appId'), | ||||
|         'https://android.izzysoft.de/frepo/$appId', | ||||
|         standardUrl); | ||||
|         standardUrl, | ||||
|         autoSelectHighestVersionCode: | ||||
|             additionalSettings['autoSelectHighestVersionCode'] == true); | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -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.8'; | ||||
| const String currentVersion = '0.14.10'; | ||||
| const String currentReleaseTag = | ||||
|     'v$currentVersion-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES | ||||
|  | ||||
|   | ||||
| @@ -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.8+200 # When changing this, update the tag in main() accordingly | ||||
| version: 0.14.10+202 # When changing this, update the tag in main() accordingly | ||||
|  | ||||
| environment: | ||||
|   sdk: '>=2.18.2 <3.0.0' | ||||
|   | ||||
		Reference in New Issue
	
	Block a user