https://github.com/topjohnwu/Magisk/
Magisk is a suite of open source software for customizing Android, supporting devices higher than Android 6.0.
Some highlight features:
Github is the only source where you can get official Magisk information and downloads.
Only bug reports from Debug builds will be accepted.
For installation issues, upload both boot image and install logs.
For Magisk issues, upload boot logcat or dmesg.
For Magisk app crashes, record and upload the logcat when the crash occurs.
Default string resources for the Magisk app and its stub APK are located here:
app/core/src/main/res/values/strings.xml
app/stub/src/main/res/values/strings.xml
Translate each and place them in the respective locations ([module]/src/main/res/values-[lang]/strings.xml
).
Magisk, including all git submodules are free software:
you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation,
either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
This release looks minor at the surface, however, the entire codebase has gone through significant refactoring and migration. The native code in Magisk used to be mainly C++, but several contributors and I have been steadily rewriting parts of the code in Rust since April 2022. After years of effort, the Rust-ification of the project slowly began picking up steam, and at the moment of this release, over 40% of the native code has been rewritten in Rust, with several major subsystem rewrites in the PR queue, planned to be merged for the next release.
Many might wonder, why introduce a new language to the project? My reason is actually not to reduce memory safety issues (although it is a nice side benefit), but to be able to develop Magisk using a more modern programming language. After using Rust for a while, it's clear to me that using Rust allows me to write more correct code and makes me happier compared to dealing with C++. People share the same sentiment as I do.
N/A
There are a LOT of internal refactoring and significantly more testing infrastructure in the Magisk project!
overlay.d
replaced files to be not accessibleoverlay.d
replaced files to be not accessibleoverlay.d
replaced files to be not accessibleoverlay.d
replaced files to be not accessiblemagiskinit
and magiskboot
) for smaller sizesmagiskinit
as init
action.sh
support to allow modules to define an action triggered from UIaction.sh
support to allow modules to define an action triggered from UImagiskinit
and magiskboot
) for smaller sizesmagiskinit
as init
action.sh
support to allow modules to define an action triggered from UImagiskinit
and magiskboot
) for smaller sizesmagiskinit
as init
sepolicy.rule
loadingmagiskinit
and magiskboot
) for smaller sizesmagiskinit
as init
magiskinit
and magiskboot
) for smaller sizesmagiskinit
as init
init
so Magisk is installable on devices with small boot partitionsresetprop -w
genfscon
and filename_trans
libsepol
payload.bin
-g
and -G
options-t
boot.img
when patching Samsung firmware with init_boot.img
ext4
partitions over f2fs
when selecting the pre-init partition(The following is the same as v26.0 release notes)
Hey! Long time no see!
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.
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.
sepolicy.rule
ImplementationMagisk 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.
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!
Hey! Long time no see!
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.
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.
sepolicy.rule
ImplementationMagisk 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.
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!
Maintenance release fixing various issues.
v25.1 fixes some minor bugs over v25.0. The following are the same as v25.0 release notes.
Another major release! A lot of the changes aren't visible at the surface, but v25 is actually a really substantial upgrade!
A significant portion of magiskinit
(the critical software that runs before your device boots up) is completely rewritten from scratch. Ever since Android introduced Project Treble in Android 8.0, Magisk has been constantly fighting against the increasingly complex partitioning and early mount setups of all kinds of devices, sometimes with weird OEM specific implementations. It got to a point that magiskinit
had become so complicated that few people (including myself!) were aware of every detail, and maintaining this piece of software like this was clearly not sustainable. After many months of planning (yes, this whole re-architecture has been in my head for a long time) and some help from external contributors, a whole new sepolicy
injection mechanism is introduced into Magisk, solving the "SELinux Problem" once and for all.
Since this is a full paradigm shift on how Magisk hot-patch the device at boot, several behaviors that many developers implicitly relied on might not exist. For example, Magisk no longer patches fstabs in most scenarios, which means AVB will remain intact; some custom kernels rely on AVB being stripped out for them by Magisk.
The superuser functionality of Magisk has not seen much changes ever since its introduction. v25 focuses on making root permission management more accurate and secure:
sharedUserId
Many might not realize, but using a trusted, unmodified Magisk app is really important. Magisk's root daemon treats the Magisk app differently and gives it blanket root access without any restrictions. A modded Magisk app can potentially backdoor your device.
And in case some of you are about to put on your tin foil hats, this is not designed to "vendor lock-in"; the goal is to make sure your root management app comes from the same developer of the underlying root implementation. Magisk's build system allows custom distributors to use its own signing keys, and in addition, I am also providing official debug builds which skips any signature verification for development.
Another major release! A lot of the changes aren't visible at the surface, but v25 is actually a really substantial upgrade!
A significant portion of magiskinit
(the critical software that runs before your device boots up) is completely rewritten from scratch. Ever since Android introduced Project Treble in Android 8.0, Magisk has been constantly fighting against the increasingly complex partitioning and early mount setups of all kinds of devices, sometimes with weird OEM specific implementations. It got to a point that magiskinit
had become so complicated that few people (including myself!) were aware of every detail, and maintaining this piece of software like this was clearly not sustainable. After many months of planning (yes, this whole re-architecture has been in my head for a long time) and some help from external contributors, a whole new sepolicy
injection mechanism is introduced into Magisk, solving the "SELinux Problem" once and for all.
Since this is a full paradigm shift on how Magisk hot-patch the device at boot, several behaviors that many developers implicitly relied on might not exist. For example, Magisk no longer patches fstabs in most scenarios, which means AVB will remain intact; some custom kernels rely on AVB being stripped out for them by Magisk.
The superuser functionality of Magisk has not seen much changes ever since its introduction. v25 focuses on making root permission management more accurate and secure:
sharedUserId
Many might not realize, but using a trusted, unmodified Magisk app is really important. Magisk's root daemon treats the Magisk app differently and gives it blanket root access without any restrictions. A modded Magisk app can potentially backdoor your device.
And in case some of you are about to put on your tin foil hats, this is not designed to "vendor lock-in"; the goal is to make sure your root management app comes from the same developer of the underlying root implementation. Magisk's build system allows custom distributors to use its own signing keys, and in addition, I am also providing official debug builds which skips any signature verification for development.
For those coming from v24.1, check the full changelog for changes introduced in v24.2.
getrandom
syscallAppSpecializeArgs
Maintenance release fixing various issues.
su -c <cmd>
lz4_legacy
archive with multiple magiclz4_lg
compressionumask
being set in zygoteFor those coming from v24.0, v24.1 only has some minor app improvements. The following are copied from v24.0 release notes.
It has been a while since the last public release, long time no see! A personal update for those unaware: I am now working at Google on the Android Platform Security team. Without further ado, let's jump right into it!
I have lost interest in fighting this battle for quite a while; plus, the existing MagiskHide implementation is flawed in so many ways. Decoupling Magisk from root hiding is, in my opinion, beneficial to the community. Ever since my announcement on Twitter months ago, highly effective "root hiding" modules (much MUCH better than MagiskHide) has been flourishing, which again shows that people are way more capable than I am on this subject. So why not give those determined their time to shine, and let me focus on improving Magisk instead of drowning in the everlasting cat-and-mouse game 😉.
Due to lack of time and maintenance, the centralized Magisk-Modules-Repo was frozen, and the functionality to download modules from the repo is removed in v24.0. As a supplement, module developers can now specify an updateJson
URL in their modules. The Magisk app will use that to check, download, and install module updates.
Zygisk is Magisk in Zygote, the next big thing for Magisk! When this feature is enabled, a part of Magisk will run in the Zygote
daemon process, allowing module developers to run code directly in every Android apps' processes. If you've heard of Riru, then Zygisk is inspired by that project and is functionally similar, though the implementation is quite different internally. I cannot wait to see what module developers can achieve using Zygisk!
For developers, details about updateJson
and building Zygisk modules can all be found in the updated documentation.
It has been a while since the last public release, long time no see! A personal update for those unaware: I am now working at Google on the Android Platform Security team. Without further ado, let's jump right into it!
I have lost interest in fighting this battle for quite a while; plus, the existing MagiskHide implementation is flawed in so many ways. Decoupling Magisk from root hiding is, in my opinion, beneficial to the community. Ever since my announcement on Twitter months ago, highly effective "root hiding" modules (much MUCH better than MagiskHide) has been flourishing, which again shows that people are way more capable than I am on this subject. So why not give those determined their time to shine, and let me focus on improving Magisk instead of drowning in the everlasting cat-and-mouse game 😉.
Due to lack of time and maintenance, the centralized Magisk-Modules-Repo was frozen, and the functionality to download modules from the repo is removed in v24.0. As a supplement, module developers can now specify an updateJson
URL in their modules. The Magisk app will use that to check, download, and install module updates.
Zygisk is Magisk in Zygote, the next big thing for Magisk! When this feature is enabled, a part of Magisk will run in the Zygote
daemon process, allowing module developers to run code directly in every Android apps' processes. If you've heard of Riru, then Zygisk is inspired by that project and is functionally similar, though the implementation is quite different internally. I cannot wait to see what module developers can achieve using Zygisk!
For developers, details about updateJson
and building Zygisk modules can all be found in the updated documentation.