MIUI缺陷修复

收集由于 MIUI 魔改而导致的问题及解决方案


测试设备为 MI8 (dipper) 各功能均正常使用,其余设备相关代码可能有些许差异,按格式删除即可

系统部分


防卡米(仅测试MIUI12)

打开*/system/framework/services.jar* 使用MT管理器 反编译 搜索.method private checkSystemSelfProtection(Z)V

.method private checkSystemSelfProtection(Z)V
......

.line xxxx
...... //删除该段
.line xxxx
...... //删除该段
.line xxxx

return-void

修改后编译 重启系统

禁止还原电池白名单(仅测试MIUI12)

打开/system/app/powerkeeper/powerkeeper.apk 取出并打开 用Dex++编辑器方式打开classes.dex,并且以代码方式搜索"Lcom/miui/powerkeeper/controller/DeviceIdleController" 进入 Lcom/miui/powerkeeper/PowerKeeperManager 这个类,并且删除代码片段:

new-instance v0, Lcom/miui/powerkeeper/controller/DeviceIdleController;

iget-object v1, p0, Lcom/miui/powerkeeper/PowerKeeperManager;->mContext:Landroid/content/Context;

invoke-direct {v0, v1, p0}, Lcom/miui/powerkeeper/controller/DeviceIdleController;-><init>(Landroid/content/Context;Lcom/miui/powerkeeper/PowerKeeperManager;)V

iput-object v0, p0, Lcom/miui/powerkeeper/PowerKeeperManager;->mDeviceIdleController:Lcom/miui/powerkeeper/controller/DeviceIdleController;
.method public getDeviceIdleController()Lcom/miui/powerkeeper/controller/DeviceIdleController;
    .registers 1

    iget-object p0, p0, Lcom/miui/powerkeeper/PowerKeeperManager;->mDeviceIdleController:Lcom/miui/powerkeeper/controller/DeviceIdleController;

    return-object p0
.end method

进入 Lcom/miui/powerkeeper/provider/PowerKeeperConfigureManager 这个类,删除代码片段:

iget-object v0, p0, Lcom/miui/powerkeeper/provider/PowerKeeperConfigureManager;->mPowerKeeperManager:Lcom/miui/powerkeeper/PowerKeeperManager;

invoke-virtual {v0}, Lcom/miui/powerkeeper/PowerKeeperManager;->getDeviceIdleController()Lcom/miui/powerkeeper/controller/DeviceIdleController;

move-result-object v0

invoke-virtual {v0}, Lcom/miui/powerkeeper/controller/Controller;->enable()V

进入 Lcom/miui/powerkeeper/statemachine/ForceDozeController 这个类,删除restoreWhiteListAppsIfQuitForceIdle()V这个方法的代码,并且加入return-void:

.method private restoreWhiteListAppsIfQuitForceIdle()V
.register 8
........ //删除此处代码
return-void
.end method

最后保存,编译,退出即可。


软件设置部分


Google Voice 闪退

  1. 权限管理
  2. 获取手机信息
  3. 空白通行证 > 始终允许

网上国网绑带户号闪退

  1. 确定已通过 MagiskHide/shamiko 等方式隐藏 Root 与框架
  2. 安装MyAndroidTools/Blocker
  3. 关闭com.sgcc.wsgw.mainbundle.EAtHomeActivitycom.sgcc.wsgw.publiclibrary.utils.server.CoreService
  4. 打开软件,同意相应的权限申请
  5. 绑定户号
  6. 打开上述两项