Magisk v16.6 Retains Root Access After Factory Reset, Fixes Mysterious Root Loss & More


John Wu, better known as topjohnwu, has been working on improving Magisk since he got back from his military training last month. As a result of Wu's efforts, we now have a new Magisk beta and this is a major update.

Magisk v16.6 will retain root access even after a factory reset has been performed. In a factory reset, the data, cache and dalvik cache partitions are wiped. Magisk relies on files in /data to function properly. Because the necessary Magisk files located in the data partition get cleaned in a factory reset, Magisk doesn't work after a device has been reset.

In v16.6 of Magisk, a stub Magisk Manager is placed in magiskinit. At the time of booting, a check for the presence of Magisk Manager will be performed. If Magisk Manager isn't installed, the stub will download and install the full Magisk Manager, and it will also rebuild the entire root environment. This automatic process retains root access and saves the user from the effort of reinstalling Magisk after a factory reset. Not only this, the process also ensures that root access is preserved when switching between different Generic System Images (or GSI for short). This also implies that same device users can share pre-rooted boot images since root access will be restored using the above process.

In older versions of Magisk, several users, including myself, randomly lost root access. Wu discovered an edge case and has included a fix for the same in v16.6. Additionally, there are fixes to prevent root loss happening due to daemon crashing.

The developer-written changelog for Magisk v16.6 and Magisk Manager v5.8.0 are given below. The changelogs can also be accessed from within the About section of the Manager.

Magisk v16.6 Beta Changelog


• Magisk Manager will preserve the random package name when upgrading within the app. Magisk will no longer prefer the package name com.topjohnwu.magisk over repackaged (hidden) Magisk Manager to prevent malware from targeting this specific package name. If you have a repackaged Magisk Manager installed, com.topjohnwu.magisk will be forcefully denied root access. You can use Restore Magisk Manager in settings, or uninstall the repackaged Magisk Manager to unlock com.topjohnwu.magisk.

• The logic to calculate free space in ext4 images is replaced with new extremely precise methods, hopefully no more module installation failures caused by images should happen. All modules using template 1500 will automatically benefit from the new free space calculation method on Magisk v16.6+, no additional changes are needed.

• Support for Samsung Galaxy S9/Samsung Galaxy S9+ is officially added.

• Magisk v16.4 switched to 32-bit only binaries and caused issues in some apps. A new wrapper script is added to eliminate all possible quirks.

• Project Treble GSIs (e.g. phh AOSP) sometimes require replacing adbd in ramdisk and used to conflict with Magisk. It is now fixed and ADB will fully function when using Project Treble GSIs.

• LineageOS introduced addon.d-v2 to A/B partition devices, the addon.d script is updated to be A/B aware (untested on my side)


Magisk Manager v5.8.0 Changelog


• Remain hidden when upgrading within repackaged Magisk Manager

• New feature: support reconstructing a proper Magisk environment if error detected (e.g. after factory reset)

• New uninstall method: download uninstaller and completely remove Magisk + Magisk Manager, following with a reboot.

• Hidden apps are now shown on the top of the list in MagiskHide fragment

• Tons of under-the-hood bug fixes and improvements


Source: XDA Developers, Magisk XDA thread (download links for Magisk can be found here)

Krittin Kalra
Krittin Kalra is a 20 year old Android freak. Striving for passions, chasing down his dreams and living a life without regrets is his sole mantra. A bit moody, he also does custom ROM reviews for AndroGuider. Currently pursuing his B.Tech, he aspires to follow his heart.
Magisk v16.6 Retains Root Access After Factory Reset, Fixes Mysterious Root Loss & More Magisk v16.6 Retains Root Access After Factory Reset, Fixes Mysterious Root Loss & More Reviewed by Krittin Kalra on 7/11/2018 08:55:00 PM
Subscribe To Us

Get All The Latest Updates Delivered Straight To Your Inbox For Free!





Powered by Blogger.