-
-
Notifications
You must be signed in to change notification settings - Fork 430
Setup
Information about different SD Maid SE setup steps.
// TODO
// TODO
SD Maid uses the Android Storage Access framework (SAF) to gain access to additional storage areas. SD Maid will ask you to grant access to specific paths that are not accessible by just having the "Manage storage" permission (Just Android Things™️).
- Press the
Grant access
button - A new window opens
- If the correct path is already selected, otherwise you have to navigate to the path that SD Maid wants.
- Then press the
Use this folder
button, the setup entry for this path will unlock and be colored green.
Repeat this process until all paths are green.
For when things don't go as planned.
Granting access to paths via the Storage Access Framework requires an app that lets the user confirm the paths to which access will be granted. This app is the "Documents" app. It's a system app that is built into every Android device since Android 5.0 (com.android.documentsui
or com.google.android.documentsui
). If you get this error, then either someone deleted or disabled this app. In most cases someone ran an overzealous "de-bloating" tool that disabled it. You can re-enable it via ADB:
adb shell pm enable com.android.documentsui
or
adb shell pm enable com.google.android.documentsui
If the window used to grant access to paths is empty, then your external storage provider package (com.android.externalstorage
) is maybe disabled (likely through an overzealous "de-bloating tool). You can re-enable it via ADB:
adb shell pm enable com.android.externalstorage
// TODO
The accessibility service allows SD Maid to interact with your device like a human, i.e. viewing the screen and pressing buttons. SD Maid can use it to automate tedious actions like pressing "Clear cache" on hundreds of apps. The accessibility service is a service that the app itself can not launch, it must be launched by the system, because this type of service grants an app additional access to your device.
The service may stop running and require you to enable it again in various circumstances:
- You update the app.
- The app crashes. If this happens you should report this as a bug. If this happens too often you may not be able to restart it by turning it off/on again until the device is rebooted.
- The system kills the app due to overly aggressive "battery optimizations" (also see https://dontkillmyapp.com/)
Some ROMs (e.g. MIUI) are notorious for aggressively stopping everything that is not whitelisted by the device manufacturer. If you are constantly asked to re-enable the accessibility service then the system may be disabling it every time SD Maid is not in active use.
Try to disable battery optimisations and on MIUI ROMs there is an extra setting called "Autostart" enable that for SD Maid.
You can also consider granting additional permission that allow SD Maid to restart the service automatically.
If your device doesn't have a way to enable accessibility services via screen (e.g. a TV device), it's possible to enable the service using ADB by running:
adb shell settings put secure enabled_accessibility_services eu.darken.sdmse/.automation.core.AutomationService
Note: This is an advanced technique and targeted towards power users.
You can grant an additional permission that allows SD Maid to restart the service on its own.
The permission is called WRITE_SECURE_SETTINGS
and can only be granted via ADB.
If you have this set up, run this command to grant the permission:
adb shell pm grant eu.darken.sdmse android.permission.WRITE_SECURE_SETTINGS
With this permission granted, SD Maid can use the command described here to enable the service when necessary. SD Maid will only use this if you have enabled the accessibility service at least once manually. If you go into setup again and tell SD Maid to not use the accessibility service, then this automatic restart technique will not be used until you manually enable the accessibility service again.
To remove this permission from SD Maid again, use this command:
adb shell pm revoke eu.darken.sdmse android.permission.WRITE_SECURE_SETTINGS
Android 13+ may apply additional restrictions to apps that have been side-loaded. So if SD Maid is not installed from a known (to Google) source like Google Play or other app stores, then you from may not be able to directly grant some permissions to SD Maid, e.g. start an accessibility service.
To lift these restrictions open SD Maids app settings screen in the system. Open the menu in the top right corner and select Allow restricted settings
, afterwards you can go back to the list of accessibility services and enable SD Maid's service.
Note: To improve usability (this is sarcasm), Google decided that this setting will only be visible if:
- You at least saw the "Restricted setting" once after clicking SD Maids accessibility service entry
- You have opened the system settings and navigated to SD Maid's settings page by hand, and not through another app or shortcuts.
😮💨
Some additional background info can be found here.
// TODO
// TODO