Class<?> klass = Object.class.getClassLoader().loadClass("MyInterface");
Object obj = Proxy.newProxyInstance(
klass.getClassLoader(), newClass[] { klass, Cloneable.class }, new InvocationHandler() {
@Override public Object invoke(Object proxy, Method method, Object[] args) { returnnull;
}
});
// Print names of declared methods - this should not include "hidden()". for (Method m : obj.getClass().getDeclaredMethods()) {
System.out.println(m.getName());
}
// Do not print names of fields. They do not have a set Java name. if (obj.getClass().getDeclaredFields().length != 2) { thrownew Exception("Expected two fields in a proxy class: 'interfaces' and 'throws'");
}
}
privatestaticfinal String DEX_EXTRA = new File(System.getenv("DEX_LOCATION"), "691-hiddenapi-proxy-ex.jar").getAbsolutePath();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.