From c188479f88f3bd0a0225e1c980caa323504090ee Mon Sep 17 00:00:00 2001 From: 0x192 Date: Tue, 18 Jan 2022 03:40:51 +0100 Subject: [PATCH] Fix critical bug preventing any action with older devices (< Android 8.0) I don't know what happened. This is a nasty bug! (and there is actually 2 bugs in the if condition) It will help #78 --- CHANGELOG.md | 1 + src/gui/widgets/package_row.rs | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 229dc2a5f..3a412d28d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ and `Removed`. - Miscellaneous minor issues in some package descriptions. - Several bad recommendations. - [[#50](https://github.com/0x192/universal-android-debloater/issues/50)] Resync button flipping theme back to `Lupin`. +- [Regression ([048e7f](https://github.com/0x192/universal-android-debloater/commit/048e7fc8fd6d44b0e8ba933c289249366254a9cc))] Weird disabled/greyed action button with older devices (< Android 8.0). Package could be selected but no action was performed. ## [0.3] - 2021-10-10 diff --git a/src/gui/widgets/package_row.rs b/src/gui/widgets/package_row.rs index c3f9263a4..165e9c08e 100644 --- a/src/gui/widgets/package_row.rs +++ b/src/gui/widgets/package_row.rs @@ -52,7 +52,7 @@ impl PackageRow { Command::none() } - pub fn view(&mut self, settings: &Settings, phone: &Phone) -> Element { + pub fn view(&mut self, settings: &Settings, _phone: &Phone) -> Element { //let trash_svg = format!("{}/resources/assets/trash.svg", env!("CARGO_MANIFEST_DIR")); //let restore_svg = format!("{}/resources/assets/rotate.svg", env!("CARGO_MANIFEST_DIR")); let button_style; @@ -83,9 +83,10 @@ impl PackageRow { warn!("Incredible! Something impossible happenned!"); } } - - if (self.state != PackageState::Uninstalled && settings.phone.expert_mode) - || (self.removal != Removal::Unsafe && phone.android_sdk >= 26) + // Disable any removal action for unsafe packages if expert_mode is disabled + if self.removal != Removal::Unsafe + || self.state != PackageState::Enabled + || settings.phone.expert_mode { selection_checkbox = Checkbox::new(self.selected, "", Message::ToggleSelection) .style(style::SelectionCheckBox::Enabled(settings.theme.palette));