Use Android Pay with Xposed Without Rebooting with Magisk
Amongst many first world problems, there is one that resonates with many XDA-dwellers. On one hand, Android is aiming for the future with solutions like Android Pay — allowing you to make payments on physical terminals with your mobile, without needing your wallet. It’s convenient and it works (if you are in supported regions).
On the other hand, modifications like Xposed and the ability to allow elevated SU permissions to apps allows for a great deal of customization. To us, Android is about making your phone our very own, and modifications like these is what make that truly possible. So, Android Pay and Xposed, they have trouble co-existing. We kind of get why, but that doesn’t stop people from trying.
Previously, if you wanted to use Android Pay, you had to stay completely stock and unrooted. Then came along the systemless variants of SuperSU and Xposed, which gave users the ability to use Android Pay if they disabled Xposed and rebooted. Mileage did vary depending on the phone, the Android Version and more variables. But this was certainly progress from the previous stages of zero compatibility.
Today’s news takes this one step further. Recognized Contributor topjohnwu, the developer of the unofficial systemless Xposed modification, has created Magisk — the universal systemless interface. As the dev calls it:
Magisk Is A Magic Mask to Alter System Systemless-ly.
Magisk by itself has a lot of potential. It taps into the potentials of making systemless modifications, while removing the complexity involved with it. Systemless mods were complex and difficult to maintain, and had limitations and impossibilities in their general usage. Magisk removes these difficulties and creates a universal interface for everyone, developers and users alike, to use systemless mods and to develop them.
Magisk has a fair few features that extend beyond Android Pay compatibility. One of them is Magic Mount, which not only allows you to replace files in /system, it even allows you add new files and directories. This by itself opens up the possibilities for all existing Xposed mods to work systemless-ly. If that does not work out in your favor, Magisk also promises multiple entry points for scripts to run during boot times. The Magisk Manager lets you manage your root mount status, which brings us to the solution of our first-world problem: using Android Pay with root and Xposed!
To install Magisk, the developer recommends starting from a 100% stock system and boot image state. Then you need to flash Magisk and you’re done. In case you are not 100% stock system and boot image, the developer has laid down a few instructions that you can follow along to install successfully.
For more features, and to learn more about the mod itself, head on over to the forum thread.
So how do you get around to using Android Pay with root and Xposed?
Firstly, you need to have Magisk installed. Then you need to ensure that you are using phh’s open-source SuperUser that is Magisk-compatible (available for download from the Magisk thread). For Xposed, you need the Magisk compatible systemless Xposed (linked in the Magisk thread). Then, you need to open the Magisk Manager that is installed automatically along with Magisk and click on unmount root. Lo and behold, Android Pay should now work, and you don’t even need to reboot! This is because this option actually temporarily fully unroots your device, so anything that needs root will not have root, with the consequence being that apps that use the Safety Net check can also not detect root.
To get root back, simply mount root back and you’re good to go. Easy and simple, with no reboots needed.
In case your superuser privilege management tool of choice is Chainfire‘s SuperSU, 100% compatibility is not guaranteed. The developer has created a handy chart which informs of what you can and cannot do if you deviate from the recommended course of actions.
If you are forced to use phh’s root due to the fact that you want Android Pay working with Xposed, but you also wanted to use incompatible apps (that need secontext live patching), here I provide a switch in “Magisk Manager” for you to set SELinux to permissive. This will give maximum compatibility (this will allow anything to happen). Please note that I do not recommend letting SELinux be switched to permissive permanently. Only use when necessary!
There’s a lot more to Magisk that is beyond the scope of this news article. The developer has covered a lot of information in his forum thread, so we recommend that you go and check it out. The developer also requests users to not bug Chainfire with compatibility requests for SuperSU with Magisk, as the dev will do it himself when appropriate.
Right now, it’s time to go #BackToStock and then go the whole way with systemless modifications. If you have tried Magisk out, let us know your experience in the comments below! And do confirm for your fellow users in the comments below if Android Pay is working on your device! Flash away!