Storyyeller / Krakatau

Java decompiler, assembler, and disassembler
GNU General Public License v3.0
1.95k stars 220 forks source link

prevents disassemble.py from writing out debug info #57

Closed carlitosLMO closed 8 years ago

carlitosLMO commented 8 years ago

How to prevents disassemble.py from writing out debug info like:

Apktool has "--no-debug-info" option. There is any similar option for disassemble.py? tks

Storyyeller commented 8 years ago

Not currently, but I can easily add one.

What do you think about having an option --hideattrs=... that you can blacklist attributes. Then you can do something like --hideattrs=LineNumberTable,LocalVariableTable,LocalVariableTypeTable

Storyyeller commented 8 years ago

Alternatively, what do you think about an option called -codeonly that ignores all attributes besides Code, ConstantValue, and BootstrapMethodsTable?

carlitosLMO commented 8 years ago

an option called -codeonly will be great! It would be easier to edit the file and then re-compile with "assemble.py"

Storyyeller commented 8 years ago

If you're going to reassemble, you'll want to include the other attributes though. At least StackMapTable, and the inner class and annotation stuff.

carlitosLMO commented 8 years ago

Would it be possible to remove only these parts: .stack stack_1 ... .stack full ... .end stack L1: ... .linenumbertable ... .end linenumbertable .localvariabletable ... .end localvariabletable

and then re-compile?

Storyyeller commented 8 years ago

Yes, but if you remove the stackmap from a 51.0+ classfile, it won't run any more.

Storyyeller commented 8 years ago

Did you ever make up your mind about the desired behavior?

Storyyeller commented 8 years ago

Closing due to lack of response.

Kreijstal commented 2 months ago

you could just strip the debug info from the class at a later time with another tool no?

Janmm14 commented 2 months ago

Yes, java asm for example has a simple class reader flag for it