• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DecodedInstruction类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.android.dx.io.instructions.DecodedInstruction的典型用法代码示例。如果您正苦于以下问题:Java DecodedInstruction类的具体用法?Java DecodedInstruction怎么用?Java DecodedInstruction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DecodedInstruction类属于com.android.dx.io.instructions包,在下文中一共展示了DecodedInstruction类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: transform

import com.android.dx.io.instructions.DecodedInstruction; //导入依赖的package包/类
public short[] transform(short[] encodedInstructions) throws DexException {
    DecodedInstruction[] decodedInstructions =
        DecodedInstruction.decodeAll(encodedInstructions);
    int size = decodedInstructions.length;

    mappedInstructions = new DecodedInstruction[size];
    mappedAt = 0;
    reader.visitAll(decodedInstructions);

    ShortArrayCodeOutput out = new ShortArrayCodeOutput(size);
    for (DecodedInstruction instruction : mappedInstructions) {
        if (instruction != null) {
            instruction.encode(out);
        }
    }

    return out.getArray();
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:19,代码来源:InstructionTransformer.java


示例2: callVisit

import com.android.dx.io.instructions.DecodedInstruction; //导入依赖的package包/类
private void callVisit(DecodedInstruction[] all, DecodedInstruction one) {
    Visitor visitor = null;

    switch (OpcodeInfo.getIndexType(one.getOpcode())) {
        case STRING_REF: visitor = stringVisitor; break;
        case TYPE_REF:   visitor = typeVisitor;   break;
        case FIELD_REF:  visitor = fieldVisitor;  break;
        case METHOD_REF: visitor = methodVisitor; break;
    }

    if (visitor == null) {
        visitor = fallbackVisitor;
    }

    if (visitor != null) {
        visitor.visit(all, one);
    }
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:19,代码来源:CodeReader.java


示例3: transform

import com.android.dx.io.instructions.DecodedInstruction; //导入依赖的package包/类
public short[] transform(IndexMap indexMap, short[] encodedInstructions) throws DexException {
    DecodedInstruction[] decodedInstructions =
        DecodedInstruction.decodeAll(encodedInstructions);
    int size = decodedInstructions.length;

    this.indexMap = indexMap;
    mappedInstructions = new DecodedInstruction[size];
    mappedAt = 0;
    reader.visitAll(decodedInstructions);

    ShortArrayCodeOutput out = new ShortArrayCodeOutput(size);
    for (DecodedInstruction instruction : mappedInstructions) {
        if (instruction != null) {
            instruction.encode(out);
        }
    }

    this.indexMap = null;
    return out.getArray();
}
 
开发者ID:johnlee175,项目名称:dex,代码行数:21,代码来源:InstructionTransformer.java


示例4: InvokeNode

import com.android.dx.io.instructions.DecodedInstruction; //导入依赖的package包/类
public InvokeNode(MethodInfo mth, DecodedInstruction insn, InvokeType type, boolean isRange, int resReg) {
	super(InsnType.INVOKE, mth.getArgsCount() + (type != InvokeType.STATIC ? 1 : 0));
	this.mth = mth;
	this.type = type;

	if (resReg >= 0) {
		setResult(InsnArg.reg(resReg, mth.getReturnType()));
	}

	int k = isRange ? insn.getA() : 0;
	if (type != InvokeType.STATIC) {
		int r = isRange ? k : InsnUtils.getArg(insn, k);
		addReg(r, mth.getDeclClass().getType());
		k++;
	}

	for (ArgType arg : mth.getArgumentsTypes()) {
		addReg(isRange ? k : InsnUtils.getArg(insn, k), arg);
		k += arg.getRegCount();
	}
}
 
开发者ID:niranjan94,项目名称:show-java,代码行数:22,代码来源:InvokeNode.java


示例5: process

import com.android.dx.io.instructions.DecodedInstruction; //导入依赖的package包/类
public InsnNode[] process() throws DecodeException {
	InsnNode[] instructions = new InsnNode[insnArr.length];
	for (int i = 0; i < insnArr.length; i++) {
		DecodedInstruction rawInsn = insnArr[i];
		if (rawInsn != null) {
			InsnNode insn = decode(rawInsn, i);
			if (insn != null) {
				insn.setOffset(i);
			}
			instructions[i] = insn;
		} else {
			instructions[i] = null;
		}
	}
	insnArr = null;
	return instructions;
}
 
开发者ID:niranjan94,项目名称:show-java,代码行数:18,代码来源:InsnDecoder.java


示例6: filledNewArray

import com.android.dx.io.instructions.DecodedInstruction; //导入依赖的package包/类
private InsnNode filledNewArray(DecodedInstruction insn, int offset, boolean isRange) {
	int resReg = getMoveResultRegister(insnArr, offset);
	ArgType arrType = dex.getType(insn.getIndex());
	ArgType elType = arrType.getArrayElement();
	boolean typeImmutable = elType.isPrimitive();
	int regsCount = insn.getRegisterCount();
	InsnArg[] regs = new InsnArg[regsCount];
	if (isRange) {
		int r = insn.getA();
		for (int i = 0; i < regsCount; i++) {
			regs[i] = InsnArg.reg(r, elType, typeImmutable);
			r++;
		}
	} else {
		for (int i = 0; i < regsCount; i++) {
			int regNum = InsnUtils.getArg(insn, i);
			regs[i] = InsnArg.reg(regNum, elType, typeImmutable);
		}
	}
	InsnNode node = new FilledNewArrayNode(elType, regs.length);
	node.setResult(resReg == -1 ? null : InsnArg.reg(resReg, arrType));
	for (InsnArg arg : regs) {
		node.addArg(arg);
	}
	return node;
}
 
开发者ID:niranjan94,项目名称:show-java,代码行数:27,代码来源:InsnDecoder.java


示例7: getArg

import com.android.dx.io.instructions.DecodedInstruction; //导入依赖的package包/类
public static int getArg(DecodedInstruction insn, int arg) {
	switch (arg) {
		case 0:
			return insn.getA();
		case 1:
			return insn.getB();
		case 2:
			return insn.getC();
		case 3:
			return insn.getD();
		case 4:
			return insn.getE();
		default:
			throw new JadxRuntimeException("Wrong argument number: " + arg);
	}
}
 
开发者ID:skylot,项目名称:jadx,代码行数:17,代码来源:InsnUtils.java


示例8: callVisit

import com.android.dx.io.instructions.DecodedInstruction; //导入依赖的package包/类
private void callVisit(DecodedInstruction[] all, DecodedInstruction one) {
    Visitor visitor = null;

    switch (OpcodeInfo.getIndexType(one.getOpcode())) {
        case STRING_REF: visitor = stringVisitor; break;
        case TYPE_REF:   visitor = typeVisitor;   break;
        case FIELD_REF:  visitor = fieldVisitor;  break;
        case METHOD_REF: visitor = methodVisitor; break;
        default: // fall out
    }

    if (visitor == null) {
        visitor = fallbackVisitor;
    }

    if (visitor != null) {
        visitor.visit(all, one);
    }
}
 
开发者ID:facebook,项目名称:buck,代码行数:20,代码来源:CodeReader.java


示例9: visit

import com.android.dx.io.instructions.DecodedInstruction; //导入依赖的package包/类
public void visit(DecodedInstruction[] all, DecodedInstruction one) {
    int stringId = one.getIndex();
    int mappedId = indexMap.adjustString(stringId);
    boolean isJumbo = (one.getOpcode() == Opcodes.CONST_STRING_JUMBO);
    jumboCheck(isJumbo, mappedId);
    mappedInstructions[mappedAt++] = one.withIndex(mappedId);
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:8,代码来源:InstructionTransformer.java


示例10: Grep

import com.android.dx.io.instructions.DecodedInstruction; //导入依赖的package包/类
public Grep(final Dex dex, Pattern pattern, final PrintWriter out) {
    this.dex = dex;
    this.out = out;

    stringIds = getStringIds(dex, pattern);

    codeReader.setStringVisitor(new CodeReader.Visitor() {
        public void visit(DecodedInstruction[] all, DecodedInstruction one) {
            encounterString(one.getIndex());
        }
    });
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:13,代码来源:Grep.java


示例11: visitAll

import com.android.dx.io.instructions.DecodedInstruction; //导入依赖的package包/类
public void visitAll(DecodedInstruction[] decodedInstructions)
        throws DexException {
    int size = decodedInstructions.length;

    for (int i = 0; i < size; i++) {
        DecodedInstruction one = decodedInstructions[i];
        if (one == null) {
            continue;
        }

        callVisit(decodedInstructions, one);
    }
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:14,代码来源:CodeReader.java


示例12: Grep

import com.android.dx.io.instructions.DecodedInstruction; //导入依赖的package包/类
public Grep(final DexBuffer dex, Pattern pattern, final PrintWriter out) {
    this.dex = dex;
    this.out = out;

    stringIds = getStringIds(dex, pattern);

    codeReader.setStringVisitor(new CodeReader.Visitor() {
        public void visit(DecodedInstruction[] all, DecodedInstruction one) {
            encounterString(one.getIndex());
        }
    });
}
 
开发者ID:AndreJCL,项目名称:JCL,代码行数:13,代码来源:Grep.java


示例13: ArithNode

import com.android.dx.io.instructions.DecodedInstruction; //导入依赖的package包/类
public ArithNode(DecodedInstruction insn, ArithOp op, ArgType type, boolean literal) {
	super(InsnType.ARITH, 2);
	this.op = op;
	setResult(InsnArg.reg(insn, 0, type));

	int rc = insn.getRegisterCount();
	if (literal) {
		if (rc == 1) {
			// self
			addReg(insn, 0, type);
			addLit(insn, type);
		} else if (rc == 2) {
			// normal
			addReg(insn, 1, type);
			addLit(insn, type);
		}
	} else {
		if (rc == 2) {
			// self
			addReg(insn, 0, type);
			addReg(insn, 1, type);
		} else if (rc == 3) {
			// normal
			addReg(insn, 1, type);
			addReg(insn, 2, type);
		}
	}
}
 
开发者ID:niranjan94,项目名称:show-java,代码行数:29,代码来源:ArithNode.java


示例14: decodeInsns

import com.android.dx.io.instructions.DecodedInstruction; //导入依赖的package包/类
public void decodeInsns(Code mthCode) throws DecodeException {
	short[] encodedInstructions = mthCode.getInstructions();
	int size = encodedInstructions.length;
	DecodedInstruction[] decoded = new DecodedInstruction[size];
	ShortArrayCodeInput in = new ShortArrayCodeInput(encodedInstructions);

	try {
		while (in.hasMore()) {
			decoded[in.cursor()] = DecodedInstruction.decode(in);
		}
	} catch (Exception e) {
		throw new DecodeException(method, "", e);
	}
	insnArr = decoded;
}
 
开发者ID:niranjan94,项目名称:show-java,代码行数:16,代码来源:InsnDecoder.java



注:本文中的com.android.dx.io.instructions.DecodedInstruction类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java EMConnectionListener类代码示例发布时间:2022-05-22
下一篇:
Java DeleteIndexAction类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap