From 8ef3df8245ff7538cd3642340c73535f8cec0582 Mon Sep 17 00:00:00 2001 From: FuckYou Date: Mon, 6 Mar 2017 17:05:09 +0100 Subject: [PATCH] Minor update - Added more Android compatibility code --- src/com/tofvesson/reflection/SafeReflection.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/tofvesson/reflection/SafeReflection.java b/src/com/tofvesson/reflection/SafeReflection.java index f02041d..ba40ffc 100644 --- a/src/com/tofvesson/reflection/SafeReflection.java +++ b/src/com/tofvesson/reflection/SafeReflection.java @@ -41,7 +41,8 @@ public final class SafeReflection { f.setAccessible(true); l = u.objectFieldOffset(AccessibleObject.class.getDeclaredField("override")); // Most desktop versions of Java }catch(Exception e){ - f = Field.class.getDeclaredField("accessFlags"); + try { f = Field.class.getDeclaredField("artField").getType().getDeclaredField("accessFlags"); } + catch(Exception ignored){ f = Field.class.getDeclaredField("accessFlags"); } f.setAccessible(true); l = u.objectFieldOffset(AccessibleObject.class.getDeclaredField("flag")); // God-damned Android }