|
|
@@ -35,9 +35,8 @@ import de.robv.android.xposed.callbacks.XC_InitPackageResources;
|
|
|
import de.robv.android.xposed.callbacks.XC_LoadPackage;
|
|
|
|
|
|
@SuppressLint("DefaultLocale")
|
|
|
-public class XposedInit implements IXposedHookLoadPackage, IXposedHookZygoteInit, IXposedHookInitPackageResources {
|
|
|
- private static final String TAG = "ModifierModule";
|
|
|
- private ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(1);
|
|
|
+public class XposedInit extends BaseHook implements IXposedHookLoadPackage, IXposedHookZygoteInit, IXposedHookInitPackageResources {
|
|
|
+ private final ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(1);
|
|
|
|
|
|
@Override
|
|
|
public void handleInitPackageResources(XC_InitPackageResources.InitPackageResourcesParam resparam) throws Throwable {
|
|
|
@@ -46,7 +45,7 @@ public class XposedInit implements IXposedHookLoadPackage, IXposedHookZygoteInit
|
|
|
@SuppressLint("UnspecifiedRegisterReceiverFlag")
|
|
|
@Override
|
|
|
public void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam) throws Throwable {
|
|
|
- log("load package: " + lpparam.packageName + ", imsi=" + getProperty("persist.spoof.imsi", "unknown"));
|
|
|
+ log("load package: " + lpparam.packageName + ", imsi=" + getProperty(PROP_IMSI, "unknown"));
|
|
|
|
|
|
if ("com.android.phone".equals(lpparam.packageName)) {
|
|
|
executor.schedule(() -> {
|
|
|
@@ -87,230 +86,9 @@ public class XposedInit implements IXposedHookLoadPackage, IXposedHookZygoteInit
|
|
|
|
|
|
|
|
|
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
|
|
- try {
|
|
|
- Class<?> PhoneInterfaceManager = XposedHelpers.findClass("com.android.phone.PhoneInterfaceManager", lpparam.classLoader);
|
|
|
- XposedHelpers.findAndHookMethod(PhoneInterfaceManager, "getLine1NumberForDisplay", int.class, String.class, String.class, new XC_MethodHook() {
|
|
|
- @Override
|
|
|
- protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
- log("spoof PhoneInterfaceManager.getLine1NumberForDisplay");
|
|
|
- param.setResult(getProperty("persist.spoof.number", ""));
|
|
|
- }
|
|
|
- });
|
|
|
- XposedHelpers.findAndHookMethod(PhoneInterfaceManager, "getNetworkCountryIsoForPhone", int.class, new XC_MethodHook() {
|
|
|
- @Override
|
|
|
- protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
- log("spoof PhoneInterfaceManager.getNetworkCountryIsoForPhone");
|
|
|
- param.setResult(getProperty("persist.spoof.country", ""));
|
|
|
- }
|
|
|
- });
|
|
|
- XposedHelpers.findAndHookMethod(PhoneInterfaceManager, "getImeiForSlot", int.class, String.class, String.class, new XC_MethodHook() {
|
|
|
- @Override
|
|
|
- protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
- log("spoof PhoneInterfaceManager.getImeiForSlot");
|
|
|
- param.setResult(getProperty("persist.spoof.imei", ""));
|
|
|
- }
|
|
|
- });
|
|
|
- XposedHelpers.findAndHookMethod(PhoneInterfaceManager, "getSimStateForSlotIndex", int.class, new XC_MethodHook() {
|
|
|
- @Override
|
|
|
- protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
- log("spoof PhoneInterfaceManager.getSimStateForSlotIndex");
|
|
|
- param.setResult(5);
|
|
|
- }
|
|
|
- });
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
-
|
|
|
- Class<?> SystemProperties = XposedHelpers.findClass("android.os.SystemProperties", lpparam.classLoader);
|
|
|
- try {
|
|
|
- Class<?> SubscriptionController = XposedHelpers.findClass("com.android.internal.telephony.subscription.SubscriptionManagerService", lpparam.classLoader);
|
|
|
- XposedHelpers.findAndHookMethod(SubscriptionController, "getPhoneNumberFromFirstAvailableSource", int.class, String.class, String.class, new XC_MethodHook() {
|
|
|
- @Override
|
|
|
- protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
- log("spoof SubscriptionController.getPhoneNumberFromFirstAvailableSource");
|
|
|
- param.setResult(getProperty("persist.spoof.number", ""));
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- XposedHelpers.findAndHookMethod(SubscriptionController, "getActiveSubscriptionInfoList", String.class, String.class, boolean.class, new XC_MethodHook() {
|
|
|
- @Override
|
|
|
- protected void afterHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
- log("spoof SubscriptionController.getActiveSubscriptionInfoList");
|
|
|
- List<SubscriptionInfo> list = (List<SubscriptionInfo>) param.getResult();
|
|
|
- for (SubscriptionInfo info : list) {
|
|
|
- XposedHelpers.setObjectField(info, "mMcc", getProperty("persist.spoof.mcc", ""));
|
|
|
- XposedHelpers.setObjectField(info, "mMnc", getProperty("persist.spoof.mnc", ""));
|
|
|
- XposedHelpers.setObjectField(info, "mCountryIso", getProperty("persist.spoof.country", ""));
|
|
|
- XposedHelpers.setObjectField(info, "mIccId", getProperty("persist.spoof.iccid", ""));
|
|
|
- }
|
|
|
-
|
|
|
- XposedHelpers.callStaticMethod(SystemProperties, "set", "gsm.sim.operator.iso-country", getProperty("persist.spoof.country", ""));
|
|
|
- XposedHelpers.callStaticMethod(SystemProperties, "set", "gsm.sim.operator.numeric", getProperty("persist.spoof.mcc", "") + getProperty("persist.spoof.mnc", ""));
|
|
|
- XposedHelpers.callStaticMethod(SystemProperties, "set", "gsm.operator.numeric", getProperty("persist.spoof.mcc", "") + getProperty("persist.spoof.mnc", ""));
|
|
|
- }
|
|
|
- });
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- try {
|
|
|
- Class<?> PhoneSubInfoController = XposedHelpers.findClass("com.android.internal.telephony.PhoneSubInfoController", lpparam.classLoader);
|
|
|
- XposedHelpers.findAndHookMethod(PhoneSubInfoController, "getIccSerialNumberForSubscriber", int.class, String.class, String.class, new XC_MethodHook() {
|
|
|
- @Override
|
|
|
- protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
- log("spoof PhoneSubInfoController.getIccSerialNumberForSubscriber");
|
|
|
- param.setResult(getProperty("persist.spoof.iccid", ""));
|
|
|
- }
|
|
|
- });
|
|
|
- XposedHelpers.findAndHookMethod(PhoneSubInfoController, "getSubscriberIdForSubscriber", int.class, String.class, String.class, new XC_MethodHook() {
|
|
|
- @Override
|
|
|
- protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
- log("spoof PhoneSubInfoController.getSubscriberIdForSubscriber");
|
|
|
- param.setResult(getProperty("persist.spoof.imsi", ""));
|
|
|
- }
|
|
|
- });
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
-
|
|
|
- XposedHelpers.findAndHookMethod(SystemProperties, "get", String.class, new XC_MethodHook() {
|
|
|
- @Override
|
|
|
- protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
- String key = (String) param.args[0];
|
|
|
- if ("gsm.sim.operator.iso-country".equals(key)) {
|
|
|
- log("spoof SystemProperties.get(" + key + ")");
|
|
|
- param.setResult(getProperty("persist.spoof.country", ""));
|
|
|
- } else if ("gsm.sim.operator.numeric".equals(key)) {
|
|
|
- log("spoof SystemProperties.get(" + key + ")");
|
|
|
- param.setResult(getProperty("persist.spoof.mcc", "") + getProperty("persist.spoof.mnc", ""));
|
|
|
- } else if ("gsm.operator.numeric".equals(key)) {
|
|
|
- log("spoof SystemProperties.get(" + key + ")");
|
|
|
- param.setResult(getProperty("persist.spoof.mcc", "") + getProperty("persist.spoof.mnc", ""));
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
+ Hook14.handleLoadPackage(lpparam);
|
|
|
} else {
|
|
|
- try {
|
|
|
- Class<?> PhoneInterfaceManager = XposedHelpers.findClass("com.android.phone.PhoneInterfaceManager", lpparam.classLoader);
|
|
|
- XposedHelpers.findAndHookMethod(PhoneInterfaceManager, "getLine1NumberForDisplay", int.class, String.class, String.class, new XC_MethodHook() {
|
|
|
- @Override
|
|
|
- protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
- log("spoof PhoneInterfaceManager.getLine1NumberForDisplay");
|
|
|
- param.setResult(getProperty("persist.spoof.number", ""));
|
|
|
- }
|
|
|
- });
|
|
|
- XposedHelpers.findAndHookMethod(PhoneInterfaceManager, "getNetworkCountryIsoForPhone", int.class, new XC_MethodHook() {
|
|
|
- @Override
|
|
|
- protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
- log("spoof PhoneInterfaceManager.getNetworkCountryIsoForPhone");
|
|
|
- param.setResult(getProperty("persist.spoof.country", ""));
|
|
|
- }
|
|
|
- });
|
|
|
- XposedHelpers.findAndHookMethod(PhoneInterfaceManager, "getImeiForSlot", int.class, String.class, String.class, new XC_MethodHook() {
|
|
|
- @Override
|
|
|
- protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
- log("spoof PhoneInterfaceManager.getImeiForSlot");
|
|
|
- param.setResult(getProperty("persist.spoof.imei", ""));
|
|
|
- }
|
|
|
- });
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
-
|
|
|
- Class<?> SystemProperties = XposedHelpers.findClass("android.os.SystemProperties", lpparam.classLoader);
|
|
|
- try {
|
|
|
- Class<?> SubscriptionController = XposedHelpers.findClass("com.android.internal.telephony.SubscriptionController", lpparam.classLoader);
|
|
|
- XposedHelpers.findAndHookMethod(SubscriptionController, "getPhoneNumberFromFirstAvailableSource", int.class, String.class, String.class, new XC_MethodHook() {
|
|
|
- @Override
|
|
|
- protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
- log("spoof SubscriptionController.getPhoneNumberFromFirstAvailableSource");
|
|
|
- param.setResult(getProperty("persist.spoof.number", ""));
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- XposedHelpers.findAndHookMethod(SubscriptionController, "getActiveSubscriptionInfoList", String.class, new XC_MethodHook() {
|
|
|
- @Override
|
|
|
- protected void afterHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
- log("spoof SubscriptionController.getActiveSubscriptionInfoList");
|
|
|
- List<SubscriptionInfo> list = (List<SubscriptionInfo>) param.getResult();
|
|
|
- for (SubscriptionInfo info : list) {
|
|
|
- XposedHelpers.setObjectField(info, "mMcc", getProperty("persist.spoof.mcc", ""));
|
|
|
- XposedHelpers.setObjectField(info, "mMnc", getProperty("persist.spoof.mnc", ""));
|
|
|
- XposedHelpers.setObjectField(info, "mCountryIso", getProperty("persist.spoof.country", ""));
|
|
|
- XposedHelpers.setObjectField(info, "mIccId", getProperty("persist.spoof.iccid", ""));
|
|
|
- }
|
|
|
-
|
|
|
- XposedHelpers.callStaticMethod(SystemProperties, "set", "gsm.sim.operator.iso-country", getProperty("persist.spoof.country", ""));
|
|
|
- XposedHelpers.callStaticMethod(SystemProperties, "set", "gsm.sim.operator.numeric", getProperty("persist.spoof.mcc", "") + getProperty("persist.spoof.mnc", ""));
|
|
|
- XposedHelpers.callStaticMethod(SystemProperties, "set", "gsm.operator.numeric", getProperty("persist.spoof.mcc", "") + getProperty("persist.spoof.mnc", ""));
|
|
|
- }
|
|
|
- });
|
|
|
- XposedHelpers.findAndHookMethod(SubscriptionController, "getActiveSubscriptionInfoList", String.class, String.class, new XC_MethodHook() {
|
|
|
- @Override
|
|
|
- protected void afterHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
- log("spoof SubscriptionController.getActiveSubscriptionInfoList");
|
|
|
- List<SubscriptionInfo> list = (List<SubscriptionInfo>) param.getResult();
|
|
|
- for (SubscriptionInfo info : list) {
|
|
|
- XposedHelpers.setObjectField(info, "mMcc", getProperty("persist.spoof.mcc", ""));
|
|
|
- XposedHelpers.setObjectField(info, "mMnc", getProperty("persist.spoof.mnc", ""));
|
|
|
- XposedHelpers.setObjectField(info, "mCountryIso", getProperty("persist.spoof.country", ""));
|
|
|
- XposedHelpers.setObjectField(info, "mIccId", getProperty("persist.spoof.iccid", ""));
|
|
|
- }
|
|
|
-
|
|
|
- XposedHelpers.callStaticMethod(SystemProperties, "set", "gsm.sim.operator.iso-country", getProperty("persist.spoof.country", ""));
|
|
|
- XposedHelpers.callStaticMethod(SystemProperties, "set", "gsm.sim.operator.numeric", getProperty("persist.spoof.mcc", "") + getProperty("persist.spoof.mnc", ""));
|
|
|
- XposedHelpers.callStaticMethod(SystemProperties, "set", "gsm.operator.numeric", getProperty("persist.spoof.mcc", "") + getProperty("persist.spoof.mnc", ""));
|
|
|
- }
|
|
|
- });
|
|
|
- XposedHelpers.findAndHookMethod(SubscriptionController, "getSimStateForSlotIndex", int.class, new XC_MethodHook() {
|
|
|
- @Override
|
|
|
- protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
- log("spoof SubscriptionController.getSimStateForSlotIndex");
|
|
|
- param.setResult(5);
|
|
|
- }
|
|
|
- });
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
-
|
|
|
- try {
|
|
|
- Class<?> PhoneSubInfoController = XposedHelpers.findClass("com.android.internal.telephony.PhoneSubInfoController", lpparam.classLoader);
|
|
|
- log("PhoneSubInfoController: " + lpparam.packageName);
|
|
|
- XposedHelpers.findAndHookMethod(PhoneSubInfoController, "getIccSerialNumberForSubscriber", int.class, String.class, String.class, new XC_MethodHook() {
|
|
|
- @Override
|
|
|
- protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
- log("spoof PhoneSubInfoController.getIccSerialNumberForSubscriber");
|
|
|
- param.setResult(getProperty("persist.spoof.iccid", ""));
|
|
|
- }
|
|
|
- });
|
|
|
- XposedHelpers.findAndHookMethod(PhoneSubInfoController, "getSubscriberIdForSubscriber", int.class, String.class, String.class, new XC_MethodHook() {
|
|
|
- @Override
|
|
|
- protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
- log("spoof PhoneSubInfoController.getSubscriberIdForSubscriber");
|
|
|
- param.setResult(getProperty("persist.spoof.imsi", ""));
|
|
|
- }
|
|
|
- });
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
-
|
|
|
- XposedHelpers.findAndHookMethod(SystemProperties, "get", String.class, new XC_MethodHook() {
|
|
|
- @Override
|
|
|
- protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
- String key = (String) param.args[0];
|
|
|
- if ("gsm.sim.operator.iso-country".equals(key)) {
|
|
|
- log("spoof SystemProperties.get(" + key + ")");
|
|
|
- param.setResult(getProperty("persist.spoof.country", ""));
|
|
|
- } else if ("gsm.sim.operator.numeric".equals(key)) {
|
|
|
- log("spoof SystemProperties.get(" + key + ")");
|
|
|
- param.setResult(getProperty("persist.spoof.mcc", "") + getProperty("persist.spoof.mnc", ""));
|
|
|
- } else if ("gsm.operator.numeric".equals(key)) {
|
|
|
- log("spoof SystemProperties.get(" + key + ")");
|
|
|
- param.setResult(getProperty("persist.spoof.mcc", "") + getProperty("persist.spoof.mnc", ""));
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
+ Hook13.handleLoadPackage(lpparam);
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -319,14 +97,14 @@ public class XposedInit implements IXposedHookLoadPackage, IXposedHookZygoteInit
|
|
|
@Override
|
|
|
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
log("spoof SubscriptionManager.getPhoneNumber");
|
|
|
- param.setResult(getProperty("persist.spoof.number", ""));
|
|
|
+ param.setResult(getProperty(PROP_NUMBER, ""));
|
|
|
}
|
|
|
});
|
|
|
XposedHelpers.findAndHookMethod(SubscriptionManager, "getPhoneNumber", int.class, int.class, new XC_MethodHook() {
|
|
|
@Override
|
|
|
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
log("spoof SubscriptionManager.getPhoneNumber");
|
|
|
- param.setResult(getProperty("persist.spoof.number", ""));
|
|
|
+ param.setResult(getProperty(PROP_NUMBER, ""));
|
|
|
}
|
|
|
});
|
|
|
|
|
|
@@ -334,50 +112,50 @@ public class XposedInit implements IXposedHookLoadPackage, IXposedHookZygoteInit
|
|
|
XposedHelpers.findAndHookMethod(SubscriptionInfo, "getMcc", new XC_MethodHook() {
|
|
|
@Override
|
|
|
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
- log("spoof SubscriptionInfo.getMcc -> " + getProperty("persist.spoof.mcc", ""));
|
|
|
- param.setResult(Integer.parseInt(getProperty("persist.spoof.mcc", "")));
|
|
|
+ log("spoof SubscriptionInfo.getMcc -> " + getProperty(PROP_MCC, ""));
|
|
|
+ param.setResult(Integer.parseInt(getProperty(PROP_MCC, "")));
|
|
|
}
|
|
|
});
|
|
|
XposedHelpers.findAndHookMethod(SubscriptionInfo, "getMnc", new XC_MethodHook() {
|
|
|
@Override
|
|
|
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
- log("spoof SubscriptionInfo.getMnc -> " + getProperty("persist.spoof.mnc", ""));
|
|
|
- param.setResult(Integer.parseInt(getProperty("persist.spoof.mnc", "")));
|
|
|
+ log("spoof SubscriptionInfo.getMnc -> " + getProperty(PROP_MNC, ""));
|
|
|
+ param.setResult(Integer.parseInt(getProperty(PROP_MNC, "")));
|
|
|
}
|
|
|
});
|
|
|
XposedHelpers.findAndHookMethod(SubscriptionInfo, "getMccString", new XC_MethodHook() {
|
|
|
@Override
|
|
|
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
- log("spoof SubscriptionInfo.getMccString -> " + getProperty("persist.spoof.mcc", ""));
|
|
|
- param.setResult(getProperty("persist.spoof.mcc", ""));
|
|
|
+ log("spoof SubscriptionInfo.getMccString -> " + getProperty(PROP_MCC, ""));
|
|
|
+ param.setResult(getProperty(PROP_MCC, ""));
|
|
|
}
|
|
|
});
|
|
|
XposedHelpers.findAndHookMethod(SubscriptionInfo, "getMncString", new XC_MethodHook() {
|
|
|
@Override
|
|
|
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
- log("spoof SubscriptionInfo.getMncString -> " + getProperty("persist.spoof.mnc", ""));
|
|
|
- param.setResult(getProperty("persist.spoof.mnc", ""));
|
|
|
+ log("spoof SubscriptionInfo.getMncString -> " + getProperty(PROP_MNC, ""));
|
|
|
+ param.setResult(getProperty(PROP_MNC, ""));
|
|
|
}
|
|
|
});
|
|
|
XposedHelpers.findAndHookMethod(SubscriptionInfo, "getNumber", new XC_MethodHook() {
|
|
|
@Override
|
|
|
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
- log("spoof SubscriptionInfo.getNumber -> " + getProperty("persist.spoof.number", ""));
|
|
|
- param.setResult(getProperty("persist.spoof.number", ""));
|
|
|
+ log("spoof SubscriptionInfo.getNumber -> " + getProperty(PROP_NUMBER, ""));
|
|
|
+ param.setResult(getProperty(PROP_NUMBER, ""));
|
|
|
}
|
|
|
});
|
|
|
XposedHelpers.findAndHookMethod(SubscriptionInfo, "getIccId", new XC_MethodHook() {
|
|
|
@Override
|
|
|
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
- log("spoof SubscriptionInfo.getIccId -> " + getProperty("persist.spoof.iccid", ""));
|
|
|
- param.setResult(getProperty("persist.spoof.iccid", ""));
|
|
|
+ log("spoof SubscriptionInfo.getIccId -> " + getProperty(PROP_ICCID, ""));
|
|
|
+ param.setResult(getProperty(PROP_ICCID, ""));
|
|
|
}
|
|
|
});
|
|
|
XposedHelpers.findAndHookMethod(SubscriptionInfo, "getCountryIso", new XC_MethodHook() {
|
|
|
@Override
|
|
|
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
- log("spoof SubscriptionInfo.getCountryIso -> " + getProperty("persist.spoof.country", ""));
|
|
|
- param.setResult(getProperty("persist.spoof.country", ""));
|
|
|
+ log("spoof SubscriptionInfo.getCountryIso -> " + getProperty(PROP_COUNTRY, ""));
|
|
|
+ param.setResult(getProperty(PROP_COUNTRY, ""));
|
|
|
}
|
|
|
});
|
|
|
|
|
|
@@ -386,57 +164,57 @@ public class XposedInit implements IXposedHookLoadPackage, IXposedHookZygoteInit
|
|
|
XposedHelpers.findAndHookMethod(TelephonyManager, "getLine1Number", new XC_MethodHook() {
|
|
|
@Override
|
|
|
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
- log("spoof TelephonyManager.getLine1Number -> " + getProperty("persist.spoof.number", ""));
|
|
|
- param.setResult(getProperty("persist.spoof.number", ""));
|
|
|
+ log("spoof TelephonyManager.getLine1Number -> " + getProperty(PROP_NUMBER, ""));
|
|
|
+ param.setResult(getProperty(PROP_NUMBER, ""));
|
|
|
}
|
|
|
});
|
|
|
XposedHelpers.findAndHookMethod(TelephonyManager, "getSimOperator", new XC_MethodHook() {
|
|
|
@Override
|
|
|
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
- log("spoof TelephonyManager.getSimOperator -> " + getProperty("persist.spoof.mcc", "") + getProperty("persist.spoof.mnc", ""));
|
|
|
- param.setResult(getProperty("persist.spoof.mcc", "") + getProperty("persist.spoof.mnc", ""));
|
|
|
+ log("spoof TelephonyManager.getSimOperator -> " + getProperty(PROP_MCC, "") + getProperty(PROP_MNC, ""));
|
|
|
+ param.setResult(getProperty(PROP_MCC, "") + getProperty(PROP_MNC, ""));
|
|
|
}
|
|
|
});
|
|
|
XposedHelpers.findAndHookMethod(TelephonyManager, "getNetworkOperator", new XC_MethodHook() {
|
|
|
@Override
|
|
|
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
- log("spoof TelephonyManager.getNetworkOperator -> " + getProperty("persist.spoof.mcc", "") + getProperty("persist.spoof.mnc", ""));
|
|
|
- param.setResult(getProperty("persist.spoof.mcc", "") + getProperty("persist.spoof.mnc", ""));
|
|
|
+ log("spoof TelephonyManager.getNetworkOperator -> " + getProperty(PROP_MCC, "") + getProperty(PROP_MNC, ""));
|
|
|
+ param.setResult(getProperty(PROP_MCC, "") + getProperty(PROP_MNC, ""));
|
|
|
}
|
|
|
});
|
|
|
XposedHelpers.findAndHookMethod(TelephonyManager, "getSimSerialNumber", new XC_MethodHook() {
|
|
|
@Override
|
|
|
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
- log("spoof TelephonyManager.getSimSerialNumber -> " + getProperty("persist.spoof.iccid", ""));
|
|
|
- param.setResult(getProperty("persist.spoof.iccid", ""));
|
|
|
+ log("spoof TelephonyManager.getSimSerialNumber -> " + getProperty(PROP_ICCID, ""));
|
|
|
+ param.setResult(getProperty(PROP_ICCID, ""));
|
|
|
}
|
|
|
});
|
|
|
XposedHelpers.findAndHookMethod(TelephonyManager, "getSubscriberId", new XC_MethodHook() {
|
|
|
@Override
|
|
|
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
- log("spoof TelephonyManager.getSubscriberId -> " + getProperty("persist.spoof.imsi", ""));
|
|
|
- param.setResult(getProperty("persist.spoof.imsi", ""));
|
|
|
+ log("spoof TelephonyManager.getSubscriberId -> " + getProperty(PROP_IMSI, ""));
|
|
|
+ param.setResult(getProperty(PROP_IMSI, ""));
|
|
|
}
|
|
|
});
|
|
|
XposedHelpers.findAndHookMethod(TelephonyManager, "getImei", new XC_MethodHook() {
|
|
|
@Override
|
|
|
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
- log("spoof TelephonyManager.getImei -> " + getProperty("persist.spoof.imei", ""));
|
|
|
- param.setResult(getProperty("persist.spoof.imei", ""));
|
|
|
+ log("spoof TelephonyManager.getImei -> " + getProperty(PROP_IMEI, ""));
|
|
|
+ param.setResult(getProperty(PROP_IMEI, ""));
|
|
|
}
|
|
|
});
|
|
|
XposedHelpers.findAndHookMethod(TelephonyManager, "getNetworkCountryIso", new XC_MethodHook() {
|
|
|
@Override
|
|
|
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
- log("spoof TelephonyManager.getNetworkCountryIso -> " + getProperty("persist.spoof.country", ""));
|
|
|
- param.setResult(getProperty("persist.spoof.country", ""));
|
|
|
+ log("spoof TelephonyManager.getNetworkCountryIso -> " + getProperty(PROP_COUNTRY, ""));
|
|
|
+ param.setResult(getProperty(PROP_COUNTRY, ""));
|
|
|
}
|
|
|
});
|
|
|
XposedHelpers.findAndHookMethod(TelephonyManager, "getSimCountryIso", new XC_MethodHook() {
|
|
|
@Override
|
|
|
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
- log("spoof TelephonyManager.getSimCountryIso -> " + getProperty("persist.spoof.country", ""));
|
|
|
- param.setResult(getProperty("persist.spoof.country", ""));
|
|
|
+ log("spoof TelephonyManager.getSimCountryIso -> " + getProperty(PROP_COUNTRY, ""));
|
|
|
+ param.setResult(getProperty(PROP_COUNTRY, ""));
|
|
|
}
|
|
|
});
|
|
|
//getSimState
|
|
|
@@ -453,42 +231,4 @@ public class XposedInit implements IXposedHookLoadPackage, IXposedHookZygoteInit
|
|
|
public void initZygote(StartupParam startupParam) throws Throwable {
|
|
|
log("initZygote");
|
|
|
}
|
|
|
-
|
|
|
- private void log(String message) {
|
|
|
- Log.i(TAG, message);
|
|
|
- XposedBridge.log(TAG + ": " + message);
|
|
|
- }
|
|
|
-
|
|
|
-// private String getVar(String key, String packageName) {
|
|
|
-// @SuppressLint("SdCardPath")
|
|
|
-// File file = new File("/data/data/" + packageName + "/rcsConfig.json");
|
|
|
-// if (!file.exists()) {
|
|
|
-// log("file " + file.getPath() + " not exist");
|
|
|
-// return "";
|
|
|
-// }
|
|
|
-// String json = null;
|
|
|
-// try {
|
|
|
-// json = FileUtils.readFileToString(file, "UTF-8");
|
|
|
-// JSONObject obj = new JSONObject(json);
|
|
|
-// return obj.getString(key);
|
|
|
-// } catch (IOException e) {
|
|
|
-// log("IOException: " + e.getMessage());
|
|
|
-// } catch (JSONException e) {
|
|
|
-// log("JSONException: " + e.getMessage());
|
|
|
-// }
|
|
|
-// return "";
|
|
|
-// }
|
|
|
-
|
|
|
- public String getProperty(String key, String defaultValue) {
|
|
|
- String value = defaultValue;
|
|
|
- try {
|
|
|
- Class<?> c = Class.forName("android.os.SystemProperties");
|
|
|
- Method get = c.getMethod("get", String.class, String.class);
|
|
|
- value = (String) (get.invoke(c, key, "unknown"));
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- } finally {
|
|
|
- return value;
|
|
|
- }
|
|
|
- }
|
|
|
}
|