use of com.googlecode.dex2jar.ir.ts.SSATransformer in project dex2jar by pxb1988.
the class AggTransformerTest method test05.
@Test
public void test05() {
String sbType = "Ljava/lang/StringBuilder;";
String sType = "Ljava/lang/String;";
Local b = addLocal("b");
Local ex = addLocal("ex");
Local c = addLocal("c");
Local d = addLocal("d");
Local e = addLocal("e");
Local cst = addLocal("cst");
addStmt(nAssign(b, nString("123")));
addStmt(nAssign(c, Exprs.nInvokeNew(new Value[0], new String[0], sbType)));
addStmt(nAssign(d, c));
addStmt(nAssign(cst, nString("p1")));
addStmt(nAssign(c, Exprs.nInvokeVirtual(new Value[] { d, cst }, sbType, "append", new String[] { sType }, sbType)));
addStmt(nAssign(e, c));
addStmt(nAssign(cst, nString("p2")));
addStmt(nAssign(c, Exprs.nInvokeVirtual(new Value[] { e, cst }, sbType, "append", new String[] { sType }, sbType)));
addStmt(nAssign(c, Exprs.nInvokeVirtual(new Value[] { c }, sbType, "toString", new String[0], sType)));
addStmt(nReturn(c));
new SSATransformer().transform(method);
transform();
Assert.assertTrue(stmts.getSize() == 1);
Assert.assertTrue(locals.size() == 0);
}
Aggregations