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

Commit

Permalink
Added support for MEID
Browse files Browse the repository at this point in the history
Fixes #1843
  • Loading branch information
M66B committed Aug 1, 2014
1 parent 110a7ae commit ae44f29
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 20 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Changelog
**Next release**

* Removed restriction *LinkAddress*, since it is not needed
* Added support for [MEID](http://en.wikipedia.org/wiki/Mobile_equipment_identifier) and removed restrictions *getNetworkType* and *getPhoneType* ([issue](/../../issues/1843))
* Updated Slovak translation

[Open issues](https://github.com/M66B/XPrivacy/issues?state=open)
Expand Down
3 changes: 2 additions & 1 deletion res/layout/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,9 @@

<EditText
android:id="@+id/etImei"
android:digits="0123456789ABCDEF"
android:hint="000000000000000"
android:inputType="numberDecimal|textNoSuggestions"
android:inputType="textCapCharacters|textNoSuggestions"
android:maxLength="16"
android:singleLine="true"
tools:ignore="HardcodedText" />
Expand Down
2 changes: 0 additions & 2 deletions src/biz/bokhorst/xprivacy/Meta.java
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,6 @@ public static List<Hook> get() {
mListHook.add(new Hook("phone", "getNetworkCountryIso", "", 10, null, null));
mListHook.add(new Hook("phone", "getNetworkOperator", "", 10, null, null));
mListHook.add(new Hook("phone", "getNetworkOperatorName", "", 10, null, null));
mListHook.add(new Hook("phone", "getNetworkType", "", 10, null, null));
mListHook.add(new Hook("phone", "getPhoneType", "", 10, null, null));
mListHook.add(new Hook("phone", "getSimCountryIso", "", 10, null, null));
mListHook.add(new Hook("phone", "getSimOperator", "", 10, null, null));
mListHook.add(new Hook("phone", "getSimOperatorName", "", 10, null, null));
Expand Down
2 changes: 1 addition & 1 deletion src/biz/bokhorst/xprivacy/PrivacyManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,7 @@ public static String getRandomProp(String name) {
return sb.toString().toUpperCase();
}

// IMEI
// IMEI/MEID
if (name.equals("IMEI")) {
// http://en.wikipedia.org/wiki/Reporting_Body_Identifier
String[] rbi = new String[] { "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "30", "33",
Expand Down
16 changes: 0 additions & 16 deletions src/biz/bokhorst/xprivacy/XTelephonyManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
import android.telephony.CellInfo;
import android.telephony.TelephonyManager;
import android.telephony.gsm.GsmCellLocation;
import android.util.Log;

Expand Down Expand Up @@ -54,8 +53,6 @@ public String getClassName() {
// public String getNetworkCountryIso()
// public String getNetworkOperator()
// public String getNetworkOperatorName()
// public int getNetworkType()
// public int getPhoneType()
// public String getSimCountryIso()
// public String getSimOperator()
// public String getSimOperatorName()
Expand All @@ -77,7 +74,6 @@ private enum Methods {
getLine1AlphaTag, getLine1Number, getMsisdn,
getNeighboringCellInfo,
getNetworkCountryIso, getNetworkOperator, getNetworkOperatorName,
getNetworkType, getPhoneType,
getSimCountryIso, getSimOperator, getSimOperatorName, getSimSerialNumber,
getSubscriberId,
getVoiceMailAlphaTag, getVoiceMailNumber,
Expand Down Expand Up @@ -113,15 +109,12 @@ public static List<XHook> getInstances(String className) {
listHook.add(new XTelephonyManager(Methods.getVoiceMailNumber, PrivacyManager.cPhone, className));

listHook.add(new XTelephonyManager(Methods.listen, PrivacyManager.cLocation, className));

listHook.add(new XTelephonyManager(Methods.listen, PrivacyManager.cPhone, className));

// No permissions required
listHook.add(new XTelephonyManager(Methods.getNetworkCountryIso, PrivacyManager.cPhone, className));
listHook.add(new XTelephonyManager(Methods.getNetworkOperator, PrivacyManager.cPhone, className));
listHook.add(new XTelephonyManager(Methods.getNetworkOperatorName, PrivacyManager.cPhone, className));
listHook.add(new XTelephonyManager(Methods.getNetworkType, PrivacyManager.cPhone, className));
listHook.add(new XTelephonyManager(Methods.getPhoneType, PrivacyManager.cPhone, className));
listHook.add(new XTelephonyManager(Methods.getSimCountryIso, PrivacyManager.cPhone, className));
listHook.add(new XTelephonyManager(Methods.getSimOperator, PrivacyManager.cPhone, className));
listHook.add(new XTelephonyManager(Methods.getSimOperatorName, PrivacyManager.cPhone, className));
Expand Down Expand Up @@ -195,15 +188,6 @@ protected void after(XParam param) throws Throwable {
if (param.getResult() != null && isRestricted(param))
param.setResult(new ArrayList<NeighboringCellInfo>());

} else if (mMethod == Methods.getNetworkType) {
if (isRestricted(param))
param.setResult(TelephonyManager.NETWORK_TYPE_UNKNOWN);

} else if (mMethod == Methods.getPhoneType) {
// TODO: add network type extra
if (isRestricted(param) || isRestricted(param, "getDeviceId") || isRestricted(param, "getSubscriberId"))
param.setResult(TelephonyManager.PHONE_TYPE_GSM); // IMEI

} else {
if (param.getResult() != null && isRestricted(param))
param.setResult(PrivacyManager.getDefacedProp(Binder.getCallingUid(), mMethod.name()));
Expand Down

0 comments on commit ae44f29

Please sign in to comment.