MuntashirAkon/AppManager · error · IllegalArgumentException
Invalid boolean value
Error message
Invalid boolean value: ${rawValue} What it means
IntentCompat.parseExtraValue() parses boolean extras. When the raw value is not 'true'/'t'/'false'/'f', it falls back to IntegerCompat.decode(); if that also fails (NumberFormatException), it throws IllegalArgumentException('Invalid boolean value: ...').
Solutions
- Use 'true'/'false' (or 't'/'f', or an integer like 0/1) as the extra value
- Sanitize the source producing the value to emit canonical boolean strings
- Catch NumberFormatException/IAE at the parse boundary and surface a friendly message
Example fix
// before "--esb flag yes" // after "--esb flag true"
Defensive patterns
Strategy: validation
Validate before calling
if (!("true".equals(v) || "false".equals(v) || "t".equals(v) || "f".equals(v))) {
try { IntegerCompat.decode(v); } catch (NumberFormatException e) {
throw new IllegalArgumentException("Boolean extra must be true/false/t/f or integer: " + v);
}
} Try / catch
try {
boolValue = parseBooleanExtra(rawValue);
} catch (IllegalArgumentException e) {
boolValue = false; // or surface a parse error
} Prevention
- Emit booleans as canonical 'true'/'false' in intent strings
- Never rely on locale-specific boolean words ('yes'/'on')
- Add round-trip tests for every extra type
When it happens
Trigger: Providing a TYPE_BOOLEAN extra whose raw string is neither a recognized boolean word nor a decodable integer (e.g. 'yes', 'on', '1.0', empty).
Common situations: Hand-editing flattened intent strings; locale/scripting tools writing non-canonical booleans; copy-paste introducing stray characters.
Understand the failure class
Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.
Related errors
- Bad component name
- Could not mount
- Error occurred during en/decryption process
- Firewall overlays require Android 13+
- Flags must be returned by the corresponding subclasses. key
AI-assisted analysis of MuntashirAkon/AppManager@0152f468fc (2026-09-12).
Data as JSON: /api/errors/8dcf25f4aba25f22.
Report an issue: GitHub.
Appendix: source
Thrown at app/src/main/java/io/github/muntashirakon/AppManager/intercept/IntentCompat.java:261
// again for the regex, thus four escape characters become one.
String[] strings = rawValue.split("(?<!\\\\),");
ArrayList<String> list = new ArrayList<>(strings.length);
Collections.addAll(list, strings);
return list;
}
case TYPE_BOOLEAN: {
// Boolean.valueOf() results in false for anything that is not "true", which is
// error-prone in shell commands
boolean boolValue;
if ("true".equals(rawValue) || "t".equals(rawValue)) {
boolValue = true;
} else if ("false".equals(rawValue) || "f".equals(rawValue)) {
boolValue = false;
} else {
try {
boolValue = IntegerCompat.decode(rawValue) != 0;
} catch (NumberFormatException ex) {
throw new IllegalArgumentException("Invalid boolean value: " + rawValue);
}
}
return boolValue;
}
default:
throw new IllegalArgumentException("Unknown type: " + type);
}
}
@Nullable
private static Pair<Integer, String> valueToParsableStringAndType(@Nullable Object object) {
if (object == null) {
return new Pair<>(TYPE_NULL, null);
} else if (object instanceof String) {
return new Pair<>(TYPE_STRING, (String) object);
} else if (object instanceof Integer) {
return new Pair<>(TYPE_INTEGER, String.valueOf((int) object));
} else if (object instanceof Long) {View on GitHub (pinned to 0152f468fc)