AOSP Android11系统源码下载方法(Pixel3)
2022-8-12 08:56:9 Author: 哆啦安全(查看原文) 阅读量:34 收藏

移动安全和Web安全(课程入口)

kali渗透测试环境搭建

Web安全|docker环境搭建(2)

Web安全攻防实战零基础速成培训班

强烈推荐Google系列Android机型(Android逆向的最佳机型)

APP逆向分析/渗透测试/安全检测/隐私合规如何选择手机机型或系统

课程+免费指导+Android逆向工作推荐

https://m.weishi100.com/mweb/series/?id=1372437

AOSP Android11系统源码下载

本节主要内容:

  下载AOSP Android 11系统源码

1.前期环境准

 源码下载开发环境:

Windows10+VMware-workstation16+ubuntu-20.04桌面版本

VMware-workstation下载地址:https://download3.vmware.com/software/WKST-1624- WIN/VMware-workstation-full-16.2.4-20089737.exe

ubuntu下载地址:https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/20.04/ubuntu-20.04.4- desktop-amd64.iso

如果要用vmware player虚拟机,Vmware player下载地

:https://customerconnect.vmware.com/en/downloads/info/slug/desktop_end_user_computing/v mware_workstation_player/16_0

 安卓系统版本:

基于AOSP Android11源码开发。

 测试手机型号:

pixel3手机设备。

  注意事项:

  电脑内存建议>=20G,方便后续为ubuntu虚拟机预留更多的内存。

  ubuntu虚拟机预留硬盘空间至少>=240G

2.码下载

由于直接使用google官方下载源很难下载,以下使用清华源下载安卓源码。

(1).创建源码目录AOSP Android11

qiang@ubuntu:~$ mkdirAosp11

qiang@ubuntu:~$ cdAosp11/

qiang@ubuntu:~/Aosp11$

qiang@ubuntu:~/Aosp11$

qiang@ubuntu:~/Aosp11$ mkdir~/bin

qiang@ubuntu:~/Aosp11$ exportPATH=~/bin:$PATH

qiang@ubuntu:~/Aosp11$ curlhttps://mirrors.tuna.tsinghua.edu.cn/git/git-repo  > ~/bin/repo qiang@ubuntu:~/Aosp11$ chmoda+x ~/bin/repo

qiang@ubuntu:~/Aosp11$ exportREPO_URL= 'https://mirrors.tuna.tsinghua.edu.cn/git/git-repo 'qiang@ubuntu:~/Aosp11$ ln-s /usr/bin/python3 /usr/bin/python

qiang@ubuntu:~/Aosp11$ sudoaptinstallandroid-tools-adb

qiang@ubuntu:~/Aosp11$ sudoaptinstallandroid-tools-fastboot

为了以后开机启动之后安装的repo工具立即生效,将repo工具路径加入.bashrc文件中。如下所示:

iang@ubuntu:~/Aosp11$ vim~/.bashrc

# ~/.bashrc: executedbybash(1) fornon-loginshells.

#see /usr/share/doc/bash/examples/startup-files (inthepackagebash-doc)

# forexamples

# ///ADDSTART

exportPATH=~/bin:$PATH

export REPO_URL= 'https://mirrors.tuna.tsinghua.edu.cn/git/git-repo '

# ///ADDEND

# If not running interactively, don 't do anything

case$-in

*i*) ;;

*) return;;

esac

# 后面内容省略 .....

qiang@ubuntu:~/Aosp11$ source  ~/.bashrc

qiang@ubuntu:~/Aosp11$

(2).配置git邮件地址

以下配置邮件址需要你个人的邮件地址。

qiang@ubuntu:~/Aosp11$ gitconfig --globaluser.name  "test007"

qiang@ubuntu:~/Aosp11$ gitconfig --globaluser.email  "test[email protected]gmail.com"

(3).使用repoinit初始化下载指定版本源码

qiang@ubuntu:~/Aosp11$ repoinit -uhttps://mirrors.tuna.tsinghua.edu.cn/git/ AOSP/platform/manifest -bandroid-11.0.0_r46

qiang@ubuntu:~/Aosp11$ reposync-j4  -d --force-sync --no-clone-bundle

3.使用不死挂机脚本下载源码

由于下载源码需要很长时间。中途会难免意外终止退出的情况。为了防止这种情况,适应挂机下载的需 求。可以使用如下download.sh脚本进行挂机下载。脚本如下:

qiang@ubuntu:~/Aosp11$ catdownload.sh

#!/bin/bash

echo"==========startreposync==="

PATH=~/bin:$PATH

gitconfig --globalhttp.postBuffer524288000

gitconfig --globalhttp.sslVerifyfalse

gitconfig --globalhttp.sslverifyfalse

gitconfig --globalurl.https://mirrors.tuna.tsinghua.edu.cn/git/

AOSP/.insteadofhttps://android.googlesource.com

repoinit -uhttps://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/

manifest-bandroid-11.0.0_r46

reposync-j4  -d --force-sync --no-clone-bundle

while[ $?!=0 ];

do

echo"===resync==="

reposync-j4  -d --force-sync --no-clone-bundle

done

在终端执行download.sh脚本,就可以挂机下载源码了。执行参考如下:

qiang@ubuntu:~/Aosp11$ pwd

/home/qiang/Aosp11

qiang@ubuntu:~/Aosp11$ ls-ladownload.sh

-rwxrwxr-x1 qiangqiang564 Jul24 08:47 download.sh

qiang@ubuntu:~/Aosp11$ ./download.sh

==========startreposync===

4.删除下载缓存释放更多空间

安卓源码repo具下载过程中会在源码根目录下面生成.repo缓存目录。该目录占用空间很大。源码下载 完成之后,可以将.repo删除释放更多空间处理。以下使用du命令查看.repo目录占用情况。如下所示:

qiang@ubuntu:~/Aosp11$ pwd

/home/qiang/Aosp11

qiang@ubuntu:~/Aosp11$ cd.repo/

qiang@ubuntu:~/Aosp11/.repo$ du-h --max-depth=./

47G     ./project-objects

6.4M    ./repo

1011M   ./projects

37M     ./manifests.git

88K     ./manifests

48G     .

qiang@ubuntu:~/Aosp11/.repo$

qiang@ubuntu:~/Aosp11/.repo$

以上命令显.repo占用48G的空间,可以使用rm命令删除相应的目录。如下所示:

qiang@ubuntu:~/Aosp11$

qiang@ubuntu:~/Aosp11$ pwd

/home/qiang/Aosp11

qiang@ubuntu:~/Aosp11$ rm-rf .repo/

qiang@ubuntu:~/Aosp11$

qiang@ubuntu:~/Aosp11$

qiang@ubuntu:~/Aosp11$

Android11系统源码的下载与编译方法(解决内存、磁盘不足问题)

推荐阅读

Android混淆规则

APP加固和脱壳方案总结

App代码混淆(自定义字典)

Android Studio自定义加固插件

Android APP防作弊SDK解决方案

加固不等于安全之APP应用更安全浅析

Android App Bundle混淆加密加壳加固保护的解决方案(过Google App上架审核)

最全Android及资源混淆方法汇总(无需加固节约成本并将APP上架Google Play成功的最佳方案)

商务合作、进群添加官方微信

Android APP防作弊SDK解决方案


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