MuntashirAkon/AppManager · error · IllegalArgumentException

Invalid format: isHidden not found

Error message

Invalid format: isHidden not found

What it means

MagiskHideRule's constructor parses the isHidden (enabled) boolean from the flattened rule string. When the StringTokenizer is exhausted before that token, it throws this IllegalArgumentException, since a MAGISK_HIDE rule requires the isHidden field.

Solutions

  1. Add the boolean isHidden token to the flattened MAGISK_HIDE rule string
  2. Validate the expected token count before parsing
  3. Re-export rules with the current AppManager version for the correct format
  4. Wrap parsing in try-catch and skip malformed lines on import

Example fix

// before
new MagiskHideRule(pkg, proc, new StringTokenizer("com.example\tcom.example")); // throws
// after
new MagiskHideRule(pkg, proc, new StringTokenizer("com.example\tcom.example\ttrue\tfalse"));
Defensive patterns

Strategy: try-catch

Validate before calling

String[] p = line.split("\t");
if (p.length < 3) throw new IllegalArgumentException("MAGISK_HIDE rule needs isHidden");
Boolean.parseBoolean(p[2]);

Type guard

boolean isParsableHideRule(String line) { String[] p = line.split("\t"); return p.length >= 3 && (p[2].equals("true") || p[2].equals("false")); }

Try / catch

try { new MagiskHideRule(pkg, proc, tokenizer); } catch (IllegalArgumentException e) { reportInvalid(line); }

Prevention

When it happens

Trigger: new MagiskHideRule(packageName, processName, tokenizer) called with fewer than the required tokens remaining, i.e. the string ends after the package/process name parts.

Common situations: Legacy Magisk Hide rule files missing newer fields, manually edited rules files, or split() producing fewer tokens than expected due to delimiter mismatches.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


AI-assisted analysis of MuntashirAkon/AppManager@0152f468fc (2026-09-12). Data as JSON: /api/errors/8788d9c5b2e2a301. Report an issue: GitHub.

Appendix: source

Thrown at app/src/main/java/io/github/muntashirakon/AppManager/rules/struct/MagiskHideRule.java:29

import io.github.muntashirakon.AppManager.rules.RuleType;

public class MagiskHideRule extends RuleEntry {
    @NonNull
    private final MagiskProcess mMagiskProcess;

    public MagiskHideRule(@NonNull MagiskProcess magiskProcess) {
        super(magiskProcess.packageName, magiskProcess.name, RuleType.MAGISK_HIDE);
        mMagiskProcess = magiskProcess;
    }

    public MagiskHideRule(@NonNull String packageName, @NonNull String processName, @NonNull StringTokenizer tokenizer)
            throws IllegalArgumentException {
        super(packageName, processName.equals(STUB) ? packageName : processName, RuleType.MAGISK_HIDE);
        mMagiskProcess = new MagiskProcess(packageName, name); // name cannot be STUB
        mMagiskProcess.setAppZygote(name.endsWith("_zygote"));
        if (tokenizer.hasMoreElements()) {
            mMagiskProcess.setEnabled(Boolean.parseBoolean(tokenizer.nextElement().toString()));
        } else throw new IllegalArgumentException("Invalid format: isHidden not found");
        if (tokenizer.hasMoreElements()) {
            mMagiskProcess.setIsolatedProcess(Boolean.parseBoolean(tokenizer.nextElement().toString()));
        }
    }

    @NonNull
    public MagiskProcess getMagiskProcess() {
        return mMagiskProcess;
    }

    @NonNull
    @Override
    public String toString() {
        return "MagiskHideRule{" +
                "packageName='" + packageName + '\'' +
                "processName='" + name + '\'' +
                ", isHidden=" + mMagiskProcess.isEnabled() +
                ", isIsolated=" + mMagiskProcess.isIsolatedProcess() +

View on GitHub (pinned to 0152f468fc)