[YEY!] Officially Xposed Framework For Nougat Is Now Available

This day couldn't have been better for a true Android enthusiast. I'm glad to inform you that official Xposed framework is finally available for Nougat and this ain't any prank.

Xposed framework was earlier ported to Nougat by a developer named abforce in the form of an ART submodule. However this unofficial implementation of Xposed was incomplete which caused some Xposed modules to not work as expected.

With the release of Nougat, several optimisations were introduced to Android Runtime (ART) which led to major chunks of Xposed framework to be rewritten. The unofficial port of Xposed by abforce simply disabled the newly introduced ART optimisations and that's what made the Xposed port to work on Nougat. Since this was kind of a workaround, this implementation was incomplete and buggy. On the other hand, the official Xposed framework builds keep the ART optimisations intact and therefore allow for efficient working of Xposed along with the ART optimisations.

If you wish to know how rovo89 got Xposed working on Nougat, you can take a look at the following statement which he gave to XDA.

The core of Xposed is obviously it's ability to hook Java methods, i.e. let modules execute code before, after or instead of these methods. Pretty much every other functionality is based in this, so it’s critical that it’s always working as expected. The general concept has been the same since I invented Xposed five years ago, it requires changing the entry point of the method. This starts to fail when the entry point isn’t checked during execution – which is actually the case with some of the optimizations in ART.

One example is when the entry point is already known at compile time, then callers can directly jump to this address without looking it up. Another example is inlining. Consider this example:

ART is smart enough to notice that the twice() method is very simple and therefore embeds the logic right into the doSomething() method, like this:

You can still hook the twice() method, but it won’t be called from doSomething() anymore at runtime, and so won’t your callback. ART is even more clever: It realizes that magic is always 42 and therefore the condition can never be fulfilled. So the whole doSomething() method is actually a no-op:


In previous versions, Xposed used to disable these optimizations completely and forced recompilation of everything. That came with several downsides. First of all, the ART developers are doing a fantastic job in maximizing the performance with their optimizations, and disabling them partly necessarily leads to less performance (I never measured how much though). Then, the recompilation itself isn’t always easy and caused me a lot of headaches, especially in the beginning. Finally, the recompiled files take up space, in addition to the precompiled files on /system.

The unofficial versions for Nougat also disable these optimizations, but they don’t force the recompilation (because the port was originally made to be integrated into the ROM). Therefore, hooks might not be executed sometimes.

With the official version, you’ll get to keep the optimized code and still have reliable hooks. How does that work? Well, Xposed records all the calls that are made. This happens while APKs are being compiled, or in a separate pass for preoptimized code. This additional data doesn’t take up much space, but it allows Xposed to find out where a certain method might have been inlined. So when a method is hooked, all its callers will be deoptimized, i.e. their code won’t be used anymore. This ensures that the hook callback will definitely be called. And if the caller is heavily used, it will simply be recompiled with JIT, this time with the knowledge that the method is hooked and therefore some of the optimizations don’t apply. This means that the effects of hooking methods are reduced to the bare minimum. Yay!

Now go ahead and try it out. Make sure to use Xposed Installer 3.1.2, as the config path had to be changed to support File Based Encryption.

Rovo89, the founder of Xposed, has been working solely on this project and that too in his spare time. That's why it took such a long time for Xposed to be available for Nougat. You can download Xposed framework from the links given below. Please note that if you proceed with Xposed's installation, you will end up tripping the SafetyNet check which means that you won't be able to use Android Pay. To proceed with the installation, you must ensure that you have unlocked the bootloader of your device and have a custom recovery installed.

Xposed framework for Nougat 7.0 (SDK 24)

Xposed framework for Nougat 7.1.1 and 7.1.2 (SDK 25)

The installation procedure is quite simple. After downloading the Xposed framework from the above links, boot your device into recovery mode and flash the Xposed framework. It is advised that you wipe the cache and dalvik cache partitions post the flashing and then reboot your device. After rebooting your device, you can start using Xposed modules by downloading them from the Xposed Installer. You can install Xposed Installer by grabbing it's APK from here.

Source: XDA

[Image credit - Xposed for the icon and Ash for performing further edits]

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.
[YEY!] Officially Xposed Framework For Nougat Is Now Available [YEY!] Officially Xposed Framework For Nougat Is Now Available Reviewed by Krittin Kalra on 10/08/2017 10:33:00 PM
Subscribe To Us

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

Powered by Blogger.