Search in sources :

Example 1 with Deobfuscator

use of jadx.core.deobf.Deobfuscator 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);
}
Also used : IJadxArgs(jadx.api.IJadxArgs) InputFile(jadx.core.utils.files.InputFile) File(java.io.File) Deobfuscator(jadx.core.deobf.Deobfuscator) InputFile(jadx.core.utils.files.InputFile)

Example 2 with Deobfuscator

use of jadx.core.deobf.Deobfuscator in project jadx by skylot.

the class RenameVisitor method process.

private void process(RootNode root) {
    Deobfuscator deobfuscator = new Deobfuscator(root);
    JadxArgs args = root.getArgs();
    if (args.isDeobfuscationOn()) {
        deobfuscator.execute();
    }
    checkClasses(deobfuscator, root, args);
    UserRenames.applyForNodes(root);
    if (args.isDeobfuscationOn() || !args.isJsonOutput()) {
        deobfuscator.savePresets();
        deobfuscator.clear();
    }
    if (args.isJsonOutput()) {
        JsonMappingGen.dump(root);
    }
}
Also used : JadxArgs(jadx.api.JadxArgs) Deobfuscator(jadx.core.deobf.Deobfuscator)

Aggregations

Deobfuscator (jadx.core.deobf.Deobfuscator)2 IJadxArgs (jadx.api.IJadxArgs)1 JadxArgs (jadx.api.JadxArgs)1 InputFile (jadx.core.utils.files.InputFile)1 File (java.io.File)1