Throwing StringIndexOutOfBoundsException when passing /dev/stdin as class file
onesunvan opened this issue · 1 comments
I'm trying to decompile only certain class file from full jar.
For these purposes I'm using linux pipe:
$ unzip -p myjar.jar com/example/App.class | jd-cli /dev/stdin
But unfortunately, jd-cli throws an exception
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1967) ~[na:1.8.0_151]
at jd.core.input.AbstractFileJDInput.cutClassSuffix(AbstractFileJDInput.java:79) ~[jd-cli.jar:na]
at jd.core.input.ClassFileInput.decompile(ClassFileInput.java:54) ~[jd-cli.jar:na]
at jd.cli.Main.main(Main.java:118) ~[jd-cli.jar:na]
(I suppose, the root cause is that jd-cli wants to discover java class name, simply cutting ".class" suffix, but in case of /dev/stdin it leads to exception)
Also, it would be grateful if jd-cli will support class ingesting from standard input out-of-the-box.
P.S. Thanks for this great tool.