Closed q960757274 closed 6 years ago
比如我想在vollry request类的add方法前做一些事情 代码如下: @Before("call(* com.android.volley.RequestQueue.add(..))") public void onGetVolleyHttpBefore(JoinPoint joinPoint) throws Throwable{ Log.v(TAG,"volley lib send request"); Object[] objects=joinPoint.getArgs(); Request request=(Request)objects[0]; Log.v(TAG,"volley lib request method="+request.getMethod()); String url=request.getUrl(); Log.v(TAG,"volley lib request url="+url); } 不生效,为什么?求大神
可以hook任何第三方库里的方法,不生效的原因很可能是aspectjx 配置过滤的问题导致,你可以参数把过滤条件删除看看,aspectjx的过滤配置是这样的:
aspectjx { includeJarFilter '' excludeJarFilter '' }
把它删掉看看。
Android 多 modual开发,不同modual之间可以hook吗
@firefly1126
比如我想在vollry request类的add方法前做一些事情 代码如下: @Before("call(* com.android.volley.RequestQueue.add(..))") public void onGetVolleyHttpBefore(JoinPoint joinPoint) throws Throwable{ Log.v(TAG,"volley lib send request"); Object[] objects=joinPoint.getArgs(); Request request=(Request)objects[0]; Log.v(TAG,"volley lib request method="+request.getMethod()); String url=request.getUrl(); Log.v(TAG,"volley lib request url="+url); } 不生效,为什么?求大神