diff --git a/CHANGELOG.md b/CHANGELOG.md index b5cdc6d6f..a4f890961 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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** diff --git a/src/biz/bokhorst/xprivacy/PrivacyService.java b/src/biz/bokhorst/xprivacy/PrivacyService.java index 814b2f476..7ab49b9e0 100644 --- a/src/biz/bokhorst/xprivacy/PrivacyService.java +++ b/src/biz/bokhorst/xprivacy/PrivacyService.java @@ -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 @@ -1698,9 +1699,14 @@ private String[] getXExtra(PRestriction restriction, Hook hook) { List listResult = new ArrayList(); 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);