Saturday, 15 August 2015

java - Decompiled Obfuscated Code "Cannot return from within an initializer" -



java - Decompiled Obfuscated Code "Cannot return from within an initializer" -

i have class file named staticinitializer.class obfuscated successfully. when have decompiled got next result ide gives compiler error "cannot homecoming within initializer". removing "return" statement solves problem. in fact want know how obfuscated class file works if has return statement in static initializer.

is there mismatch between compiling , running phase of java files, obfuscation detects , uses them way of obfuscation?

decompiled code

public class staticinitializer { static { int a=12; int b=34; homecoming ; } }

edited: next operation shows obfuscated class file compiled jdk 1.5

javap -c staticinitializer.class major version: 49

j2se 8 = 52, j2se 7 = 51, j2se 6.0 = 50,

j2se 5.0 = 49,

jdk 1.4 = 48, jdk 1.3 = 47, jdk 1.2 = 46, jdk 1.1 = 45

a decompiler never 100% accurate, there multiple ways of programming line of code. jad (when decompiler java, synonymous jad) not back upwards jdk 1.5 , later. no longer developed or maintained.

also looking @ decompiled code giving error because,from java 7 onwards, looks main method before loading class. alter previous java versions , hence static block not executing. in previous versions, behavior jre used main method post loading class , after executing static blocks. work in previous versions not in new versions of java. since jad no longer maintained might show obsolete code valid @ 1 time upon time.

java obfuscation decompiling

No comments:

Post a Comment