@@ -102,6 +102,17 @@ public BaseData dexkit(DexKitBridge bridge) throws ReflectiveOperationException
102102 }
103103 });
104104
105+ Method method4 = DexKit .findMember ("StartActivateSimIms" , new IDexKit () {
106+ @ Override
107+ public BaseData dexkit (DexKitBridge bridge ) throws ReflectiveOperationException {
108+ MethodData methodData = bridge .findMethod (FindMethod .create ()
109+ .matcher (MethodMatcher .create ()
110+ .usingStrings ("ImsActivateTask" , "cloud control not allow this mccmnc activate with method " )
111+ )).singleOrNull ();
112+ return methodData ;
113+ }
114+ });
115+
105116 Field field = DexKit .findMember ("ActivateSimSubId" , new IDexKit () {
106117 @ Override
107118 public BaseData dexkit (DexKitBridge bridge ) throws ReflectiveOperationException {
@@ -140,7 +151,7 @@ public BaseData dexkit(DexKitBridge bridge) throws ReflectiveOperationException
140151 @ Override
141152 public void before (HookParam param ) throws InvocationTargetException , IllegalAccessException {
142153 int subId = (int ) getObjectField (param .getThisObject (), field .getName ());
143- XposedLog .d (TAG , getPackageName (), "Roaming SIM " + subId );
154+ // XposedLog.d(TAG, getPackageName(), "SIM " + subId);
144155 Object contextGetter = callStaticMethod (method2 .getDeclaringClass (), method2 .getName ());
145156 Object originSlotId = EzxHelpUtils .findMethodBestMatch (method3 .getDeclaringClass (), method3 .getName (), subId ).invoke (contextGetter , subId );
146157 int slotId = (int ) originSlotId ;
@@ -152,6 +163,24 @@ public void before(HookParam param) throws InvocationTargetException, IllegalAcc
152163 }
153164 });
154165
166+ //findAndHookMethod("com.xiaomi.activate.simactivate.q", "C", new IMethodHook() {
167+ hookMethod (method4 , new IMethodHook () {
168+ @ RequiresPermission (allOf = {Manifest .permission .READ_PHONE_STATE , Manifest .permission .READ_PHONE_NUMBERS , Manifest .permission .ACCESS_COARSE_LOCATION , "android.permission.READ_PRIVILEGED_PHONE_STATE" })
169+ @ Override
170+ public void before (HookParam param ) throws InvocationTargetException , IllegalAccessException {
171+ int subId = (int ) getObjectField (param .getThisObject (), field .getName ());
172+ //XposedLog.d(TAG, getPackageName(), "IMS SIM " + subId);
173+ Object contextGetter = callStaticMethod (method2 .getDeclaringClass (), method2 .getName ());
174+ Object originSlotId = EzxHelpUtils .findMethodBestMatch (method3 .getDeclaringClass (), method3 .getName (), subId ).invoke (contextGetter , subId );
175+ int slotId = (int ) originSlotId ;
176+ Context context = (Context ) getObjectField (param .getThisObject (), field2 .getName ());
177+ if (isRoaming (context , slotId , mChinaTeleZoneCodeList , mChinaIccidStartsWithList , isRadical )) {
178+ XposedLog .d (TAG , getPackageName (), "IMS Roaming SIM, skip activate." );
179+ param .setResult (null );
180+ }
181+ }
182+ });
183+
155184 findAndHookMethod ("com.xiaomi.activate.ActivationSmsReceiver" , "onReceive" , Context .class , Intent .class , new IMethodHook () {
156185 @ RequiresPermission (allOf = {Manifest .permission .READ_PHONE_STATE , Manifest .permission .READ_PHONE_NUMBERS , Manifest .permission .ACCESS_COARSE_LOCATION , "android.permission.READ_PRIVILEGED_PHONE_STATE" })
157186 @ Override
0 commit comments