Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

Commit

Permalink
Fixed XPrivacy not being activated below JellyBean MR1 (SDK 17)
Browse files Browse the repository at this point in the history
Refs #1602
  • Loading branch information
M66B committed Mar 26, 2014
1 parent 94a7df9 commit aa22124
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**
Expand Down
7 changes: 4 additions & 3 deletions src/biz/bokhorst/xprivacy/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
Expand All @@ -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());
Expand Down

0 comments on commit aa22124

Please sign in to comment.