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


Java MethodImplementation类代码示例

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


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

示例1: internMethod

import org.jf.dexlib2.iface.MethodImplementation; //导入依赖的package包/类
@Nonnull public BuilderMethod internMethod(@Nonnull String definingClass,
                                           @Nonnull String name,
                                           @Nullable List<? extends MethodParameter> parameters,
                                           @Nonnull String returnType,
                                           int accessFlags,
                                           @Nonnull Set<? extends Annotation> annotations,
                                           @Nullable MethodImplementation methodImplementation) {
    if (parameters == null) {
        parameters = ImmutableList.of();
    }
    return new BuilderMethod(context.methodPool.internMethod(definingClass, name, parameters, returnType),
            internMethodParameters(parameters),
            accessFlags,
            context.annotationSetPool.internAnnotationSet(annotations),
            methodImplementation);
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:17,代码来源:DexBuilder.java

示例2: internMethod

import org.jf.dexlib2.iface.MethodImplementation; //导入依赖的package包/类
public BuilderMethod internMethod( String definingClass,
                                            String name,
                                            List<? extends MethodParameter> parameters,
                                            String returnType,
                                           int accessFlags,
                                            Set<? extends Annotation> annotations,
                                            MethodImplementation methodImplementation) {
    if (parameters == null) {
        parameters = ImmutableList.of();
    }
    return new BuilderMethod(methodSection.internMethod(definingClass, name, parameters, returnType),
            internMethodParameters(parameters),
            accessFlags,
            annotationSetSection.internAnnotationSet(annotations),
            methodImplementation);
}
 
开发者ID:AndreJCL,项目名称:JCL,代码行数:17,代码来源:DexBuilder.java

示例3: BasicMethod

import org.jf.dexlib2.iface.MethodImplementation; //导入依赖的package包/类
public BasicMethod(
		String definingClass,
		String name,
		List<? extends MethodParameter> parameters,
		String returnType,
		int accessFlags,
		Set<? extends Annotation> annotations,
		MethodImplementation methodImplementation
) {
	this.definingClass = definingClass;
	this.name = name;
	this.parameters = parameters;
	this.returnType = returnType;
	this.accessFlags = accessFlags;
	this.annotations = annotations;
	this.methodImplementation = methodImplementation;
}
 
开发者ID:DexPatcher,项目名称:dexpatcher-tool,代码行数:18,代码来源:BasicMethod.java

示例4: internDebug

import org.jf.dexlib2.iface.MethodImplementation; //导入依赖的package包/类
private void internDebug(@Nonnull Method method) {
    for (MethodParameter param : method.getParameters()) {
        String paramName = param.getName();
        if (paramName != null) {
            stringPool.intern(paramName);
        }
    }

    MethodImplementation methodImpl = method.getImplementation();
    if (methodImpl != null) {
        for (DebugItem debugItem : methodImpl.getDebugItems()) {
            switch (debugItem.getDebugItemType()) {
                case DebugItemType.START_LOCAL:
                    StartLocal startLocal = (StartLocal) debugItem;
                    stringPool.internNullable(startLocal.getName());
                    typePool.internNullable(startLocal.getType());
                    stringPool.internNullable(startLocal.getSignature());
                    break;
                case DebugItemType.SET_SOURCE_FILE:
                    stringPool.internNullable(((SetSourceFile) debugItem).getSourceFile());
                    break;
            }
        }
    }
}
 
开发者ID:niranjan94,项目名称:show-java,代码行数:26,代码来源:ClassPool.java

示例5: internMethod

import org.jf.dexlib2.iface.MethodImplementation; //导入依赖的package包/类
@Nonnull
public BuilderMethod internMethod(@Nonnull String definingClass,
                                  @Nonnull String name,
                                  @Nullable List<? extends MethodParameter> parameters,
                                  @Nonnull String returnType,
                                  int accessFlags,
                                  @Nonnull Set<? extends Annotation> annotations,
                                  @Nullable MethodImplementation methodImplementation) {
    if (parameters == null) {
        parameters = ImmutableList.of();
    }
    return new BuilderMethod(context.methodPool.internMethod(definingClass, name, parameters, returnType),
            internMethodParameters(parameters),
            accessFlags,
            context.annotationSetPool.internAnnotationSet(annotations),
            methodImplementation);
}
 
开发者ID:niranjan94,项目名称:show-java,代码行数:18,代码来源:DexBuilder.java

示例6: translateClassDef

import org.jf.dexlib2.iface.MethodImplementation; //导入依赖的package包/类
private ClassDetail translateClassDef(ClassInfo ci, ClassDef classDef, IdentityHashMap<MethodInfo, MethodImplementation> collector) {
    ClassDetail.Builder builder = new ClassDetail.Builder();
    if (classDef.getSuperclass() == null) {
        builder.setBaseType(null); // for java.lang.Object
    } else {
        builder.setBaseType(Dalvik.findOrCreateClass(ci.scope, classDef.getSuperclass()));
    }
    builder.setInterfaces(findOrCreateClasses(ci.scope, classDef.getInterfaces()));
    builder.setAccessFlags(translateAccessFlags(classDef.getAccessFlags()));
    builder.setAllMethods(translateMethods(ci, classDef.getMethods(), collector));
    builder.setStaticFields(translateFields(ci.scope, classDef.getStaticFields()));
    HashMap<String, ClassInfo> fields = translateFields(ci.scope, classDef.getInstanceFields());
    // TODO: do we need this?
    if (ci.isInnerClass()) {
        fields.put("this$0", ci.getOuterClass());
    }
    builder.setFields(fields);
    builder.setIsFrameworkClass(isFramework);
    return builder.build();
}
 
开发者ID:mingyuan-xia,项目名称:PATDroid,代码行数:21,代码来源:SmaliClassDetailLoader.java

示例7: reMethodImpl

import org.jf.dexlib2.iface.MethodImplementation; //导入依赖的package包/类
@Override
protected MethodImplementation reMethodImpl(MethodImplementation methodImplementation) {
    if (methodImplementation == null){
        return null;
    }
    Iterable<? extends Instruction> instructions = methodImplementation.getInstructions();
    Iterable<? extends DebugItem> debugItems = methodImplementation.getDebugItems();
    List<? extends TryBlock<? extends ExceptionHandler>> tryBlocks = methodImplementation.getTryBlocks();
    return new ImmutableMethodImplementation(methodImplementation.getRegisterCount(), reInstructions(instructions), reTryCatchBlock(methodImplementation.getTryBlocks()), reDebugItem(methodImplementation.getDebugItems()));

}
 
开发者ID:alibaba,项目名称:atlas,代码行数:12,代码来源:MethodImplReIClassDef.java

示例8: modifyMethodAndFix

import org.jf.dexlib2.iface.MethodImplementation; //导入依赖的package包/类
private static MethodImplementation modifyMethodAndFix(@Nonnull MethodImplementation implementation, Method method) {
    MutableMethodImplementation mutableImplementation = new MutableMethodImplementation(implementation);
    System.out.println(mutableImplementation.getRegisterCount());
    List<BuilderInstruction> instructions = mutableImplementation.getInstructions();
    mutableImplementation.addInstruction(0,
            new BuilderInstruction21c(Opcode.CONST_STRING, 0,
                    new ImmutableStringReference("AndFix:" + method.getDefiningClass().replace("/", "."))));
    mutableImplementation.addInstruction(1,
            new BuilderInstruction35c(Opcode.INVOKE_STATIC, 1,
                    0, 0, 0, 0, 0,
                    new ImmutableMethodReference("Landroid/util/Log;", "e",
                            Lists.newArrayList("Ljava/lang/String;", "Ljava/lang/String;"), "I")));

    return mutableImplementation;
}
 
开发者ID:alibaba,项目名称:atlas,代码行数:16,代码来源:PatchMethodTool.java

示例9: modifyMethodTpatch

import org.jf.dexlib2.iface.MethodImplementation; //导入依赖的package包/类
private static MethodImplementation modifyMethodTpatch(@Nonnull MethodImplementation implementation, Method method) {
        MutableMethodImplementation mutableImplementation = new MutableMethodImplementation(implementation);
        System.out.println(mutableImplementation.getRegisterCount());
        List<BuilderInstruction> instructions = mutableImplementation.getInstructions();
        boolean isModified = false;
        for (int i = 0; i < instructions.size(); i++) {
            isModified = false;
            if (instructions.get(i).getOpcode() == Opcode.INVOKE_DIRECT) {
                if (!isModified) {
                    mutableImplementation.addInstruction(i++,
                            new BuilderInstruction21c(Opcode.CONST_STRING, 0,
                                    new ImmutableStringReference("tpatch:" + method.getDefiningClass().replace("/", "."))));
                    mutableImplementation.addInstruction(i++,
                            new BuilderInstruction35c(Opcode.INVOKE_STATIC, 1,
                                    0, 0, 0, 0, 0,
                                    new ImmutableMethodReference("Landroid/util/Log;", "e",
                                            Lists.newArrayList("Ljava/lang/String;", "Ljava/lang/String;"), "I")));
                    isModified = true;
                    break;

                }

            }
//            mutableImplementation.addInstruction(instructions.get(i));
        }

        return mutableImplementation;
    }
 
开发者ID:alibaba,项目名称:atlas,代码行数:29,代码来源:PatchMethodTool.java

示例10: of

import org.jf.dexlib2.iface.MethodImplementation; //导入依赖的package包/类
@Nullable
public static ImmutableMethodImplementation of(@Nullable MethodImplementation methodImplementation) {
    if (methodImplementation == null) {
        return null;
    }
    if (methodImplementation instanceof ImmutableMethodImplementation) {
        return (ImmutableMethodImplementation)methodImplementation;
    }
    return new ImmutableMethodImplementation(
            methodImplementation.getRegisterCount(),
            methodImplementation.getInstructions(),
            methodImplementation.getTryBlocks(),
            methodImplementation.getDebugItems());
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:15,代码来源:ImmutableMethodImplementation.java

示例11: ImmutableMethod

import org.jf.dexlib2.iface.MethodImplementation; //导入依赖的package包/类
public ImmutableMethod(@Nonnull String definingClass,
                       @Nonnull String name,
                       @Nullable Iterable<? extends MethodParameter> parameters,
                       @Nonnull String returnType,
                       int accessFlags,
                       @Nullable Set<? extends Annotation> annotations,
                       @Nullable MethodImplementation methodImplementation) {
    this.definingClass = definingClass;
    this.name = name;
    this.parameters = ImmutableMethodParameter.immutableListOf(parameters);
    this.returnType = returnType;
    this.accessFlags = accessFlags;
    this.annotations = ImmutableAnnotation.immutableSetOf(annotations);
    this.methodImplementation = ImmutableMethodImplementation.of(methodImplementation);
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:16,代码来源:ImmutableMethod.java

示例12: getDebugItems

import org.jf.dexlib2.iface.MethodImplementation; //导入依赖的package包/类
@Nullable @Override
public Iterable<? extends DebugItem> getDebugItems(@Nonnull BuilderMethod builderMethod) {
    MethodImplementation impl = builderMethod.getImplementation();
    if (impl == null) {
        return null;
    }
    return impl.getDebugItems();
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:9,代码来源:BuilderClassPool.java

示例13: getRegisterCount

import org.jf.dexlib2.iface.MethodImplementation; //导入依赖的package包/类
@Override public int getRegisterCount(@Nonnull BuilderMethod builderMethod) {
    MethodImplementation impl = builderMethod.getImplementation();
    if (impl == null) {
        return 0;
    }
    return impl.getRegisterCount();
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:8,代码来源:BuilderClassPool.java

示例14: getInstructions

import org.jf.dexlib2.iface.MethodImplementation; //导入依赖的package包/类
@Nullable @Override
public Iterable<? extends Instruction> getInstructions(@Nonnull BuilderMethod builderMethod) {
    MethodImplementation impl = builderMethod.getImplementation();
    if (impl == null) {
        return null;
    }
    return impl.getInstructions();
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:9,代码来源:BuilderClassPool.java

示例15: getTryBlocks

import org.jf.dexlib2.iface.MethodImplementation; //导入依赖的package包/类
@Nonnull @Override
public List<? extends TryBlock<? extends ExceptionHandler>> getTryBlocks(@Nonnull BuilderMethod builderMethod) {
    MethodImplementation impl = builderMethod.getImplementation();
    if (impl == null) {
        return ImmutableList.of();
    }
    return impl.getTryBlocks();
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:9,代码来源:BuilderClassPool.java


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