当前位置: 首页>>代码示例>>Java>>正文


Java TypeUtils.isWideType方法代码示例

本文整理汇总了Java中org.jf.dexlib2.util.TypeUtils.isWideType方法的典型用法代码示例。如果您正苦于以下问题:Java TypeUtils.isWideType方法的具体用法?Java TypeUtils.isWideType怎么用?Java TypeUtils.isWideType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jf.dexlib2.util.TypeUtils的用法示例。


在下文中一共展示了TypeUtils.isWideType方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: writeParameters

import org.jf.dexlib2.util.TypeUtils; //导入方法依赖的package包/类
private static void writeParameters(IndentingWriter writer, Method method,
                                    List<? extends MethodParameter> parameters,
                                    baksmaliOptions options) throws IOException {
    boolean isStatic = AccessFlags.STATIC.isSet(method.getAccessFlags());
    int registerNumber = isStatic ? 0 : 1;
    for (MethodParameter parameter : parameters) {
        String parameterType = parameter.getType();
        String parameterName = parameter.getName();
        Collection<? extends Annotation> annotations = parameter.getAnnotations();
        if (parameterName != null || annotations.size() != 0) {
            writer.write(".param p");
            writer.printSignedIntAsDec(registerNumber);

            if (parameterName != null && options.outputDebugInfo) {
                writer.write(", ");
                ReferenceFormatter.writeStringReference(writer, parameterName);
            }
            writer.write("    # ");
            writer.write(parameterType);
            writer.write("\n");
            if (annotations.size() > 0) {
                writer.indent(4);

                String containingClass = null;
                if (options.useImplicitReferences) {
                    containingClass = method.getDefiningClass();
                }
                AnnotationFormatter.writeTo(writer, annotations, containingClass);
                writer.deindent(4);
                writer.write(".end param\n");
            }
        }

        registerNumber++;
        if (TypeUtils.isWideType(parameterType)) {
            registerNumber++;
        }
    }
}
 
开发者ID:alibaba,项目名称:atlas,代码行数:40,代码来源:MethodDefinition.java

示例2: propagateParameterTypes

import org.jf.dexlib2.util.TypeUtils; //导入方法依赖的package包/类
private void propagateParameterTypes(int parameterStartRegister) {
    int i=0;
    for (MethodParameter parameter: method.getParameters()) {
        if (TypeUtils.isWideType(parameter)) {
            setPostRegisterTypeAndPropagateChanges(startOfMethod, parameterStartRegister + i++,
                    RegisterType.getWideRegisterType(parameter, true));
            setPostRegisterTypeAndPropagateChanges(startOfMethod, parameterStartRegister + i++,
                    RegisterType.getWideRegisterType(parameter, false));
        } else {
            setPostRegisterTypeAndPropagateChanges(startOfMethod, parameterStartRegister + i++,
                    RegisterType.getRegisterType(classPath, parameter));
        }
    }
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:15,代码来源:MethodAnalyzer.java

示例3: writeParameters

import org.jf.dexlib2.util.TypeUtils; //导入方法依赖的package包/类
private static void writeParameters(IndentingWriter writer, Method method,
                                    List<? extends MethodParameter> parameters,
                                    baksmaliOptions options) throws IOException {
    boolean isStatic = AccessFlags.STATIC.isSet(method.getAccessFlags());
    int registerNumber = isStatic?0:1;
    for (MethodParameter parameter: parameters) {
        String parameterType = parameter.getType();
        String parameterName = parameter.getName();
        Collection<? extends Annotation> annotations = parameter.getAnnotations();
        if (parameterName != null || annotations.size() != 0) {
            writer.write(".param p");
            writer.printSignedIntAsDec(registerNumber);

            if (parameterName != null && options.outputDebugInfo) {
                writer.write(", ");
                ReferenceFormatter.writeStringReference(writer, parameterName);
            }
            writer.write("    # ");
            writer.write(parameterType);
            writer.write("\n");
            if (annotations.size() > 0) {
                writer.indent(4);
                AnnotationFormatter.writeTo(writer, annotations);
                writer.deindent(4);
                writer.write(".end param\n");
            }
        }

        registerNumber++;
        if (TypeUtils.isWideType(parameterType)) {
            registerNumber++;
        }
    }
}
 
开发者ID:Miracle963,项目名称:zjdroid,代码行数:35,代码来源:MethodDefinition.java

示例4: onSimpleEdit

import org.jf.dexlib2.util.TypeUtils; //导入方法依赖的package包/类
@Override
protected Method onSimpleEdit(Method patch, PatcherAnnotation annotation, Method target, boolean inPlace) {

	if (!inPlace && NATIVE.isSet(patch.getAccessFlags() & target.getAccessFlags())) {
		log(ERROR, "cannot rename native method");
	}

	MethodImplementation implementation = target.getImplementation();
	if (isTaggedByLastParameter(patch, false)) {
		List<? extends MethodParameter> parameters = patch.getParameters();
		MethodParameter lastParameter = parameters.get(parameters.size() - 1);
		int tagRegisterCount = (TypeUtils.isWideType(lastParameter) ? 2 : 1);
		implementation = new BasicMethodImplementation(
				implementation.getRegisterCount() + tagRegisterCount,
				implementation.getInstructions(),
				implementation.getTryBlocks(),
				implementation.getDebugItems());
	}

	Method patched = new BasicMethod(
			patch.getDefiningClass(),
			patch.getName(),
			patch.getParameters(),
			patch.getReturnType(),
			patch.getAccessFlags(),
			annotation.getFilteredAnnotations(),
			implementation);

	return super.onSimpleEdit(patched, annotation, target, inPlace);

}
 
开发者ID:DexPatcher,项目名称:dexpatcher-tool,代码行数:32,代码来源:MethodSetPatcher.java

示例5: propagateParameterTypes

import org.jf.dexlib2.util.TypeUtils; //导入方法依赖的package包/类
private void propagateParameterTypes(int parameterStartRegister) {
    int i = 0;
    for (MethodParameter parameter : method.getParameters()) {
        if (TypeUtils.isWideType(parameter)) {
            setPostRegisterTypeAndPropagateChanges(startOfMethod, parameterStartRegister + i++,
                    RegisterType.getWideRegisterType(parameter, true));
            setPostRegisterTypeAndPropagateChanges(startOfMethod, parameterStartRegister + i++,
                    RegisterType.getWideRegisterType(parameter, false));
        } else {
            setPostRegisterTypeAndPropagateChanges(startOfMethod, parameterStartRegister + i++,
                    RegisterType.getRegisterType(classPath, parameter));
        }
    }
}
 
开发者ID:niranjan94,项目名称:show-java,代码行数:15,代码来源:MethodAnalyzer.java

示例6: writeParameters

import org.jf.dexlib2.util.TypeUtils; //导入方法依赖的package包/类
private static void writeParameters(IndentingWriter writer, Method method,
                                    List<? extends MethodParameter> parameters,
                                    baksmaliOptions options) throws IOException {
    boolean isStatic = AccessFlags.STATIC.isSet(method.getAccessFlags());
    int registerNumber = isStatic?0:1;
    for (MethodParameter parameter: parameters) {
        String parameterType = parameter.getType();
        String parameterName = parameter.getName();
        Collection<? extends Annotation> annotations = parameter.getAnnotations();
        if (parameterName != null || annotations.size() != 0) {
            writer.write(".param p");
            writer.printSignedIntAsDec(registerNumber);

            if (parameterName != null && options.outputDebugInfo) {
                writer.write(", ");
                ReferenceFormatter.writeStringReference(writer, parameterName);
            }
            writer.write("    # ");
            writer.write(parameterType);
            writer.write("\n");
            if (annotations.size() > 0) {
                writer.indent(4);

                String containingClass = null;
                if (options.useImplicitReferences) {
                    containingClass = method.getDefiningClass();
                }
                AnnotationFormatter.writeTo(writer, annotations, containingClass);
                writer.deindent(4);
                writer.write(".end param\n");
            }
        }

        registerNumber++;
        if (TypeUtils.isWideType(parameterType)) {
            registerNumber++;
        }
    }
}
 
开发者ID:Sukelluskello,项目名称:VectorAttackScanner,代码行数:40,代码来源:MethodDefinition.java

示例7: writeTo

import org.jf.dexlib2.util.TypeUtils; //导入方法依赖的package包/类
public void writeTo(IndentingWriter writer) throws IOException {
    int parameterRegisterCount = 0;
    if (!AccessFlags.STATIC.isSet(method.getAccessFlags())) {
        parameterRegisterCount++;
    }

    writer.write(".method ");
    writeAccessFlags(writer, method.getAccessFlags());
    writer.write(method.getName());
    writer.write("(");
    for (MethodParameter parameter: methodParameters) {
        String type = parameter.getType();
        writer.write(type);
        parameterRegisterCount++;
        if (TypeUtils.isWideType(type)) {
            parameterRegisterCount++;
        }
    }
    writer.write(")");
    writer.write(method.getReturnType());
    writer.write('\n');

    writer.indent(4);
    if (classDef.options.useLocalsDirective) {
        writer.write(".locals ");
        writer.printSignedIntAsDec(methodImpl.getRegisterCount() - parameterRegisterCount);
    } else {
        writer.write(".registers ");
        writer.printSignedIntAsDec(methodImpl.getRegisterCount());
    }
    writer.write('\n');
    writeParameters(writer, method, methodParameters, classDef.options);

    if (registerFormatter == null) {
        registerFormatter = new RegisterFormatter(classDef.options, methodImpl.getRegisterCount(),
                parameterRegisterCount);
    }

    AnnotationFormatter.writeTo(writer, method.getAnnotations());

    writer.write('\n');

    List<MethodItem> methodItems = getMethodItems();
    for (MethodItem methodItem: methodItems) {
        if (methodItem.writeTo(writer)) {
            writer.write('\n');
        }
    }
    writer.deindent(4);
    writer.write(".end method\n");
}
 
开发者ID:Miracle963,项目名称:zjdroid,代码行数:52,代码来源:MethodDefinition.java

示例8: writeTo

import org.jf.dexlib2.util.TypeUtils; //导入方法依赖的package包/类
public void writeTo(IndentingWriter writer) throws IOException {
    int parameterRegisterCount = 0;
    if (!AccessFlags.STATIC.isSet(method.getAccessFlags())) {
        parameterRegisterCount++;
    }

    writer.write(".method ");
    writeAccessFlags(writer, method.getAccessFlags());
    writer.write(method.getName());
    writer.write("(");
    for (MethodParameter parameter: methodParameters) {
        String type = parameter.getType();
        writer.write(type);
        parameterRegisterCount++;
        if (TypeUtils.isWideType(type)) {
            parameterRegisterCount++;
        }
    }
    writer.write(")");
    writer.write(method.getReturnType());
    writer.write('\n');

    writer.indent(4);
    if (classDef.options.useLocalsDirective) {
        writer.write(".locals ");
        writer.printSignedIntAsDec(methodImpl.getRegisterCount() - parameterRegisterCount);
    } else {
        writer.write(".registers ");
        writer.printSignedIntAsDec(methodImpl.getRegisterCount());
    }
    writer.write('\n');
    writeParameters(writer, method, methodParameters, classDef.options);

    if (registerFormatter == null) {
        registerFormatter = new RegisterFormatter(classDef.options, methodImpl.getRegisterCount(),
                parameterRegisterCount);
    }

    String containingClass = null;
    if (classDef.options.useImplicitReferences) {
        containingClass = method.getDefiningClass();
    }
    AnnotationFormatter.writeTo(writer, method.getAnnotations(), containingClass);

    writer.write('\n');

    List<MethodItem> methodItems = getMethodItems();
    for (MethodItem methodItem: methodItems) {
        if (methodItem.writeTo(writer)) {
            writer.write('\n');
        }
    }
    writer.deindent(4);
    writer.write(".end method\n");
}
 
开发者ID:Sukelluskello,项目名称:VectorAttackScanner,代码行数:56,代码来源:MethodDefinition.java


注:本文中的org.jf.dexlib2.util.TypeUtils.isWideType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。