MagiskDocument

2023.4.5 Magisk v26.0

嘿!好久不见!

将最低 Android 版本提升到6.0

Magisk 对 Android Lollipop 的支持在不知不觉中已经中断了一段时间。此外,Magisk 的活跃开发者都没有运行 Android Lollipop 的实际硬件。我们依赖使用官方安卓模拟器对旧平台进行回归测试,但谷歌从未提供过支持 SELinux 的棒棒糖模拟器镜像,这让我们别无选择,只能放弃对棒棒糖的支持,因为在没有充分测试的情况下,我们不放心支持安卓棒棒糖。

新的 Magic Mount 实现

魔力挂载(Magic Mount)是一项能让模块修改分区的功能,现已进行了重大改写。现有实现无法很好地与使用 overlayfs 向系统注入覆盖层的 OEM 配合使用。新的实现方式从根本上改变了文件系统镜像的创建方式,为我们提供了未修改文件系统的更精确克隆。

新的 sepolicy.rule 实现

Magisk 允许模块通过包含 sepolicy.rule 文件来提供自定义 SELinux 补丁。由于 SELinux 补丁的复杂性,该功能的兼容性一直很不稳定;许多设备都不支持。在此版本中,我们设计了全新的启动前分区检测机制,以支持更多设备。由于复杂的原因,该检测机制无法在第三方 Recovery 环境中执行。

这意味着使用第三方 Recovery 功能安装 Magisk v26+ 将是不完整的;需要在启动后通过 Magisk 应用程序重新安装。

Zygisk 更新

新版 Zygisk API v4 现已上线!它具有新功能和完善的 PLT 函数钩子 API。Zygisk 的实现也经历了一些重大的重构,包括新的代码加载/卸载机制和新的 PLT 函数钩子实现。

前往 Zygisk 模块示例 仓库查看新的 API 和文档!

Hey! Long time no see!

Bumping Minimum Android Version to 6.0

Magisk’s support for Android Lollipop has been pretty broken for a while without it being noticed. Also, none of the active developers of Magisk have actual hardware to run Android Lollipop. We rely on using the official Android emulator for regression testing on older platforms, however Google never shipped a Lollipop emulator image with SELinux support, leaving us with no option but to drop Lollipop support since we don’t feel comfortable supporting Android Lollipop without adequate testing.

New Magic Mount Implementation

Magic Mount, the feature that make modules modify partitions, has gone through a major rewrite. The existing implementation doesn’t work well with OEMs injecting overlays into their system using overlayfs. The new implementation fundamentally changes how filesystem mirrors are created, giving us a more accurate clone of the unmodified filesystem.

New sepolicy.rule Implementation

Magisk allows modules to provide custom SELinux patches by including the file sepolicy.rule. Due to the complicated nature of SELinux patching, the compatibility of this functionality has been pretty spotty; many devices are not supported. In this release, a brand new pre-init partition detection mechanism has been designed to support even more devices. Due to complicated reasons, this detection mechanism cannot be performed in a custom recovery environment.

This means that any installation of Magisk v26+ using custom recovery will be incomplete; a subsequent re-installation through the Magisk app after booting up is required.

Zygisk Updates

The new Zygisk API v4 is now live! It comes with new features and a refined PLT function hook API. The implementaton of Zygisk has also gone through some major refactoring, including new code loading/unloading mechanisms and a new PLT function hook implementation.

Head over to the Zygisk Module Sample repository to check out the new API and documentation!

Full Changelog: here