use of jadx.core.dex.nodes.ClassNode in project jadx by skylot.
the class TestReturnWrapping method test.
@Test
public void test() {
ClassNode cls = getClassNode(TestCls.class);
String code = cls.getCode().toString();
assertThat(code, containsString("return 255;"));
assertThat(code, containsString("return arg0 + 1;"));
assertThat(code, containsString("return i > 128 ? arg0.toString() + ret.toString() : Integer.valueOf(i);"));
assertThat(code, containsString("return arg0 + 2;"));
assertThat(code, containsString("arg0 -= 951;"));
}
use of jadx.core.dex.nodes.ClassNode in project jadx by skylot.
the class TestVariables3 method test.
@Test
public void test() {
ClassNode cls = getClassNode(TestCls.class);
String code = cls.getCode().toString();
assertThat(code, containsString("int i;"));
assertThat(code, containsString("i = 2;"));
assertThat(code, containsString("i = 3;"));
assertThat(code, containsString("s = null;"));
assertThat(code, containsString("return s + \" \" + i;"));
}
use of jadx.core.dex.nodes.ClassNode in project jadx by skylot.
the class TestArithConst method test.
@Test
public void test() {
noDebugInfo();
ClassNode cls = getClassNodeFromSmali("TestArithConst");
String code = cls.getCode().toString();
assertThat(code, containsOne("return i + CONST_INT;"));
}
use of jadx.core.dex.nodes.ClassNode in project jadx by skylot.
the class TestInlineVarArg method test.
@Test
public void test() {
noDebugInfo();
ClassNode cls = getClassNodeFromSmali("TestInlineVarArg");
String code = cls.getCode().toString();
assertThat(code, containsOne("f(\"a\", \"b\", \"c\");"));
}
use of jadx.core.dex.nodes.ClassNode in project jadx by skylot.
the class RenameVisitor method checkClasses.
private void checkClasses(RootNode root) {
Set<String> clsNames = new HashSet<String>();
for (ClassNode cls : root.getClasses(true)) {
checkClassName(cls);
if (!CASE_SENSITIVE_FS) {
ClassInfo classInfo = cls.getClassInfo();
String clsFileName = classInfo.getAlias().getFullPath();
if (!clsNames.add(clsFileName.toLowerCase())) {
String newShortName = deobfuscator.getClsAlias(cls);
String newFullName = classInfo.makeFullClsName(newShortName, true);
classInfo.rename(cls.dex(), newFullName);
clsNames.add(classInfo.getAlias().getFullPath().toLowerCase());
}
}
}
}
Aggregations