mirror of
				https://github.com/ImranR98/Obtainium.git
				synced 2025-10-31 05:23:28 +01:00 
			
		
		
		
	| @@ -255,7 +255,7 @@ | |||||||
|     "matchGroupToUse": "Match Group to Use", |     "matchGroupToUse": "Match Group to Use", | ||||||
|     "highlightTouchTargets": "Highlight less obvious touch targets", |     "highlightTouchTargets": "Highlight less obvious touch targets", | ||||||
|     "pickExportDir": "Pick Export Directory", |     "pickExportDir": "Pick Export Directory", | ||||||
|     "autoExportOnUpdateCheckKeepNum": "Auto-export on update check (keep last N auto-exports)", |     "autoExportOnChanges": "Auto-export on changes", | ||||||
|     "removeAppQuestion": { |     "removeAppQuestion": { | ||||||
|         "one": "Remover App?", |         "one": "Remover App?", | ||||||
|         "other": "Remover Apps?" |         "other": "Remover Apps?" | ||||||
|   | |||||||
| @@ -252,7 +252,7 @@ | |||||||
|    "matchGroupToUse": "Match Group to Use", |    "matchGroupToUse": "Match Group to Use", | ||||||
|    "highlightTouchTargets": "Highlight less obvious touch targets", |    "highlightTouchTargets": "Highlight less obvious touch targets", | ||||||
|    "pickExportDir": "Pick Export Directory", |    "pickExportDir": "Pick Export Directory", | ||||||
|    "autoExportOnUpdateCheckKeepNum": "Auto-export on update check (keep last N auto-exports)", |    "autoExportOnChanges": "Auto-export on changes", | ||||||
|      "removeAppQuestion": { |      "removeAppQuestion": { | ||||||
|       "one": "Želite li ukloniti aplikaciju?", |       "one": "Želite li ukloniti aplikaciju?", | ||||||
|       "other": "Želite li ukloniti aplikacije?" |       "other": "Želite li ukloniti aplikacije?" | ||||||
|   | |||||||
| @@ -252,7 +252,7 @@ | |||||||
|     "matchGroupToUse": "Match Group to Use", |     "matchGroupToUse": "Match Group to Use", | ||||||
|     "highlightTouchTargets": "Highlight less obvious touch targets", |     "highlightTouchTargets": "Highlight less obvious touch targets", | ||||||
|     "pickExportDir": "Pick Export Directory", |     "pickExportDir": "Pick Export Directory", | ||||||
|     "autoExportOnUpdateCheckKeepNum": "Auto-export on update check (keep last N auto-exports)", |     "autoExportOnChanges": "Auto-export on changes", | ||||||
|     "removeAppQuestion": { |     "removeAppQuestion": { | ||||||
|         "one": "App entfernen?", |         "one": "App entfernen?", | ||||||
|         "other": "Apps entfernen?" |         "other": "Apps entfernen?" | ||||||
|   | |||||||
| @@ -255,7 +255,7 @@ | |||||||
|     "matchGroupToUse": "Match Group to Use", |     "matchGroupToUse": "Match Group to Use", | ||||||
|     "highlightTouchTargets": "Highlight less obvious touch targets", |     "highlightTouchTargets": "Highlight less obvious touch targets", | ||||||
|     "pickExportDir": "Pick Export Directory", |     "pickExportDir": "Pick Export Directory", | ||||||
|     "autoExportOnUpdateCheckKeepNum": "Auto-export on update check (keep last N auto-exports)", |     "autoExportOnChanges": "Auto-export on changes", | ||||||
|     "removeAppQuestion": { |     "removeAppQuestion": { | ||||||
|         "one": "Remove App?", |         "one": "Remove App?", | ||||||
|         "other": "Remove Apps?" |         "other": "Remove Apps?" | ||||||
|   | |||||||
| @@ -252,7 +252,7 @@ | |||||||
|     "matchGroupToUse": "Match Group to Use", |     "matchGroupToUse": "Match Group to Use", | ||||||
|     "highlightTouchTargets": "Highlight less obvious touch targets", |     "highlightTouchTargets": "Highlight less obvious touch targets", | ||||||
|     "pickExportDir": "Pick Export Directory", |     "pickExportDir": "Pick Export Directory", | ||||||
|     "autoExportOnUpdateCheckKeepNum": "Auto-export on update check (keep last N auto-exports)", |     "autoExportOnChanges": "Auto-export on changes", | ||||||
|     "removeAppQuestion": { |     "removeAppQuestion": { | ||||||
|         "one": "¿Eliminar Aplicación?", |         "one": "¿Eliminar Aplicación?", | ||||||
|         "other": "¿Eliminar Aplicaciones?" |         "other": "¿Eliminar Aplicaciones?" | ||||||
|   | |||||||
| @@ -252,7 +252,7 @@ | |||||||
|     "matchGroupToUse": "Match Group to Use", |     "matchGroupToUse": "Match Group to Use", | ||||||
|     "highlightTouchTargets": "Highlight less obvious touch targets", |     "highlightTouchTargets": "Highlight less obvious touch targets", | ||||||
|     "pickExportDir": "Pick Export Directory", |     "pickExportDir": "Pick Export Directory", | ||||||
|     "autoExportOnUpdateCheckKeepNum": "Auto-export on update check (keep last N auto-exports)", |     "autoExportOnChanges": "Auto-export on changes", | ||||||
|     "removeAppQuestion": { |     "removeAppQuestion": { | ||||||
|         "one": "برنامه حذف شود؟", |         "one": "برنامه حذف شود؟", | ||||||
|         "other": "برنامه ها حذف شوند؟" |         "other": "برنامه ها حذف شوند؟" | ||||||
|   | |||||||
| @@ -252,7 +252,7 @@ | |||||||
|     "matchGroupToUse": "Match Group to Use", |     "matchGroupToUse": "Match Group to Use", | ||||||
|     "highlightTouchTargets": "Highlight less obvious touch targets", |     "highlightTouchTargets": "Highlight less obvious touch targets", | ||||||
|     "pickExportDir": "Pick Export Directory", |     "pickExportDir": "Pick Export Directory", | ||||||
|     "autoExportOnUpdateCheckKeepNum": "Auto-export on update check (keep last N auto-exports)", |     "autoExportOnChanges": "Auto-export on changes", | ||||||
|     "removeAppQuestion": { |     "removeAppQuestion": { | ||||||
|         "one": "Supprimer l'application ?", |         "one": "Supprimer l'application ?", | ||||||
|         "other": "Supprimer les applications ?" |         "other": "Supprimer les applications ?" | ||||||
|   | |||||||
| @@ -251,7 +251,7 @@ | |||||||
|     "matchGroupToUse": "Match Group to Use", |     "matchGroupToUse": "Match Group to Use", | ||||||
|     "highlightTouchTargets": "Highlight less obvious touch targets", |     "highlightTouchTargets": "Highlight less obvious touch targets", | ||||||
|     "pickExportDir": "Pick Export Directory", |     "pickExportDir": "Pick Export Directory", | ||||||
|     "autoExportOnUpdateCheckKeepNum": "Auto-export on update check (keep last N auto-exports)", |     "autoExportOnChanges": "Auto-export on changes", | ||||||
|     "removeAppQuestion": { |     "removeAppQuestion": { | ||||||
|         "one": "Eltávolítja az alkalmazást?", |         "one": "Eltávolítja az alkalmazást?", | ||||||
|         "other": "Eltávolítja az alkalmazást?" |         "other": "Eltávolítja az alkalmazást?" | ||||||
|   | |||||||
| @@ -252,7 +252,7 @@ | |||||||
|     "matchGroupToUse": "Match Group to Use", |     "matchGroupToUse": "Match Group to Use", | ||||||
|     "highlightTouchTargets": "Highlight less obvious touch targets", |     "highlightTouchTargets": "Highlight less obvious touch targets", | ||||||
|     "pickExportDir": "Pick Export Directory", |     "pickExportDir": "Pick Export Directory", | ||||||
|     "autoExportOnUpdateCheckKeepNum": "Auto-export on update check (keep last N auto-exports)", |     "autoExportOnChanges": "Auto-export on changes", | ||||||
|     "removeAppQuestion": { |     "removeAppQuestion": { | ||||||
|         "one": "Rimuovere l'app?", |         "one": "Rimuovere l'app?", | ||||||
|         "other": "Rimuovere le app?" |         "other": "Rimuovere le app?" | ||||||
|   | |||||||
| @@ -253,7 +253,7 @@ | |||||||
|     "matchGroupToUse": "Match Group to Use", |     "matchGroupToUse": "Match Group to Use", | ||||||
|     "highlightTouchTargets": "Highlight less obvious touch targets", |     "highlightTouchTargets": "Highlight less obvious touch targets", | ||||||
|     "pickExportDir": "Pick Export Directory", |     "pickExportDir": "Pick Export Directory", | ||||||
|     "autoExportOnUpdateCheckKeepNum": "Auto-export on update check (keep last N auto-exports)", |     "autoExportOnChanges": "Auto-export on changes", | ||||||
|     "removeAppQuestion": { |     "removeAppQuestion": { | ||||||
|         "one": "アプリを削除しますか?", |         "one": "アプリを削除しますか?", | ||||||
|         "other": "アプリを削除しますか?" |         "other": "アプリを削除しますか?" | ||||||
|   | |||||||
| @@ -258,7 +258,7 @@ | |||||||
|     "matchGroupToUse": "Match Group to Use", |     "matchGroupToUse": "Match Group to Use", | ||||||
|     "highlightTouchTargets": "Highlight less obvious touch targets", |     "highlightTouchTargets": "Highlight less obvious touch targets", | ||||||
|     "pickExportDir": "Pick Export Directory", |     "pickExportDir": "Pick Export Directory", | ||||||
|     "autoExportOnUpdateCheckKeepNum": "Auto-export on update check (keep last N auto-exports)", |     "autoExportOnChanges": "Auto-export on changes", | ||||||
|     "removeAppQuestion": { |     "removeAppQuestion": { | ||||||
|         "one": "Usunąć aplikację?", |         "one": "Usunąć aplikację?", | ||||||
|         "few": "Usunąć aplikacje?", |         "few": "Usunąć aplikacje?", | ||||||
|   | |||||||
| @@ -252,7 +252,7 @@ | |||||||
|     "matchGroupToUse": "Match Group to Use", |     "matchGroupToUse": "Match Group to Use", | ||||||
|     "highlightTouchTargets": "Highlight less obvious touch targets", |     "highlightTouchTargets": "Highlight less obvious touch targets", | ||||||
|     "pickExportDir": "Pick Export Directory", |     "pickExportDir": "Pick Export Directory", | ||||||
|     "autoExportOnUpdateCheckKeepNum": "Auto-export on update check (keep last N auto-exports)", |     "autoExportOnChanges": "Auto-export on changes", | ||||||
|     "removeAppQuestion": { |     "removeAppQuestion": { | ||||||
|         "one": "Удалить приложение?", |         "one": "Удалить приложение?", | ||||||
|         "other": "Удалить приложения?" |         "other": "Удалить приложения?" | ||||||
|   | |||||||
| @@ -253,7 +253,7 @@ | |||||||
|     "matchGroupToUse": "Match Group to Use", |     "matchGroupToUse": "Match Group to Use", | ||||||
|     "highlightTouchTargets": "Highlight less obvious touch targets", |     "highlightTouchTargets": "Highlight less obvious touch targets", | ||||||
|     "pickExportDir": "Pick Export Directory", |     "pickExportDir": "Pick Export Directory", | ||||||
|     "autoExportOnUpdateCheckKeepNum": "Auto-export on update check (keep last N auto-exports)", |     "autoExportOnChanges": "Auto-export on changes", | ||||||
|     "removeAppQuestion": { |     "removeAppQuestion": { | ||||||
|         "one": "是否删除应用?", |         "one": "是否删除应用?", | ||||||
|         "other": "是否删除应用?" |         "other": "是否删除应用?" | ||||||
|   | |||||||
| @@ -19,7 +19,7 @@ import 'package:easy_localization/src/easy_localization_controller.dart'; | |||||||
| // ignore: implementation_imports | // ignore: implementation_imports | ||||||
| import 'package:easy_localization/src/localization.dart'; | import 'package:easy_localization/src/localization.dart'; | ||||||
|  |  | ||||||
| const String currentVersion = '0.14.12'; | const String currentVersion = '0.14.13'; | ||||||
| const String currentReleaseTag = | const String currentReleaseTag = | ||||||
|     'v$currentVersion-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES |     'v$currentVersion-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES | ||||||
|  |  | ||||||
|   | |||||||
| @@ -74,11 +74,6 @@ class AppsPageState extends State<AppsPage> { | |||||||
|         setState(() { |         setState(() { | ||||||
|           refreshingSince = null; |           refreshingSince = null; | ||||||
|         }); |         }); | ||||||
|         if (settingsProvider.autoExportOnUpdateCheckKeepNum > 0) { |  | ||||||
|           appsProvider.exportApps(isAuto: true).then((value) { |  | ||||||
|             appsProvider.trimAutoExports(); |  | ||||||
|           }); |  | ||||||
|         } |  | ||||||
|       }); |       }); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -337,36 +337,19 @@ class _ImportExportPageState extends State<ImportExportPage> { | |||||||
|                             GeneratedForm( |                             GeneratedForm( | ||||||
|                                 items: [ |                                 items: [ | ||||||
|                                   [ |                                   [ | ||||||
|                                     GeneratedFormTextField( |                                     GeneratedFormSwitch( | ||||||
|                                         'autoExportOnUpdateCheckKeepNum', |                                       'autoExportOnChanges', | ||||||
|                                         label: tr( |                                       label: tr('autoExportOnChanges'), | ||||||
|                                             'autoExportOnUpdateCheckKeepNum'), |                                       defaultValue: | ||||||
|                                         required: false, |                                           settingsProvider.autoExportOnChanges, | ||||||
|                                         defaultValue: settingsProvider |                                     ) | ||||||
|                                             .autoExportOnUpdateCheckKeepNum |  | ||||||
|                                             .toString(), |  | ||||||
|                                         textInputType: const TextInputType |  | ||||||
|                                             .numberWithOptions(), |  | ||||||
|                                         additionalValidators: [ |  | ||||||
|                                           (value) { |  | ||||||
|                                             value ??= settingsProvider |  | ||||||
|                                                 .autoExportOnUpdateCheckKeepNum |  | ||||||
|                                                 .toString(); |  | ||||||
|                                             return intValidator(value, |  | ||||||
|                                                 positive: true); |  | ||||||
|                                           } |  | ||||||
|                                         ]) |  | ||||||
|                                   ] |                                   ] | ||||||
|                                 ], |                                 ], | ||||||
|                                 onValueChanges: (value, valid, isBuilding) { |                                 onValueChanges: (value, valid, isBuilding) { | ||||||
|                                   if (valid && !isBuilding) { |                                   if (valid && !isBuilding) { | ||||||
|                                     if (value[ |                                     if (value['autoExportOnChanges'] != null) { | ||||||
|                                             'autoExportOnUpdateCheckKeepNum'] != |                                       settingsProvider.autoExportOnChanges = | ||||||
|                                         null) { |                                           value['autoExportOnChanges'] == true; | ||||||
|                                       settingsProvider |  | ||||||
|                                               .autoExportOnUpdateCheckKeepNum = |  | ||||||
|                                           int.parse(value[ |  | ||||||
|                                               'autoExportOnUpdateCheckKeepNum']); |  | ||||||
|                                     } |                                     } | ||||||
|                                   } |                                   } | ||||||
|                                 }), |                                 }), | ||||||
|   | |||||||
| @@ -16,7 +16,6 @@ import 'package:device_info_plus/device_info_plus.dart'; | |||||||
| import 'package:easy_localization/easy_localization.dart'; | import 'package:easy_localization/easy_localization.dart'; | ||||||
| import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||||
| import 'package:flutter/services.dart'; | import 'package:flutter/services.dart'; | ||||||
| import 'package:obtainium/app_sources/html.dart'; |  | ||||||
| import 'package:obtainium/components/generated_form.dart'; | import 'package:obtainium/components/generated_form.dart'; | ||||||
| import 'package:obtainium/components/generated_form_modal.dart'; | import 'package:obtainium/components/generated_form_modal.dart'; | ||||||
| import 'package:obtainium/custom_errors.dart'; | import 'package:obtainium/custom_errors.dart'; | ||||||
| @@ -917,6 +916,7 @@ class AppsProvider with ChangeNotifier { | |||||||
|       } |       } | ||||||
|     } |     } | ||||||
|     notifyListeners(); |     notifyListeners(); | ||||||
|  |     await exportApps(isAuto: true); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   Future<void> removeApps(List<String> appIds) async { |   Future<void> removeApps(List<String> appIds) async { | ||||||
| @@ -938,6 +938,7 @@ class AppsProvider with ChangeNotifier { | |||||||
|     } |     } | ||||||
|     if (appIds.isNotEmpty) { |     if (appIds.isNotEmpty) { | ||||||
|       notifyListeners(); |       notifyListeners(); | ||||||
|  |       await exportApps(isAuto: true); | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
| @@ -1097,6 +1098,17 @@ class AppsProvider with ChangeNotifier { | |||||||
|   Future<String?> exportApps({bool pickOnly = false, isAuto = false}) async { |   Future<String?> exportApps({bool pickOnly = false, isAuto = false}) async { | ||||||
|     if (isAuto) { |     if (isAuto) { | ||||||
|       logs.add('Started auto-export.'); |       logs.add('Started auto-export.'); | ||||||
|  |       var exportDir = settingsProvider.exportDir; | ||||||
|  |       if (exportDir != null) { | ||||||
|  |         var files = await saf.listFiles(exportDir, | ||||||
|  |             columns: [saf.DocumentFileColumn.id]).toList(); | ||||||
|  |         if (files.isNotEmpty) { | ||||||
|  |           for (var f in files) { | ||||||
|  |             saf.delete(f.uri); | ||||||
|  |           } | ||||||
|  |           logs.add('Previous auto-export deleted.'); | ||||||
|  |         } | ||||||
|  |       } | ||||||
|     } |     } | ||||||
|     var exportDir = settingsProvider.exportDir; |     var exportDir = settingsProvider.exportDir; | ||||||
|     if (exportDir == null || pickOnly) { |     if (exportDir == null || pickOnly) { | ||||||
| @@ -1122,32 +1134,6 @@ class AppsProvider with ChangeNotifier { | |||||||
|     return returnPath; |     return returnPath; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   Future<void> trimAutoExports() async { |  | ||||||
|     var exportDir = settingsProvider.exportDir; |  | ||||||
|     if (exportDir != null) { |  | ||||||
|       var files = await saf |  | ||||||
|           .listFiles(exportDir, columns: [saf.DocumentFileColumn.id]).toList(); |  | ||||||
|       var maxCount = settingsProvider.autoExportOnUpdateCheckKeepNum; |  | ||||||
|       if (files.length > maxCount) { |  | ||||||
|         files.sort((a, b) { |  | ||||||
|           if (a.name == null) { |  | ||||||
|             return -1; |  | ||||||
|           } else if (b.name == null) { |  | ||||||
|             return 1; |  | ||||||
|           } else { |  | ||||||
|             return compareAlphaNumeric(a.name!, b.name!); |  | ||||||
|           } |  | ||||||
|         }); |  | ||||||
|         files = files.reversed.toList(); |  | ||||||
|         logs.add( |  | ||||||
|             'Deleting auto-exports older than ${files[maxCount - 1].uri.pathSegments.last}.'); |  | ||||||
|         files.sublist(maxCount).forEach((f) { |  | ||||||
|           saf.delete(f.uri); |  | ||||||
|         }); |  | ||||||
|       } |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|   Future<int> importApps(String appsJSON) async { |   Future<int> importApps(String appsJSON) async { | ||||||
|     List<App> importedApps = (jsonDecode(appsJSON) as List<dynamic>) |     List<App> importedApps = (jsonDecode(appsJSON) as List<dynamic>) | ||||||
|         .map((e) => App.fromJson(e)) |         .map((e) => App.fromJson(e)) | ||||||
| @@ -1431,10 +1417,6 @@ Future<void> bgUpdateCheck(int taskId, Map<String, dynamic>? params) async { | |||||||
|       if (toNotify.isNotEmpty) { |       if (toNotify.isNotEmpty) { | ||||||
|         notificationsProvider.notify(UpdateNotification(toNotify)); |         notificationsProvider.notify(UpdateNotification(toNotify)); | ||||||
|       } |       } | ||||||
|       if (appsProvider.settingsProvider.autoExportOnUpdateCheckKeepNum > 0) { |  | ||||||
|         await appsProvider.exportApps(isAuto: true); |  | ||||||
|         await appsProvider.trimAutoExports(); |  | ||||||
|       } |  | ||||||
|     } |     } | ||||||
|     // If you're done checking and found some silently installable updates, schedule another task which will run in install mode |     // If you're done checking and found some silently installable updates, schedule another task which will run in install mode | ||||||
|     if (didCompleteChecking && toInstall.isNotEmpty) { |     if (didCompleteChecking && toInstall.isNotEmpty) { | ||||||
|   | |||||||
| @@ -391,12 +391,12 @@ class SettingsProvider with ChangeNotifier { | |||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   int get autoExportOnUpdateCheckKeepNum { |   bool get autoExportOnChanges { | ||||||
|     return prefs?.getInt('autoExportOnUpdateCheckKeepNum') ?? 0; |     return prefs?.getBool('autoExportOnChanges') ?? false; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   set autoExportOnUpdateCheckKeepNum(int val) { |   set autoExportOnChanges(bool val) { | ||||||
|     prefs?.setInt('autoExportOnUpdateCheckKeepNum', val); |     prefs?.setBool('autoExportOnChanges', val); | ||||||
|     notifyListeners(); |     notifyListeners(); | ||||||
|   } |   } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -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 | # 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 | # 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. | # of the product and file versions while build-number is used as the build suffix. | ||||||
| version: 0.14.12+204 # When changing this, update the tag in main() accordingly | version: 0.14.13+205 # When changing this, update the tag in main() accordingly | ||||||
|  |  | ||||||
| environment: | environment: | ||||||
|   sdk: '>=3.0.0 <4.0.0' |   sdk: '>=3.0.0 <4.0.0' | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user