From 53677e2f397549e96d89103f2431c3e34ac5cdf3 Mon Sep 17 00:00:00 2001 From: KobeW50 <84587632+KobeW50@users.noreply.github.com> Date: Sun, 15 Oct 2023 13:14:19 -0400 Subject: [PATCH 1/3] fix: typo in reset patch selection dialog (#1387) --- assets/i18n/en_US.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/i18n/en_US.json b/assets/i18n/en_US.json index 9185c6d0..aa514089 100644 --- a/assets/i18n/en_US.json +++ b/assets/i18n/en_US.json @@ -254,7 +254,7 @@ "resetStoredPatchesLabel": "Reset patch selection", "resetStoredPatchesHint": "Reset the stored patch selection", "resetStoredPatchesDialogTitle": "Reset patch selection?", - "resetStoredPatchesDialogText": "The default selection of patches will be restored..", + "resetStoredPatchesDialogText": "The default selection of patches will be restored.", "resetStoredPatches": "Patch selection has been reset", "resetStoredOptionsLabel": "Reset patch options", From 59adb91f5f5ebcb01f5288f0da5b2b23ab856801 Mon Sep 17 00:00:00 2001 From: Ushie Date: Sun, 15 Oct 2023 20:16:58 +0300 Subject: [PATCH 2/3] fix(settings): inverted version compatibility switch --- lib/services/manager_api.dart | 2 +- lib/ui/views/patcher/patcher_viewmodel.dart | 12 +++++++----- .../patches_selector_viewmodel.dart | 9 ++++++--- .../widgets/patchesSelectorView/patch_item.dart | 17 ++++++++++------- 4 files changed, 24 insertions(+), 16 deletions(-) diff --git a/lib/services/manager_api.dart b/lib/services/manager_api.dart index ad306761..6850c31d 100644 --- a/lib/services/manager_api.dart +++ b/lib/services/manager_api.dart @@ -677,7 +677,7 @@ class ManagerAPI { Future> getDefaultPatches() async { final List patches = await getPatches(); final List defaultPatches = []; - if (isVersionCompatibilityCheckEnabled() == false) { + if (isVersionCompatibilityCheckEnabled() == true) { defaultPatches.addAll( patches .where( diff --git a/lib/ui/views/patcher/patcher_viewmodel.dart b/lib/ui/views/patcher/patcher_viewmodel.dart index ec7d8128..95244c6d 100644 --- a/lib/ui/views/patcher/patcher_viewmodel.dart +++ b/lib/ui/views/patcher/patcher_viewmodel.dart @@ -80,7 +80,8 @@ class PatcherViewModel extends BaseViewModel { } bool checkRequiredPatchOption(BuildContext context) { - if (getNullRequiredOptions(selectedPatches, selectedApp!.packageName).isNotEmpty) { + if (getNullRequiredOptions(selectedPatches, selectedApp!.packageName) + .isNotEmpty) { showRequiredOptionDialog(context); return false; } @@ -190,7 +191,7 @@ class PatcherViewModel extends BaseViewModel { this.selectedPatches.clear(); this.selectedPatches.addAll(patches.where((patch) => !patch.excluded)); } - if (!_managerAPI.isVersionCompatibilityCheckEnabled()) { + if (_managerAPI.isVersionCompatibilityCheckEnabled()) { this.selectedPatches.removeWhere((patch) => !isPatchSupported(patch)); } if (!_managerAPI.areUniversalPatchesEnabled()) { @@ -199,11 +200,12 @@ class PatcherViewModel extends BaseViewModel { .removeWhere((patch) => patch.compatiblePackages.isEmpty); } final usedPatches = _managerAPI.getUsedPatches(selectedApp!.packageName); - for (final patch in usedPatches){ - if (!patches.any((p) => p.name == patch.name)){ + for (final patch in usedPatches) { + if (!patches.any((p) => p.name == patch.name)) { removedPatches.add('• ${patch.name}'); for (final option in patch.options) { - _managerAPI.clearPatchOption(selectedApp!.packageName, patch.name, option.key); + _managerAPI.clearPatchOption( + selectedApp!.packageName, patch.name, option.key); } } } diff --git a/lib/ui/views/patches_selector/patches_selector_viewmodel.dart b/lib/ui/views/patches_selector/patches_selector_viewmodel.dart index 6719cdce..29b670ca 100644 --- a/lib/ui/views/patches_selector/patches_selector_viewmodel.dart +++ b/lib/ui/views/patches_selector/patches_selector_viewmodel.dart @@ -169,7 +169,7 @@ class PatchesSelectorViewModel extends BaseViewModel { .where( (element) => !element.excluded && - (_managerAPI.isVersionCompatibilityCheckEnabled() || + (!_managerAPI.isVersionCompatibilityCheckEnabled() || isPatchSupported(element)), ), ); @@ -209,7 +209,10 @@ class PatchesSelectorViewModel extends BaseViewModel { query.isEmpty || query.length < 2 || patch.name.toLowerCase().contains(query.toLowerCase()) || - patch.name.replaceAll(RegExp(r'[^\w\s]+'), '').toLowerCase().contains(query.toLowerCase()), + patch.name + .replaceAll(RegExp(r'[^\w\s]+'), '') + .toLowerCase() + .contains(query.toLowerCase()), ) .toList(); if (_managerAPI.areUniversalPatchesEnabled()) { @@ -281,7 +284,7 @@ class PatchesSelectorViewModel extends BaseViewModel { this.selectedPatches.addAll( patches.where((patch) => selectedPatches.contains(patch.name)), ); - if (!_managerAPI.isVersionCompatibilityCheckEnabled()) { + if (_managerAPI.isVersionCompatibilityCheckEnabled()) { this.selectedPatches.removeWhere((patch) => !isPatchSupported(patch)); } } else { diff --git a/lib/ui/widgets/patchesSelectorView/patch_item.dart b/lib/ui/widgets/patchesSelectorView/patch_item.dart index c5ff5974..92fe1454 100644 --- a/lib/ui/widgets/patchesSelectorView/patch_item.dart +++ b/lib/ui/widgets/patchesSelectorView/patch_item.dart @@ -48,12 +48,13 @@ class _PatchItemState extends State { Widget build(BuildContext context) { widget.isSelected = widget.isSelected && (!widget.isUnsupported || - widget._managerAPI.isVersionCompatibilityCheckEnabled()) && !widget.hasUnsupportedPatchOption; + !widget._managerAPI.isVersionCompatibilityCheckEnabled()) && + !widget.hasUnsupportedPatchOption; return Padding( padding: const EdgeInsets.symmetric(vertical: 4.0), child: Opacity( opacity: widget.isUnsupported && - widget._managerAPI.isVersionCompatibilityCheckEnabled() == false + widget._managerAPI.isVersionCompatibilityCheckEnabled() == true ? 0.5 : 1, child: CustomCard( @@ -65,7 +66,7 @@ class _PatchItemState extends State { ), onTap: () { if (widget.isUnsupported && - !widget._managerAPI.isVersionCompatibilityCheckEnabled()) { + widget._managerAPI.isVersionCompatibilityCheckEnabled()) { widget.isSelected = false; widget.toast.showBottom('patchItem.unsupportedPatchVersion'); } else if (widget.isChangeEnabled) { @@ -79,7 +80,7 @@ class _PatchItemState extends State { setState(() {}); } if (!widget.isUnsupported || - widget._managerAPI.isVersionCompatibilityCheckEnabled()) { + !widget._managerAPI.isVersionCompatibilityCheckEnabled()) { widget.onChanged(widget.isSelected); } }, @@ -98,7 +99,8 @@ class _PatchItemState extends State { ), onChanged: (newValue) { if (widget.isUnsupported && - !widget._managerAPI.isVersionCompatibilityCheckEnabled()) { + widget._managerAPI + .isVersionCompatibilityCheckEnabled()) { widget.isSelected = false; widget.toast.showBottom( 'patchItem.unsupportedPatchVersion', @@ -114,7 +116,8 @@ class _PatchItemState extends State { setState(() {}); } if (!widget.isUnsupported || - widget._managerAPI.isVersionCompatibilityCheckEnabled()) { + !widget._managerAPI + .isVersionCompatibilityCheckEnabled()) { widget.onChanged(widget.isSelected); } }, @@ -154,7 +157,7 @@ class _PatchItemState extends State { runSpacing: 4, children: [ if (widget.isUnsupported && - widget._managerAPI + !widget._managerAPI .isVersionCompatibilityCheckEnabled()) Padding( padding: const EdgeInsets.only(top: 8), From 6a12e8f37aefb38d82409407fdb6584b0716fa4b Mon Sep 17 00:00:00 2001 From: Ushie Date: Sun, 15 Oct 2023 20:19:23 +0300 Subject: [PATCH 3/3] build: bump version to v1.13.1 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index a608f031..93a4fad4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,7 @@ homepage: https://github.com/revanced/revanced-manager publish_to: 'none' -version: 1.13.0+101300000 +version: 1.13.1+101300100 environment: sdk: '>=3.0.0 <4.0.0'