MIUI 缺陷修复

为获得最佳浏览体验请 点击此处 进入我的个人博客享受更佳排版并获取最近更新

成也 MIUI 败也 MIUI ,小米手机一大卖点就是 MIUI 所提供的各种便捷功能,但其对于系统的魔改导致了搞机人士的诸多不便,本篇文章将长期收集 MIUI 系统各类 “缺陷解决方案”


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


防卡米

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

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

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

return-void

修改后编译
重启系统


禁止还原电池白名单

打开/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;->(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 restoreWhiteListAppIfQuitForceIdle()V
.register 7
........ //删除此处代码
return-void
.end method

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

版权声明: 本博客所有文章皆为原创,除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!

你可能感兴趣的:(教程)