|
|
@@ -9,7 +9,7 @@ import de.robv.android.xposed.XposedHelpers;
|
|
|
import de.robv.android.xposed.callbacks.XC_LoadPackage;
|
|
|
|
|
|
public class Hook13 extends BaseHook {
|
|
|
- public static void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam) throws Throwable {
|
|
|
+ public static void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam) {
|
|
|
try {
|
|
|
Class<?> PhoneInterfaceManager = XposedHelpers.findClass("com.android.phone.PhoneInterfaceManager", lpparam.classLoader);
|
|
|
XposedHelpers.findAndHookMethod(PhoneInterfaceManager, "getLine1NumberForDisplay", int.class, String.class, String.class, new XC_MethodHook() {
|
|
|
@@ -33,6 +33,23 @@ public class Hook13 extends BaseHook {
|
|
|
param.setResult(getProperty(PROP_IMEI, ""));
|
|
|
}
|
|
|
});
|
|
|
+ XposedHelpers.findAndHookMethod(PhoneInterfaceManager, "getSubscriptionSpecificCarrierId", int.class, new XC_MethodHook() {
|
|
|
+ @Override
|
|
|
+ protected void beforeHookedMethod(MethodHookParam param) {
|
|
|
+ int carrierId = Integer.parseInt(getProperty(PROP_CARRIER_ID, "-1"));
|
|
|
+ if (carrierId != -1) {
|
|
|
+ log("spoof PhoneInterfaceManager.getSubscriptionSpecificCarrierId");
|
|
|
+ param.setResult(carrierId);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ XposedHelpers.findAndHookMethod(PhoneInterfaceManager, "getSubscriptionCarrierId", int.class, new XC_MethodHook() {
|
|
|
+ @Override
|
|
|
+ protected void beforeHookedMethod(MethodHookParam param) {
|
|
|
+ log("spoof PhoneInterfaceManager.getSubscriptionCarrierId");
|
|
|
+ param.setResult(Integer.parseInt(getProperty(PROP_CARRIER_ID, "1187")));
|
|
|
+ }
|
|
|
+ });
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
@@ -58,11 +75,16 @@ public class Hook13 extends BaseHook {
|
|
|
XposedHelpers.setObjectField(info, "mMnc", getProperty(PROP_MNC, ""));
|
|
|
XposedHelpers.setObjectField(info, "mCountryIso", getProperty(PROP_COUNTRY, ""));
|
|
|
XposedHelpers.setObjectField(info, "mIccId", getProperty(PROP_ICCID, ""));
|
|
|
+ int carrierId = Integer.parseInt(getProperty(PROP_CARRIER_ID, "-1"));
|
|
|
+ if (carrierId != -1) {
|
|
|
+ XposedHelpers.setObjectField(info, "mCarrierId", carrierId);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
XposedHelpers.callStaticMethod(SystemProperties, "set", "gsm.sim.operator.iso-country", getProperty(PROP_COUNTRY, ""));
|
|
|
XposedHelpers.callStaticMethod(SystemProperties, "set", "gsm.sim.operator.numeric", getProperty(PROP_MCC, "") + getProperty(PROP_MNC, ""));
|
|
|
XposedHelpers.callStaticMethod(SystemProperties, "set", "gsm.operator.numeric", getProperty(PROP_MCC, "") + getProperty(PROP_MNC, ""));
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
XposedHelpers.findAndHookMethod(SubscriptionController, "getActiveSubscriptionInfoList", String.class, String.class, new XC_MethodHook() {
|
|
|
@@ -75,11 +97,16 @@ public class Hook13 extends BaseHook {
|
|
|
XposedHelpers.setObjectField(info, "mMnc", getProperty(PROP_MNC, ""));
|
|
|
XposedHelpers.setObjectField(info, "mCountryIso", getProperty(PROP_COUNTRY, ""));
|
|
|
XposedHelpers.setObjectField(info, "mIccId", getProperty(PROP_ICCID, ""));
|
|
|
+ int carrierId = Integer.parseInt(getProperty(PROP_CARRIER_ID, "-1"));
|
|
|
+ if (carrierId != -1) {
|
|
|
+ XposedHelpers.setObjectField(info, "mCarrierId", carrierId);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
XposedHelpers.callStaticMethod(SystemProperties, "set", "gsm.sim.operator.iso-country", getProperty(PROP_COUNTRY, ""));
|
|
|
XposedHelpers.callStaticMethod(SystemProperties, "set", "gsm.sim.operator.numeric", getProperty(PROP_MCC, "") + getProperty(PROP_MNC, ""));
|
|
|
XposedHelpers.callStaticMethod(SystemProperties, "set", "gsm.operator.numeric", getProperty(PROP_MCC, "") + getProperty(PROP_MNC, ""));
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
XposedHelpers.findAndHookMethod(SubscriptionController, "getSimStateForSlotIndex", int.class, new XC_MethodHook() {
|
|
|
@@ -130,5 +157,14 @@ public class Hook13 extends BaseHook {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ Class<?> CarrierResolver = XposedHelpers.findClass("com.android.internal.telephony.CarrierResolver", lpparam.classLoader);
|
|
|
+ XposedHelpers.findAndHookMethod(CarrierResolver, "getCarrierIdFromSimMccMnc", String.class, String.class, new XC_MethodHook() {
|
|
|
+ @Override
|
|
|
+ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
+ log("spoof CarrierResolver.getCarrierIdFromSimMccMnc");
|
|
|
+ param.setResult(Integer.parseInt(getProperty(PROP_CARRIER_ID, "1187")));
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
}
|