{"record":{"id":"759cdd7690294cdf","repo":"MuntashirAkon/AppManager","slug":"invalid-format-ssaid-not-found","errorCode":null,"errorMessage":"Invalid format: ssaid not found","messagePattern":"Invalid format: ssaid not found","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/io/github/muntashirakon/AppManager/rules/struct/SsaidRule.java","lineNumber":25,"sourceCode":"import java.util.Objects;\nimport java.util.StringTokenizer;\n\nimport io.github.muntashirakon.AppManager.rules.RuleType;\n\npublic class SsaidRule extends RuleEntry {\n    @NonNull\n    private String mSsaid;\n\n    public SsaidRule(@NonNull String packageName, @NonNull String ssaid) {\n        super(packageName, STUB, RuleType.SSAID);\n        mSsaid = ssaid;\n    }\n\n    public SsaidRule(@NonNull String packageName, @NonNull StringTokenizer tokenizer) {\n        super(packageName, STUB, RuleType.SSAID);\n        if (tokenizer.hasMoreElements()) {\n            mSsaid = tokenizer.nextElement().toString();\n        } else throw new IllegalArgumentException(\"Invalid format: ssaid not found\");\n    }\n\n    @NonNull\n    public String getSsaid() {\n        return mSsaid;\n    }\n\n    public void setSsaid(@NonNull String ssaid) {\n        mSsaid = ssaid;\n    }\n\n    @NonNull\n    @Override\n    public String toString() {\n        return \"SsaidRule{\" +\n                \"packageName='\" + packageName + '\\'' +\n                \", ssaid='\" + mSsaid + '\\'' +\n                '}';","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/MuntashirAkon/AppManager/blob/0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5/app/src/main/java/io/github/muntashirakon/AppManager/rules/struct/SsaidRule.java#L7-L43","documentation":"The SsaidRule constructor consumes the ssaid value from the tokenizer after the type token. If no further token exists, it throws IllegalArgumentException(\"Invalid format: ssaid not found\"), since an SSAID rule is meaningless without the ssaid string.","triggerScenarios":"Parsing a rule line of the form \"pkg\\tSTUB\\tSSAID\" with no fourth tab-separated token carrying the ssaid value via RuleEntry.unflattenFromString.","commonSituations":"Truncated export files; manual editing that dropped the last column; copy/paste losing the trailing tab field.","solutions":["Add the missing ssaid token to the rule line (\"pkg\\tSTUB\\tSSAID\\t<ssaid>\").","Skip such lines during import with a pre-check that at least 4 tokens exist for SSAID rules.","Re-export the rules from the source device/app."],"exampleFix":"// before\nString line = pkg + \"\\tSTUB\\tSSAID\";\nRuleEntry e = RuleEntry.unflattenFromString(null, line, false);\n// after\nString line = pkg + \"\\tSTUB\\tSSAID\\t\" + ssaid;\nRuleEntry e = RuleEntry.unflattenFromString(null, line, false);","handlingStrategy":"validation","validationCode":"String[] p = line.split(\"\\t\", -1);\nboolean ok = p.length >= 3 && \"SSAID\".equals(p[2]) ? p.length >= 4 : true;\n// only parse when ok","typeGuard":null,"tryCatchPattern":"try {\n    RuleEntry e = RuleEntry.unflattenFromString(null, line, false);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"ssaid not found\")) repairOrSkip(line);\n}","preventionTips":["Always serialize SSAID rules with all four fields.","Round-trip test: flattenToString then unflattenFromString each rule after export."],"tags":["parsing","missing-field","rules"],"backgroundTag":"missing-required-argument","analyzedSha":"0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5","analyzedAt":"2026-09-12T14:03:37.243Z","contentChangedAt":"2026-09-12T14:03:37.243Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}