提交 cd8307f4 编写于 作者: S Skylot

chore: remove unused d8 from convert plugin

上级 a7201052
......@@ -6,6 +6,5 @@ dependencies {
api(project(":jadx-plugins:jadx-plugins-api"))
implementation(project(":jadx-plugins:jadx-dex-input"))
implementation('com.android.tools:r8:1.6.84')
implementation(files('lib/dx-1.16.jar'))
}
package jadx.plugins.input.javaconvert;
import java.nio.file.Path;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.android.tools.r8.CompilationFailedException;
import com.android.tools.r8.CompilationMode;
import com.android.tools.r8.D8;
import com.android.tools.r8.D8Command;
import com.android.tools.r8.Diagnostic;
import com.android.tools.r8.DiagnosticsHandler;
import com.android.tools.r8.OutputMode;
public class D8Converter {
private static final Logger LOG = LoggerFactory.getLogger(D8Converter.class);
public static void run(Path path, Path tempDirectory) throws CompilationFailedException {
D8Command d8Command = D8Command.builder(new LogHandler())
.addProgramFiles(path)
.setOutput(tempDirectory, OutputMode.DexIndexed)
.setMode(CompilationMode.DEBUG)
.setMinApiLevel(30)
.setIntermediate(true)
.setEnableDesugaring(false)
.build();
D8.run(d8Command);
}
private static class LogHandler implements DiagnosticsHandler {
@Override
public void error(Diagnostic diagnostic) {
LOG.error("D8 error: {}", format(diagnostic));
}
@Override
public void warning(Diagnostic diagnostic) {
LOG.warn("D8 warning: {}", format(diagnostic));
}
@Override
public void info(Diagnostic diagnostic) {
LOG.info("D8 info: {}", format(diagnostic));
}
public static String format(Diagnostic diagnostic) {
return diagnostic.getDiagnosticMessage()
+ ", origin: " + diagnostic.getOrigin()
+ ", position: " + diagnostic.getPosition();
}
}
}
......@@ -37,7 +37,6 @@ public class JavaConvertLoader {
Path tempDirectory = Files.createTempDirectory("jadx-");
result.addTempPath(tempDirectory);
// D8Converter.run(path, tempDirectory);
DxConverter.run(path, tempDirectory);
LOG.debug("Converted to dex: {}", path.toAbsolutePath());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册