pxb1988/dex2jar · error · RuntimeException

not support type

Error message

not support type 

What it means

When -t/--arg-types is supplied, DecryptStringCmd maps each type token to a JVM descriptor; only `string` (and similar supported tokens like int/long types above it) are recognized. An unknown token hits the default branch and throws this RuntimeException.

Solutions

  1. Use only supported tokens (e.g. `string`, `int`, `long`, `double`, `boolean` per the switch cases)
  2. Check the tool's help for the exact -t token spelling
  3. Omit -t entirely to use the default (Ljava/lang/String;) signature

Example fix

// before
d2j-decrypt-string -t string,Object a.jar
// after
d2j-decrypt-string -t string a.jar
Defensive patterns

Strategy: validation

Validate before calling

Set<String> allowed = Set.of("string", "int", "long", "double", "boolean");
for (String t : argTypes.split(",")) if (!allowed.contains(t)) throw new IllegalArgumentException("bad -t token: " + t);

Try / catch

try { DecryptStringCmd.main(args); } catch (RuntimeException e) { if (e.getMessage().startsWith("not support type")) { System.err.println("Use supported -t tokens only"); } else throw e; }

Prevention

When it happens

Trigger: Passing an unrecognized token in -t, e.g. `-t string,foo` where `foo` isn't one of the switch cases in the arg-types parsing loop.

Common situations: Typos in type names, using Java names like `String` instead of the tool's tokens, or using types the decrypt helper doesn't take.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of pxb1988/dex2jar@b5bda4fb49 (2026-09-08). Data as JSON: /api/errors/a23e8a5225eb9b46. Report an issue: GitHub.

Appendix: source

Thrown at dex-tools/src/main/java/com/googlecode/dex2jar/tools/DecryptStringCmd.java:898

                            break;
                        case "int":
                            sb.append("I");
                            break;
                        case "long":
                            sb.append("J");
                            break;
                        case "float":
                            sb.append("F");
                            break;
                        case "double":
                            sb.append("D");
                            break;
                        case "string":
                            sb.append("Ljava/lang/String;");
                            break;

                        default:
                            throw new RuntimeException("not support type " + type_list[i] + " on -t/--arg-types");
                    }
                }
                methodConfigs.add(this.build("L" + methodOwner.replace('.', '/') + ";->" + methodName + "("
                        + sb + ")Ljava/lang/String;"));
            } else {
                methodConfigs.add(this.build("L" + methodOwner.replace('.', '/') + ";->" + methodName + "(Ljava/lang/String;)Ljava/lang/String;"));
            }
        }
        return methodConfigs;
    }

    /**
     * fix for issue 216, travel all the parent of class and use getDeclaredMethod to find methods
     */
    private Method findAnyMethodMatch(Class<?> clz, String name, Class<?>[] classes) {
        try {
            Method m = clz.getDeclaredMethod(name, classes);
            if (m != null) {

View on GitHub (pinned to b5bda4fb49)