[Magisk] topjohnwu:
2017.9.6 Magisk v14.0

Finally got some free time to work on development! Before adding the Pixel (XL) mess into the mix, I figured I would focus on stabilizing the current version, and make installing easier and more robust.

There are tons of under-the-hood changes compared to the last stable version, here I'll summarize the changes (include those in the betas) all in one post.

Busybox is Back

I have constructed a setup to easily build busybox for Android, and it has been included into Magisk. Also, a cleverly crafted update-binary, a shell script that has busybox embedded and can extract binaries matching the architecture on-the-fly, is used as a basis for installing. That busybox binary will also be used in various places such as all boot scripts and Magisk Manager, but will not be exposed externally. In order to install busybox systemless-ly, please install the Busybox module from [MENTION=4544860]osm0sis[/MENTION], which is available on the module repo.

Samsung Stock Kernel Workarounds

Tons of changes has been done to overcome some weird issues on Samsung devices, including exec and fork issues. All functionality are thoroughly tested to work on both Samsung and non-Samsung devices.

Hiding Magisk Manager

This new feature has been added to Magisk Manager. The approach is pretty naive, as it can be still detected in some way, but it should work in many cases. When select to hide Magisk Manager, it will randomly generate a new package name (so it can't be blacklisted) and install a new app called "Unhide Magisk Manager" to your device, then it will eventually hide itself. While Magisk Manager is hidden, root will work with apps that were granted before (the database is still there), but no new requests can work since the application itself is hidden and all components are disabled. To unhide Magisk Manager, simply just open "Unhide Magisk Manager", Magisk Manager will immediately be unhidden and started up, while the unhide app will automatically remove itself.

New Installation Method

Nearly a month ago, I introduced a way to install Magisk through ADB. This is nice for devices with no custom recovery support, or for people like me who wants to preserve stock recovery to apply OTAs. To make things even easier, I have added this feature natively into Magisk Manager. In Magisk Manager you can provide your stock boot image (in both raw image format or tar-ed up ODIN flashable format), the app will then patch the provided image. Other required files and scripts are extracted within the app's data, and will be picked up automatically while booting up once with a magisk patched boot image. Check the new instructions in the OP for more info.

Once your device has Magisk installed, you can install Magisk modules through Magisk Manager without custom recoveries. The powerful systemless interface means that you can literally do anything to your device - of course systemless-ly!

New Magisk Manager Features

Apart from the new installation method, some other new features are also added. You can now restore your stock boot image by selecting Uninstall > Restore Stock Boot. Personally I find it very useful: after restoring to stock boot image (without reboot), I can directly apply OTAs on my device. Of course, you need to have stock recovery installed (thanks to the new installation method, I refrain from installing custom recoveries), or if supported you can use Chainfire's FlashFire to apply the OTA. After applying the OTA, you have to re-root your device again, or if using FlashFire you can just choose to flash Magisk along with the OTA.

Another feature is the introduction of update channels. You can now opt-in to receive updates from the beta channel through Magisk Manager.

New Magisk Module Template - New Versioning Scheme

Modules Developers please pay attention to this part!

A new template has been pushed to the repo. Starting from this version, the template version (the template entry in module.prop), is now the minimum supported Magisk version code. So for this particular release, the template version will be "1400", which is the version code of Magisk v14.0 (1400).

The updated template comes with tons improvements here and there, so repo developers please migrate to the new template ASAP.

The reason why there is a minimum required Magisk version has been mentioned before: it is due to the fact that most installation logic is NOT in the modules, they are shipped in a universal script with Magisk.

Also, starting from v4, all previous versions will be preserved on the Github repo in the branch name in respect to its version.

The default branch, which should be the latest one, will only have two commits:

"Initial Commit" --> "Magisk Module Template <version_num>"

All changes are squashed into one single commit. It will be much cleaner for new module developers to start from

While other older branches will have three:

"Initial Commit" --> "Magisk Module Template <old_ver_num>" --> "Template <old_ver_num> -> <next_ver_num>"

The third commit is there to show the difference between the old and new version. This is useful for existing module developers to know what to update. If you are familiar with git, you can simply just cherry-pick this commit to finish the migration.

Small Update to MagiskHide

Some devices ships with broken kernels! These kernels will cause magisk.img fail to mount. Previously this will also cause MagiskHide refuse to work, since the hide list is stored in the image. With a small adjustment, MagiskHide now works fine without the requirement of the image to be mounted, but this also means that if you want to hide certain apps in addition to SafetyNet, you will need to manually add them each time you reboot, since the hide list only exists in memory. In other words, if your kernel cannot mount magisk.img, you are forced to run in core-only mode.

Pixel, Pixel, Pixel

If this update is working fine just as expected, I'll finally put full force into working on Pixel (XL) support. I've already done some brief research, hopefully I can pump out official support soon lol.

Below is the changelog from the previous beta:

v13.6 -> v14.0

- [Magic Mount] Fix a typo in cloning attributes

- [Daemon] Introduce workaround on Samsung device with weird fork behaviors

- [script] Simplify installation scripts

- [script] Installation will migrate old or broken stock boot image backups to proper format

- [script] Fix an issue with selabel setting in util_functions on Lollipop

- [busybox] Bump version to 1.27.2

- [MagiskHide] magisk.img mounted is no longer a requirement

Devices with issues mounting magisk.img can now run in proper core-only mode