diff --git a/CHANGELOG.md b/CHANGELOG.md index 78d947c67..bb11a423b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ Changelog **Next release** +* Fixed XPrivacy not being activated below JellyBean MR1 (SDK 17) ([issue](/../../issues/1602)) + [Open issues](https://github.com/M66B/XPrivacy/issues?state=open) **Version 2.0.12 STABLE** diff --git a/src/biz/bokhorst/xprivacy/Util.java b/src/biz/bokhorst/xprivacy/Util.java index 95e1b5bbb..1e248ecac 100644 --- a/src/biz/bokhorst/xprivacy/Util.java +++ b/src/biz/bokhorst/xprivacy/Util.java @@ -34,7 +34,6 @@ import android.os.Environment; import android.os.Process; import android.os.RemoteException; -import android.os.UserHandle; import android.util.Base64; import android.util.Log; import android.widget.Toast; @@ -195,7 +194,8 @@ public static int getAppId(int uid) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) try { // UserHandle: public static final int getAppId(int uid) - Method method = (Method) UserHandle.class.getDeclaredMethod("getAppId", int.class); + Class clazz = Class.forName("android.os.UserHandle"); + Method method = (Method) clazz.getDeclaredMethod("getAppId", int.class); uid = (Integer) method.invoke(null, uid); } catch (Throwable ex) { Util.log(null, Log.WARN, ex.toString()); @@ -210,7 +210,8 @@ public static int getUserId(int uid) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) try { // UserHandle: public static final int getUserId(int uid) - Method method = (Method) UserHandle.class.getDeclaredMethod("getUserId", int.class); + Class clazz = Class.forName("android.os.UserHandle"); + Method method = (Method) clazz.getDeclaredMethod("getUserId", int.class); userId = (Integer) method.invoke(null, uid); } catch (Throwable ex) { Util.log(null, Log.WARN, ex.toString());