Clarify settings screen with per-feature explanations

Checkbox labels like "Accessibility services" read as status, not action —
unclear whether checking it meant "hide this" or something else. Replaces
the flat label map with a label + one-line description per feature, and
adds a short caption on each app card spelling out what checking a box
actually does.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Claude Sonnet 5
2026-08-06 21:46:16 +06:00
parent 2f6065cc8b
commit b6cc511423
2 changed files with 42 additions and 12 deletions
@@ -1,5 +1,7 @@
package space.bdeshi.veil
data class FeatureInfo(val label: String, val description: String)
object Features {
const val PREFS_NAME = "veil_prefs"
const val KEY_PREFIX = "features_"
@@ -21,13 +23,31 @@ object Features {
BUILD_TAGS,
)
val LABELS: LinkedHashMap<String, String> = linkedMapOf(
ACCESSIBILITY to "Accessibility services",
ADB to "USB / wireless debugging",
DEV_OPTIONS to "Developer options enabled",
MOCK_LOCATION to "Mock location (legacy flag only)",
ROOT_APPS to "Root/manager apps (PackageManager)",
BUILD_TAGS to "Build tags/type (test-keys, userdebug)",
val INFO: LinkedHashMap<String, FeatureInfo> = linkedMapOf(
ACCESSIBILITY to FeatureInfo(
"Hide accessibility services",
"This app will see zero accessibility services running, even if you have some enabled.",
),
ADB to FeatureInfo(
"Hide USB / wireless debugging",
"This app will see debugging as off, regardless of your actual setting.",
),
DEV_OPTIONS to FeatureInfo(
"Hide developer options",
"This app will see Developer Options as disabled.",
),
MOCK_LOCATION to FeatureInfo(
"Hide mock location (legacy flag)",
"Only covers the old pre-Android-6 system flag — modern per-app mock location isn't covered.",
),
ROOT_APPS to FeatureInfo(
"Hide root / manager apps",
"Apps in the \"hidden packages\" list below become invisible to this app's PackageManager lookups.",
),
BUILD_TAGS to FeatureInfo(
"Hide test-keys / userdebug build",
"This app will see build tags as release-keys/user instead of your real build.",
),
)
val DEFAULT_HIDDEN_PACKAGES: Set<String> = setOf(
@@ -74,9 +74,9 @@ class SettingsActivity : Activity() {
setPadding(0, dp(24), 0, dp(4))
})
root.addView(TextView(this).apply {
text = "Used by the \"Root/manager apps\" toggle above — apps in this list become " +
"invisible to getPackageInfo/getInstalledPackages for any target app with that " +
"toggle on."
text = "Used by the \"Hide root / manager apps\" checkbox above — apps in this list " +
"become invisible to PackageManager lookups for any target app with that box " +
"checked."
setPadding(0, 0, 0, dp(8))
})
@@ -154,10 +154,15 @@ class SettingsActivity : Activity() {
textSize = 16f
setTypeface(typeface, Typeface.BOLD)
})
card.addView(TextView(this).apply {
text = "Checking a box below hides that thing from this app specifically — it stays " +
"on for every other app."
setPadding(0, 0, 0, dp(8))
})
for ((id, label) in Features.LABELS) {
for ((id, info) in Features.INFO) {
card.addView(CheckBox(this).apply {
text = label
text = info.label
isChecked = id in enabled
setOnCheckedChangeListener { _, isChecked ->
val current = (prefs.getStringSet(Features.keyFor(pkg), Features.ALL) ?: Features.ALL).toMutableSet()
@@ -166,6 +171,11 @@ class SettingsActivity : Activity() {
fixPermissions()
}
})
card.addView(TextView(this).apply {
text = info.description
textSize = 13f
setPadding(dp(32), 0, 0, dp(8))
})
}
card.addView(Button(this).apply {