ShowSimOperator.java 文件源码

java
阅读 21 收藏 0 点赞 0 评论 0

项目:Xposed-ShowSimOperator 作者:
/**
 * Get the original network operator name (as if TelephonyManager#getNetworkOperatorName were unhooked)
 *
 * @param subId subscription id
 * @return the original network operator name
 */
private static String getRealNetworkOperatorNameBySubId(int subId) throws Throwable {
  Method getPhoneId = XposedHelpers.findMethodExact(SubscriptionManager.class.getName(), null, "getPhoneId", int.class);
  int phoneId = (Integer) getPhoneId.invoke(getSubscriptionManager(), subId);

  Class<?> TelephonyProperties = XposedHelpers.findClass("com.android.internal.telephony.TelephonyProperties", null);
  String PROPERTY_OPERATOR_ALPHA = (String) XposedHelpers.getStaticObjectField(TelephonyProperties, "PROPERTY_OPERATOR_ALPHA");

  Method getTelephonyProperty = XposedHelpers.findMethodExact(TelephonyManager.class.getName(), null, "getTelephonyProperty", int.class, String.class, String.class);
  return (String) getTelephonyProperty.invoke(getTelephonyManager(), phoneId, PROPERTY_OPERATOR_ALPHA, "");
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号