use of jadx.core.utils.files.InputFile in project jadx by skylot.
the class RenameVisitor method init.
@Override
public void init(RootNode root) {
IJadxArgs args = root.getArgs();
InputFile firstInputFile = root.getDexNodes().get(0).getDexFile().getInputFile();
final String firstInputFileName = firstInputFile.getFile().getAbsolutePath();
final String inputPath = FilenameUtils.getFullPathNoEndSeparator(firstInputFileName);
final String inputName = FilenameUtils.getBaseName(firstInputFileName);
File deobfMapFile = new File(inputPath, inputName + ".jobf");
deobfuscator = new Deobfuscator(args, root.getDexNodes(), deobfMapFile);
boolean deobfuscationOn = args.isDeobfuscationOn();
if (deobfuscationOn) {
deobfuscator.execute();
}
checkClasses(root);
}
use of jadx.core.utils.files.InputFile in project jadx by skylot.
the class ConvertToClsSet method main.
public static void main(String[] args) throws IOException, DecodeException {
if (args.length < 2) {
usage();
System.exit(1);
}
File output = new File(args[0]);
List<InputFile> inputFiles = new ArrayList<InputFile>(args.length - 1);
for (int i = 1; i < args.length; i++) {
File f = new File(args[i]);
if (f.isDirectory()) {
addFilesFromDirectory(f, inputFiles);
} else {
InputFile.addFilesFrom(f, inputFiles);
}
}
for (InputFile inputFile : inputFiles) {
LOG.info("Loaded: {}", inputFile.getFile());
}
RootNode root = new RootNode(new JadxArgs());
root.load(inputFiles);
ClsSet set = new ClsSet();
set.load(root);
set.save(output);
LOG.info("Output: {}", output);
LOG.info("done");
}
use of jadx.core.utils.files.InputFile in project jadx by skylot.
the class RootNode method load.
public void load(List<InputFile> inputFiles) throws DecodeException {
dexNodes = new ArrayList<DexNode>();
for (InputFile input : inputFiles) {
for (DexFile dexFile : input.getDexFiles()) {
try {
LOG.debug("Load: {}", dexFile);
DexNode dexNode = new DexNode(this, dexFile);
dexNodes.add(dexNode);
} catch (Exception e) {
throw new DecodeException("Error decode file: " + dexFile, e);
}
}
}
for (DexNode dexNode : dexNodes) {
dexNode.loadClasses();
}
initInnerClasses();
}
Aggregations