Search in sources :

Example 1 with NoOpCodeCache

use of jadx.api.impl.NoOpCodeCache in project jadx by skylot.

the class JadxCLI method processAndSave.

private static int processAndSave(JadxCLIArgs cliArgs) {
    LogHelper.initLogLevel(cliArgs);
    LogHelper.setLogLevelsForLoadingStage();
    JadxArgs jadxArgs = cliArgs.toJadxArgs();
    jadxArgs.setCodeCache(new NoOpCodeCache());
    jadxArgs.setCodeWriterProvider(SimpleCodeWriter::new);
    try (JadxDecompiler jadx = new JadxDecompiler(jadxArgs)) {
        jadx.load();
        if (checkForErrors(jadx)) {
            return 1;
        }
        LogHelper.setLogLevelsForDecompileStage();
        if (!SingleClassMode.process(jadx, cliArgs)) {
            save(jadx);
        }
        int errorsCount = jadx.getErrorsCount();
        if (errorsCount != 0) {
            jadx.printErrorsReport();
            LOG.error("finished with errors, count: {}", errorsCount);
        } else {
            LOG.info("done");
        }
    }
    return 0;
}
Also used : JadxDecompiler(jadx.api.JadxDecompiler) SimpleCodeWriter(jadx.api.impl.SimpleCodeWriter) JadxArgs(jadx.api.JadxArgs) NoOpCodeCache(jadx.api.impl.NoOpCodeCache)

Aggregations

JadxArgs (jadx.api.JadxArgs)1 JadxDecompiler (jadx.api.JadxDecompiler)1 NoOpCodeCache (jadx.api.impl.NoOpCodeCache)1 SimpleCodeWriter (jadx.api.impl.SimpleCodeWriter)1