Skip to content

Commit 38594d5

Browse files
committed
将Tab定义成四个空格
1 parent 96e7f79 commit 38594d5

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

src/main/java/ppsoft1991/decompier/Printer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package ppsoft1991.decompier;
22

33
public class Printer implements org.jd.core.v1.api.printer.Printer {
4-
protected static final String TAB = " ";
4+
protected static final String TAB = " ";
55
protected static final String NEWLINE = "\n";
66

77
protected int indentationCount = 0;

src/main/java/ppsoft1991/unzip/DecompilerClassScan.java

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import java.nio.file.Files;
1313
import java.nio.file.Path;
1414
import java.nio.file.Paths;
15+
import java.util.List;
1516
import java.util.stream.Collectors;
1617
import java.util.stream.Stream;
1718

@@ -22,10 +23,21 @@ public void scan(String dir, String s) throws Exception {
2223
dir = dir +"/";
2324
}
2425
try (Stream<Path> paths = Files.walk(Paths.get(dir))) {
25-
String finalDir = dir;
26-
paths.map(Path::toString).filter(f -> f.endsWith(".class"))
27-
.collect(Collectors.toList())
28-
.forEach(c -> decompiler(new File(c), finalDir));
26+
List<String> collect = paths.map(Path::toString).filter(f -> f.endsWith(".class"))
27+
.collect(Collectors.toList());
28+
int collectLength = collect.size();
29+
int part = collectLength/100;
30+
int aPart = part;
31+
int partNum = 0;
32+
for (int i = 0; i < collectLength; i++) {
33+
if (aPart == i){
34+
System.out.println("完成了: "+partNum+"%");
35+
partNum++;
36+
aPart = aPart + part;
37+
}
38+
decompiler(new File(collect.get(i)), dir);
39+
}
40+
//.forEach(c -> decompiler(new File(c), finalDir));
2941
} catch (IOException e) {
3042
e.printStackTrace();
3143
}
@@ -34,7 +46,9 @@ public void scan(String dir, String s) throws Exception {
3446
public static void decompiler(File clazzFile, String base){
3547
int baseLength = base.length();
3648
String path = clazzFile.getAbsolutePath();
37-
System.out.println(clazzFile.getAbsolutePath());
49+
if (Main.log){
50+
System.out.println(clazzFile.getAbsolutePath());
51+
}
3852
path = path.substring(baseLength);
3953
if (path.endsWith(".class")){
4054
Loader loader = new ppsoft1991.decompier.Loader(new File(base));

0 commit comments

Comments
 (0)