下载Android12 源码
sudo apt-get update
安装curl
sudo apt install curl
验证curl
curl
sudo curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo -o /usr/bin/repo
sudo chmod +x /usr/bin/repo
sudo apt install git
sudo apt-get install python
ctrl+H显示隐藏文件
可以将如下内容复制到你的~/.bashrc里
export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'
查看要下载的版本
https://source.android.google.cn/docs/setup/about/build-numbers?hl=zh-cn#source-code-tags-and-builds
repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-12.1.0_r26
或者
repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest -b android-12.1.0_r26
repo sync -j2
如果报错git仓库连不上
rm -rf /home/zhao/android/.repo/projects/bootable/bootloader/legacy.git
编译源码
sudo apt install libswitch-perl -y
sudo apt install libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-dev g++-multilib -y
sudo apt install git flex bison gperf build-essential libncurses5-dev:i386 -y
sudo apt install dpkg-dev libsdl1.2-dev libesd0-dev -y
sudo apt install git-core gnupg -y
sudo apt install zlib1g-dev gcc-multilib -y
sudo apt install libc6-dev-i386 -y
sudo apt install lib32ncurses5-dev x11proto-core-dev libx11-dev -y
sudo apt install libxml2-utils xsltproc m4 -y
sudo apt install lib32z-dev ccache -y
sudo apt install python-markdown zlib1g-dev:i386 -y
sudo apt install libssl-dev -y
sudo apt install android-tools-fastboot -y
sudo apt install android-tools-adb -y
#如果安装过程中发现"无法定位软件包"字,可进行如下
sudo apt install vim
#在/etc/apt 的sources.list末端添加镜像源
sudo vim /etc/apt 的sources.list
deb http://archive.ubuntu.com/ubuntu/ trusty main universe restricted multiverse
sudo apt-get update
下载
https://developers.google.cn/android/blobs-preview?hl=zh-cn
source ./build/envsetup.sh
#Pixel 3a的产品代号为sargo
lunch aosp_sargo-userdebug
make update-api -j2 && make -j2
本文由网上采集发布,不代表我们立场,转载联系作者并注明出处:https://www.90175.com/wenku/txtlist_i133v.html