/** * Checks if the interface method overrides the virtual or interface method2 * @param method A Method from an interface * @param method2 A Method from an interface or a class * @return true if the interface method overrides the virtual or interface method2 */ private boolean interfaceMethodOverrides(@Nonnull Method method, @Nonnull Method method2) { ClassProto classProto = (ClassProto)classPath.getClass(method2.getDefiningClass()); if (classProto.isInterface()) { ClassProto targetClassProto = (ClassProto)classPath.getClass(method.getDefiningClass()); return targetClassProto.implementsInterface(method2.getDefiningClass()); } else { return false; } }
private boolean isOverridableByDefaultMethod(@Nonnull Method method) { ClassProto classProto = (ClassProto)classPath.getClass(method.getDefiningClass()); return classProto.isInterface(); }
if (!AccessFlags.ABSTRACT.isSet(interfaceMethod.getAccessFlags())) { ClassProto existingInterface = (ClassProto)classPath.getClass( defaultMethods.get(defaultMethodIndex).getDefiningClass()); if (!existingInterface.implementsInterface(interfaceMethod.getDefiningClass())) { Method removedMethod = defaultMethods.remove(defaultMethodIndex); defaultConflictMethods.add(removedMethod); mirandaMethods.get(mirandaMethodIndex).getDefiningClass()); if (!existingInterface.implementsInterface(interfaceMethod.getDefiningClass())) { Method oldMethod = mirandaMethods.remove(mirandaMethodIndex); int methodOrderValue = methodOrder.get(oldMethod);
if (!AccessFlags.ABSTRACT.isSet(interfaceMethod.getAccessFlags())) { ClassProto existingInterface = (ClassProto)classPath.getClass( defaultMethods.get(defaultMethodIndex).getDefiningClass()); if (!existingInterface.implementsInterface(interfaceMethod.getDefiningClass())) { Method removedMethod = defaultMethods.remove(defaultMethodIndex); defaultConflictMethods.add(removedMethod); mirandaMethods.get(mirandaMethodIndex).getDefiningClass()); if (!existingInterface.implementsInterface(interfaceMethod.getDefiningClass())) { Method oldMethod = mirandaMethods.remove(mirandaMethodIndex); int methodOrderValue = methodOrder.get(oldMethod);
ClassProto thisClass = (ClassProto)classPath.getClass(method.getDefiningClass());
method.getDefiningClass(), method.getName(), method.getParameters(),
setPostRegisterTypeAndPropagateChanges(startOfMethod, thisRegister, RegisterType.getRegisterType(RegisterType.UNINIT_THIS, classPath.getClass(method.getDefiningClass()))); } else { setPostRegisterTypeAndPropagateChanges(startOfMethod, thisRegister, RegisterType.getRegisterType(RegisterType.REFERENCE, classPath.getClass(method.getDefiningClass())));
containingClass = method.getDefiningClass();
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"); }
if (isSuper) { TypeProto typeProto = classPath.getClass(method.getDefiningClass()); TypeProto superType; ClassDef thisClass = classPath.getClassDef(method.getDefiningClass());
ClassDef thisClass = classPath.getClassDef(method.getDefiningClass());
containingClass = method.getDefiningClass();
@Override @Nonnull public String getDefiningClass() { return method.getDefiningClass(); }
private boolean isOverridableByDefaultMethod(@Nonnull Method method) { ClassProto classProto = (ClassProto)classPath.getClass(method.getDefiningClass()); return classProto.isInterface(); }
public ControlFlowGraph(Method method) { this(getFlatMethod(method)); String definingClass = method.getDefiningClass(); this.identifier = definingClass + "." + method.getName() + "()" + method.getReturnType(); // this.identifier = definingClass.substring(definingClass.lastIndexOf("/")+1) + method.getName() + "(" + method.getReturnType() + ")"; this.identifier = this.identifier.replace(";", ""); this.shortIdentifier = identifier.substring(definingClass.lastIndexOf("/")+1); }
final String classContext; if (methodDef.classDef.options.implicitReferences) { classContext = methodDef.method.getDefiningClass(); } else { classContext = null;
private boolean canAccess(@Nonnull Method virtualMethod) { if (!methodIsPackagePrivate(virtualMethod.getAccessFlags())) { return true; } String otherPackage = getPackage(virtualMethod.getDefiningClass()); String ourPackage = getPackage(getClassDef().getType()); return otherPackage.equals(ourPackage); }
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; }
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()); }