Remove All Ads from XDA

[2018.7.19] Magisk v16.0 - Root & Universal Systemless Interface [Android 5.0+]

1,800 posts
Thanks Meter: 46,721
By topjohnwu, Recognized Developer / Recognized Contributor on 3rd October 2016, 06:00 PM
Thread Closed Email Thread
28th March 2018, 08:41 AM |#41  
OP Recognized Developer / Recognized Contributor
Flag Taipei
Thanks Meter: 46,721
Donate to Me
2018.3.28 Magisk v16.3
Remove Backward Compatibility Symlinks
The paths of some static files have been moved to secure directories for quite some while. I've added symlinks to reduce breakage at that time, but it also introduces a ton of dirty workarounds into the hiding mechanism. The module template was already updated with these changes for over 4 months, I think it is about time to remove these symlinks.

Remove SafetyNet Blacklists
Previously, Magisk Manager has an internal list of apps that uses SafetyNet. It will blacklist these apps to prevent users from double hiding them. However a recent update of Pokemon GO introduces its own detection method in addition to the existing SafetyNet check, so I decided to simply just remove this list all together. Pokemon GO users will now need to explicitly add the app to the hide list for the best experience.

Future Plans
I'm aware of Magisk currently doesn't work on Samsung S9(+). It is most likely caused by yet another weird Treble implementation from OEMs. So the next goal is to of course add support for these new Sammys.
Also another controversy news has caught the spotlight: Google banning none certified devices from Google Play Services upon setup. This can be workarounded with installing Magisk before running the setup. I would love to add some optimization so it can play better with Treble ROMs (GSI) out of the box to prevent these issues.
But keep in mind that I'm still in charge of the military training, so development will be slow.
The Following 758 Users Say Thank You to topjohnwu For This Useful Post: [ View ]
29th April 2018, 11:09 AM |#42  
OP Recognized Developer / Recognized Contributor
Flag Taipei
Thanks Meter: 46,721
Donate to Me
2018.4.29 Magisk v16.4
Massive Refactoring
I spent weeks redesigning the way Magisk starts up, including how /sbin tmpfs overlay is constructed. Along with the redesign, I cleaned up the sepolicy rules and also switched the domain root processes will run in to prevent conflicts. Some parts of procedure graph in the docs thus became obsolete, but I haven't have the time to update it yet.
In this major refactoring, I finally decided to remove post-fs mode. As a replacement, the files for simple mount should now be moved from /cache/magisk_mount to /data/adb/magisk_simple, and will be mounted immediately in post-fs-data mode before the daemon initialization.

MagiskHide Improvements
There is an increasing amount of apps that run device verification / root detection in a separate service, which was under the radar of MagiskHide's implementation. These services are now included as the target.

I still haven't had the time to check out Galaxy S9 support yet, as these under-the-hood changes took more time than I expected.
Here are the changelogs:
  • Magisk v16.4
    - [Daemon] Directly check logcat command instead of detecting logd, should fix logging and MagiskHide on several Samsung devices
    - [Daemon] Fix startup Magisk Manager APK installation on Android P
    - [MagiskPolicy] Switch from AOSP u:r:su:s0 to u:r:magisk:s0 to prevent conflicts
    - [MagiskPolicy] Remove unnecessary sepolicy rules to reduce security penalty
    - [Daemon] Massive re-design /sbin tmpfs overlay and daemon start up
    - [MagiskInit] Remove magiskinit_daemon, the actual magisk daemon (magiskd) shall handle everything itself
    - [Daemon] Remove post-fs stage as it is very limited and also will not work on A/B devices; replaced with simple mount in post-fs-data, which will run ASAP even before the daemon is started
    - [General] Remove all 64-bit binaries as there is no point in using them; all binaries are now 32-bit only.
    Some weirdly implemented root apps might break (e.g. Tasker, already reported to the developer), but it is not my fault
    - [resetprop] Add Protobuf encode/decode to support manipulating persist properties on Android P
    - [MagiskHide] Include app sub-services as hiding targets. This might significantly increase the amount of apps that could be properly hidden
  • Magisk Manager v5.7.0
    - Add app shortcuts for Android 7.1+
    - Bump minimal module minMagisk requirement to 1500
    - Adjustments for new sepolicies on v16.4+
    - Fix crashes when refreshing the online repo
The Following 817 Users Say Thank You to topjohnwu For This Useful Post: [ View ]
8th July 2018, 12:22 AM |#43  
OP Recognized Developer / Recognized Contributor
Flag Taipei
Thanks Meter: 46,721
Donate to Me
2018.7.8 Magisk v16.6
Hello, long time no see guys! Wondering why v16.5 is skipped? Because we went through so many internal testing that we ran out of version numbers

Full Treble-ish
Magisk relies on files placed in /data to work properly, so if you performed factory reset, Magisk couldn't fully function until you re-install. In this new version, a stub Magisk Manager APK is embedded into magiskinit, and it will be installed if no manager is detected. The stub will download and install the full Magisk Manager, then the full version will reconstruct a proper Magisk environment. This is particular useful for people switching to/across GSI ROMs: you can swap system images with full wipes without the need to reinstall Magisk! This also means that people can share pre-rooted boot images with others using the same device, as Magisk is fully functional with solely a patched boot image.

No More Mysterious Root Loss
Several users has been constantly reporting the "root loss" issue: Magisk will randomly stop working. Actually, over a year ago when MagiskHide was just announced, a similar issue was widespread and fixed at that time. The cause of the issue has something to do with the fact that Magisk unexpectedly unmounts stuffs in Zygote's mount namespace. Recently I found out that there are devices running multiple Zygote servers at a time! This weird edge case was not handled by MagiskHide, and thus root loss issues still occurs on some users. A new mechanism is implemented to mitigate this notorious bug.

However, there were still users losing root caused by a more serious issue: magisk daemon crashing. To cure the symptoms but not the disease, I introduced Invincible Mode a while ago, but the reason of the crashes was never identified. I spent some time rewriting the most complicated (and suspicious) part: logcat monitoring, introducing a new daemon, magisklogd, which will work hand in hand with the main daemon, magiskd. Internal testers who used to experience daemon crashes no longer have any issues up to this point; additionally a new invincible mode implemented by constant handshaking between the 2 daemons still remains, should the daemon crashes.

Tons of other bug fixes, optimizations, new support is also added to this release, here I'll briefly go through them.
  • 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/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.
  • 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 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)

Note to ROM Developers
If you are embedding Magisk Zip into your ROM, and your ROM uses Aroma Installer, please be aware that on some devices (most likely Samsung devices), it is possible that the installation process of Magisk could break Aroma. Please test flashing your ROM zip before releasing to your users. If you found out you are the few unfortunate devices, unzip the Magisk zip, and do the following changes and re-zip the installer:

# Remove or comment out these 2 lines in META-INF/com/google/android/updater-script

$BOOTSIGNED && ui_print "- Boot image is signed with AVB 1.0"
The reason why Aroma Installer breaks is unknown. Maybe consider letting the project that's abandoned for nearly 5 years go?
The Following 601 Users Say Thank You to topjohnwu For This Useful Post: [ View ]
18th July 2018, 10:33 PM |#44  
OP Recognized Developer / Recognized Contributor
Flag Taipei
Thanks Meter: 46,721
Donate to Me
2018.7.19 Magisk v16.7
A stable release is imminent!

Hot Fix (versionCode: 1671)
  • Fix booting to fastboot on half-treble devices (OP5/5T on stable OOS, maybe more)
  • Detect ramdisk partition for Huawei

Bug Fixes
EMUI's logcat for some reason will change the permission of its output file, and since Magisk will do several logcat commands dumping output to /dev/null, the permission is messed up, causing tons of stuff to break, including adbd; the issue is now fixed. Some new Treble devices (e.g. OnePlus 5/5T) had some issues with the "lazy" method I used to early mount partitions, so the "proper" way is introduced: magiskinit will start reading fstab in device trees to detect the partition partname. A positive side effect is that some custom Treble devices (many Xiaomi devices) modifies the device tree to redirect vendor to an unused partition, and this is now fully supported!

Legacy Support
Starting from v16.7, the native part of Magisk is compiled against SDK 16 (Android 4.1 JellyBean), which is the beginning of legacy support. This doesn't mean you can flash Magisk on your obsolete devices now, as there are tons of stuffs needed to be done: Magisk Manager does not install on anything lower than Android 5.0; most features are not even tested yet. Proper legacy support won't happen until the next release is pushed to the stable channel though, v17 is my top priority now and I want it to be as bug free as possible!
The Following 512 Users Say Thank You to topjohnwu For This Useful Post: [ View ]
Thread Closed Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes