提交 1b60c1d1 编写于 作者: S Skylot

test: print smali code for debug purpose

上级 8321d5e3
......@@ -86,6 +86,7 @@ public abstract class IntegrationTest extends TestUtils {
private boolean allowWarnInCode;
private boolean printLineNumbers;
private boolean printSmali;
private DynamicCompiler dynamicCompiler;
......@@ -156,7 +157,7 @@ public abstract class IntegrationTest extends TestUtils {
}
protected JadxDecompiler loadFiles(List<File> inputFiles) {
JadxDecompiler d = null;
JadxDecompiler d;
try {
args.setInputFiles(inputFiles);
d = new JadxDecompiler(args);
......@@ -188,11 +189,21 @@ public abstract class IntegrationTest extends TestUtils {
}
System.out.println("-----------------------------------------------------------");
if (printSmali) {
clsList.forEach(this::printSmali);
}
clsList.forEach(this::checkCode);
compile(clsList);
clsList.forEach(this::runAutoCheck);
}
private void printSmali(ClassNode cls) {
System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
System.out.println(cls.getSmali());
System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
}
private void printCodeWithLineNumbers(ICodeInfo code) {
String codeStr = code.getCodeStr();
Map<Integer, Integer> lineMapping = code.getLineMapping();
......@@ -488,6 +499,12 @@ public abstract class IntegrationTest extends TestUtils {
this.args.setRawCFGOutput(true);
}
// Use only for debug purpose
@Deprecated
protected void printSmali() {
this.printSmali = true;
}
// Use only for debug purpose
@Deprecated
protected void outputRawCFG() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册