Skip to main content

Official Xposed Framework for Android Nougat is Here

As the Android ecosystem has matured over the years, fewer and fewer users find reasons why they should root their device. There's a growing trend of users choosing to stay on the stock firmware, either because they find the experience satisfactory or don't want to play a cat-and-mouse game with Google's SafetyNet API. But if you asked a user back in early 2016 why they rooted their phones, perhaps the number one reason that was given was so they could install the Xposed Framework. It's been over a year since Android 7.0 Nougat was first released, but the long wait is finally over: official Xposed Framework for Android Nougat is finally available.
Throughout the past year, XDA Senior Recognized Developer rovo89, the lead developer of the Xposed Framework, has provided several updates on the progress of Xposed Framework for Android Nougat. For some, the wait has been tolerable mostly due to the sheer number of additional functionality that the Xposed Framework offers in Android Marshmallow. But many others have moved on to a life without Xposed on their devices.
We saw a glimpse of renewed excitement in the project when developer abforce released an ART submodule for AOSP 7.1.2, but as our very own GermainZ points out you were better off waiting for the official Xposed Framework release as abforce's implementation required the framework to be integrated into custom ROMs. Furthermore, this unofficial implementation was incomplete, leading to inconsistent or buggy behavior with certain Xposed Modules.
While abforce did a great job in getting his unofficial Xposed working on Android 7.1 Nougat, his implementation went against rovo89's vision for Xposed—that it should be a stable solution providing a reliable and easy to use contract for users and developers alike. What we mean by this is that not only should modules work without issue for users, but the way that modules are set up should be consistent among users so developers will know whether or not a Xposed Module is to blame for an app crash.
We no longer have to worry about such issues as rovo89 (after some help from XDA Recognized Developer wanam) is now ready to release an official update to the Xposed Framework and Installer—bringing compatibility with Android 7.0/7.1 Nougat. That means you won't have to install a custom ROM or have to mess with flashing unstable versions to enjoy Xposed—just root your phone and install the latest Xposed Installer application (linked below) and the Xposed Installer will do the magic of installing Xposed for you.
ler will do the magic of installing Xposed for you.



Xposed Installer Browsing the Module Repository
This might seem a bit late in some minds, especially since this release comes over a month after Android 8.0 Oreo was released. Keep in mind that very few devices will have access to a stable version of Android Oreo for many months to come. Android Oreo is only on 0.2% of all Android devices (compared to ~18% on Nougat) according to the latest statistics from Google, but many of our users are the kind who love installing custom ROMs to stay on the bleeding edge.
android oreo october distribution numbers
Android Version Distribution as of October 2017. Source: Google
Though even if you install an unofficial port of Android 8.0 available on a myriad of devices on our forums, many of these ports are not daily driver status. So unless you're willing to shell out hundreds of dollars for a brand new Google Pixel 2/2 XL, Sony Xperia XZ1/XZ1 Compact, or an upcoming device such as the Huawei Mate 10, then you'll probably be able to squeeze several months of use out of Xposed Framework on Android Nougat.
If that sounds like you, then head on over to the official forum thread for the Xposed Installer and framework zips to get it up and running on your Android Nougat device.
For the many newer users who are not as acquainted with what the Xposed Framework can be used for or how it works, we will briefly explain the Xposed Framework below, why you should be excited, and why development on this took as long as it did.

Why install the Xposed Framework?

Want to get custom ROM features without flashing a custom ROM? The mother of all Xposed Modules for tweaking your ROM, known as GravityBox, has you covered. Want to customize display settings on a per-app basis? Try App Settings. How about customizing certain applications like Hangouts? Or modifying Instagram so you can download whatever posts you like?

Xposed gives developers the ability to modify pretty much whatever they want—mostly aimed at individual applications but even system-wide features can be modified. The examples we listed is just the tip of the iceberg. The number of additional features you can add or apps you can modify is incredible—just search through the official Xposed Module repository to see for yourself. Keep in mind that some modules might need to be updated for this new release and for Nougat support, so be sure to check before installing them on your Nougat ROM!

How do Xposed Modules work?

The gist of it is that the Xposed Framework allows modules to "hook" into the Java methods of any application—be it user-installed or a system application. Xposed lets modules execute their own methods before, during, or in place of the original methods of the target application.
For instance, imagine a method used in the Gmail application that posts notifications for new emails. By default, the method creates a new notification with buttons to archive/delete or reply to the email. A Xposed Module could be made to hook into this method and add a new button such as "mark as read." (Yes, there's already a Module for just that.)
The above is an over-simplification of the end result of what the Xposed Framework allows its modules to do. The Framework itself is incredibly complex and making it work nearly universally on rooted devices—without needing a custom ROM—is why Xposed for Android Nougat has taken so long to complete.

Why does Xposed development take so long?

The magic behind Xposed—what allows Modules to hook into methods of other apps—requires deep knowledge of how Zygote and the Android Runtime (ART) works. These requirements already preclude a large number of people from contributing to the project, but the problem is exacerbated by the fact the rovo89 has been the main contributor to Xposed for the past 5 years.
That's why calls for open sourcing his modifications made to Xposed since the last public release of Xposed have been denied. It's his brainchild, and he's the best at understanding it and modifying it, so adding more manpower onto the project at such a late stage could simply delay the project further.
Plus, if rovo89 continuously updated his source, he was worried that someone would take the unfinished code to build a semi-functioning Xposed Framework without the universal Xposed Installer to accompany it. (This exact thing happened anyways with the abforce implementation, and the resulting mess of various installation methods justified rovo89's hesitation.)
Thus, the best thing we could do was to give rovo89 time to work on his pet project. Xposed is not his full, or even part-time, job. It's simply a hobby, one that he's done for the benefit of the community for 5 years. A project as complex as Xposed requires time to work and then test—time that he didn't often have due to his other obligations. Progress was being made over the past year, just as rovo89 documented in a few of his public updates on the issue until finally both the Xposed Framework itself and the Xposed Installer are ready for release.

What did rovo89 do to get Xposed working in Nougat?

New releases of Android sometimes bring changes to the way ART works, which may require parts of Xposed to be reworked. Android 7.0 Nougat introduced a Just-in-Time compiler for ART to help improve runtime performance of applications, for instance. But the unofficial Xposed Framework by abforce simply disables many ART optimizations so that method hooking can work correctly.
Xposed Framework for Android Nougat
ART Optimizations in Android Nougat. Source: Google
In contrast, rovo89's implementation keeps all ART optimizations in Android Nougat by recompiling a method's caller using JIT and still having the method hooks in place. That means you can enjoy the benefits of a Xposed Module without sacrificing performance by forcefully disabling ART optimizations.
For further details of what rovo89 did to finally achieve a reliable hooking method in Xposed for Android Nougat, we recommend you read the below statement that he provided us.

Full statement from rovo89

The core of Xposed is obviously its 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:

Xposed Framework ART Optimizations

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:

Xposed Framework ART Optimizations

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:

Xposed Framework ART Optimization

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.

Conclusion

We hope you are as hyped as we are about the release of Xposed for Android 7.X Nougat. The wait has been long, but unavoidable given the sheer complexity of Xposed. If you're still confused about what Xposed is or how it works, don't worry. Very few people (us included) actually understand how it works. Developers like rovo89 do their best at packaging their work so you don't really have to understand what's going on underneath the hood.
Do you like the Xposed Framework? Consider donating to rovo89 for the awesome work that he does. If you think you have what it takes to contribute to the project, check out rovo89's GitHub page below.
Looking for Xposed Modules? Check out our Xposed Framework Module subforum or download the XDA Labs application and browse our collection of Xposed Modules.

Android Oreo Progress

In case you're wondering, here's how progress is on getting Xposed for Android Oreo:

I have already started work on Android 8.0. There are a few new language features that I'll have to look at, but the general concept should still work. That includes all the work on invalidating compiled code of any callers when a method is hooked, which took by far the most time when I worked on Nougat. So I'm really confident that I'll be much faster this time. Android 8.1shouldn't be much different, so I expect not much additional work for it.


Source:here

via Blogger http://ift.tt/2yakEpH

Comments

Popular posts from this blog

Xiaomi Mi A1 XDA Review: Android One and Xiaomi Hardware Result in a Delightful & Affordable Stock Experience

The Xiaomi Mi A1 is one of Xiaomi's biggest releases of the year 2017. Despite its overall humbling package, the phone marks a few important milestones for the Chinese company as well as for the Android ecosystem. The Mi A1 is important because it is the  first Xiaomi smartphone to ship without Xiaomi's own custom UX , MIUI on top of the Android OS. It is also the first device that is  the result of a reboot of Google's Android One program  —  an initiative that saw little success in its first phase in India . The Mi A1 is also the first Xiaomi device in recent times that does not see an equivalent launch in China, becoming the first Xiaomi device to be India-exclusive at launch. But does the Mi A1 with its Android One branding provide the value experience we are used to from Xiaomi? In this review, we'll take an in-depth dive into the Xiaomi Mi A1. Rather than listing specs and talking about how the experience felt, this feature attempts to prov

A lot of Galaxy S8 users are reporting problems with missing texts

The Galaxy S8 is one of the  best smartphones to debut in 2017 , but it seems like there is an increasingly large number of reports of people experiencing problems with receiving text messages on the phone. The reports all seem to have the Galaxy S8 in common, as most people report the problem no matter which carrier they're using. Threads for Galaxy S8 users on   Verizon ,   AT&T , T-Mobile, and   Sprint   reveal the same problem with delayed texts or texts not arriving at all. It also doesn't seem to be exclusive to a specific messaging app, as several reports show it's happening in the default Samsung SMS app, Textra, and even Android Messages. Someone suggested trying to turn off Advanced Messaging in the default messaging app to see if that stops text messages from being delayed but right now this solution is pretty anecdotal. Have you been noticing missing text messages on your Galaxy S8? Let us know in the comments. source: here via Blogger http://i

Why would you want to build your own VR backpack? To save money and move freely!

One of the first issues we came across with the  HTC Vive  was the cable that follows you around the room, potentially tripping you up or pulling on the headset when you've taken time to get a perfect fit. While mainstream wireless VR systems are seemingly somewhere around the corner, some PC manufacturers have taken it upon themselves to create the next best thing: VR backpacks. The cable running from your PC to your headset is no longer a problem, and immersion is taken one step further. Unfortunately, these backpacks are usually prohibitively expensive, and, besides, you might already have the hardware needed to create your own. Is it possible? Is it worth the time? Let's find out! Pre-built backpack options Before we get into building our own backpack, let's take a look at some pre-built offerings from HP, ZOTAC, and MSI. HP OMEN X For  about $3,000 , you can grab this sleek, compact PC with an Intel Core i7-7820HK quad-core processor (CPU), an NVIDIA GTX 10