summaryrefslogtreecommitdiffstats
path: root/src/test/TestInput.java
blob: 22735555c7ee38517bb7165df46d84544efb437c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package test;

import java.io.File;
import java.util.Date;

import com.vladium.utils.timing.TimerFactory;

import de.fernflower.main.decompiler.ConsoleDecompiler;


public class TestInput {

	public static void main(String[] args) {

		try {
			TimerFactory.initialize(new File(".").getCanonicalPath()+"/lib/timer/hrtlib.dll");
		} catch(Exception ex) {
			ex.printStackTrace();
		}
		
		File[] dirs = new File("C:\\revjava\\remote\\data\\input\\").listFiles();
		
		for(File dir : dirs) {
			if(dir.isDirectory()) {
				Date start = new Date();
				System.out.println("==========================================================================");
				System.out.println("Processing " + dir.getAbsolutePath());
				decompileDirectory(dir);
				System.out.println("Proceeded " + dir.getAbsolutePath());
				System.out.println("Time elapsed " + (new Date().getTime() - start.getTime())/1000);
				System.out.println("==========================================================================");
			}
		}
		
	}
	
	private static void decompileDirectory(File dir) {
		
		try {
			
			ConsoleDecompiler decompiler = new ConsoleDecompiler();
			
			decompiler.addSpace(dir, true);
			
			decompiler.decompileContext(new File("C:\\Temp\\fernflower\\dec\\output\\", dir.getName()));
			
			
		} catch(Exception ex) {
			ex.printStackTrace();
		}
		
	}

}