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

Commit

Permalink
Added experimental setting again to enable/disable IPC support info
Browse files Browse the repository at this point in the history
  • Loading branch information
M66B committed Jul 4, 2014
1 parent a2b68cf commit 3529d62
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
3 changes: 1 addition & 2 deletions res/layout/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="30dip"
android:text="@string/settings_experimental"
android:visibility="gone" />
android:text="@string/settings_experimental" />

<CheckBox
android:id="@+id/cbHttps"
Expand Down
3 changes: 2 additions & 1 deletion src/biz/bokhorst/xprivacy/SettingsDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
boolean parameters = PrivacyManager.getSettingBool(uid, PrivacyManager.cSettingParameters, false);
boolean log = PrivacyManager.getSettingBool(uid, PrivacyManager.cSettingLog, false);
boolean components = PrivacyManager.getSettingBool(uid, PrivacyManager.cSettingSystem, false);
boolean experimental = PrivacyManager.getSettingBool(uid, PrivacyManager.cSettingExperimental, false);
boolean experimental = PrivacyManager.getSettingBool(uid, PrivacyManager.cSettingExperimental,
!PrivacyManager.cStableRelease);
boolean https = PrivacyManager.getSettingBool(uid, PrivacyManager.cSettingHttps, true);
String confidence = PrivacyManager.getSetting(uid, PrivacyManager.cSettingConfidence, "");
final boolean expert = (components || experimental || !https || !"".equals(confidence));
Expand Down
4 changes: 4 additions & 0 deletions src/biz/bokhorst/xprivacy/UpdateService.java
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ private static void upgrade(Context context) throws NameNotFoundException {
Util.log(null, Log.WARN, "Deleting " + setting);
PrivacyManager.setSetting(setting.uid, setting.type, setting.name, null);
}

// Reset experimental setting
if (storedVersion.compareTo(new Version("2.1.21")) < 0)
PrivacyManager.setSetting(userId, PrivacyManager.cSettingExperimental, null);
} else
Util.log(null, Log.WARN, "No upgrade from version " + storedVersion + " to " + currentVersion);

Expand Down
8 changes: 7 additions & 1 deletion src/biz/bokhorst/xprivacy/XBinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

public class XBinder extends XHook {
private Methods mMethod;
private static Boolean mStable = null;

private static long mToken = 0;
private static final int BITS_TOKEN = 16;
Expand Down Expand Up @@ -453,7 +454,12 @@ private void markIPC(XParam param) throws Throwable {
.startsWith("com.android.server.content.IContentServiceEx$Stub$Proxy"))) {
found = true;

if (PrivacyManager.cStableRelease) {
if (mStable == null) {
int userId = Util.getUserId(uid);
mStable = !PrivacyManager.getSettingBool(userId, PrivacyManager.cSettingExperimental,
!PrivacyManager.cStableRelease);
}
if (mStable) {
if (i + 1 < ste.length) {
String name = ste[i + 1].getClassName();
ok = (name.startsWith("android.") || name.startsWith("com.android."));
Expand Down

0 comments on commit 3529d62

Please sign in to comment.