Java Code Examples for com.android.dx.dex.code.CstInsn#getIndex()
The following examples show how to use
com.android.dx.dex.code.CstInsn#getIndex() .
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: Form22c.java From Box with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override public boolean isCompatible(DalvInsn insn) { RegisterSpecList regs = insn.getRegisters(); if (!((insn instanceof CstInsn) && (regs.size() == 2) && unsignedFitsInNibble(regs.get(0).getReg()) && unsignedFitsInNibble(regs.get(1).getReg()))) { return false; } CstInsn ci = (CstInsn) insn; int cpi = ci.getIndex(); if (! unsignedFitsInShort(cpi)) { return false; } Constant cst = ci.getConstant(); return (cst instanceof CstType) || (cst instanceof CstFieldRef); }
Example 2
Source File: Form35c.java From Box with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override public boolean isCompatible(DalvInsn insn) { if (!(insn instanceof CstInsn)) { return false; } CstInsn ci = (CstInsn) insn; int cpi = ci.getIndex(); if (! unsignedFitsInShort(cpi)) { return false; } Constant cst = ci.getConstant(); if (!((cst instanceof CstMethodRef) || (cst instanceof CstType) || (cst instanceof CstCallSiteRef))) { return false; } RegisterSpecList regs = ci.getRegisters(); return (wordCount(regs) >= 0); }
Example 3
Source File: Form22c.java From Box with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override public boolean isCompatible(DalvInsn insn) { RegisterSpecList regs = insn.getRegisters(); if (!((insn instanceof CstInsn) && (regs.size() == 2) && unsignedFitsInNibble(regs.get(0).getReg()) && unsignedFitsInNibble(regs.get(1).getReg()))) { return false; } CstInsn ci = (CstInsn) insn; int cpi = ci.getIndex(); if (! unsignedFitsInShort(cpi)) { return false; } Constant cst = ci.getConstant(); return (cst instanceof CstType) || (cst instanceof CstFieldRef); }
Example 4
Source File: Form35c.java From Box with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override public boolean isCompatible(DalvInsn insn) { if (!(insn instanceof CstInsn)) { return false; } CstInsn ci = (CstInsn) insn; int cpi = ci.getIndex(); if (! unsignedFitsInShort(cpi)) { return false; } Constant cst = ci.getConstant(); if (!((cst instanceof CstMethodRef) || (cst instanceof CstType) || (cst instanceof CstCallSiteRef))) { return false; } RegisterSpecList regs = ci.getRegisters(); return (wordCount(regs) >= 0); }
Example 5
Source File: Form22c.java From J2ME-Loader with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override public boolean isCompatible(DalvInsn insn) { RegisterSpecList regs = insn.getRegisters(); if (!((insn instanceof CstInsn) && (regs.size() == 2) && unsignedFitsInNibble(regs.get(0).getReg()) && unsignedFitsInNibble(regs.get(1).getReg()))) { return false; } CstInsn ci = (CstInsn) insn; int cpi = ci.getIndex(); if (! unsignedFitsInShort(cpi)) { return false; } Constant cst = ci.getConstant(); return (cst instanceof CstType) || (cst instanceof CstFieldRef); }
Example 6
Source File: Form35c.java From J2ME-Loader with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override public boolean isCompatible(DalvInsn insn) { if (!(insn instanceof CstInsn)) { return false; } CstInsn ci = (CstInsn) insn; int cpi = ci.getIndex(); if (! unsignedFitsInShort(cpi)) { return false; } Constant cst = ci.getConstant(); if (!((cst instanceof CstMethodRef) || (cst instanceof CstType))) { return false; } RegisterSpecList regs = ci.getRegisters(); return (wordCount(regs) >= 0); }
Example 7
Source File: Form22c.java From buck with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override public boolean isCompatible(DalvInsn insn) { RegisterSpecList regs = insn.getRegisters(); if (!((insn instanceof CstInsn) && (regs.size() == 2) && unsignedFitsInNibble(regs.get(0).getReg()) && unsignedFitsInNibble(regs.get(1).getReg()))) { return false; } CstInsn ci = (CstInsn) insn; int cpi = ci.getIndex(); if (! unsignedFitsInShort(cpi)) { return false; } Constant cst = ci.getConstant(); return (cst instanceof CstType) || (cst instanceof CstFieldRef); }
Example 8
Source File: Form35c.java From buck with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override public boolean isCompatible(DalvInsn insn) { if (!(insn instanceof CstInsn)) { return false; } CstInsn ci = (CstInsn) insn; int cpi = ci.getIndex(); if (! unsignedFitsInShort(cpi)) { return false; } Constant cst = ci.getConstant(); if (!((cst instanceof CstMethodRef) || (cst instanceof CstType))) { return false; } RegisterSpecList regs = ci.getRegisters(); return (wordCount(regs) >= 0); }
Example 9
Source File: Form3rc.java From Box with Apache License 2.0 | 5 votes |
/** {@inheritDoc} */ @Override public boolean isCompatible(DalvInsn insn) { if (!(insn instanceof CstInsn)) { return false; } CstInsn ci = (CstInsn) insn; int cpi = ci.getIndex(); Constant cst = ci.getConstant(); if (! unsignedFitsInShort(cpi)) { return false; } if (!((cst instanceof CstMethodRef) || (cst instanceof CstType) || (cst instanceof CstCallSiteRef))) { return false; } RegisterSpecList regs = ci.getRegisters(); int sz = regs.size(); return (regs.size() == 0) || (isRegListSequential(regs) && unsignedFitsInShort(regs.get(0).getReg()) && unsignedFitsInByte(regs.getWordCount())); }
Example 10
Source File: Form3rc.java From Box with Apache License 2.0 | 5 votes |
/** {@inheritDoc} */ @Override public boolean isCompatible(DalvInsn insn) { if (!(insn instanceof CstInsn)) { return false; } CstInsn ci = (CstInsn) insn; int cpi = ci.getIndex(); Constant cst = ci.getConstant(); if (! unsignedFitsInShort(cpi)) { return false; } if (!((cst instanceof CstMethodRef) || (cst instanceof CstType) || (cst instanceof CstCallSiteRef))) { return false; } RegisterSpecList regs = ci.getRegisters(); int sz = regs.size(); return (regs.size() == 0) || (isRegListSequential(regs) && unsignedFitsInShort(regs.get(0).getReg()) && unsignedFitsInByte(regs.getWordCount())); }
Example 11
Source File: Form3rc.java From J2ME-Loader with Apache License 2.0 | 5 votes |
/** {@inheritDoc} */ @Override public boolean isCompatible(DalvInsn insn) { if (!(insn instanceof CstInsn)) { return false; } CstInsn ci = (CstInsn) insn; int cpi = ci.getIndex(); Constant cst = ci.getConstant(); if (! unsignedFitsInShort(cpi)) { return false; } if (!((cst instanceof CstMethodRef) || (cst instanceof CstType))) { return false; } RegisterSpecList regs = ci.getRegisters(); return (regs.size() == 0) || (isRegListSequential(regs) && unsignedFitsInShort(regs.get(0).getReg()) && unsignedFitsInByte(regs.getWordCount())); }
Example 12
Source File: Form3rc.java From buck with Apache License 2.0 | 5 votes |
/** {@inheritDoc} */ @Override public boolean isCompatible(DalvInsn insn) { if (!(insn instanceof CstInsn)) { return false; } CstInsn ci = (CstInsn) insn; int cpi = ci.getIndex(); Constant cst = ci.getConstant(); if (! unsignedFitsInShort(cpi)) { return false; } if (!((cst instanceof CstMethodRef) || (cst instanceof CstType))) { return false; } RegisterSpecList regs = ci.getRegisters(); int sz = regs.size(); return (regs.size() == 0) || (isRegListSequential(regs) && unsignedFitsInShort(regs.get(0).getReg()) && unsignedFitsInByte(regs.getWordCount())); }
Example 13
Source File: Form21c.java From Box with Apache License 2.0 | 4 votes |
/** {@inheritDoc} */ @Override public boolean isCompatible(DalvInsn insn) { if (!(insn instanceof CstInsn)) { return false; } RegisterSpecList regs = insn.getRegisters(); RegisterSpec reg; switch (regs.size()) { case 1: { reg = regs.get(0); break; } case 2: { /* * This format is allowed for ops that are effectively * 2-arg but where the two args are identical. */ reg = regs.get(0); if (reg.getReg() != regs.get(1).getReg()) { return false; } break; } default: { return false; } } if (!unsignedFitsInByte(reg.getReg())) { return false; } CstInsn ci = (CstInsn) insn; int cpi = ci.getIndex(); Constant cst = ci.getConstant(); if (! unsignedFitsInShort(cpi)) { return false; } return cst instanceof CstType || cst instanceof CstFieldRef || cst instanceof CstString || cst instanceof CstMethodHandle || cst instanceof CstProtoRef; }
Example 14
Source File: Form21c.java From Box with Apache License 2.0 | 4 votes |
/** {@inheritDoc} */ @Override public boolean isCompatible(DalvInsn insn) { if (!(insn instanceof CstInsn)) { return false; } RegisterSpecList regs = insn.getRegisters(); RegisterSpec reg; switch (regs.size()) { case 1: { reg = regs.get(0); break; } case 2: { /* * This format is allowed for ops that are effectively * 2-arg but where the two args are identical. */ reg = regs.get(0); if (reg.getReg() != regs.get(1).getReg()) { return false; } break; } default: { return false; } } if (!unsignedFitsInByte(reg.getReg())) { return false; } CstInsn ci = (CstInsn) insn; int cpi = ci.getIndex(); Constant cst = ci.getConstant(); if (! unsignedFitsInShort(cpi)) { return false; } return cst instanceof CstType || cst instanceof CstFieldRef || cst instanceof CstString || cst instanceof CstMethodHandle || cst instanceof CstProtoRef; }
Example 15
Source File: Form21c.java From J2ME-Loader with Apache License 2.0 | 4 votes |
/** {@inheritDoc} */ @Override public boolean isCompatible(DalvInsn insn) { if (!(insn instanceof CstInsn)) { return false; } RegisterSpecList regs = insn.getRegisters(); RegisterSpec reg; switch (regs.size()) { case 1: { reg = regs.get(0); break; } case 2: { /* * This format is allowed for ops that are effectively * 2-arg but where the two args are identical. */ reg = regs.get(0); if (reg.getReg() != regs.get(1).getReg()) { return false; } break; } default: { return false; } } if (!unsignedFitsInByte(reg.getReg())) { return false; } CstInsn ci = (CstInsn) insn; int cpi = ci.getIndex(); Constant cst = ci.getConstant(); if (! unsignedFitsInShort(cpi)) { return false; } return (cst instanceof CstType) || (cst instanceof CstFieldRef) || (cst instanceof CstString); }
Example 16
Source File: Form21c.java From buck with Apache License 2.0 | 4 votes |
/** {@inheritDoc} */ @Override public boolean isCompatible(DalvInsn insn) { if (!(insn instanceof CstInsn)) { return false; } RegisterSpecList regs = insn.getRegisters(); RegisterSpec reg; switch (regs.size()) { case 1: { reg = regs.get(0); break; } case 2: { /* * This format is allowed for ops that are effectively * 2-arg but where the two args are identical. */ reg = regs.get(0); if (reg.getReg() != regs.get(1).getReg()) { return false; } break; } default: { return false; } } if (!unsignedFitsInByte(reg.getReg())) { return false; } CstInsn ci = (CstInsn) insn; int cpi = ci.getIndex(); Constant cst = ci.getConstant(); if (! unsignedFitsInShort(cpi)) { return false; } return (cst instanceof CstType) || (cst instanceof CstFieldRef) || (cst instanceof CstString); }