Skip to content

Commit

Permalink
Fix critical bug preventing any action with older devices (< Android …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
0x192 committed Jan 18, 2022
1 parent d840934 commit c188479
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 5 additions & 4 deletions src/gui/widgets/package_row.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl PackageRow {
Command::none()
}

pub fn view(&mut self, settings: &Settings, phone: &Phone) -> Element<Message> {
pub fn view(&mut self, settings: &Settings, _phone: &Phone) -> Element<Message> {
//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;
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit c188479

Please sign in to comment.