use of jadx.api.ICodeInfo in project jadx by skylot.
the class JadxClassNodeAssertions method reloadCode.
public JadxCodeAssertions reloadCode(IntegrationTest testInstance) {
isNotNull();
ICodeInfo code = actual.reloadCode();
Assertions.assertThat(code).isNotNull();
String codeStr = code.getCodeStr();
Assertions.assertThat(codeStr).isNotBlank();
JadxCodeAssertions codeAssertions = new JadxCodeAssertions(codeStr);
codeAssertions.print();
testInstance.runChecks(actual);
return codeAssertions;
}
use of jadx.api.ICodeInfo in project jadx by skylot.
the class TestReturnSourceLine method test.
@Test
public void test() {
printLineNumbers();
ClassNode cls = getClassNode(TestCls.class);
ICodeInfo codeInfo = cls.getCode();
String[] lines = codeInfo.getCodeStr().split(ICodeWriter.NL);
MethodNode test1 = cls.searchMethodByShortId("test1(Z)I");
checkLine(lines, codeInfo, test1, 3, "return 1;");
MethodNode test2 = cls.searchMethodByShortId("test2(I)I");
checkLine(lines, codeInfo, test2, 3, "return v - 1;");
checkLine(lines, codeInfo, test2, 6, "return v + 1;");
MethodNode test3 = cls.searchMethodByShortId("test3(I)I");
if (isJavaInput()) {
// dx lost line number for this return
checkLine(lines, codeInfo, test3, 3, "return v;");
}
checkLine(lines, codeInfo, test3, 6, "return v + 1;");
}
Aggregations