{"record":{"id":"e59f42907128f8c3","repo":"MuntashirAkon/AppManager","slug":"bad-component-name-rawvalue","errorCode":null,"errorMessage":"Bad component name: ${rawValue}","messagePattern":"Bad component name: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/io/github/muntashirakon/AppManager/intercept/IntentCompat.java","lineNumber":180,"sourceCode":"                    list[i] = Uri.parse(strings[i]);\n                }\n                return list;\n            }\n            case TYPE_URI_AL: {\n                // Split on commas unless they are preceded by an escape.\n                // The escape character must be escaped for the string and\n                // again for the regex, thus four escape characters become one.\n                String[] strings = rawValue.split(\"(?<!\\\\\\\\),\");\n                List<Uri> list = new ArrayList<>(strings.length);\n                for (String s : strings) {\n                    list.add(Uri.parse(s));\n                }\n                return list;\n            }\n            case TYPE_COMPONENT_NAME:\n                ComponentName cn = ComponentName.unflattenFromString(rawValue);\n                if (cn == null) {\n                    throw new IllegalArgumentException(\"Bad component name: \" + rawValue);\n                }\n                return cn;\n            case TYPE_INT_ARR: {\n                String[] strings = rawValue.split(\",\");\n                int[] list = new int[strings.length];\n                for (int i = 0; i < strings.length; i++) {\n                    list[i] = IntegerCompat.decode(strings[i].trim());\n                }\n                return list;\n            }\n            case TYPE_INT_AL: {\n                String[] strings = rawValue.split(\",\");\n                ArrayList<Integer> list = new ArrayList<>(strings.length);\n                for (String string : strings) {\n                    list.add(IntegerCompat.decode(string.trim()));\n                }\n                return list;\n            }","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/MuntashirAkon/AppManager/blob/0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5/app/src/main/java/io/github/muntashirakon/AppManager/intercept/IntentCompat.java#L162-L198","documentation":"IntentCompat.parseExtraValue() reconstructs typed Intent extras from a flattened string form. For TYPE_COMPONENT_NAME it calls ComponentName.unflattenFromString(rawValue); a null result means the string is not of the form 'package/class', so it throws IllegalArgumentException('Bad component name: ...').","triggerScenarios":"Passing a TYPE_COMPONENT_NAME extra whose raw value lacks the required 'pkg/cls' flattening — e.g. missing slash, empty class, or malformed package.","commonSituations":"Hand-crafting or editing intercepted-intent strings; copying intent URIs between apps with typos; automation scripts producing invalid component strings.","solutions":["Format the value as 'full.package.name/fully.qualified.ClassName', e.g. com.example/.MainActivity","Use ComponentName.flattenToString() on the source side so the value round-trips correctly","Validate with ComponentName.unflattenFromString() != null before setting the extra"],"exampleFix":"// before\n\"com.example.MainActivity\" // no package/class separator\n// after\n\"com.example/com.example.MainActivity\"","handlingStrategy":"validation","validationCode":"if (ComponentName.unflattenFromString(rawValue) == null) {\n    throw new IllegalArgumentException(\"Not a flattenToString() component: \" + rawValue);\n}","typeGuard":null,"tryCatchPattern":"try {\n    Object v = IntentCompat.parseExtraValue(type, rawValue);\n} catch (IllegalArgumentException e) {\n    Log.w(TAG, \"Malformed extra value\", e);\n}","preventionTips":["Always produce component strings with ComponentName.flattenToString()","Validate 'pkg/cls' shape before writing intent strings","Avoid hand-editing flattened intent representations"],"tags":["java","android","intent"],"backgroundTag":"invalid-argument-format","analyzedSha":"0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5","analyzedAt":"2026-09-12T14:03:37.243Z","contentChangedAt":"2026-09-12T14:03:37.243Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}