我看到一些Java应用程序具有如下代码:
public class Test {
public Test();
Code:
0: aload_0
1: invokespecial #1 // Method java/lang/Object."":()V
4: return
public static void main(java.lang.String[]);
Code:
0: invokestatic #2 // Method printOne:()V
3: invokestatic #2 // Method printOne:()V
6: invokestatic #3 // Method printTwo:()V
9: return
public static void printOne();
Code:
0: getstatic #4 // Field java/lang/System.out:Ljava/io/PrintStream;
3: ldc #5 // String Hello World
5: invokevirtual #6 // Method java/io/PrintStream.println:(Ljava/lang/String;)V
8: return
public static void printTwo();
Code:
0: invokestatic #2 // Method printOne:()V
3: invokestatic #2 // Method printOne:()V
6: return
}
我想知道这是哪种混淆,以及什么样的工具可以混淆像这样的JAR文件。
答案 0 :(得分:4)
在已编译的Java类上运行javap -c
,您将获得Java字节码。那不是混淆,而是反编译。来自IBM的相当不错的资源是Java bytecode:Understanding bytecode makes you a better programmer
答案 1 :(得分:1)
这是javac
生成的-Java代码的编译器。将其转换为代码实际上非常容易:
public class Test {
// an implicit constructor:
public Test(){
}
public static void testOne(){
System.out.println("Hello World");
}
public static String testTwo(){
testOne();
testOne();
}
}