ImmutableMethod meth = new ImmutableMethod(classType, sm.getName(), parameters, returnType, accessFlags, buildMethodAnnotations(sm), impl); methods.add(meth);
@Nonnull @Override protected ImmutableMethod makeImmutable(@Nonnull Method item) { return ImmutableMethod.of(item); } };
public ImmutableClassDef(@Nonnull String type, int accessFlags, @Nullable String superclass, @Nullable Collection<String> interfaces, @Nullable String sourceFile, @Nullable Collection<? extends Annotation> annotations, @Nullable Iterable<? extends Field> fields, @Nullable Iterable<? extends Method> methods) { if (fields == null) { fields = ImmutableList.of(); } if (methods == null) { methods = ImmutableList.of(); } this.type = type; this.accessFlags = accessFlags; this.superclass = superclass; this.interfaces = interfaces==null ? ImmutableList.<String>of() : ImmutableList.copyOf(interfaces); this.sourceFile = sourceFile; this.annotations = ImmutableAnnotation.immutableSetOf(annotations); this.staticFields = ImmutableField.immutableSetOf(Iterables.filter(fields, FieldUtil.FIELD_IS_STATIC)); this.instanceFields = ImmutableField.immutableSetOf(Iterables.filter(fields, FieldUtil.FIELD_IS_INSTANCE)); this.directMethods = ImmutableMethod.immutableSetOf(Iterables.filter(methods, MethodUtil.METHOD_IS_DIRECT)); this.virtualMethods = ImmutableMethod.immutableSetOf(Iterables.filter(methods, MethodUtil.METHOD_IS_VIRTUAL)); }
public ImmutableClassDef(@Nonnull String type, int accessFlags, @Nullable String superclass, @Nullable Collection<String> interfaces, @Nullable String sourceFile, @Nullable Collection<? extends Annotation> annotations, @Nullable Iterable<? extends Field> fields, @Nullable Iterable<? extends Method> methods) { if (fields == null) { fields = ImmutableList.of(); } if (methods == null) { methods = ImmutableList.of(); } this.type = type; this.accessFlags = accessFlags; this.superclass = superclass; this.interfaces = interfaces==null ? ImmutableList.<String>of() : ImmutableList.copyOf(interfaces); this.sourceFile = sourceFile; this.annotations = ImmutableAnnotation.immutableSetOf(annotations); this.staticFields = ImmutableField.immutableSetOf(Iterables.filter(fields, FieldUtil.FIELD_IS_STATIC)); this.instanceFields = ImmutableField.immutableSetOf(Iterables.filter(fields, FieldUtil.FIELD_IS_INSTANCE)); this.directMethods = ImmutableMethod.immutableSetOf(Iterables.filter(methods, MethodUtil.METHOD_IS_DIRECT)); this.virtualMethods = ImmutableMethod.immutableSetOf(Iterables.filter(methods, MethodUtil.METHOD_IS_VIRTUAL)); }
@Nonnull private static Method inlineMethod(int accessFlags, @Nonnull String cls, @Nonnull String name, @Nonnull String params, @Nonnull String returnType) { ImmutableList<ImmutableMethodParameter> paramList = ImmutableList.copyOf(ParamUtil.parseParamString(params)); return new ImmutableMethod(cls, name, paramList, returnType, accessFlags, null, null); }
public ImmutableClassDef(@Nonnull String type, int accessFlags, @Nullable String superclass, @Nullable Collection<String> interfaces, @Nullable String sourceFile, @Nullable Collection<? extends Annotation> annotations, @Nullable Iterable<? extends Field> fields, @Nullable Iterable<? extends Method> methods) { if (fields == null) { fields = ImmutableList.of(); } if (methods == null) { methods = ImmutableList.of(); } this.type = type; this.accessFlags = accessFlags; this.superclass = superclass; this.interfaces = interfaces==null ? ImmutableSet.<String>of() : ImmutableSet.copyOf(interfaces); this.sourceFile = sourceFile; this.annotations = ImmutableAnnotation.immutableSetOf(annotations); this.staticFields = ImmutableField.immutableSetOf(Iterables.filter(fields, FieldUtil.FIELD_IS_STATIC)); this.instanceFields = ImmutableField.immutableSetOf(Iterables.filter(fields, FieldUtil.FIELD_IS_INSTANCE)); this.directMethods = ImmutableMethod.immutableSetOf(Iterables.filter(methods, MethodUtil.METHOD_IS_DIRECT)); this.virtualMethods = ImmutableMethod.immutableSetOf(Iterables.filter(methods, MethodUtil.METHOD_IS_VIRTUAL)); }
@Nonnull @Override protected ImmutableMethod makeImmutable(@Nonnull Method item) { return ImmutableMethod.of(item); } };
@Nonnull private static Method inlineMethod(int accessFlags, @Nonnull String cls, @Nonnull String name, @Nonnull String params, @Nonnull String returnType) { ImmutableList<ImmutableMethodParameter> paramList = ImmutableList.copyOf(ParamUtil.parseParamString(params)); return new ImmutableMethod(cls, name, paramList, returnType, accessFlags, null, null); }
this.staticFields = ImmutableField.immutableSetOf(staticFields); this.instanceFields = ImmutableField.immutableSetOf(instanceFields); this.directMethods = ImmutableMethod.immutableSetOf(directMethods); this.virtualMethods = ImmutableMethod.immutableSetOf(virtualMethods);
@Nonnull @Override protected ImmutableMethod makeImmutable(@Nonnull Method item) { return ImmutableMethod.of(item); } };
@Nonnull private static Method inlineMethod(int accessFlags, @Nonnull String cls, @Nonnull String name, @Nonnull String params, @Nonnull String returnType) { ImmutableList<ImmutableMethodParameter> paramList = ImmutableList.copyOf(ParamUtil.parseParamString(params)); return new ImmutableMethod(cls, name, paramList, returnType, accessFlags, null, null); }
this.staticFields = ImmutableField.immutableSetOf(staticFields); this.instanceFields = ImmutableField.immutableSetOf(instanceFields); this.directMethods = ImmutableMethod.immutableSetOf(directMethods); this.virtualMethods = ImmutableMethod.immutableSetOf(virtualMethods);
return new ImmutableMethod(className, methodName, methodParams, methodRet, accessFlags, null, null);
this.staticFields = ImmutableField.immutableSetOf(staticFields); this.instanceFields = ImmutableField.immutableSetOf(instanceFields); this.directMethods = ImmutableMethod.immutableSetOf(directMethods); this.virtualMethods = ImmutableMethod.immutableSetOf(virtualMethods);
return new ImmutableMethod(className, methodName, methodParams, methodRet, accessFlags, null, null);
return new ImmutableMethod(className, methodName, methodParams, methodRet, accessFlags, null, null);
private static List<Method> reDexMethods(@Nonnull ClassDef classDef) { List<Method> taintedMethods = Lists.newArrayList(); for (Method method : classDef.getMethods()) { MethodImplementation implementation = method.getImplementation(); MutableMethodImplementation mutableImplementation = new MutableMethodImplementation(implementation); taintedMethods.add(new ImmutableMethod( method.getDefiningClass(), method.getName(), method.getParameters(), method.getReturnType(), method.getAccessFlags(), method.getAnnotations(), mutableImplementation)); } return taintedMethods; }
return new ImmutableMethod(reType, classProcessor.methodProcess(isInit ? methodName : DefineUtils.getDalvikClassName(method.getDefiningClass()), methodName, isBasic ? basicType.get(returnType) : DefineUtils.getDalvikClassName(returnType), StringUtils.join(argsOringn, ",")).methodName,
public static ImmutableMethod of(Method method) { if (method instanceof ImmutableMethod) { return (ImmutableMethod)method; } return new ImmutableMethod( method.getDefiningClass(), method.getName(), method.getParameters(), method.getReturnType(), method.getAccessFlags(), method.getAnnotations(), method.getImplementation()); }
public static ImmutableMethod of(Method method) { if (method instanceof ImmutableMethod) { return (ImmutableMethod)method; } return new ImmutableMethod( method.getDefiningClass(), method.getName(), method.getParameters(), method.getReturnType(), method.getAccessFlags(), method.getAnnotations(), method.getImplementation()); }