From 91f9008995e78607c3844366cb73a8d271c31dd9 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 26 Jun 2014 17:41:07 +0200 Subject: [PATCH] Fixed compatibility with Boat Browser Fixes #1760 --- CHANGELOG.md | 1 + src/biz/bokhorst/xprivacy/XField.java | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37bffce12..1ba16ad81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ Changelog * Fixed all problems reported through the support info * Thanks for sending all the support info! +* Fixed compatibility with [Boat Browser](https://play.google.com/store/apps/details?id=com.boatbrowser.free) * Updated Slovak translation [Open issues](https://github.com/M66B/XPrivacy/issues?state=open) diff --git a/src/biz/bokhorst/xprivacy/XField.java b/src/biz/bokhorst/xprivacy/XField.java index 669fc5316..2fc7e278b 100644 --- a/src/biz/bokhorst/xprivacy/XField.java +++ b/src/biz/bokhorst/xprivacy/XField.java @@ -111,8 +111,12 @@ protected void before(XParam param) throws Throwable { if (Binder.getCallingUid() == android.os.Process.SYSTEM_UID) return; - // Check if class listed + // Make accessible Field field = (Field) param.thisObject; + param.setObjectExtra("accessible", (Boolean) field.isAccessible()); + field.setAccessible(true); + + // Check if class listed String className = field.getDeclaringClass().getName(); if (!cClassName.contains(className)) return; @@ -131,6 +135,12 @@ protected void before(XParam param) throws Throwable { @Override protected void after(XParam param) throws Throwable { - // Do nothing + // Check if Android + if (Binder.getCallingUid() == android.os.Process.SYSTEM_UID) + return; + + // Restore accessibility + Field field = (Field) param.thisObject; + field.setAccessible((Boolean) param.getObjectExtra("accessible")); } }