From 732b6ba36c40bd19cf5a99948d0211d96af57ef6 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 24 May 2015 09:31:35 +0200 Subject: [PATCH] Revised telephony restrictions Closes #2198 --- AndroidManifest.xml | 2 +- CHANGELOG.md | 3 +- res/values/functions.xml | 20 +++ src/biz/bokhorst/xprivacy/Hook.java | 8 + src/biz/bokhorst/xprivacy/Meta.java | 57 ++++-- .../bokhorst/xprivacy/XTelephonyManager.java | 166 ++++++++++++++---- 6 files changed, 205 insertions(+), 51 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index a8dc6e14f..a7a7c5424 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -2,7 +2,7 @@ package="biz.bokhorst.xprivacy" android:installLocation="internalOnly" android:versionCode="473" - android:versionName="3.6.11" > + android:versionName="3.6.12" > Google documentation]]> + + Google documentation]]> + Google documentation]]> + Google documentation]]> + Google documentation]]> + Google documentation]]> + Google documentation]]> + ISIM information]]> + ISIM information]]> + ISIM information]]> + + + + Google documentation]]> + MSISDN]]> + Google documentation]]> + Google documentation]]> + Google documentation]]> + Google documentation]]> + Google documentation]]> Google documentation]]> diff --git a/src/biz/bokhorst/xprivacy/Hook.java b/src/biz/bokhorst/xprivacy/Hook.java index 195b52864..bbd26056a 100644 --- a/src/biz/bokhorst/xprivacy/Hook.java +++ b/src/biz/bokhorst/xprivacy/Hook.java @@ -23,6 +23,7 @@ public class Hook implements Comparable { private int mNotAOSPSdk = 0; private boolean mUnsafe = false; private boolean mOptional = false; + private boolean mObsolete = false; private String mAnnotation = null; public Hook(String restrictionName, String methodName) { @@ -116,6 +117,11 @@ protected Hook optional() { return this; } + protected Hook obsolete() { + mObsolete = true; + return this; + } + public void annotate(String text) { mAnnotation = text; } @@ -135,6 +141,8 @@ public String[] getPermissions() { } public boolean isAvailable() { + if (mObsolete) + return false; if (Build.VERSION.SDK_INT < mSdkFrom) return false; if (Build.VERSION.SDK_INT > mSdkTo) diff --git a/src/biz/bokhorst/xprivacy/Meta.java b/src/biz/bokhorst/xprivacy/Meta.java index 0b82a5312..b83cd9399 100644 --- a/src/biz/bokhorst/xprivacy/Meta.java +++ b/src/biz/bokhorst/xprivacy/Meta.java @@ -362,28 +362,47 @@ public static List get() { mListHook.add(new Hook("phone", "getVoiceMailAlphaTag", "READ_PHONE_STATE", 10, null, null).notAOSP(19)); mListHook.add(new Hook("phone", "getVoiceMailNumber", "READ_PHONE_STATE", 10, null, null).notAOSP(19)); - mListHook.add(new Hook("phone", "Srv_getDeviceId", "READ_PHONE_STATE", 10, "2.99", "getDeviceId").AOSP(19)); - mListHook.add(new Hook("phone", "Srv_getGroupIdLevel1", "READ_PHONE_STATE", 18, "2.99", "getGroupIdLevel1").AOSP(19)); - mListHook.add(new Hook("phone", "Srv_getIsimDomain", "READ_PRIVILEGED_PHONE_STATE", 14, "2.99", "getIsimDomain").AOSP(19)); - mListHook.add(new Hook("phone", "Srv_getIsimImpi", "READ_PRIVILEGED_PHONE_STATE", 14, "2.99", "getIsimImpi").AOSP(19)); - mListHook.add(new Hook("phone", "Srv_getIsimImpu", "READ_PRIVILEGED_PHONE_STATE", 14, "2.99", "getIsimImpu").AOSP(19)); - mListHook.add(new Hook("phone", "Srv_getLine1AlphaTag", "READ_PHONE_STATE", 10, "2.99", "getLine1AlphaTag").AOSP(19)); - mListHook.add(new Hook("phone", "Srv_getLine1Number", "READ_PHONE_STATE", 10, "2.99", "getLine1Number").AOSP(19)); - mListHook.add(new Hook("phone", "Srv_getMsisdn", "READ_PHONE_STATE", 14, "2.99", "getMsisdn").AOSP(19)); - mListHook.add(new Hook("phone", "Srv_getIccSerialNumber", "READ_PHONE_STATE", 10, "2.99", "getSimSerialNumber").AOSP(19)); - mListHook.add(new Hook("phone", "Srv_getSubscriberId", "READ_PHONE_STATE", 10, "2.99", "getSubscriberId").AOSP(19)); - 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).AOSP(21)); - mListHook.add(new Hook("phone", "Srv_getIsimIst", "READ_PRIVILEGED_PHONE_STATE", 21, "3.5.6", null).AOSP(21)); - mListHook.add(new Hook("phone", "Srv_getIsimPcscf", "READ_PRIVILEGED_PHONE_STATE", 21, "3.5.6", null).AOSP(21)); + mListHook.add(new Hook("phone", "Srv_getDeviceId", "READ_PHONE_STATE", 10, "2.99", "getDeviceId").AOSP(19).to(20)); + mListHook.add(new Hook("phone", "Srv_getGroupIdLevel1", "READ_PHONE_STATE", 18, "2.99", "getGroupIdLevel1").AOSP(19).to(20)); + mListHook.add(new Hook("phone", "Srv_getIsimDomain", "READ_PRIVILEGED_PHONE_STATE", 14, "2.99", "getIsimDomain").AOSP(19).to(20)); + mListHook.add(new Hook("phone", "Srv_getIsimImpi", "READ_PRIVILEGED_PHONE_STATE", 14, "2.99", "getIsimImpi").AOSP(19).to(20)); + mListHook.add(new Hook("phone", "Srv_getIsimImpu", "READ_PRIVILEGED_PHONE_STATE", 14, "2.99", "getIsimImpu").AOSP(19).to(20)); + mListHook.add(new Hook("phone", "Srv_getLine1AlphaTag", "READ_PHONE_STATE", 10, "2.99", "getLine1AlphaTag").AOSP(19).to(20)); + mListHook.add(new Hook("phone", "Srv_getLine1Number", "READ_PHONE_STATE", 10, "2.99", "getLine1Number").AOSP(19).to(20)); + mListHook.add(new Hook("phone", "Srv_getMsisdn", "READ_PHONE_STATE", 14, "2.99", "getMsisdn").AOSP(19).to(20)); + mListHook.add(new Hook("phone", "Srv_getIccSerialNumber", "READ_PHONE_STATE", 10, "2.99", "getSimSerialNumber").AOSP(19).to(20)); + mListHook.add(new Hook("phone", "Srv_getSubscriberId", "READ_PHONE_STATE", 10, "2.99", "getSubscriberId").AOSP(19).to(20)); + mListHook.add(new Hook("phone", "Srv_getVoiceMailAlphaTag", "READ_PHONE_STATE", 10, "2.99", "getVoiceMailAlphaTag").AOSP(19).to(20)); + mListHook.add(new Hook("phone", "Srv_getVoiceMailNumber", "READ_PHONE_STATE", 10, "2.99", "getVoiceMailNumber").AOSP(19).to(20)); + mListHook.add(new Hook("phone", "Srv_getCompleteVoiceMailNumber", "READ_PHONE_STATE", 10, "2.99", null).AOSP(19).to(20)); + + mListHook.add(new Hook("phone", "Srv_getImei", "READ_PHONE_STATE", 21, "3.5.6", null).AOSP(21).obsolete()); + mListHook.add(new Hook("phone", "Srv_getIsimIst", "READ_PRIVILEGED_PHONE_STATE", 21, "3.5.6", null).AOSP(21).obsolete()); + mListHook.add(new Hook("phone", "Srv_getIsimPcscf", "READ_PRIVILEGED_PHONE_STATE", 21, "3.5.6", null).AOSP(21).obsolete()); mListHook.add(new Hook("phone", "Srv_getCdmaMdn", "MODIFY_PHONE_STATE", 21, "3.5.6", null).AOSP(21)); mListHook.add(new Hook("phone", "Srv_getCdmaMin", "MODIFY_PHONE_STATE", 21, "3.5.6", null).AOSP(21)); - mListHook.add(new Hook("phone", "Srv_getLine1AlphaTagForDisplay", "READ_PHONE_STATE", 21, "3.5.6", null).AOSP(21)); - mListHook.add(new Hook("phone", "Srv_getLine1NumberForDisplay", "READ_PHONE_STATE", 21, "3.5.6", null).AOSP(21)); + mListHook.add(new Hook("phone", "Srv_getLine1AlphaTagForDisplay", "READ_PHONE_STATE", 21, "3.5.6", null).AOSP(21).obsolete()); + mListHook.add(new Hook("phone", "Srv_getLine1NumberForDisplay", "READ_PHONE_STATE", 21, "3.5.6", null).AOSP(21).obsolete()); + + mListHook.add(new Hook("phone", "Srv_getCompleteVoiceMailNumberForSubscriber5", "READ_PHONE_STATE", 21, "3.6.12", "Srv_getCompleteVoiceMailNumber").AOSP(Build.VERSION_CODES.LOLLIPOP)); + mListHook.add(new Hook("phone", "Srv_getDeviceId5", "READ_PHONE_STATE", 21, "3.6.12", "Srv_getDeviceId").AOSP(Build.VERSION_CODES.LOLLIPOP)); + mListHook.add(new Hook("phone", "Srv_getDeviceIdForPhone5", "READ_PHONE_STATE", 21, "3.6.12", "Srv_getDeviceId").AOSP(Build.VERSION_CODES.LOLLIPOP)); + mListHook.add(new Hook("phone", "Srv_getGroupIdLevel1ForSubscriber5", "READ_PHONE_STATE", 21, "3.6.12", "Srv_getGroupIdLevel1").AOSP(Build.VERSION_CODES.LOLLIPOP)); + mListHook.add(new Hook("phone", "Srv_getIccSerialNumberForSubscriber5", "READ_PHONE_STATE", 21, "3.6.12", "Srv_getIccSerialNumber").AOSP(Build.VERSION_CODES.LOLLIPOP)); + mListHook.add(new Hook("phone", "Srv_getImeiForSubscriber5", "READ_PHONE_STATE", 21, "3.6.12", "Srv_getImei").AOSP(Build.VERSION_CODES.LOLLIPOP)); + mListHook.add(new Hook("phone", "Srv_getIsimDomain5", "READ_PRIVILEGED_PHONE_STATE", 21, "3.6.12", "Srv_getIsimDomain").AOSP(Build.VERSION_CODES.LOLLIPOP)); + mListHook.add(new Hook("phone", "Srv_getIsimImpi5", "READ_PRIVILEGED_PHONE_STATE", 21, "3.6.12", "Srv_getIsimImpi").AOSP(Build.VERSION_CODES.LOLLIPOP)); + mListHook.add(new Hook("phone", "Srv_getIsimImpu5", "READ_PRIVILEGED_PHONE_STATE", 21, "3.6.12", "Srv_getIsimImpu").AOSP(Build.VERSION_CODES.LOLLIPOP)); + mListHook.add(new Hook("phone", "Srv_getIsimIst5", "READ_PRIVILEGED_PHONE_STATE", 21, "3.6.12", "Srv_getIsimIst").AOSP(Build.VERSION_CODES.LOLLIPOP)); + mListHook.add(new Hook("phone", "Srv_getIsimPcscf5", "READ_PRIVILEGED_PHONE_STATE", 21, "3.6.12", "Srv_getIsimPcscf").AOSP(Build.VERSION_CODES.LOLLIPOP)); + mListHook.add(new Hook("phone", "Srv_getLine1AlphaTagForSubscriber5", "READ_PHONE_STATE", 21, "3.6.12", "Srv_getLine1AlphaTagForDisplay").AOSP(Build.VERSION_CODES.LOLLIPOP)); + mListHook.add(new Hook("phone", "Srv_getLine1NumberForSubscriber5", "READ_PHONE_STATE", 21, "3.6.12", "Srv_getLine1NumberForDisplay").AOSP(Build.VERSION_CODES.LOLLIPOP)); + mListHook.add(new Hook("phone", "Srv_getMsisdnForSubscriber5", "READ_PHONE_STATE", 21, "3.6.12", "Srv_getMsisdn").AOSP(Build.VERSION_CODES.LOLLIPOP)); + mListHook.add(new Hook("phone", "Srv_getNaiForSubscriber5", "READ_PHONE_STATE", 21, "3.6.12", null).AOSP(Build.VERSION_CODES.LOLLIPOP)); + mListHook.add(new Hook("phone", "Srv_getSubscriberIdForSubscriber5", "READ_PHONE_STATE", 21, "3.6.12", "Srv_getSubscriberId").AOSP(Build.VERSION_CODES.LOLLIPOP)); + mListHook.add(new Hook("phone", "Srv_getVoiceMailAlphaTagForSubscriber5", "READ_PHONE_STATE", 21, "3.6.12", "Srv_getVoiceMailAlphaTag").AOSP(Build.VERSION_CODES.LOLLIPOP)); + mListHook.add(new Hook("phone", "Srv_getVoiceMailNumberForSubscriber5", "READ_PHONE_STATE", 21, "3.6.12", "Srv_getVoiceMailNumber").AOSP(Build.VERSION_CODES.LOLLIPOP)); 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)); diff --git a/src/biz/bokhorst/xprivacy/XTelephonyManager.java b/src/biz/bokhorst/xprivacy/XTelephonyManager.java index fba41d138..21831de47 100644 --- a/src/biz/bokhorst/xprivacy/XTelephonyManager.java +++ b/src/biz/bokhorst/xprivacy/XTelephonyManager.java @@ -24,11 +24,11 @@ public class XTelephonyManager extends XHook { private static final Map mListener = new WeakHashMap(); private enum Srv { - SubInfo, Registry, Phone + SubInfo, Registry, Phone, SICtl }; private XTelephonyManager(Methods method, String restrictionName, Srv srv) { - super(restrictionName, method.name().replace("Srv_", ""), method.name()); + super(restrictionName, method.name().replace("Srv_", "").replace("5", ""), method.name()); mMethod = method; if (srv == Srv.SubInfo) mClassName = "com.android.internal.telephony.PhoneSubInfo"; @@ -36,6 +36,8 @@ else if (srv == Srv.Registry) mClassName = "com.android.server.TelephonyRegistry"; else if (srv == Srv.Phone) mClassName = "com.android.phone.PhoneInterfaceManager"; + else if (srv == Srv.SICtl) + mClassName = "com.android.internal.telephony.PhoneSubInfoController"; else Util.log(null, Log.ERROR, "Unknown srv=" + srv.name()); } @@ -147,7 +149,28 @@ private enum Methods { Srv_enableLocationUpdatesForSubscriber, Srv_disableLocationUpdatesForSubscriber, Srv_getCdmaMdn, Srv_getCdmaMin, - Srv_getLine1AlphaTagForDisplay, Srv_getLine1NumberForDisplay + Srv_getLine1AlphaTagForDisplay, Srv_getLine1NumberForDisplay, + + // Android 5.x + // http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/5.1.0_r1/com/android/internal/telephony/PhoneSubInfoController.java + Srv_getCompleteVoiceMailNumberForSubscriber5, + Srv_getDeviceId5, + Srv_getDeviceIdForPhone5, + Srv_getGroupIdLevel1ForSubscriber5, + Srv_getIccSerialNumberForSubscriber5, + Srv_getImeiForSubscriber5, + Srv_getIsimDomain5, + Srv_getIsimImpi5, + Srv_getIsimImpu5, + Srv_getIsimIst5, + Srv_getIsimPcscf5, + Srv_getLine1AlphaTagForSubscriber5, + Srv_getLine1NumberForSubscriber5, + Srv_getMsisdnForSubscriber5, + Srv_getNaiForSubscriber5, // new + Srv_getSubscriberIdForSubscriber5, + Srv_getVoiceMailAlphaTagForSubscriber5, + Srv_getVoiceMailNumberForSubscriber5 }; // @formatter:on @@ -158,29 +181,61 @@ public static List getInstances(String className, boolean server) { className = cClassName; if (server) { - // PhoneSubInfo - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) + // PhoneSubInfo/Controller + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { listHook.add(new XTelephonyManager(Methods.Srv_getDeviceId, PrivacyManager.cPhone, Srv.SubInfo)); - else - listHook.add(new XTelephonyManager(Methods.Srv_getDeviceId, PrivacyManager.cPhone, Srv.Phone)); - - listHook.add(new XTelephonyManager(Methods.Srv_getGroupIdLevel1, PrivacyManager.cPhone, Srv.SubInfo)); - listHook.add(new XTelephonyManager(Methods.Srv_getIccSerialNumber, PrivacyManager.cPhone, Srv.SubInfo)); - listHook.add(new XTelephonyManager(Methods.Srv_getIsimDomain, PrivacyManager.cPhone, Srv.SubInfo)); - listHook.add(new XTelephonyManager(Methods.Srv_getIsimImpi, PrivacyManager.cPhone, Srv.SubInfo)); - listHook.add(new XTelephonyManager(Methods.Srv_getIsimImpu, PrivacyManager.cPhone, Srv.SubInfo)); - listHook.add(new XTelephonyManager(Methods.Srv_getLine1AlphaTag, PrivacyManager.cPhone, Srv.SubInfo)); - listHook.add(new XTelephonyManager(Methods.Srv_getLine1Number, PrivacyManager.cPhone, Srv.SubInfo)); - listHook.add(new XTelephonyManager(Methods.Srv_getMsisdn, PrivacyManager.cPhone, Srv.SubInfo)); - listHook.add(new XTelephonyManager(Methods.Srv_getSubscriberId, PrivacyManager.cPhone, Srv.SubInfo)); - listHook.add(new XTelephonyManager(Methods.Srv_getCompleteVoiceMailNumber, PrivacyManager.cPhone, - Srv.SubInfo)); - 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_getGroupIdLevel1, PrivacyManager.cPhone, Srv.SubInfo)); + listHook.add(new XTelephonyManager(Methods.Srv_getIccSerialNumber, PrivacyManager.cPhone, + Srv.SubInfo)); + listHook.add(new XTelephonyManager(Methods.Srv_getIsimDomain, PrivacyManager.cPhone, Srv.SubInfo)); + listHook.add(new XTelephonyManager(Methods.Srv_getIsimImpi, PrivacyManager.cPhone, Srv.SubInfo)); + listHook.add(new XTelephonyManager(Methods.Srv_getIsimImpu, PrivacyManager.cPhone, Srv.SubInfo)); + listHook.add(new XTelephonyManager(Methods.Srv_getLine1AlphaTag, PrivacyManager.cPhone, Srv.SubInfo)); + listHook.add(new XTelephonyManager(Methods.Srv_getLine1Number, PrivacyManager.cPhone, Srv.SubInfo)); + listHook.add(new XTelephonyManager(Methods.Srv_getMsisdn, PrivacyManager.cPhone, Srv.SubInfo)); + listHook.add(new XTelephonyManager(Methods.Srv_getSubscriberId, PrivacyManager.cPhone, Srv.SubInfo)); + listHook.add(new XTelephonyManager(Methods.Srv_getCompleteVoiceMailNumber, PrivacyManager.cPhone, + Srv.SubInfo)); + 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)); + } else { + listHook.add(new XTelephonyManager(Methods.Srv_getDeviceIdForPhone5, PrivacyManager.cPhone, + Srv.SICtl)); + listHook.add(new XTelephonyManager(Methods.Srv_getGroupIdLevel1ForSubscriber5, + PrivacyManager.cPhone, Srv.SICtl)); + listHook.add(new XTelephonyManager(Methods.Srv_getIccSerialNumberForSubscriber5, + PrivacyManager.cPhone, Srv.SICtl)); + listHook.add(new XTelephonyManager(Methods.Srv_getIsimDomain5, PrivacyManager.cPhone, Srv.SICtl)); + listHook.add(new XTelephonyManager(Methods.Srv_getIsimImpi5, PrivacyManager.cPhone, Srv.SICtl)); + listHook.add(new XTelephonyManager(Methods.Srv_getIsimImpu5, PrivacyManager.cPhone, Srv.SICtl)); + listHook.add(new XTelephonyManager(Methods.Srv_getLine1AlphaTagForSubscriber5, + PrivacyManager.cPhone, Srv.SICtl)); + listHook.add(new XTelephonyManager(Methods.Srv_getLine1NumberForSubscriber5, PrivacyManager.cPhone, + Srv.SICtl)); + listHook.add(new XTelephonyManager(Methods.Srv_getMsisdnForSubscriber5, PrivacyManager.cPhone, + Srv.SICtl)); + listHook.add(new XTelephonyManager(Methods.Srv_getSubscriberIdForSubscriber5, + PrivacyManager.cPhone, Srv.SICtl)); + listHook.add(new XTelephonyManager(Methods.Srv_getCompleteVoiceMailNumberForSubscriber5, + PrivacyManager.cPhone, Srv.SICtl)); + listHook.add(new XTelephonyManager(Methods.Srv_getVoiceMailAlphaTagForSubscriber5, + PrivacyManager.cPhone, Srv.SICtl)); + listHook.add(new XTelephonyManager(Methods.Srv_getVoiceMailNumberForSubscriber5, + PrivacyManager.cPhone, Srv.SICtl)); + + listHook.add(new XTelephonyManager(Methods.Srv_getImeiForSubscriber5, PrivacyManager.cPhone, + Srv.SICtl)); + listHook.add(new XTelephonyManager(Methods.Srv_getIsimIst5, PrivacyManager.cPhone, Srv.SICtl)); + listHook.add(new XTelephonyManager(Methods.Srv_getIsimPcscf5, PrivacyManager.cPhone, Srv.SICtl)); + listHook.add(new XTelephonyManager(Methods.Srv_getNaiForSubscriber5, PrivacyManager.cPhone, + Srv.SICtl)); + } } else { listHook.add(new XTelephonyManager(Methods.disableLocationUpdates, null, className)); listHook.add(new XTelephonyManager(Methods.enableLocationUpdates, PrivacyManager.cLocation, className)); @@ -235,6 +290,8 @@ public static List getPhoneInstances() { listHook.add(new XTelephonyManager(Methods.Srv_getLine1AlphaTagForDisplay, PrivacyManager.cPhone, Srv.Phone)); listHook.add(new XTelephonyManager(Methods.Srv_getLine1NumberForDisplay, PrivacyManager.cPhone, Srv.Phone)); } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1) + listHook.add(new XTelephonyManager(Methods.Srv_getDeviceId5, PrivacyManager.cPhone, Srv.Phone)); return listHook; } @@ -359,6 +416,27 @@ protected void before(XParam param) throws Throwable { case Srv_getLine1AlphaTagForDisplay: case Srv_getLine1NumberForDisplay: break; + + case Srv_getCompleteVoiceMailNumberForSubscriber5: + case Srv_getDeviceId5: + case Srv_getDeviceIdForPhone5: + case Srv_getGroupIdLevel1ForSubscriber5: + case Srv_getIccSerialNumberForSubscriber5: + case Srv_getImeiForSubscriber5: + case Srv_getIsimDomain5: + case Srv_getIsimImpi5: + case Srv_getIsimImpu5: + case Srv_getIsimIst5: + case Srv_getIsimPcscf5: + case Srv_getLine1AlphaTagForSubscriber5: + case Srv_getLine1NumberForSubscriber5: + case Srv_getMsisdnForSubscriber5: + case Srv_getNaiForSubscriber5: + case Srv_getSubscriberIdForSubscriber5: + case Srv_getVoiceMailAlphaTagForSubscriber5: + case Srv_getVoiceMailNumberForSubscriber5: + break; + } } @@ -441,9 +519,25 @@ protected void after(XParam param) throws Throwable { case Srv_getIsimImpu: case Srv_getSubscriberId: case Srv_getImei: + case Srv_getDeviceId5: + case Srv_getDeviceIdForPhone5: + case Srv_getGroupIdLevel1ForSubscriber5: + case Srv_getIccSerialNumberForSubscriber5: + case Srv_getImeiForSubscriber5: + case Srv_getIsimDomain5: + case Srv_getIsimImpi5: + case Srv_getIsimImpu5: + case Srv_getNaiForSubscriber5: + case Srv_getSubscriberIdForSubscriber5: if (param.getResult() != null) - if (isRestricted(param)) - param.setResult(PrivacyManager.getDefacedProp(uid, mMethod.name().replace("Srv_", ""))); + if (isRestricted(param)) { + String name = mMethod.name(); + name = name.replace("Srv_", ""); + name = name.replace("ForPhone", ""); + name = name.replace("ForSubscriber", ""); + name = name.replace("5", ""); + param.setResult(PrivacyManager.getDefacedProp(uid, name)); + } break; case Srv_getLine1AlphaTag: @@ -454,17 +548,29 @@ protected void after(XParam param) throws Throwable { case Srv_getVoiceMailAlphaTag: case Srv_getLine1AlphaTagForDisplay: case Srv_getLine1NumberForDisplay: + case Srv_getCompleteVoiceMailNumberForSubscriber5: + case Srv_getLine1AlphaTagForSubscriber5: + case Srv_getLine1NumberForSubscriber5: + case Srv_getMsisdnForSubscriber5: + case Srv_getVoiceMailAlphaTagForSubscriber5: + case Srv_getVoiceMailNumberForSubscriber5: String srvPhoneNumber = (String) param.getResult(); if (srvPhoneNumber != null) - if (isRestrictedValue(param, srvPhoneNumber)) - param.setResult(PrivacyManager.getDefacedProp(uid, - mMethod.name().replace("Srv_", "").replace("ForDisplay", ""))); + if (isRestrictedValue(param, srvPhoneNumber)) { + String name = mMethod.name(); + name = name.replace("Srv_", ""); + name = name.replace("ForSubscriber", ""); + name = name.replace("5", ""); + param.setResult(PrivacyManager.getDefacedProp(uid, name)); + } break; case Srv_getIsimIst: case Srv_getIsimPcscf: case Srv_getCdmaMdn: case Srv_getCdmaMin: + case Srv_getIsimIst5: + case Srv_getIsimPcscf5: if (param.getResult() != null) if (isRestricted(param)) param.setResult(null);