Skip to content

Add jad --file for decompiling existing class files - #3298

Open
wozhenbang2004 wants to merge 4 commits into
alibaba:masterfrom
wozhenbang2004:2280-jad-class-file
Open

wozhenbang2004 wants to merge 4 commits into
alibaba:masterfrom
wozhenbang2004:2280-jad-class-file

Conversation

@wozhenbang2004

Copy link
Copy Markdown

Fixes #2280.

Add jad --file /path/to/Foo.class [method-name] to decompile a class file already on the target machine without loading it into the JVM. This reuses the existing CFR output and supports --source-only, --lineNumber and --hideUnicode. File paths can be completed in the shell. Class-loader selection, regex matching and dump-directory options are rejected in file mode.

Added command tests and English/Chinese usage examples. The 14 tests in JadCommandTest, DecompilerTest and CompletionUtilsTest pass. Also checked the packaged application on Java 21 using startup -javaagent, through the HTTP API and telnet client: an unloaded class file (including a path with spaces), a single method, invalid paths, and the normal loaded-class command. The file's class remains unloaded after decompilation.

Dynamic attach was not verified because its handshake timed out in this environment.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

jad 增强直接反编译某个 .class 文件的功能

1 participant