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

Commit

Permalink
Added white/black listing for parent folder
Browse files Browse the repository at this point in the history
Fixes #1474
  • Loading branch information
M66B committed Jun 28, 2014
1 parent 91e3269 commit fa4024b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ echo "ipc" >disabled
echo "system.getInstalledProviders" >>disabled
```

* Added white/black listing for parent folder ([issue](/../../issues/1474))

[Open issues](https://github.com/M66B/XPrivacy/issues?state=open)

**Version 2.1.12 BETA**
Expand Down
12 changes: 9 additions & 3 deletions src/biz/bokhorst/xprivacy/PrivacyService.java
Original file line number Diff line number Diff line change
Expand Up @@ -1515,6 +1515,7 @@ final class AlertDialogHolder {
public View dialog = null;
}

@SuppressLint("InflateParams")
private View getOnDemandView(final PRestriction restriction, final Hook hook, ApplicationInfoEx appInfo,
final PRestriction result, Context context, final CountDownLatch latch) throws NameNotFoundException {
// Get resources
Expand Down Expand Up @@ -1698,9 +1699,14 @@ private String[] getXExtra(PRestriction restriction, Hook hook) {
List<String> listResult = new ArrayList<String>();
if (hook != null)
if (hook.whitelist().equals(Meta.cTypeFilename)) {
String folder = new File(restriction.extra).getParent();
if (!TextUtils.isEmpty(folder))
listResult.add(folder + File.separatorChar + "*");
File file = new File(restriction.extra);
for (int i = 1; i <= 3 && file != null; i++) {
String parent = file.getParent();
if (!TextUtils.isEmpty(parent))
listResult.add(parent + File.separatorChar + "*");
file = file.getParentFile();
}

} else if (hook.whitelist().equals(Meta.cTypeIPAddress)) {
int semi = restriction.extra.lastIndexOf(':');
String address = (semi >= 0 ? restriction.extra.substring(0, semi) : restriction.extra);
Expand Down

0 comments on commit fa4024b

Please sign in to comment.