禁用阿里系App一键登录
https://help.aliyun.com/zh/pnvs/developer-reference/the-android-client-access

| com.mobile.auth.gatewayauth.PhoneNumberAuthHelperProxy.checkEnvAvailable(int, com.mobile.auth.gatewayauth.TokenResultListener)
|

| findAndHookMethod("com.ali.user.number.auth.NumAuthComponent", classLoader, "initCheck", "com.ali.user.mobile.model.NumAuthCallback", new XC_MethodReplacement() { @Override protected Object replaceHookedMethod(MethodHookParam param) throws Throwable { log("initCheck..."); return null; } });
|
更通用的方法
在初始化环境的时候会检查SIM卡状态,如果不存在SIM卡,就不能进行“一键登录”。
| public static boolean checkEnv(Context context0) { return (NetworkUtil.hasSimCard(context0)) && !NetworkUtil.isAirModeEnable(context0) && (NetworkUtil.isMobileNetworkOpen(context0)); }
public static boolean hasSimCard(Context context0) { return ((TelephonyManager)context0.getSystemService("phone")).getSimState() == 5; }
|
Hook 代码:
| findAndHookMethod(TelephonyManager.class, "getSimState", new XC_MethodReplacement() { @Override protected Object replaceHookedMethod(MethodHookParam param) throws Throwable { return TelephonyManager.SIM_STATE_ABSENT; } });
|