• Things you need to know about Xposed Framework

    xposed installer techapu

    So we have been talking about tweaks, customizations and why to root Android? Now you can get answers from here. The main part in rooting Android is to create Tweaks of our own choice. But how do we create them? Well, those can be, changing charging symbols in the status bar or adding unincluded gestures or even you can counterfeit Android. Before we go on the topic How to install Xposed Framework you need to know about it. Please read the full post before committing any action.

    What is Xposed Framework?

    Simply you can say it as a Tweaking tool with some modules in it. Developers were able to release frameworks upto Marshmallow. But for Nougat (7.x) it took so long to come out. Rovo89 the developer of Xposed Framework finally released it for Nougat and Oreo.

    Android 7.x code was changed a lot compared to previous versions of Android and it is also the stable version when compared to previous versions. So it is tough for the developer of Xposed Framework to spread it out. You can look for his statement about being late in releasing it from here.

    There are situations when a Android user moves from one ROM to another merely for the feature the other one provides. For flashing you always need to go into Custom Recovery, Wipe system every time you install new Rom. It is time consuming and also there may occur errors if not done properly , eventually it sometimes lead to brick of your device. But if you flash Xposed Framework once through Custom Recovery then you can create whatever tweaks/mods you wish to see in your device. Not telling you that flashing Xposed Framework doesn’t cause any wrong to your device. It actually cause bootloops if not properly installed or if wrong zip is flashed.You have to check which processor architecture is running in you Android whether it may be arm or arm64 or x86. Also you need to know that its installation depends on which version of Android you are using. For Lollipop (5.0 only) it is SDK21, for Lollipop (5.1 above) it is SDK22, for Marshmallow (6.0) it is SDK23, for Nougat (7.0) it is SDK24, for Nougat (7.1) it is SDK25, for Oreo (8.0) it is SDK26, for Oreo (8.1) it is SDK27. So you need to check Processor Architecture and also android version before installing it.

    Another thing is that Xposed can sometimes cause unintended side effects when used on ROMs of Samsung and LG. Basically, Xposed Framework is designed with stock Android in mind, so when used in these ROMs it may cause instability of the ROM you are using or it may damage it completely.

    What Xposed actually does to Android source code?

    Xposed contains modules. What are these modules and what is the need of them? The answer is that it is these modules that change source code and override it buy adding a new code to those places which you try to tweak. It is these modules that help developers to change code of the system and apps at runtime, it gives them huge opportunities to modify the behavior and look of your device. With the help of Xposed, mods were added to Custom ROMs.

    Also that what happens internally in Android when Xposed Framework is installed is not known completely. There may occur instability with your ROM, sometimes it may go wrong with some of the tweaks while implementing them.

    Note:

    To install Xposed you need to root your device and also a Custom Recovery should be present, you also have see the architecture of your device. To root your device you have to do a lot of research and also in installing Xposed.

    Why to flash Xposed instead of Custom ROMs?

    There are some reasons why you can stick with present ROM and flash Xposed rather than changing ROMs every time.
    1. Easy to handle, one time flash: To flash a new ROM you need to go into Custom Recovery, wipe Cache, Dalvik Cache, System and then install it. Along with that you also need to flash Gapps (Google Apps). It takes some time for doing the whole process. But if you use Xposed you need not do those wipes. You only need to flash it once through custom recovery after that you can do modifications using Xposed Installer app. The next time onwards you can download whatever tweaks you want, install them. With this you can save your time but at the same time I am not discouraging you to flash new ROMs as it gives fun most of the times.
    2. Little knowledge on Android! Yep when you start to use Xposed you can actually know what to change and what not to. In the initial stages you may face difficulties but as the time moves it becomes easy and small for you. Gaining more experience is the biggest asset to anyone in this world. Go and have a try at it.
    3. No need to move from one ROM to another: As already stated you can stay in the present ROM and do tweaks. You don’t even know how the new ROM you are going to install is bug free or stable. But sometime if the present ROM is with bugs the you can move to another ROM.

    What are Modules?

    As stated above, the functionality of Xposed Framework is enhanced by Modules, just like some of the apps on your Android phone enhance your phone’s functionality (Launcher, Greenify, Apk remover etc). Modules are basically .apk files you can download from Xposed Installer and install just like the normal apps you install.

    xposed framework, installer and modules for Android

    How Xposed Modules work?

    Giving a brief idea of it, 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 as told in what Xposed does to Android Source code.

    How to install Xposed Framework?

    Always you cannot guess what may happen while flashing through Custom Recovery. So it is always advisable to make a backup while flashing something through Custom Recovery.

    Requirements:

    Before going to installation you need to download some file. The list of files to be downloaded are not provided by me directly because those are to downloaded from another site called XDA which is the main publisher of AOSP tweaks and others. I don’t want to use the hard work of the dev for my blog. So I provide a link to it through which you can download necessary file. Thanks to XDA and the dev revo89.
    1. Your device need to be rooted before going further.
    2. You need to have a Custom Recovery Installed.
    3. You need to know you devices processor architecture. Click here if not known.
    4. You need to know on which version of Android you are presently working under.
    5. Very important is the basic knowledge of using Custom Recover.
    6. And the finally one is the files that you have to downloaded.

    Download the file from here and stay upto date from there. If you want full detailed information about Xposed the you can refer this link, for the list of modules refer this link.

    Steps to install Xposed Framework:

    To this time I think you would have downloaded the required file. Now going forward with below steps.
    1. First of all you need to enable Unknown Sources (security tab) in settings to install the app.
    2. Put the downloaded file in you SD card (or Root folder of you Android if SD card is not there)
    3. Go to Custom Recovery either with the help of a Third Part applications ( like Flashify, Mobileuncle MTK tools, TWRP etc) or by using volume and power buttons (it changes from device. So look for how to go into Recovery mode in your device--Google it).
    4. Now the process begins first thing to do is to take a backup of your present ROM (Always advisable). If already had a backup then you can skip this step.
    5. Now click on install tab in the Recovery. Go to the location where you have placed the zip file and select it. Swipe to flash it.
    6. After finished flashing you can Reboot the device.
    7. After the phone was ON if you see Xposed Installer apps in menu then you can skip this step otherwise again go to the place where you have placed the zip file, there you will see a .apk file and install it.
    8. Now open Xposed Installer app from the menu and click on Framework displayed as the first option. After that click on Install/Update option, it will install the needed thing. It will struck for few seconds so do not bother about it.
    9. Give SuperSU permissions when asked and reboot the device once done.
    10. Thats it you are done with it
    11. You can enjoy it from now onwards.

    Note:

    If you get any errors check the compatibility of the zip file you have downloaded with your device.

    How to install modules?

    As installing Modules is the main reason of having Xposed Framework. To install modules you can either download from XDA or from Xposed repository.
    Best way is to download from the app itself by searching the required module in the downloads section.
    Following procedure can be followed to install Modules. Keep in mind that procedure to install any module changes for each of them. So I am giving only outline of what to follow in installing those modules.
    1. First of all go to downloads section in the app, browser the module you want to tweak.
    2. Select the module you want, read the description given over there. That description tells you whether your devices supports that module.
    3. If that module supports your device then download it by clicking on download button.
    4. After finishing download, install it as you install an app.
    5. It will display a notification after installed displaying the Module is not active.
    6. Click on the notification, it’ll take you to the section where you have downloaded or will download. From there select the module which you want to active.
    7. Now reboot, it will be applied and you can enjoy it.

    Below is the statement of revo89:

    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 optimization - Android techapu


    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 optimization - Android techapu


    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:

    public static void doSomething(){    }


    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.

    Telling you that I am not responsible if anything happens to your device. I am just sharing what I have learned. So it is your choice to install Xposed Framework. Anything happen to your device is your soul responsible. Please follow every step without skipping one. Do not flash if you are using Samsung ROMs. For better assistance go here or for detailed information on Xposed go here.

  • No comments:

    Post a Comment