Java Code Examples for org.jf.dexlib2.iface.instruction.formats.PackedSwitchPayload#getSwitchElements()
The following examples show how to use
org.jf.dexlib2.iface.instruction.formats.PackedSwitchPayload#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: PackedSwitchInstruction.java From JAADAS with GNU General Public License v3.0 | 6 votes |
protected Stmt switchStatement(DexBody body, Instruction targetData, Local key) { PackedSwitchPayload i = (PackedSwitchPayload) 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: ImmutablePackedSwitchPayload.java From ZjDroid with Apache License 2.0 | 5 votes |
@Nonnull public static ImmutablePackedSwitchPayload of(PackedSwitchPayload instruction) { if (instruction instanceof ImmutablePackedSwitchPayload) { return (ImmutablePackedSwitchPayload)instruction; } return new ImmutablePackedSwitchPayload( instruction.getSwitchElements()); }
Example 3
Source File: ImmutablePackedSwitchPayload.java From zjdroid with Apache License 2.0 | 5 votes |
@Nonnull public static ImmutablePackedSwitchPayload of(PackedSwitchPayload instruction) { if (instruction instanceof ImmutablePackedSwitchPayload) { return (ImmutablePackedSwitchPayload)instruction; } return new ImmutablePackedSwitchPayload( instruction.getSwitchElements()); }
Example 4
Source File: ImmutablePackedSwitchPayload.java From HeyGirl with Apache License 2.0 | 5 votes |
@Nonnull public static ImmutablePackedSwitchPayload of(PackedSwitchPayload instruction) { if (instruction instanceof ImmutablePackedSwitchPayload) { return (ImmutablePackedSwitchPayload)instruction; } return new ImmutablePackedSwitchPayload( instruction.getSwitchElements()); }
Example 5
Source File: ImmutablePackedSwitchPayload.java From ZjDroid with Apache License 2.0 | 5 votes |
@Nonnull public static ImmutablePackedSwitchPayload of(PackedSwitchPayload instruction) { if (instruction instanceof ImmutablePackedSwitchPayload) { return (ImmutablePackedSwitchPayload)instruction; } return new ImmutablePackedSwitchPayload( instruction.getSwitchElements()); }