Java Code Examples for org.jf.dexlib2.iface.instruction.formats.SparseSwitchPayload#getSwitchElements()
The following examples show how to use
org.jf.dexlib2.iface.instruction.formats.SparseSwitchPayload#getSwitchElements() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SparseSwitchInstruction.java From JAADAS with GNU General Public License v3.0 | 6 votes |
protected Stmt switchStatement(DexBody body, Instruction targetData, Local key) { SparseSwitchPayload i = (SparseSwitchPayload) targetData; List<? extends SwitchElement> seList = i.getSwitchElements(); // the default target always follows the switch statement int defaultTargetAddress = codeAddress + instruction.getCodeUnits(); Unit defaultTarget = body.instructionAtAddress(defaultTargetAddress).getUnit(); List<IntConstant> lookupValues = new ArrayList<IntConstant>(); List<Unit> targets = new ArrayList<Unit>(); for(SwitchElement se: seList) { lookupValues.add(IntConstant.v(se.getKey())); int offset = se.getOffset(); targets.add(body.instructionAtAddress(codeAddress + offset).getUnit()); } switchStmt = Jimple.v().newLookupSwitchStmt(key, lookupValues, targets, defaultTarget); setUnit(switchStmt); if (IDalvikTyper.ENABLE_DVKTYPER) { Debug.printDbg(IDalvikTyper.DEBUG, "constraint: "+ switchStmt); DalvikTyper.v().setType(switchStmt.getKeyBox(), IntType.v(), true); } return switchStmt; }
Example 2
Source File: ImmutableSparseSwitchPayload.java From ZjDroid with Apache License 2.0 | 5 votes |
@Nonnull public static ImmutableSparseSwitchPayload of(SparseSwitchPayload instruction) { if (instruction instanceof ImmutableSparseSwitchPayload) { return (ImmutableSparseSwitchPayload)instruction; } return new ImmutableSparseSwitchPayload( instruction.getSwitchElements()); }
Example 3
Source File: ImmutableSparseSwitchPayload.java From zjdroid with Apache License 2.0 | 5 votes |
@Nonnull public static ImmutableSparseSwitchPayload of(SparseSwitchPayload instruction) { if (instruction instanceof ImmutableSparseSwitchPayload) { return (ImmutableSparseSwitchPayload)instruction; } return new ImmutableSparseSwitchPayload( instruction.getSwitchElements()); }
Example 4
Source File: ImmutableSparseSwitchPayload.java From HeyGirl with Apache License 2.0 | 5 votes |
@Nonnull public static ImmutableSparseSwitchPayload of(SparseSwitchPayload instruction) { if (instruction instanceof ImmutableSparseSwitchPayload) { return (ImmutableSparseSwitchPayload)instruction; } return new ImmutableSparseSwitchPayload( instruction.getSwitchElements()); }
Example 5
Source File: ImmutableSparseSwitchPayload.java From ZjDroid with Apache License 2.0 | 5 votes |
@Nonnull public static ImmutableSparseSwitchPayload of(SparseSwitchPayload instruction) { if (instruction instanceof ImmutableSparseSwitchPayload) { return (ImmutableSparseSwitchPayload)instruction; } return new ImmutableSparseSwitchPayload( instruction.getSwitchElements()); }