X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/80fe26a61e165b7456274d6cc52ae40cb53b5c13..0e832de422b749cc0e33c2aa067983ad421949bf:/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); } }