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

Commit

Permalink
Added restrictions Srv_getImei, Srv_getIsimIst and Srv_getIsimPcscf
Browse files Browse the repository at this point in the history
Refs #1757
  • Loading branch information
M66B committed Dec 15, 2014
1 parent efb83df commit 9b2bfc3
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 17 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Changelog
* Added restriction *Srv_getCurrentSyncsAsUser* ([issue](/../../issues/1757))
* Added restrictions *Srv_addGpsMeasurementsListener* and *Srv_addGpsNavigationMessageListener* ([issue](/../../issues/1757))
* Added restrictions *getCarrierConfigValues* and *sendMultimediaMessage* ([issue](/../../issues/1757))
* Added restrictions *Srv_getImei*, *Srv_getIsimIst* and *Srv_getIsimPcscf* ([issue](/../../issues/1757))

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

Expand Down
3 changes: 3 additions & 0 deletions res/values/functions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,9 @@
<string name="phone_Srv_getVoiceMailNumber" translatable="false"><![CDATA[<a href="https://developer.android.com/reference/android/telephony/TelephonyManager.html#getVoiceMailNumber()">Google documentation</a>]]></string>
<string name="phone_Srv_getCompleteVoiceMailNumber" translatable="false"><![CDATA[<a href="https://developer.android.com/reference/android/telephony/TelephonyManager.html#getVoiceMailNumber()">Google documentation</a>]]></string>
<string name="phone_Srv_listen" translatable="false"><![CDATA[<a href="https://developer.android.com/reference/android/telephony/TelephonyManager.html#listen(android.telephony.PhoneStateListener,%20int)">Google documentation</a>]]></string>
<string name="phone_Srv_getImei" translatable="false"><![CDATA[<a href="https://developer.android.com/reference/android/telephony/TelephonyManager.html#getDeviceId()">Google documentation</a>]]></string>
<string name="phone_Srv_getIsimIst" translatable="false"><![CDATA[Will restrict access to the IMS Service Table (IST) that was loaded from the ISIM]]></string>
<string name="phone_Srv_getIsimPcscf" translatable="false"><![CDATA[Will restrict access to the IMS Proxy Call Session Control Function(PCSCF) that were loaded from the ISIM]]></string>

<!-- sensors -->
<string name="sensors_getDefaultSensor" translatable="false"><![CDATA[<a href="https://developer.android.com/reference/android/hardware/SensorManager.html#getDefaultSensor(int)">Google documentation</a>]]></string>
Expand Down
3 changes: 3 additions & 0 deletions src/biz/bokhorst/xprivacy/Meta.java
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,9 @@ public static List<Hook> get() {
mListHook.add(new Hook("phone", "Srv_getVoiceMailAlphaTag", "READ_PHONE_STATE", 10, "2.99", "getVoiceMailAlphaTag").AOSP(19));
mListHook.add(new Hook("phone", "Srv_getVoiceMailNumber", "READ_PHONE_STATE", 10, "2.99", "getVoiceMailNumber").AOSP(19));
mListHook.add(new Hook("phone", "Srv_getCompleteVoiceMailNumber", "READ_PHONE_STATE", 10, "2.99", null).AOSP(19));
mListHook.add(new Hook("phone", "Srv_getImei", "READ_PHONE_STATE", 21, "3.5.6", null));
mListHook.add(new Hook("phone", "Srv_getIsimIst", "READ_PRIVILEGED_PHONE_STATE", 21, "3.5.6", null));
mListHook.add(new Hook("phone", "Srv_getIsimPcscf", "READ_PRIVILEGED_PHONE_STATE", 21, "3.5.6", null));

mListHook.add(new Hook("phone", "listen", "READ_PHONE_STATE", 10, null, null).notAOSP(19));
mListHook.add(new Hook("phone", "Srv_listen", "READ_PHONE_STATE", 10, null, null).AOSP(19));
Expand Down
52 changes: 35 additions & 17 deletions src/biz/bokhorst/xprivacy/XTelephonyManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,31 +79,33 @@ public String getClassName() {
// frameworks/base/telephony/java/android/telephony/TelephonyManager.java
// http://developer.android.com/reference/android/telephony/TelephonyManager.html

// public java.lang.String getDeviceId()
// public java.lang.String getDeviceSvn()
// public java.lang.String getSubscriberId()
// public java.lang.String getGroupIdLevel1()
// public java.lang.String getIccSerialNumber()
// public java.lang.String getLine1Number()
// public java.lang.String getLine1AlphaTag()
// public java.lang.String getMsisdn()
// public java.lang.String getVoiceMailNumber()
// public java.lang.String getCompleteVoiceMailNumber()
// public java.lang.String getVoiceMailAlphaTag()
// public java.lang.String getIsimImpi()
// public java.lang.String getIsimDomain()
// public java.lang.String[] getIsimImpu()
// http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.4.4_r1/com/android/internal/telephony/PhoneSubInfo.java
// public String getDeviceId()
// public String getSubscriberId()
// public String getGroupIdLevel1()
// public String getIccSerialNumber()
// public String getImei()
// public String getLine1Number()
// public String getLine1AlphaTag()
// public String getMsisdn()
// public String getVoiceMailNumber()
// public String getVoiceMailAlphaTag()
// public String getCompleteVoiceMailNumber()
// public String getIsimImpi()
// public String getIsimDomain()
// public String[] getIsimImpu()
// public String getIsimIst()
// public String[] getIsimPcscf()
// http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/5.0.0_r1/com/android/internal/telephony/PhoneSubInfo.java

// public void listen(java.lang.String pkg, IPhoneStateListener callback, int events, boolean notifyNow)
// http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.4.4_r1/com/android/server/TelephonyRegistry.java
// http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/5.0.0_r1/com/android/server/TelephonyRegistry.java

// public void enableLocationUpdates()
// public void disableLocationUpdates()
// public java.util.List<android.telephony.CellInfo> getAllCellInfo()
// public android.os.Bundle getCellLocation()
// public java.util.List<android.telephony.NeighboringCellInfo> getNeighboringCellInfo()
// http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android-apps/4.4.4_r1/com/android/phone/PhoneInterfaceManager.java#PhoneInterfaceManager
// http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android-apps/5.0.0_r1/com/android/phone/PhoneInterfaceManager.java

// @formatter:on

Expand All @@ -128,6 +130,7 @@ private enum Methods {
Srv_getMsisdn,
Srv_getSubscriberId,
Srv_getCompleteVoiceMailNumber, Srv_getVoiceMailNumber, Srv_getVoiceMailAlphaTag,
Srv_getImei, Srv_getIsimIst, Srv_getIsimPcscf,

Srv_listen,

Expand Down Expand Up @@ -190,6 +193,10 @@ public static List<XHook> getInstances(String className) {
listHook.add(new XTelephonyManager(Methods.Srv_getVoiceMailAlphaTag, PrivacyManager.cPhone, Srv.SubInfo));
listHook.add(new XTelephonyManager(Methods.Srv_getVoiceMailNumber, PrivacyManager.cPhone, Srv.SubInfo));

listHook.add(new XTelephonyManager(Methods.Srv_getImei, PrivacyManager.cPhone, Srv.SubInfo));
listHook.add(new XTelephonyManager(Methods.Srv_getIsimIst, PrivacyManager.cPhone, Srv.SubInfo));
listHook.add(new XTelephonyManager(Methods.Srv_getIsimPcscf, PrivacyManager.cPhone, Srv.SubInfo));

listHook.add(new XTelephonyManager(Methods.Srv_listen, PrivacyManager.cLocation, Srv.Registry));
listHook.add(new XTelephonyManager(Methods.Srv_listen, PrivacyManager.cPhone, Srv.Registry));
}
Expand Down Expand Up @@ -308,6 +315,9 @@ protected void before(XParam param) throws Throwable {
case Srv_getCompleteVoiceMailNumber:
case Srv_getVoiceMailNumber:
case Srv_getVoiceMailAlphaTag:
case Srv_getImei:
case Srv_getIsimIst:
case Srv_getIsimPcscf:
break;
}
}
Expand Down Expand Up @@ -388,6 +398,7 @@ protected void after(XParam param) throws Throwable {
case Srv_getIsimImpi:
case Srv_getIsimImpu:
case Srv_getSubscriberId:
case Srv_getImei:
if (param.getResult() != null)
if (isRestricted(param))
param.setResult(PrivacyManager.getDefacedProp(uid, mMethod.name().replace("Srv_", "")));
Expand All @@ -404,6 +415,13 @@ protected void after(XParam param) throws Throwable {
if (isRestrictedValue(param, srvPhoneNumber))
param.setResult(PrivacyManager.getDefacedProp(uid, mMethod.name().replace("Srv_", "")));
break;

case Srv_getIsimIst:
case Srv_getIsimPcscf:
if (param.getResult() != null)
if (isRestricted(param))
param.setResult(null);
break;
}
}

Expand Down

0 comments on commit 9b2bfc3

Please sign in to comment.