public MethodInvocationStub(T baseInterface, Class<?>... proxyInterfaces) { this.mBaseInterface = baseInterface; if (baseInterface != null) { if (proxyInterfaces == null) { proxyInterfaces = MethodParameterUtils.getAllInterface(baseInterface.getClass()); } mProxyInterface = (T) Proxy.newProxyInstance(baseInterface.getClass().getClassLoader(), proxyInterfaces, new HookInvocationHandler()); } else { VLog.w(TAG, "Unable to build HookDelegate: %s.", getIdentityName()); } }
public static Class<?>[] getAllInterface(Class clazz){ HashSet<Class<?>> classes = new HashSet<>(); getAllInterfaces(clazz,classes); Class<?>[] result=new Class[classes.size()]; classes.toArray(result); return result; }
@Override public Object call(Object who, Method method, Object... args) throws Throwable { MethodParameterUtils.replaceFirstAppPkg(args); return method.invoke(who, args); } }
@Override public Object call(Object who, Method method, Object... args) throws Throwable { MethodParameterUtils.replaceLastAppPkg(args); return method.invoke(who, args); } }
@Override public boolean beforeCall(Object who, Method method, Object... args) { MethodParameterUtils.replaceSequenceAppPkg(args, sequence); return super.beforeCall(who, method, args); } }
@Override public boolean beforeCall(Object who, Method method, Object... args) { MethodParameterUtils.replaceLastAppComponent(args); return super.beforeCall(who, method, args); } }
@Override public boolean beforeCall(Object who, Method method, Object... args) { MethodParameterUtils.replaceLastAppPkg(args); return super.beforeCall(who, method, args); } }
@Override public boolean beforeCall(Object who, Method method, Object... args) { MethodParameterUtils.replaceSequenceAppPkg(args, sequence); return super.beforeCall(who, method, args); } }
@Override public Object call(Object who, Method method, Object... args) throws Throwable { MethodParameterUtils.replaceFirstAppPkg(args); return method.invoke(who, args); }
@Override public Object call(Object who, Method method, Object... args) throws Throwable { MethodParameterUtils.replaceLastAppPkg(args); Intent service = (Intent) args[0]; String resolvedType = (String) args[1]; return VActivityManager.get().peekService(service, resolvedType); }
public static void getAllInterfaces(Class clazz, HashSet<Class<?>> interfaceCollection) { Class<?>[] classes = clazz.getInterfaces(); if (classes.length != 0) { interfaceCollection.addAll(Arrays.asList(classes)); } if (clazz.getSuperclass() != Object.class) { getAllInterfaces(clazz.getSuperclass(), interfaceCollection); } }
@Override public boolean beforeCall(Object who, Method method, Object... args) { MethodParameterUtils.replaceSequenceAppPkg(args, sequence); return super.beforeCall(who, method, args); } }
public MethodInvocationStub(T baseInterface, Class<?>... proxyInterfaces) { this.mBaseInterface = baseInterface; if (baseInterface != null) { if (proxyInterfaces == null) { proxyInterfaces = MethodParameterUtils.getAllInterface(baseInterface.getClass()); } mProxyInterface = (T) Proxy.newProxyInstance(baseInterface.getClass().getClassLoader(), proxyInterfaces, new HookInvocationHandler()); } else { VLog.d(TAG, "Unable to build HookDelegate: %s.", getIdentityName()); } }
@Override public Object call(Object who, Method method, Object... args) throws Throwable { MethodParameterUtils.replaceFirstAppPkg(args); return method.invoke(who, args); }
@Override public Object call(Object who, Method method, Object... args) throws Throwable { MethodParameterUtils.replaceLastAppPkg(args); return method.invoke(who, args); } }
public static Class<?>[] getAllInterface(Class clazz){ HashSet<Class<?>> classes = new HashSet<>(); getAllInterfaces(clazz,classes); Class<?>[] result=new Class[classes.size()]; classes.toArray(result); return result; }
public MethodInvocationStub(T baseInterface, Class<?>... proxyInterfaces) { this.mBaseInterface = baseInterface; if (baseInterface != null) { if (proxyInterfaces == null) { proxyInterfaces = MethodParameterUtils.getAllInterface(baseInterface.getClass()); } mProxyInterface = (T) Proxy.newProxyInstance(baseInterface.getClass().getClassLoader(), proxyInterfaces, new HookInvocationHandler()); } else { VLog.w(TAG, "Unable to build HookDelegate: %s.", getIdentityName()); } }
@Override public Object call(Object who, Method method, Object... args) throws Throwable { MethodParameterUtils.replaceFirstAppPkg(args); return method.invoke(who, args); } }
@Override public Object call(Object who, Method method, Object... args) throws Throwable { MethodParameterUtils.replaceLastAppPkg(args); return method.invoke(who, args); } }
public static Class<?>[] getAllInterface(Class clazz){ HashSet<Class<?>> classes = new HashSet<>(); getAllInterfaces(clazz,classes); Class<?>[] result=new Class[classes.size()]; classes.toArray(result); return result; }