X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/4e2cc9d31bca82d99377b34371535f2ec9ee5c33..97bec96b43b66ab78af95d2b6c6c24f0d0a8006a:/Java/Cycript.java diff --git a/Java/Cycript.java b/Java/Cycript.java index 79ebe8e..8fb7817 100644 --- a/Java/Cycript.java +++ b/Java/Cycript.java @@ -80,16 +80,18 @@ public static class Wrapper if (false) return null; else if (method.equals(Object$equals)) + // XXX: this assumes there is only one proxy return proxy == args[0]; else if (method == Object$hashCode) - return System.identityHashCode(proxy); + // XXX: this assumes there is only one wrapper + return hashCode(); else return handle(protect_, method.getName(), args); } } -public static Object proxy(Class proxy, long protect) { - return Proxy.newProxyInstance(proxy.getClassLoader(), new Class[] {proxy}, new Wrapper(protect)); +public static Object proxy(Class proxy, Wrapper wrapper) { + return Proxy.newProxyInstance(proxy.getClassLoader(), new Class[] {proxy}, wrapper); } }