-
-
Notifications
You must be signed in to change notification settings - Fork 476
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Core: Check and handle invalid app inventory data on Samsung devices
`QUERY_ALL_PACKAGES` is a permission that is automatically granted, at least according to documentation. Except, of course, on some Samsung devices running Android 14, because why not do things differently... This PR prevents SD Maid from crashing in these cases. A specific error is shown. The state is now detected and treated as a permission error and will show as incomplete-setup. Fixes #1354
- Loading branch information
Showing
40 changed files
with
339 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 0 additions & 5 deletions
5
app-common-io/src/main/java/eu/darken/sdmse/common/pkgs/pkgops/IllegalPkgDataException.kt
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
app-common-pkgs/src/main/java/eu/darken/sdmse/common/pkgs/InvalidPkgInventoryException.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package eu.darken.sdmse.common.pkgs | ||
|
||
import eu.darken.sdmse.common.ca.toCaString | ||
import eu.darken.sdmse.common.error.HasLocalizedError | ||
import eu.darken.sdmse.common.error.LocalizedError | ||
|
||
class InvalidPkgInventoryException( | ||
override val message: String | ||
) : IllegalStateException(), HasLocalizedError { | ||
|
||
override fun getLocalizedError(): LocalizedError = LocalizedError( | ||
throwable = this, | ||
label = R.string.pkgrepo_invalid_inventory_error_title.toCaString(), | ||
description = R.string.pkgrepo_invalid_inventory_error_description.toCaString(), | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<resources> | ||
<string name="pkgrepo_invalid_inventory_error_title">Invalid app inventory</string> | ||
<string name="pkgrepo_invalid_inventory_error_description">The system provided an invalid list of installed apps to SD Maid.</string> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.