Giter Club home page Giter Club logo

xposedtools's Introduction

Xposed Tools

These tools can be used to compile and package the Xposed framework. They are especially useful when it comes to releasing files for various platforms and Android versions. Note that Xposed by itself is quite complicated and not suitable for beginners. You'll need a certain level of experience with C++ and general software development in order to build and modify Xposed by yourself.


General note on forks and custom builds

Xposed is open-source and contributions are very welcome. The files in this repository hopefully make it easier to compile custom versions for testing and improvements. However, please be careful when you publish your own versions. Make clear that it's an unofficial version to avoid confusion, and also remember to give proper attribution. Your version probably still includes 99% or more of the original source code that has been written since 2012, so it wouldn't be fair to make it sound like you did all the work. Also, if you made some fixes or improvements, it's in everyone's interest that you create a pull request and contribute them back to the original project.


Build script (build.pl)

This script can perform the following steps:

  • Compile the native executables (app_process), libraries (libxposed_*.so) and the modified ART runtime.
  • Collect these files and put them into a common output directory.
  • Create the xposed.prop file that serves as label for the published package.
  • Create a flashable ZIP file to install the Xposed framework.

It can also compile the Java part of the framework, called XposedBridge.jar.

You can call ./build.pl --help to get a list of allowed options. Usually, it's enough to specify the -t option, e.g ./build.pl -t arm,x86:21 to build ARM and x86 files for SDK 21 (Android 5.0).

You will need to have Perl installed to run this script. It also requires some Perl modules, some of which might not be pre-installed. Depending on your distribution, you can install them using your OS package manager (like apt-get, packages could be named lib*-perl) or via cpan <modulename>. Please look up the details for your installation yourself.


Build preparations

AOSP source tree

If you have never built the native parts of Xposed before, you obviously need to download the source code. The Xposed source is placed in the complete AOSP source tree, so it's not enough to download just the SDK/NDK. Instead, please follow the official instructions to download the full source of the Android version that you want to build for. If you have done everything right, the command make -j4 app_process should succeed. Please note that I can't support you with these steps.

Xposed source code

Once you have the AOSP source ready, you can integrate the Xposed sources into it. There are at least three ways to do so:

Local manifest

This is probably the easiest way to get started. Go to the root directory of the AOSP directory. Change into the .repo subdirectory and create a folder called local_manifests. Then create a symbolic link to one of the manifests that are included in this repository, e.g. ln -s /path/to/this/repository/local_manifests/xposed_sdk21.xml .. Afterwards, go back to the AOSP root directory and run repo sync again. This will also help to avoid some failures when compiling older Android versions on recent VMs.

Manual cloning

If you're afraid that repo sync might overwrite your changes or for some other reasons you don't want to use it, you can also clone the repositories manually. First, navigate to the framework/base/cmds directory and execute git clone https://github.com/rovo89/Xposed.git xposed. This repository contains the modified app_process executable and the libxposed_*.so files.

For variants that include ART, you will also need to replace art folder. However, you have to be careful that the repo sync command doesn't interfere with the new directory. For this, follow the steps above to activate the remove_art.xml manifest and run repo sync. This should already remove the art directory in the AOSP root, but otherwise, just remove it manually. Then execute git clone https://github.com/rovo89/android_art.git art to download the modified files.

Bind mounting

In case you have many AOSP trees and want to keep the Xposed source in sync for all of them (i.e. make one change and apply it to all SDKs immediately), you can also look into bind mounts. It's basically the same as manual cloning, but you clone the files into a separate directory and then use bind mounts to map them into the AOSP tree. This is a pretty advanced technique, so I won't go into details here.

XposedBridge source code (or prebuilt file)

If you want to compile XposedBridge.jar yourself, clone https://github.com/rovo89/XposedBridge and set the javadir variable accordingly. Make sure that the Gradle build is working fine, the Android SDK and other dependencies need to be installed for this. Then you can call ./build.pl -a java to build and copy the JAR.

If you want to use a prebuilt file instead, copy it to a java subfolder in the outdir that you have configured in build.conf. For example, if outdir is set to /android/out, then the file should be stored in /android/out/java/XposedBridge.jar.


Configuration (build.conf)

The build.pl script requires some configuration. The settings are stored in INI file format in build.conf.
As the configuration is specific to your local machine, it's not included in the GitHub repository. There is, however, a file called build.conf.sample with some examples. You can either copy it to build.conf or create your own file based on it.

[General]

outdir: The output directory for compiled files. All Xposed-specific executables/libraries are copied here, and it's used to store log files and the flashable ZIP. This directory must exist.
javadir: (Optional) The directory that XposedBridge has been checked out to (see above).

[Build]

version: The version number that is stored in the /system/xposed.prop file. It's displayed in various places, e.g. while flashing the ZIP file or in the installer. It's also the API version for Xposed, so please make sure that you use the version number that your build is based on. You're free to add any custom suffix with your own version number. You can use the placeholder %s to insert the current date in YYYYMMDD format.
makeflags: Additional parameters to pass to each make command. The default value is -j4, which enables parallel build with 4 jobs.

[GPG]

sign: (Optional) Might be all to sign all build, or release to sign only release builds (-r parameter) using gpg -ab <file>.
user: (Optional) This is passed as -u parameter to the gpg command, see its man page for allowed formats.

[AospDir]

The parameters in this section tell the build script where the AOSP source trees (see above) are stored for each Android version. The key is the SDK version, the value is the directory.

[BusyBox]

In case you want to compile the specialized BusyBox fork from https://github.com/rovo89/android_external_busybox, you have to add a mapping of platform to an Android SDK version. In the source tree for this SDK version, you have to check out the project into the folder external/busybox.

xposedtools's People

Contributors

rovo89 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xposedtools's Issues

I used XposedTools to build zip.but in zip not found update-binaray

in /META-INF/com/google/android/
Only flash-script and updater-script

I used ./build.pl -t arm64:25
config content is

[General]
outdir = /var/android/xposed_ok/XposedTools-89/out
javadir = /var/android/android7.1.2/android-7.1.2_r8/XposedBridge
[Build]
version = 89 ()
[AospDir]
25 = /var/android/android7.1.2/android-7.1.2_r8

thanks

Integrating Xposed to AOSP source tree

I'd need to integrate/merge Xposed to AOSP source tree such that when I issue make at the AOSP root, it creates system.img shipping Xposed framework out-of-the-box.

Current installation steps kinda patches an existing non-Xposed image and makes it Xposed installed (via update-binaries scripts).

Could you please point me out to the way I could approach my goal?

What is the license applied to this repo?

Hi there,

What is the license which apply to this repository? I cannot see it, if you forget to add one, could you add it? otherwise can you make it clearer in the README or adding a LICENSE file.

Many thanks in advance.

build wrong

./build.pl -t arm64:23

make: *** No rule to make target out/target/product/hammerhead/obj/STATIC_LIBRARIES/libbase_intermediates/export_includes', needed by out/target/product/hammerhead/obj/SHARED_LIBRARIES/libart_intermediates/import_includes'. Stop.

SDK 15 build failed issue

Hey guys,

Tried to build SDK 15 but then got the errors below:

Loading config file /home/bruce/XposedTools/build.conf...
Checking requirements...
Expanding targets from 'arm:15'...
SDK 15, platform arm

Processing SDK 15, platform arm...
Compiling...
Executing: cd /home/bruce/WORKING_DIRECTORY/aosp/4.0.3_r1 && . build/envsetup.sh >/dev/null && lunch full-eng >/dev/null && make -j4 TARGET_CPU_SMP=true xposed libxposed_dalvik
Log: /home/bruce/XposedTools/android/out/sdk15/arm/logs/build_20151231_183447.log

Build failed!
Last 10 lines from the log:
cc1plus: warnings being treated as errors
frameworks/base/cmds/xposed/app_main.cpp: In function 'int main(int, char* const_)':
frameworks/base/cmds/xposed/app_main.cpp:271: error: will never be executed
frameworks/base/cmds/xposed/app_main.cpp:272: error: will never be executed
frameworks/base/cmds/xposed/app_main.cpp: In constructor 'android::AppRuntime::AppRuntime()':
frameworks/base/cmds/xposed/app_main.cpp:68: error: will never be executed
make: *_* [out/target/product/generic/obj/EXECUTABLES/xposed_intermediates/app_main.o] error 1
cc1plus: warnings being treated as errors
frameworks/base/cmds/xposed/xposed_service.cpp:641: error: unused parameter 'allowIsolated'
make: *** [out/target/product/generic/obj/EXECUTABLES/xposed_intermediates/xposed_service.o] error 1

Then I tried to change the 2 files below, but still not working:

Host_linux-x86.mk

HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0

HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0

Android.mk

local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter -Werror

local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter

Still I saw the exactly same error.

Any idea what is wrong with this?

Hope to provide a XposedBridgeApi-86.jar

I am a novice, I VPN agent in China led me to download dependent module too long, download this project compiled for a long time are not complete, so can give me a 86 API?

Installation on Android emulator

Hi rovo89,

I appreciate the nice feature Xposed framework has provided. Recently, I try to compile xposed with AOSP Marshmallow (6.0.1) using XposedTools. I followed the manual installation in README by replacing art directory, adding xposed into AOSP source tree and then using "./build.pl -t arm:23". The compile was successful. However, when running it inside emulator. The emulator hangs with no connection reachable from using adb, so there is no way that I can provide feedback using logcat. In addition, I also tried by removing those modifications to AOSP. The emulator works.

Appreciate it if any feedback could be provided. Thanks.

error: undefined reference to 'art::mirror::Object::Clone(art::Thread*, unsigned int)'

frameworks/base/cmds/xposed/libxposed_art.cpp:144: error: undefined reference to 'art::mirror::ArtMethod::EnableXposedHook(art::ScopedObjectAccess&, _jobject*)'
frameworks/base/cmds/xposed/libxposed_art.cpp:189: error: undefined reference to 'art::mirror::Object::Clone(art::Thread*, unsigned int)'
frameworks/base/cmds/xposed/libxposed_art.cpp:189: error: undefined reference to 'art::mirror::Object::Clone(art::Thread*, unsigned int)'
frameworks/base/cmds/xposed/libxposed_art.cpp:189: error: undefined reference to 'art::mirror::Object::Clone(art::Thread*, unsigned int)'
frameworks/base/cmds/xposed/libxposed_art.cpp:85: error: undefined reference to 'art::mirror::ArtMethod::xposed_callback_class'
collect2: error: ld returned 1 exit status
make: *** [out/target/product/s900_96board/obj/SHARED_LIBRARIES/libxposed_art_intermediates/LINKED/libxposed_art.so] ้”™่ฏฏ 1

make failed to build some targets (01:13 (mm:ss))

Where are the jars from some Xposed repositories?

I've become aware of Xposed Framework mainly because it's a dependency of XPrivacy. Everything seems to good to be true, and quoting yourself @rovo89, "with great power comes great risk".

That's why, for such a powerful framework, I'm planning to compile it myself all source code. I know this doesn't mean it's completely safe from a security perspective (Heartbleed was here in the past to show us that being open source doesn't mean it's secure), I know I can't audit all source code, but I'm trying to remove all the odds and minimize the risks.

For example, SuperSU was already closed source, but, somehow, people trusted chainfire: I wouldn't trust it before and much less now that it's sold to a strange company. How can I trust a binary that has root access if it's source it's not available?

Don't get me wrong, I'm not saying you're creating malicious apks, we can even decompile the apks, the source is not that obfuscated, but, in theory, you could. That's ihnerent to how binaries work specially when I'm giving it root access. We have the same issue when using binayy blobs in official firmwares specially in a NSA era, but it's different from using something from an official vendor that you can even take it to court and your framework that is taken as is.

Superficially reading the source code, specially from XposedInstaller, we can see some jars

286987   48 -rw-r--r--   1      47645 Jan 25 13:46 ./libs/libsuperuser-185868.jar
286985   32 -rw-r--r--   1      30181 Jan 25 13:46 ./libs/StickyListHeaders-d7f6fc.jar
286986  632 -rw-r--r--   1     644520 Jan 25 13:46 ./libs/android-support-v13.jar
287177 1160 -rw-r--r--   1    1184741 Jan 25 13:46 ./tools/signapk.jar
286973  100 -rw-r--r--   1      98482 Jan 25 13:46 ./assets/XposedBridge.jar
286983    4 -rw-r--r--   1       3191 Jan 25 13:46 ./lib/AndroidHiddenAPI.jar

That I know I can decompile them in a worst case scenario, but I would like to know:

  • where they are from and, if possible, if you can document them being explicit where they are from (some have an origin in it's history like Sticky);
  • pointing out which other compiled binaries (and zips with other files or binaries) you have in your repositories.

I believe more people may have the same doubts as me, so I thank you in advance if you can enlighten us in this matter. Anyways, congrats in having a module that has 8 million downloads in it's last version and couting.

I was inspired by this post that someone posted in xda forums. I even copied the jars example from there. Thanks. :)

Compile fo MIPS

Is it possible to compile xposed framework for MIPS Architecture?

Sometimes CPU variant detection is wrong

I got a report from a user whose cellphone contains a Snapdragon 652, which is ARM64 for sure, and Xposed Installer can detect this CPU variant and download zip for ARM64. However, either he installs the zip via recovery or installer, it always throws an error message which says that his CPU variant is ARM and he is installing on the wrong platform.

I checked build.prop, and found this line: ro.product.cpu.abi=arm64-v8a, which is right. From the research I did to the install script I can find nothing wrong. Can you suggest some possible reasons?

Support for TouchWiz Lollipop

Hi,
I am aware of the fact that xposed is only compatible with AOSP ROMs. But I had always been using Samsung mobiles with TouchWiz ROMs. I cannot live without xposed in my mobile. It's just a torture. I want to know if you are already working on bringing support to touchwiz. If yes can you tell me a rough idea as to when I can expect the release(even if it is after a year please mention it, as I can decide whether to update to lollipop or not based on your comment).

Also I am C/C++ developer, but not too great in system programming. If you think it will be easy for others to port xposed for touchwiz, please guide us here.

Thanks a lot for the awesome framework :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.