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

Commit

Permalink
Fixed updating dangerous functions restrictions when dangerous enabled
Browse files Browse the repository at this point in the history
Fixes #1742
  • Loading branch information
M66B committed Jun 20, 2014
1 parent 305c008 commit 27c9f50
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**
Expand Down
11 changes: 2 additions & 9 deletions src/biz/bokhorst/xprivacy/PrivacyService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions src/biz/bokhorst/xprivacy/UpdateService.java
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,9 @@ private static List<PRestriction> 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);
Expand Down

0 comments on commit 27c9f50

Please sign in to comment.