• Xposed ROM modding without modifying APKs


    In this thread, I'm presenting a framework which gives you the possibility to modify your ROM - without modifying any APK (developers) or flashing (users)! 

    Please don't use this thread for problems with modules or questions related to anything but the Xposed framework and its installer!

    Some technical details:
    I extended the /system/bin/app_process executable to load a JAR file on startup. The classes of this file will sit in every process (including the one for system services) and can act with their powers. And even more: I have implemented something that allows developers to replace any method in any class (may it be in the framework, systemui or a custom app). This makes Xposed very powerful. You can change parameters for the method call, modify the return value or skip the call to the method completely - it's all up to you! Also replacing or adding resources is easy.

    Advantages:
    • No need to modify any APKs. This means:
      • No need to decompile, change things in smali, compile, sign, ...
      • It will work for odexed and deodexed ROMs.
      • Your mod is not bound to a specific version of the ROM. Unless there is a major change in the methods called for a certain functionality, your mod will continue to work even when you upgrade your ROM. Hell, it will probably even work with different ROMs.
      • Multiple mods can be installed at the same time, even if they change the same package. So you can use these battery icons and those quick toggles. Even hooking the same method twice is possible. Of course, this only works properly if the mods are not trying to do incompatible things.
    • It does its magic at runtime. That means you can implement options to let the user decide if they prefer the bikeshed to be painted in red or blue. Or you can have some extra logic for certain ROMs without building different mod versions.
    • It can be disabled easily without having to reflash.
    • It's open source.

    Download:
    You can download the installer from the attachment.

    How to install:
    First step for everything you do: Create a nandroid backup and make sure you know how to restore it!
    I'm not responsible for anything you do with your phone/tablet/rice cooker.
    There is also the risk to soft-brick your device. In such a case, restoring a backup is the easiest way to get rid of it (other possibilities mentioned below).

    For the framework:
    1. Download XposedInstaller.apk and install it
    2. Launch the Xposed Installer and click on "Install/Update"
    3. Reboot
    4. Done!

    For any modifications/modules you want to install:
    1. Download <module>.apk and install it
    2. Launch the Xposed Installer and go to the "Modules" tab (you will also get there if you click on the notification warning you that the module is not enabled yet)
    3. Enable the module by checking the checkbox
    4. Reboot
    5. Done!

    In case you get into a boot loop:
    You can flash the attached Xposed-Disabler-CWM.zip by Tungstwenty. It will be copied to your (external) SD card when you install Xposed as well. The only thing it does is copying /system/bin/app_process.orig back to /system/bin/app_process, which you can also do yourself (e.g. with adb shell in recovery mode).
    You could also create a file /data/xposed/disabled, which causes Xposed to be bypassed as well.

    Modules:
    See http://www.villainrom.co.uk/forum/fo...ramework_mods/ and this thread. There might also be other threads for modules.
    Please don't use this thread for problems with modules! Use the thread of the module instead.

    How to write a module:
    If you are an interested developer, give it a try. The development tutorial will help you get started. Further documentation (e.g. how to replace resources) is here. And of course, you can ask your development questions in this thread.
    If you have suggestions for new functions the framework could provide (which means they should be useful for more than your module), you can do this here as well. However, requests that I or somewhen else should write a module for xyz are NOT allowed here. Again, this thread is only about the framework.

    Changelog:
    1.0: Initial version
    1.1: ???
    1.2: Installer
    1.5: Resource replacing
    1.6: Some fixes and improvements [629 downloads]
    2.0 rc2: Lots of thing redone. Supports (temporarily) replacing native libraries, lots of additions and changes for developers. [3234 downloads]
    2.0: Removed the native library replacement again, support for 4.1 and 4.2, Instagram crash fixed, ... [631 downloads]
    2.0.1: Fixed a crash when a module tries to hook a function with "long" or "double" parameters [930 downloads]
    2.0.2: Fixed a problem which resulted in a boot loop [4310 downloads]
    2.1: Various improvements, e.g. earlier callbacks for module loading. For details, see this post. [345 downloads]
    2.1.1: Fixed a bug in drawable replacements [5421 downloads]
    2.1.2: Small fixes, added Chinese and Russian translations [11415 downloads]
    2.1.3: Reverted a change in 2.1.2 that caused bootloops; new translations and some more fixes

    Source code:
    https://github.com/rovo89/Xposed (the C++ part)
    https://github.com/rovo89/XposedBridge (the Java part)
    https://github.com/rovo89/XposedInstaller (Installer app)

    Thanks to:
    Tungstwenty for his many contributions, both in code and thoughts
    burstlam for Chinese translations
    jack_nuclear for Russian translations
    kecinzer for Czech translations

     
    ATTACHED THUMBNAILS
    Click image for larger version

Name:	Screenshot_2012-04-05-19-32-42.png
Views:	351901
Size:	22.5 KB
ID:	984824   Click image for larger version

Name:	Screenshot_2012-04-05-19-32-54.png
Views:	344555
Size:	16.7 KB
ID:	984825  
    ATTACHED FILES
    File Type: zip Xposed-Disabler-CWM.zip - [Click for QR Code] (121.2 KB, 7910 views)
    File Type: jar XposedBridgeApi_2.1.jar - [Click for QR Code] (97.0 KB, 7379 views)
    File Type: apk XposedInstaller_2.1.3.apk - [Click for QR Code] (532.3 KB, 41352 views)
  • 相关阅读:
    偏函数 匿名函数 高阶函数 map filter reduce
    函数
    Python的字符串格式化
    集合
    列表 元组 字典
    字符串
    数字
    Python基础-杂项
    Java 和C/C++的“语法”上的差异!
    MySQL基础原创笔记(一)
  • 原文地址:https://www.cnblogs.com/maifengqiang/p/3068243.html
Copyright © 2020-2023  润新知