编译完aosp源码,开始编译xposed
原贴地址
http://zhaoxincheng.com/index.php/2020/07/24/%e7%bc%96%e8%af%91xposed/
在谷歌云上高速编译安卓AOSP ROM、驱动、内核并完成刷机
安卓设备 sailfish
编译环境
推荐kali(最终是在kali上搞定)
apt install git -y git config --global user.email "your mail" git config --global user.name "your name" apt install -y gcc make libstdc++.i686 libstdc++-devel.i686 zlib-devel openssl-devel perl cpio expat-devel gettext-devel autoconf glibc.i686 glibc-devel.i686 zlib-devel.i686 libstdc++.i686 libX11-devel.i686 ncurses-devel.i686 ncurses-libs.i686 gperf flex gcc-c++ bison patch apt install -y java-1.8.0-openjdk.x86_64 java-1.8.0-openjdk-devel.x86_64 java-1.8.0-openjdk-headless.x86_64 apt install perl -y apt -q perl-CPAN
mkdir ~/bin PATH=~/bin:$PATH curl -sSL 'https://gerrit-googlesource.proxy.ustclug.org/git-repo/+/master/repo?format=TEXT' |base64 -d > ~/bin/repo chmod +x ~/bin/repo export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'
yum install htop -y
mkdir n/ cd /root/n/
repo init -u https://android.googlesource.com/platform/manifest也可以指定特定的版本同步源码,记得输入y
repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest -b android-7.1.2_r33 --depth=1
repo sync repo sync -j8 #8个线程同步代码 nohup repo sync -j8 >>sync.log 2>&1 & #推荐:后台去同步,ssh断开也没事。可以看到htop下,多个cpu已经跑起来了。
XposedTools
cd ~ git clone https://github.com/rovo89/XposedTools.git
修改配置文件
cp build.conf.sample build.conf vim build.conf
如下配置
[General] outdir = /root/n/out #输出目录,out一定要存在 javadir = /root/n/XposedBridge #XposedBridge的 位置 [Build] # Please keep the base version number and add your custom suffix version = 89 (custom build by xyz / %s)#我们这里是89版本 makeflags = -j8 #8个线程同步 [GPG] sign = release user = 852109AA! # Root directories of the AOSP source tree per SDK version [AospDir] #19 = /android/aosp/440 #21 = /android/aosp/500 25 = /root/n #安卓7.1源码位置,上边两个注释 # SDKs to be used for compiling BusyBox # Needs https://github.com/rovo89/android_external_busybox [BusyBox]#下面的都改成25,看资料说不改也行 arm = 25 x86 = 25 armv5 = 25
xposed
xposed为整个Xposed框架的native部分,主要内容为xposed修改的app_process源码和相关库文件.这里需要提一下,这部分源码有两种同步方式.第一采用修改local_manifests,然后repo sync的方式.第二种则为手动下载合并.本文采用第二种方式.
cd /root/n cd frameworks/base/cmds/ git clone https://github.com/rovo89/Xposed.git xposed
cd /root/n rm -rf art git clone https://github.com/rovo89/android_art.git -b xposed-nougat-mr2 art
cd /root/n git clone https://github.com/rovo89/XposedBridge.git
XposedBridge/app/build.gradle
为下面的(这里是安卓7.1就是sdk25)。sdk.dir=/root/Android/sdk#自己的sdk目录
初始化编译环境
source build/envsetup.sh lunch
编译XposedBridge
cd /root/XposedTools ./build.pl -a java
编译完成
BUILD SUCCESSFUL Total time: 1.478 secs Copying APK to XposedBridge.jar... Skipping non-existent /Users/zxc/Android/n/XposedBridge/app/build/outputs/apk/app-release.apk Skipping non-existent /Users/zxc/Android/n/XposedBridge/app/build/outputs/apk/app-release-unaligned.apk /Users/zxc/Android/n/XposedBridge/app/build/outputs/apk/app-release-unsigned.apk => /Users/zxc/Android/n/out/java/XposedBridge.jar Done!
./build.pl -t arm64:25 #25是sdk版本 对应安卓7.1
sudo apt-get install libxml2-utils
public Builder setUrl(String url) { mUrl = url; System.out.println("xposed=" + url); if (url.contains("uninstaller")) { mUrl = "http://192.168.2.185:8000/xposed-uninstaller-20180117-arm64.zip"; } else { mUrl = "http://192.168.2.185:8000/xposed-v89-sdk25-arm64-custom-build-by-xyz-20200726.zip"; } return this; }
python3会出现 print错误
修改build/tools/findleaves.py里面的print r为print(r) 即可
大小写敏感问题
mac 分区是默认不是大小敏感,所以需要重新分区。
参考这里 https://blog.bihe0832.com/mac-disk-utility.html
Checking build tools versions... build/core/main.mk:159: ************************************************************ build/core/main.mk:160: You are building on a case-insensitive filesystem. build/core/main.mk:161: Please move your source tree to a case-sensitive filesystem. build/core/main.mk:162: ************************************************************ build/core/main.mk:163: *** Case-insensitive filesystems not supported.
export MAC_SDK_VERSION="10.11"https://github.com/phracker/MacOSX-SDKs/releases/download/10.11/MacOSX10.8.sdk.tar.xz
#mac_sdk_versions_supported := 10.6 10.7 10.8 10.9 mac_sdk_versions_supported := 10.11
brew install wsk
[公告]看雪论坛2020激励机制上线了!发帖不减雪币了!如何获得积分快速升级?
最后于 14小时前 被mb_aoooaosd编辑 ,原因: