diff options
author | Zbigniew Szymański <zbigniew.szymanski@wearezeta.com> | 2014-03-12 18:05:55 +0100 |
---|---|---|
committer | Zbigniew Szymański <zbigniew.szymanski@wearezeta.com> | 2014-03-12 18:05:55 +0100 |
commit | 42a362cb897975044b942f914af8024325d8e737 (patch) | |
tree | f8cdacba13da59d61c2b2c3057a15a91c080e894 /AndroidAsync/src/com/koushikdutta/async/PushParser.java | |
parent | 3a75acf48c4bc9ec05fa3606ae753ae82f3d0ffd (diff) | |
download | AndroidAsync-42a362cb897975044b942f914af8024325d8e737.tar.gz AndroidAsync-42a362cb897975044b942f914af8024325d8e737.tar.bz2 AndroidAsync-42a362cb897975044b942f914af8024325d8e737.zip |
PushParser fix for tap callback method call
- moved "proguard friendly fallback" after "proper" method search,
- added .setAccessible(true) before invoking discovered method
Diffstat (limited to 'AndroidAsync/src/com/koushikdutta/async/PushParser.java')
-rw-r--r-- | AndroidAsync/src/com/koushikdutta/async/PushParser.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/AndroidAsync/src/com/koushikdutta/async/PushParser.java b/AndroidAsync/src/com/koushikdutta/async/PushParser.java index 8b5be70..aa41754 100644 --- a/AndroidAsync/src/com/koushikdutta/async/PushParser.java +++ b/AndroidAsync/src/com/koushikdutta/async/PushParser.java @@ -240,6 +240,7 @@ public class PushParser { TapCallback callback = mCallback; mCallback = null; Method method = getTap(callback); + method.setAccessible(true); method.invoke(callback, args); } catch (Exception ex) { @@ -255,11 +256,6 @@ public class PushParser { Method found = mTable.get(callback.getClass()); if (found != null) return found; - // try the proguard friendly route, take the first/only method - // in case "tap" has been renamed - Method[] candidates = callback.getClass().getDeclaredMethods(); - if (candidates.length == 1) - return candidates[0]; for (Method method : callback.getClass().getMethods()) { if ("tap".equals(method.getName())) { @@ -267,6 +263,13 @@ public class PushParser { return method; } } + + // try the proguard friendly route, take the first/only method + // in case "tap" has been renamed + Method[] candidates = callback.getClass().getDeclaredMethods(); + if (candidates.length == 1) + return candidates[0]; + String fail = "-keep class * extends com.koushikdutta.async.TapCallback {\n" + " *;\n" + |