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

Commit

Permalink
Make allowed applications application specific
Browse files Browse the repository at this point in the history
Refs #686
  • Loading branch information
M66B committed Nov 15, 2013
1 parent 2c6f635 commit cefa3c1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
12 changes: 8 additions & 4 deletions src/biz/bokhorst/xprivacy/ActivityApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,8 @@ public int compare(ApplicationInfo info1, ApplicationInfo info2) {
mListApp.add(String.format("%s (%s)", pm.getApplicationLabel(mListInfo.get(i)),
mListInfo.get(i).packageName));
mSelection[i] = PrivacyManager.getSettingBool(null, ActivityApp.this, 0,
String.format("Application.%s", mListInfo.get(i).packageName), false, false);
String.format("Application.%d.%s", mListInfo.get(i).uid, mListInfo.get(i).packageName),
false, false);
} catch (Throwable ex) {
Util.bug(null, ex);
}
Expand All @@ -594,9 +595,12 @@ protected void onPostExecute(Object result) {
new DialogInterface.OnMultiChoiceClickListener() {
public void onClick(DialogInterface dialog, int whichButton, boolean isChecked) {
try {
PrivacyManager.setSetting(null, ActivityApp.this, 0,
String.format("Application.%s", mListInfo.get(whichButton).packageName),
Boolean.toString(isChecked));
PrivacyManager.setSetting(
null,
ActivityApp.this,
0,
String.format("Application.%d.%s", mListInfo.get(whichButton).uid,
mListInfo.get(whichButton).packageName), Boolean.toString(isChecked));
} catch (Throwable ex) {
Util.bug(null, ex);
Toast toast = Toast.makeText(ActivityApp.this, ex.toString(), Toast.LENGTH_LONG);
Expand Down
3 changes: 2 additions & 1 deletion src/biz/bokhorst/xprivacy/XApplicationPackageManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ private List<ResolveInfo> filterResolveInfo(List<ResolveInfo> original) {
}

public static boolean isPackageAllowed(String packageName) {
return PrivacyManager.getSettingBool(null, null, 0, String.format("Application.%s", packageName), false, true);
return PrivacyManager.getSettingBool(null, null, 0,
String.format("Application.%d.%s", Binder.getCallingUid(), packageName), false, true);
}
}
2 changes: 1 addition & 1 deletion src/biz/bokhorst/xprivacy/XPrivacy.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class XPrivacy implements IXposedHookLoadPackage, IXposedHookZygoteInit {
@SuppressLint("InlinedApi")
public void initZygote(StartupParam startupParam) throws Throwable {
// Log load
Util.log(null, Log.INFO, String.format("load %s", startupParam.modulePath));
Util.log(null, Log.INFO, String.format("Load %s", startupParam.modulePath));

// Account manager
hookAll(XAccountManager.getInstances());
Expand Down

0 comments on commit cefa3c1

Please sign in to comment.