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

Commit

Permalink
Allow own package name for Srv_getPackageInfo/Srv_getApplicationInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
M66B committed Aug 19, 2014
1 parent 7fbade3 commit 58433ed
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Version 2.99.x and version 3.x will be available with a [pro license](http://www
**Next release**

* Show if application has specific fake values ([issue](/../../issues/1831))
* Allow own package name for *Srv_getPackageInfo* and *Srv_getApplicationInfo*
* Updated Dutch translation

[Open issues](https://github.com/M66B/XPrivacy/issues?state=open)
Expand Down Expand Up @@ -198,6 +199,7 @@ XPrivacy 2
**Next release**

* Show if application has specific fake values ([issue](/../../issues/1831))
* Allow own package name for *Srv_getPackageInfo* and *Srv_getApplicationInfo*
* Updated Dutch translation

[Open issues](https://github.com/M66B/XPrivacy/issues?state=open)
Expand Down
14 changes: 14 additions & 0 deletions src/biz/bokhorst/xprivacy/XPackageManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,21 @@ protected void after(XParam param) throws Throwable {
case Srv_getPackageInfo:
case Srv_getApplicationInfo:
if (param.args.length > 0 && param.args[0] instanceof String && param.getResult() != null) {
// Allow own package name
int uid = -1;
if (mMethod == Methods.Srv_getPackageInfo) {
PackageInfo pInfo = (PackageInfo) param.getResult();
if (pInfo.applicationInfo != null)
uid = pInfo.applicationInfo.uid;
} else if (mMethod == Methods.Srv_getApplicationInfo) {
ApplicationInfo aInfo = (ApplicationInfo) param.getResult();
uid = aInfo.uid;
}
if (uid == Binder.getCallingUid())
return;

String packageName = (String) param.args[0];

// Prevent recursion
if (!XPackageManager.class.getPackage().getName().equals(packageName))
if (isRestrictedExtra(param, packageName))
Expand Down

0 comments on commit 58433ed

Please sign in to comment.