{"record":{"id":"869c96422bc9be18","repo":"pxb1988/dex2jar","slug":"not-support-class-value-yet","errorCode":null,"errorMessage":"not support .class value yet!","messagePattern":"not support \\.class value yet!","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"dex-tools/src/main/java/com/googlecode/dex2jar/tools/DecryptStringCmd.java","lineNumber":951,"sourceCode":"                Method m = findAnyMethodMatch(itf, name, classes);\n                if (m != null) {\n                    return m;\n                }\n            }\n        }\n        return null;\n    }\n\n    Object readCst(AbstractInsnNode q) {\n\n        switch (q.getOpcode()) {\n            case Opcodes.LDC:\n                // LDC: String, integer, long and double cases (Opcodes.LDC comprehends LDC_W and LDC2_W)\n                // push 32bit or 64bit int/float\n                // push string/type\n                LdcInsnNode ldc = (LdcInsnNode) q;\n                if (ldc.cst instanceof Type) {\n                    throw new RuntimeException(\"not support .class value yet!\");\n                }\n                return ldc.cst;\n\n            case Opcodes.BIPUSH:\n            case Opcodes.SIPUSH:\n                // INT_INSN (\"instruction with a single int operand\")\n                // push 8bit or 16bit int\n                IntInsnNode in = (IntInsnNode) q;\n                return in.operand;\n\n            case Opcodes.ICONST_M1:\n            case Opcodes.ICONST_0:\n            case Opcodes.ICONST_1:\n            case Opcodes.ICONST_2:\n            case Opcodes.ICONST_3:\n            case Opcodes.ICONST_4:\n            case Opcodes.ICONST_5:\n                // ICONST_*: push a tiny int, -1 <= value <= 5","sourceCodeStart":933,"sourceCodeEnd":969,"githubUrl":"https://github.com/pxb1988/dex2jar/blob/b5bda4fb4935ae8b3869b422454ae3b3896c7bc1/dex-tools/src/main/java/com/googlecode/dex2jar/tools/DecryptStringCmd.java#L933-L969","documentation":"The string-decryption scanner evaluates constant-producing instructions to recover encrypted-string arguments. LDC pushing a Type constant (.class literal) is not a supported constant value, so it throws this RuntimeException.","triggerScenarios":"The candidate decryptor method chain contains an LDC instruction loading a Class constant (e.g. `Foo.class`) inside the scanned method, hitting the `ldc.cst instanceof Type` check.","commonSituations":"Analyzing obfuscated code where the decryptor helper references .class literals for lookups, or modern bytecode patterns the tool predates.","solutions":["Exclude methods with .class LDC instructions from the -m config and target the core decryptor directly","Patch DecryptStringCmd to return the Type constant (e.g. return ldc.cst or a placeholder) instead of throwing","Use a newer dex2jar build if available; this limitation has been addressed in some forks"],"exampleFix":"// before\nif (ldc.cst instanceof Type) { throw new RuntimeException(\"not support .class value yet!\"); }\n// after\nif (ldc.cst instanceof Type) { return ((Type) ldc.cst).getClassName(); }","handlingStrategy":"try-catch","validationCode":"// Pre-scan target methods for Type LDC instructions\nboolean hasClassLdc = method.instructions.stream()\n    .anyMatch(insn -> insn instanceof LdcInsnNode && ((LdcInsnNode) insn).cst instanceof Type);","typeGuard":null,"tryCatchPattern":"try { runDecryptScan(config); } catch (RuntimeException e) { if (\"not support .class value yet!\".equals(e.getMessage())) { skipMethodAndLog(); } else throw e; }","preventionTips":["Target the core string-decryptor method directly, avoiding helpers with .class literals","Filter candidate methods for Type LDCs before scanning","Fork/patch the scanner to treat Type constants as opaque values"],"tags":["bytecode","unsupported","ldc"],"backgroundTag":"unsupported-operation","analyzedSha":"b5bda4fb4935ae8b3869b422454ae3b3896c7bc1","analyzedAt":"2026-09-08T00:44:01.258Z","contentChangedAt":"2026-09-08T00:44:01.258Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}