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

Commit

Permalink
Restrict /system/build.prop
Browse files Browse the repository at this point in the history
Refs #575
  • Loading branch information
Marcel Bokhorst committed Aug 25, 2013
1 parent 8baef51 commit 40eddf3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,7 @@ How to get beta releases:

* Setting for IP address ([issue](https://github.com/M66B/XPrivacy/issues/554))
* Restrict browser user agent string ([issue](https://github.com/M66B/XPrivacy/issues/537))
* Restrict /system/build.prop ([issue](https://github.com/M66B/XPrivacy/issues/575))
* Fixed margins on large screens
* Fixed restricting NFC
* Fixed exporting dangerous function exceptions ([issue](https://github.com/M66B/XPrivacy/issues/283))
Expand Down
1 change: 1 addition & 0 deletions assets/meta.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<Hook restriction="identification" method="%macaddr" permissions="" sdk="14" />
<Hook restriction="identification" method="%serialno" permissions="" sdk="14" />
<Hook restriction="identification" method="/proc" dangerous="true" permissions="" sdk="14" />
<Hook restriction="identification" method="/system/build.prop" dangerous="true" permissions="" sdk="14" />
<Hook restriction="identification" method="getString" permissions="" sdk="14" />
<Hook restriction="identification" method="GservicesProvider" dangerous="true" permissions="READ_GSERVICES" sdk="14" />
<Hook restriction="identification" method="SERIAL" permissions="" sdk="14" />
Expand Down
11 changes: 6 additions & 5 deletions src/biz/bokhorst/xprivacy/XIoBridge.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public String getClassName() {
public static List<XHook> getInstances() {
List<XHook> listHook = new ArrayList<XHook>();
listHook.add(new XIoBridge("open", PrivacyManager.cIdentification, "/proc"));
listHook.add(new XIoBridge("open", PrivacyManager.cIdentification, "/system/build.prop"));
return listHook;
}

Expand All @@ -35,13 +36,13 @@ protected void before(MethodHookParam param) throws Throwable {
if (param.args.length > 0) {
String fileName = (String) param.args[0];
if (fileName != null && fileName.startsWith(mFileName)) {
// Zygote, Android
if (Process.myUid() <= 0 || Process.myUid() == PrivacyManager.cAndroidUid)
return;

// /proc
if (mFileName.equals("/proc")) {
// Zygote, Android
if (Process.myUid() <= 0 || Process.myUid() == PrivacyManager.cAndroidUid)
return;

// Facebook
// Allow command line
if (fileName.equals("/proc/self/cmdline"))
return;

Expand Down

0 comments on commit 40eddf3

Please sign in to comment.