编程语言
首页 > 编程语言> > Xposed源码编译

Xposed源码编译

作者:互联网

原文链接:https://www.imisty.cn/?p=20

参考博文

编译Xposed

Xposed简介

编译准备

配置

这里jar文件存放的目录不同的博文是不一致的,但是觉得framework里面靠谱一点

注:如果想生成供Xposed模块调用的XposedBridge.jar,则在Android Studio的右侧打开Gradle Project,双击jarStubs就会在app/build/api生成api.jar

[General]
outdir = /home/misty/bin/WORKING_DIRECTORY/out
#javadir = /android/XposedBridge

[Build]
# Please keep the base version number and add your custom suffix
version = 86 (custom build by xyz / %s)
# makeflags = -j4

[GPG]
sign = release
user = 852109AA!

# Root directories of the AOSP source tree per SDK version
[AospDir]
#19 = /android/aosp/440
#21 = /android/aosp/500
23 = /home/misty/bin/WORKING_DIRECTORY

# SDKs to be used for compiling BusyBox
# Needs https://github.com/rovo89/android_external_busybox

#[BusyBox]
#arm = 23
#x86 = 23
#armv5 = 23



* outdir:指定Android源码中的out目录
* javadir:指定XposedBridge目录,如果你不需要编译XposedBridge.jar可以不指定
* version:Xposed版本,这个版本号将显示在XposedInstaller上
* ApospDir下的数字:设置sdk版本对应的Android源码
* [BusyBox]标签:busybox,可以不指定

./build.pl -a java

./build.pl -t arm64:23

配置 perl 环境

解决模块安装失败的问题

    libconfig-inifiles-perl - Read .ini-style configuration files

常见问题

    build/core/base_rules.mk:157: *** art_bak: MODULE.TARGET.FAKE.cpplint-art-phony already defined by art。 停止。

       #### make failed to build some targets (6 seconds) ####

编译XposedBridge问题

编译android6.0源码需要java1.7,而编译xposedbridge需要java1.8,所以这里为了切换方便临时指定Java环境变量

misty@ubuntu:~/bin/xposed/XposedTools$ ./build.pl -a java 
Loading config file /home/misty/bin/xposed/XposedTools/build.conf...
Checking requirements...
Building the Java part...
Compiling...

FAILURE: Build failed with an exception.

* Where:
Build file '/home/misty/bin/xposed/XposedBridge/app/build.gradle' line: 3

* What went wrong:
A problem occurred evaluating project ':app'.
> java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 0.682 secs
misty@ubuntu:~/bin/xposed/XposedTools$ vim /etc/profile
misty@ubuntu:~/bin/xposed/XposedTools$ export JAVA_HOME=/home/misty/MyFile/jdk1.8.0_211
misty@ubuntu:~/bin/xposed/XposedTools$ export PATH=$PATH:$JAVA_HOME/bin
misty@ubuntu:~/bin/xposed/XposedTools$ java -version

相关命令

标签:XposedBridge,art,Xposed,编译,源码,build,Android
来源: https://blog.csdn.net/lookinthefog/article/details/93861992