Code example for Method

Methods: getName, getReturnType

0
    if (mProviderField.get() == null) {
      Object provider = Proxy.newProxyInstance(classLoader, new Class[]{webViewProviderClass}, new InvocationHandler() {
        @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
          if (DEBUG) System.out.println("[DEBUG] WebView: " + method);
 
          if (method.getName().equals("getViewDelegate") || method.getName().equals("getScrollDelegate")) {
            return Proxy.newProxyInstance(classLoader, new Class[]{
                getClassNamed("android.webkit.WebViewProvider$ViewDelegate"), 
                getClassNamed("android.webkit.WebViewProvider$ScrollDelegate") 
            }, new InvocationHandler() {
              @Override 
              public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
                if (DEBUG) System.out.println("[DEBUG] WebView delegate: " + method);
                return nullish(method);
              } 
            }); 
          } 
 
          return nullish(method);
        } 
      }); 
      mProviderField.set(provider);
    } 
  } 
 
  @Implementation 
  public void setLayoutParams(LayoutParams params) {
    field("mLayoutParams").ofType(LayoutParams.class).in(realWebView).set(params);
  } 
 
  private Object nullish(Method method) {
    Class<?> returnType = method.getReturnType();
    if (returnType.equals(long.class)
        || returnType.equals(double.class)
        || returnType.equals(int.class)
        || returnType.equals(float.class)
        || returnType.equals(short.class)