Package jadx.core.dex.regions.conditions

Examples of jadx.core.dex.regions.conditions.IfCondition


  }

  @Test
  public void testSimplify() {
    // '!(!a || !b)' => 'a && b'
    IfCondition a = makeSimpleCondition();
    IfCondition b = makeSimpleCondition();
    IfCondition c = not(merge(Mode.OR, not(a), not(b)));
    IfCondition simp = simplify(c);

    assertEquals(simp.getMode(), Mode.AND);
    assertEquals(simp.first(), a);
    assertEquals(simp.second(), b);
  }
View Full Code Here


  }

  @Test
  public void testSimplify2() {
    // '(!a || !b) && !c' => '!((a && b) || c)'
    IfCondition a = makeSimpleCondition();
    IfCondition b = makeSimpleCondition();
    IfCondition c = makeSimpleCondition();
    IfCondition cond = merge(Mode.AND, merge(Mode.OR, not(a), not(b)), not(c));
    IfCondition simp = simplify(cond);

    assertEquals(simp.getMode(), Mode.NOT);
    IfCondition f = simp.first();
    assertEquals(f.getMode(), Mode.OR);
    assertEquals(f.first().getMode(), Mode.AND);
    assertEquals(f.first().first(), a);
    assertEquals(f.first().second(), b);
    assertEquals(f.second(), c);
  }
View Full Code Here

    LoopLabelAttr labelAttr = region.getInfo().getStart().get(AType.LOOP_LABEL);
    if (labelAttr != null) {
      code.startLine(mgen.getNameGen().getLoopLabel(labelAttr)).add(':');
    }

    IfCondition condition = region.getCondition();
    if (condition == null) {
      // infinite loop
      code.startLine("while (true) {");
      makeRegionIndent(code, region.getBody());
      code.startLine('}');
View Full Code Here

TOP

Related Classes of jadx.core.dex.regions.conditions.IfCondition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.