AOSP Android11系统源码和内核源码
2023-1-24 13:48:56 Author: 哆啦安全(查看原文) 阅读量:14 收藏

1.下载repo工具
(1).创建bin,并加入到PATH中
mkdir ~/binPATH=~/bin:$PATH
(2).安装依赖库
sudo apt-get install bison g++-multilib git gperf libxml2-utils make zlib1g-dev:i386 zip liblz4-tool libncurses5 libssl-dev bc flex curl python-is-python3
sudo apt-get install git-core gnupg flex bison build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 libncurses5 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev libxml2-utils xsltproc unzip fontconfig
bc bison build-essential ccache curl flex g++-multilib gcc-multilib git gnupg gperf imagemagicklib32ncurses5-dev lib32readline-dev lib32z1-dev libelf-dev liblz4-tool libncurses5 libncurses5-devlibsdl1.2-dev libssl-dev libxml2 libxml2-utils lzop pngcrush rsyncschedtool squashfs-tools xsltproczip zlib1g-dev python
apt install bison treedpkg --add-architecture i386apt updateapt install libc6:i386 libncurses5:i386 libstdc++6:i386apt install libxml2-utilssudo apt-get install libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-dev g++-multilibsudo apt-get install -y git flex bison gperf build-essential libncurses5-dev:i386sudo apt-get install tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386sudo apt-get install dpkg-dev libsdl1.2-dev libesd0-devsudo apt-get install git-core gnupg flex bison gperf build-essential  sudo apt-get install zip curl zlib1g-dev gcc-multilib g++-multilibsudo apt-get install libc6-dev-i386sudo apt-get install lib32ncurses5-dev x11proto-core-dev libx11-devsudo apt-get install libgl1-mesa-dev libxml2-utils xsltproc unzip m4sudo apt-get install lib32z-dev ccache

(3).下载repo并设置权限

curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo > ~/bin/repochmod a+x ~/bin/repo

2.下载源码

(1).创建工作目录

mkdir aospcd aosp
vim ~/.bashrcexport REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/'
git config --global user.email "[email protected]"git config --global user.name "gyp"

(2).初始化仓库(不指定版本,默认下载最近的代码)

repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest

(3).初始化并指定版本

repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-11.0.0_r1
repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest -bandroid-11.0.0_r46
repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest -b android-12.0.0_r3

(4).同步源码

repo sync

3.驱动下载

https://source.android.google.cn/setup/build/downloading#obtaining-proprietary-binarieshttps://developers.google.cn/android/blobs-previewhttps://developers.google.cn/android/drivers
repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest -b android-12.0.0_r3
https://developers.google.cn/android/drivers

4.下载内核源码

AOSP源码中并不包括内核源码,需要单独下载,内核源码有很多版本,比如common是通用的Linux内核,msm是用于使用高通MSM芯片的Android设备,goldfish是用于Android模拟器的内核源码。

(1).goldfish

mkdir kernelcd kernel
git clone https://aosp.tuna.tsinghua.edu.cn/kernel/goldfish.git
cd goldfishgit branch -a
git checkout remotes/origin/android-goldfish-3.4

5.AOSP Android系统源码及内核源码

https://developer.sony.com/develop/open-devices/guides/aosp-build-instructionshttps://developer.sony.com/develop/open-devices/guides/aosp-build-instructions/build-aosp-android-android-11-0-0
https://source.android.google.cn/setup/start/build-numbers
http://source.android.com/setup/start/build-numbers#source-code-tags-and-buildshttps://android.googlesource.com/kernehttps://android.googlesource.com/kernel/msm/

Android studio导入AOSP系统源码及源码Debug调试

https://developer.android.google.cn/studio/debug#breakPoints
Android studio导入Android系统源码https://blog.csdn.net/qq_23327993/article/details/100932496
Android Studio导入系统源码https://blog.csdn.net/m0_58241002/article/details/126543948
Android Studio导入Android平台源码https://blog.csdn.net/xiaosayidao/article/details/79023369
Android Studio调试系统源码的方法https://blog.csdn.net/dc3120/article/details/112384879?spm=1001.2014.3001.5502
Android Studio导入系统源码并对源码进行debug调试https://blog.csdn.net/u014078003/article/details/123842413
Android Studio调试系统源码的三种方式http://liuwangshu.cn/framework/aosp/5-debug-aosp.html

商务合作

2023年招聘

安全培训服务


推荐阅读

AOSP Android11系统源码开发环境搭建

Android12系统源代码下载、编译和刷机

AOSP Android11系统源码下载方法(Pixel3)

AOSP Android11系统源码编译方法(Pixel3)

谷歌云上高速编译安卓AOSP ROM、驱动、内核并完成刷机

干货|Android APP应用工程师转Framework工程师(仅此一篇够了)

干货|云服务器编译Android10系统源码或刷机或联网过程遇到的坑(Google Pixel3手机)

商务合作

更多业务合作,点击下方"阅读原文"


文章来源: http://mp.weixin.qq.com/s?__biz=Mzg2NzUzNzk1Mw==&mid=2247495015&idx=1&sn=e43f769f19899f23b2d948732fb7c073&chksm=ceb8a829f9cf213f209f0d7886777c7de61475d01c27348b5d357440a7c733fbc14618c712f3#rd
如有侵权请联系:admin#unsafe.sh