精简:不需要获取 mImei 和 mImsi,避免异常

This commit is contained in:
pppscn 2022-01-26 23:30:51 +08:00
parent e0142ed351
commit 5c8d19f93c

View File

@ -356,11 +356,11 @@ public class PhoneUtils {
simInfo.mNumber = subscriptionInfo.getNumber(); simInfo.mNumber = subscriptionInfo.getNumber();
simInfo.mCountryIso = subscriptionInfo.getCountryIso(); simInfo.mCountryIso = subscriptionInfo.getCountryIso();
simInfo.mSubscriptionId = subscriptionInfo.getSubscriptionId(); simInfo.mSubscriptionId = subscriptionInfo.getSubscriptionId();
try { /*try {
simInfo.mImei = getReflexMethodWithId(context, "getDeviceId", String.valueOf(simInfo.mSimSlotIndex)); simInfo.mImei = getReflexMethodWithId(context, "getDeviceId", String.valueOf(simInfo.mSimSlotIndex));
simInfo.mImsi = getReflexMethodWithId(context, "getSubscriberId", String.valueOf(subscriptionInfo.getSubscriptionId())); simInfo.mImsi = getReflexMethodWithId(context, "getSubscriberId", String.valueOf(subscriptionInfo.getSubscriptionId()));
} catch (MethodNotFoundException ignored) { } catch (MethodNotFoundException ignored) {
} }*/
Log.d(TAG, String.valueOf(simInfo)); Log.d(TAG, String.valueOf(simInfo));
infos.add(simInfo); infos.add(simInfo);
} }
@ -380,12 +380,11 @@ public class PhoneUtils {
simInfo.mNumber = cursor.getString(cursor.getColumnIndex("number")); simInfo.mNumber = cursor.getString(cursor.getColumnIndex("number"));
simInfo.mCountryIso = cursor.getString(cursor.getColumnIndex("mcc")); simInfo.mCountryIso = cursor.getString(cursor.getColumnIndex("mcc"));
String id = cursor.getString(cursor.getColumnIndex("_id")); String id = cursor.getString(cursor.getColumnIndex("_id"));
/*try {
try {
simInfo.mImei = getReflexMethodWithId(context, "getDeviceId", String.valueOf(simInfo.mSimSlotIndex)); simInfo.mImei = getReflexMethodWithId(context, "getDeviceId", String.valueOf(simInfo.mSimSlotIndex));
simInfo.mImsi = getReflexMethodWithId(context, "getSubscriberId", String.valueOf(id)); simInfo.mImsi = getReflexMethodWithId(context, "getSubscriberId", String.valueOf(id));
} catch (MethodNotFoundException ignored) { } catch (MethodNotFoundException ignored) {
} }*/
Log.d(TAG, String.valueOf(simInfo)); Log.d(TAG, String.valueOf(simInfo));
infos.add(simInfo); infos.add(simInfo);
} while (cursor.moveToNext()); } while (cursor.moveToNext());