29 lines
1.3 KiB
Java
29 lines
1.3 KiB
Java
import jadx.api.*;
|
|
import java.nio.file.*;
|
|
import java.util.*;
|
|
|
|
public final class InspectGameSdk {
|
|
public static void main(String[] args) throws Exception {
|
|
JadxArgs config = new JadxArgs();
|
|
config.setInputFile(Path.of(args[0]).toFile());
|
|
Path output = Path.of("analysis", "sdk_login");
|
|
Files.createDirectories(output);
|
|
try (JadxDecompiler decompiler = new JadxDecompiler(config)) {
|
|
decompiler.load();
|
|
if (args[1].equals("list")) {
|
|
for (JavaClass cls : decompiler.getClassesWithInners()) {
|
|
String name = cls.getFullName();
|
|
if (args.length > 2 ? name.matches(args[2]) : name.toLowerCase().contains("diyidan") && name.toLowerCase().matches(".*(login|user|account|api|http|request|crypt|sign|game).*")) System.out.println(name);
|
|
}
|
|
} else {
|
|
for (int i = 1; i < args.length; i++) {
|
|
JavaClass cls = decompiler.searchJavaClassByOrigFullName(args[i]);
|
|
if (cls == null) { System.out.println("MISSING " + args[i]); continue; }
|
|
Files.writeString(output.resolve(args[i] + ".java"), cls.getCode());
|
|
System.out.println("EXPORTED " + args[i]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|