标签:准备 函数参数 may sample 命名 plugin 组成 analysis release
参考博文 https://www.cnblogs.com/luoyesiqiu/p/9524651.html
XposedInstaller,该项目是Xposed安装器,使得普通用户在使用Xposed更方便,同时,它还可以管理手机上已经安装的Xposed模块,它编译完成后将生成apk文件,本文不讨论如何编译它。
git clone https://github.com/rovo89/android_art -b xposed-nougat-mr2 art
,注意根据Android源码版本选择分支或者对应的标签,或者git checkout xposed-marshmallow
直接切换到对应的远程分支aosp/out/target/product/hammerhead/system/framework/
这里jar文件存放的目录不同的博文是不一致的,但是觉得framework里面靠谱一点
注:如果想生成供Xposed模块调用的XposedBridge.jar,则在Android Studio的右侧打开Gradle Project,双击jarStubs就会在app/build/api生成api.jar
git clone https://github.com/rovo89/XposedTools
,将XposedTools目录下的build.conf.sample复制一份,并将它重命名为build.conf,build.conf文件用于配置构建环境,我们来看他的内容:[General]
# 如果不编译XposedBridge,需要自行将XposedBridge.jar放置到输出目录的 java文件夹下
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
编译生成供cpu架构为arm64,sdk为23平台使用的Xposed
编译完成后,将在Android源码目录/out/sdk23/arm生成可刷入手机的zip文件
XposedTools 依赖于 perl,所以我们要跑起来就要有一个 perl 环境。首次运行 perl 需要安装依赖 Config::IniFiles
perl -MCPAN -e ‘install Config::IniFiles‘
大概需要在安装下面的两个依赖(不同系统可能不同)
perl -MCPAN -e ‘install File::Tail‘
perl -MCPAN -e ‘install File::ReadBackwards‘
如果还不成功,按照下面的方法安装所需的模块即可
perl -MCPAN -e ‘install [ModuleName]‘
libconfig-inifiles-perl - Read .ini-style configuration files
sudo aptitude install File::ReadBackwards
虽然可能会出现安装失败,但是会出现依赖提醒,按照提示安装依赖即可
根据提示安装依赖cpan -f Archive::Zip
Can't locate Archive/Zip.pm in @INC (you may need to install the Archive::Zip module) (@INC contains: /home/aosp/xposed/XposedTools /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at ./build.pl line 11.
BEGIN failed--compilation aborted at ./build.pl line 11.
root@a03e3a9cc004:/home/aosp/xposed/XposedTools# cpan -f Archive::Zip
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) ####
编译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
getprop|grep arm
查看CPU相关的信息
每一丝灵感都值得被记录,每一笔记录都是成长,每一点成长都值得欢呼
博主个人站: www.imisty.cn
CSDN博客: https://blog.csdn.net/lookinthefog
博客园 :https://imist.cnblogs.com/
希望能够认识一些热爱技术的小伙伴,欢迎友链接哟
标签:准备 函数参数 may sample 命名 plugin 组成 analysis release
原文地址:https://www.cnblogs.com/imist/p/11417360.html