Exclusions

Matthias Urhahn edited this page Sep 21, 2016 · 5 revisions

Exclusions

Exclusions exclude items from SD Maids tools.

Creating exclusions

Note: For a new exclusion to take effect, the tool it should be applied to has to be refreshed.

Directly from results

The easiest way to create an exclusion is to long press the item you want to exclude, in the tool where you don't want to see it again. Select it and choose "Exclusion" from the context menu. SD Maid will fill in all necessary details.

By browsing to it

You can do the same through locating the file in SD Maids Explorer, which also offers such an action when selecting a file. Note that SD Maid will make it a global exclusion if you don't change it.

Manually

Alternatively you can manually create an exclusion by venturing the ExclusionManager, which you can find at the bottom of the navigation drawer.

Exclusion types

Simple

The simple exclusions is the type you get when you create a new exclusion. It matches if the input text contains the exclusion text. Example: A simple exclusion with the text /Cake/ would match /tasty/Cake/Strawberry. Matching is case-sensitive.

Regex

A regex exclusion allows you to exclude items based on a regular expression. It matches if the regular expression matches the input text. To switch from simple to regex exclusion, choose the respective option in the toolbar during exclusion creation. Note: As exclusions are checked for thousands of files. Many exclusions of this type or inefficient regular expressions can significantly slow down operations. A handy site to play with regular expressions is regex101.

Modifying exclusions

Exclusions can be deleted or modified by tapping an entry in the ExclusionManager or by trying to create an exclusion that matches an already existing exclusion. Note: For changed exclusions to take effect, the tool it should be applied to has to be refreshed.

Effect on tools

Exclusions are applied during the SCAN phase of each tool. If modified your exclusions you have to refresh the tools data in order for the new exclusions to take effect. How an exclusion takes effect depends on the tool:

  • Searcher: Applied to each items filepath
  • AppControl: Applied to each apps packagename and appname
  • CorpseFinder: Applied to each items filepath
  • SystemCleaner: Applied to each items filepath
  • AppCleaner: Applied to each items filepath, packagename and appname
  • Duplicates: Applied to each items filepath
  • Databases: Applied to each files filepath and _packagename
  • LastModified: Applied to each items filepath

Importing/Exporting

Exclusions can be imported/exported in form of JSON files. Each file may hold multiple exclusions. Format example:

{
    "version": 4,
    "exclusions": [
        {
            "type": "SIMPLE_CONTAINS",
            "tags": [
                "SYSTEMCLEANER",
                "APPCLEANER",
                "DATABASES"
            ],
            "contains_string": "com.android.systemui"
        },
        {
            "type": "REGEX",
            "tags": [
                "SYSTEMCLEANER",
                "APPCLEANER",
                "DATABASES"
            ],
            "regex_string": "^(?>eu\\.thedarken\\.sdm)$"
        }
    ]
}

Default exclusions

SD Maid already comes with a set of default exclusions for items. Some of these are locked, meaning that you can remove them (e.g. SD Maid excluding itself), other can be removed. Only remove default exclusions if you know what you are doing. Example:

  • com.android.systemui is a non-locked default exclusion. If the app is running (which the system UI always is) SD Maid has to kill it before working on it. While not critical, killing the system UI can lead to soft-reboot which can lead other apps to malfunction. As the system UI doesn't offer much to do for SD Maid anyways, a default exclusion was added for it.