Skip to content

Commit

Permalink
Add IPC restriction
Browse files Browse the repository at this point in the history
  • Loading branch information
M66B committed Jan 15, 2014
1 parent 6b2f149 commit 5d82a96
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ Test and beta releases will have experimental functions enabled by default.

**Next release**

* Experimental: restriction for direct interprocess communication (System/IPC)
* Experimental: new, faster way of getting restrictions/settings

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

**Version 1.11.12 BETA**
Expand Down
1 change: 1 addition & 0 deletions assets/meta.xml
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@
<Hook restriction="system" method="android.intent.action.EXTERNAL_APPLICATIONS_AVAILABLE" dangerous="true" permissions="" sdk="10" />
<Hook restriction="system" method="android.intent.action.EXTERNAL_APPLICATIONS_UNAVAILABLE" dangerous="true" permissions="" sdk="10" />
<Hook restriction="system" method="ApplicationsProvider" permissions="" sdk="10" />
<Hook restriction="system" method="IPC" dangerous="true" from="1.11.13" permissions="" sdk="1" />

<Hook restriction="view" method="loadUrl" permissions="" sdk="1" />
<Hook restriction="view" method="WebView" permissions="" sdk="1" />
Expand Down
2 changes: 0 additions & 2 deletions src/biz/bokhorst/xprivacy/Requirements.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.Inet4Address;
import java.net.InterfaceAddress;
Expand All @@ -18,7 +17,6 @@
import android.net.wifi.WifiInfo;
import android.os.Build;
import android.os.IBinder;
import android.os.RemoteException;
import android.text.TextUtils;
import android.util.Log;

Expand Down
10 changes: 3 additions & 7 deletions src/biz/bokhorst/xprivacy/XBinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ public class XBinder extends XHook {
private static boolean mMagical = false;
private static int FLAG_XPRIVACY = 0x000000A0;
private static int BITS_MAGIC = 16;
private static boolean cEnabled = true;
private static boolean cRestrict = false;

// @formatter:off
public static List<String> cListService = Arrays.asList(new String[] {
Expand Down Expand Up @@ -69,10 +67,8 @@ private enum Methods {

public static List<XHook> getInstances() {
List<XHook> listHook = new ArrayList<XHook>();
if (cEnabled) {
listHook.add(new XBinder(Methods.execTransact, null)); // Binder
listHook.add(new XBinder(Methods.transact, null)); // BinderProxy
}
listHook.add(new XBinder(Methods.execTransact, null)); // Binder
listHook.add(new XBinder(Methods.transact, null)); // BinderProxy
return listHook;
}

Expand Down Expand Up @@ -113,7 +109,7 @@ private void checkIPC(MethodHookParam param) {
String name = binder.getInterfaceDescriptor();
if (cListService.contains(name)) {
Util.log(this, Log.WARN, "restrict name=" + name + " uid=" + uid + " my=" + Process.myUid());
if (cRestrict) {
if (PrivacyManager.getRestricted(this, null, uid, PrivacyManager.cSystem, "IPC", true, true)) {
// Get reply parcel
Parcel reply = null;
try {
Expand Down

0 comments on commit 5d82a96

Please sign in to comment.