@Nonnull @Override public Set<? extends Annotation> getAnnotations() { return method.getAnnotations(); }
protected List<SootClass> getThrownExceptions(final Method method) { // the following snippet retrieves all exceptions that this method // throws by analyzing its annotations List<SootClass> thrownExceptions = new ArrayList<SootClass>(); for (Annotation a : method.getAnnotations()) { Type atype = DexType.toSoot(a.getType()); String atypes = atype.toString(); if (!(atypes.equals("dalvik.annotation.Throws"))) { continue; } for (AnnotationElement ae : a.getElements()) { EncodedValue ev = ae.getValue(); if (ev instanceof ArrayEncodedValue) { for (EncodedValue evSub : ((ArrayEncodedValue) ev).getValue()) { if (evSub instanceof TypeEncodedValue) { TypeEncodedValue valueType = (TypeEncodedValue) evSub; String exceptionName = valueType.getValue(); String dottedName = Util.dottedClassName(exceptionName); thrownExceptions.add(SootResolver.v().makeClassRef(dottedName)); } } } } } return thrownExceptions; } }
method.getReturnType(), method.getAccessFlags(), method.getAnnotations(), methodImpl );
Set<? extends Annotation> aSet = method.getAnnotations(); if (!(aSet == null || aSet.isEmpty())) { List<Tag> tags = handleAnnotation(aSet, null);
public static void writeEmptyMethodTo(IndentingWriter writer, Method method, BaksmaliOptions options) throws IOException { writer.write(".method "); writeAccessFlags(writer, method.getAccessFlags()); writer.write(method.getName()); writer.write("("); ImmutableList<MethodParameter> methodParameters = ImmutableList.copyOf(method.getParameters()); for (MethodParameter parameter: methodParameters) { writer.write(parameter.getType()); } writer.write(")"); writer.write(method.getReturnType()); writer.write('\n'); writer.indent(4); writeParameters(writer, method, methodParameters, options); String containingClass = null; if (options.implicitReferences) { containingClass = method.getDefiningClass(); } AnnotationFormatter.writeTo(writer, method.getAnnotations(), containingClass); writer.deindent(4); writer.write(".end method\n"); }
containingClass = method.getDefiningClass(); AnnotationFormatter.writeTo(writer, method.getAnnotations(), containingClass);
@Nonnull @Override public Set<? extends Annotation> getAnnotations() { return method.getAnnotations(); }
@Override @Nonnull public Set<? extends Annotation> getAnnotations() { return method.getAnnotations(); }
@Override @Nonnull public Set<? extends Annotation> getAnnotations() { return method.getAnnotations(); }
@Override @Nonnull public Set<? extends Annotation> getAnnotations() { return method.getAnnotations(); }
@Override @Nonnull public Set<? extends Annotation> getAnnotations() { return RewriterUtils.rewriteSet(rewriters.getAnnotationRewriter(), method.getAnnotations()); }
@Override @Nonnull public Set<? extends Annotation> getAnnotations() { return RewriterUtils.rewriteSet(rewriters.getAnnotationRewriter(), method.getAnnotations()); }
@Override @Nonnull public Set<? extends Annotation> getAnnotations() { return RewriterUtils.rewriteSet(rewriters.getAnnotationRewriter(), method.getAnnotations()); }
List<Annotation> getAnnotations(Method m, Set<String> set) { List<Annotation> result = new ArrayList<>(); for(org.jf.dexlib2.iface.Annotation a : m.getAnnotations()) { if (set == null || set.contains(AnnotationVisibility.getVisibility(a.getVisibility()))) { result.add(DexUtil.getAnnotation(a, getClassLoader().getReference())); } } return result; }
List<Annotation> getAnnotations(Method m, Set<String> set) { List<Annotation> result = new ArrayList<>(); for(org.jf.dexlib2.iface.Annotation a : m.getAnnotations()) { if (set == null || set.contains(AnnotationVisibility.getVisibility(a.getVisibility()))) { result.add(DexUtil.getAnnotation(a, getClassLoader().getReference())); } } return result; }
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; }
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()); }
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 void writeEmptyMethodTo(IndentingWriter writer, Method method, baksmaliOptions options) throws IOException { writer.write(".method "); writeAccessFlags(writer, method.getAccessFlags()); writer.write(method.getName()); writer.write("("); ImmutableList<MethodParameter> methodParameters = ImmutableList.copyOf(method.getParameters()); for (MethodParameter parameter: methodParameters) { writer.write(parameter.getType()); } writer.write(")"); writer.write(method.getReturnType()); writer.write('\n'); writer.indent(4); writeParameters(writer, method, methodParameters, options); AnnotationFormatter.writeTo(writer, method.getAnnotations()); writer.deindent(4); writer.write(".end method\n"); }