diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b0b22c28..71ad073b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,8 @@ Changelog **Next release** +* Fixed updating dangerous functions restrictions when dangerous enabled ([issue](/../../issues/1742)) + [Open issues](https://github.com/M66B/XPrivacy/issues?state=open) **Version 2.1.5 STABLE** diff --git a/src/biz/bokhorst/xprivacy/PrivacyService.java b/src/biz/bokhorst/xprivacy/PrivacyService.java index 3f01da88f..9c97e9762 100644 --- a/src/biz/bokhorst/xprivacy/PrivacyService.java +++ b/src/biz/bokhorst/xprivacy/PrivacyService.java @@ -511,15 +511,8 @@ public PRestriction getRestriction(final PRestriction restriction, boolean usage // Default dangerous if (!methodFound && hook != null && hook.isDangerous()) if (!getSettingBool(userId, PrivacyManager.cSettingDangerous, false)) { - String version = getSetting(new PSetting(userId, "", PrivacyManager.cSettingVersion, "0.0")).value; - if (new Version(version).compareTo(new Version("2.0.32")) < 0) { - mresult.restricted = false; - if (hook.whitelist() == null) - mresult.asked = true; - } else { - mresult.restricted = false; - mresult.asked = (hook.whitelist() == null); - } + mresult.restricted = false; + mresult.asked = (hook.whitelist() == null); } // Check whitelist diff --git a/src/biz/bokhorst/xprivacy/UpdateService.java b/src/biz/bokhorst/xprivacy/UpdateService.java index 661ef0a44..c794d162a 100644 --- a/src/biz/bokhorst/xprivacy/UpdateService.java +++ b/src/biz/bokhorst/xprivacy/UpdateService.java @@ -321,8 +321,9 @@ private static List getUpgradeWork(Version sVersion, int uid, bool } // Restrict dangerous - if (dangerous && restricted && hook.isDangerous()) { - PRestriction restriction = new PRestriction(uid, hook.getRestrictionName(), hook.getName(), false); + if (restricted && hook.isDangerous()) { + PRestriction restriction = new PRestriction(uid, hook.getRestrictionName(), hook.getName(), + dangerous); restriction.asked = (hook.whitelist() == null); if (PrivacyManager.isRestrictionSet(restriction)) Util.log(null, Log.WARN, "Restrict dangerous set restriction=" + restriction);