alexkasko / krakatau-java

Assembler, disassembler and decompiler for Java class files
GNU General Public License v3.0
17 stars 4 forks source link

Handle .jar targets #1

Open Sputuks3 opened 10 years ago

Sputuks3 commented 10 years ago

The original Krakatau allows for handling of .jar files as targets. Does this version support the auto decompilation of .jar files, or do we have to manually unpack before passing it?

alexkasko commented 10 years ago

This version does not support jars unpacking before decompilation. Slow decompilation speed made big jars processing not very convenient.

It's not hard to add, but to add it cleanly, all file processing should be moved from python code part to java one first. I'll leave the issue open for possible implementation in future.

Sputuks3 commented 10 years ago

Haven't actually looked at the python code yet, but what is their approach, unpack all first before processing or recursively one at a time? Which is more efficient?

alexkasko commented 10 years ago

For disassemble it just reads files from jar one by one, not sure about decompilation. I think jar processing time will be negligible (in either ways) comparing to actual decompilation.

Sputuks3 commented 10 years ago

Actually why not compile Krakatau during initialization to optimize loading speeds?

See PythonInterpreter for more info.

alexkasko commented 10 years ago

If It really works I will be glad to add it. I haven't dig it much but read somewhere in jython wiki that compiler works only with jython 2.2 and unsupported (cannot find the link now and maybe it was about another compiler).

Storyyeller commented 8 years ago

To answer the question, Krakatau reads the files directly out of the jar using Python's zipfile library. It's pointless and dangerous to unpack the jar because the filesystem may not be able to handle the filenames in the jar.