惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

小众软件
小众软件
博客园_首页
博客园 - 聂微东
T
Tailwind CSS Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
J
Java Code Geeks
The Cloudflare Blog
aimingoo的专栏
aimingoo的专栏
Martin Fowler
Martin Fowler
D
Docker
人人都是产品经理
人人都是产品经理
WordPress大学
WordPress大学
博客园 - 三生石上(FineUI控件)
Microsoft Azure Blog
Microsoft Azure Blog
Recent Announcements
Recent Announcements
Apple Machine Learning Research
Apple Machine Learning Research
阮一峰的网络日志
阮一峰的网络日志
B
Blog RSS Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Microsoft Security Blog
Microsoft Security Blog
L
LangChain Blog
Jina AI
Jina AI
博客园 - Franky
D
DataBreaches.Net

Homepage on Aditya Telange

One Year with evil-winrm-py - A Retrospective Bypassing LinkedIn's Connection Privacy with a Simple Search Filter Making Dynamic Instrumentation Accessible with Frida UI Breaking Payload Encryption in Web Applications HackTheBox (HTB) - Escape HackTheBox (HTB) - Resolute HackTheBox (HTB) - Certified State of VMWare Workstation (Pro?) on Linux Android App Security Testing Lab with MobSleuth Android phone as a Webcam on Linux Breaking down Reverse shell commands HackTheBox (HTB) - Photobomb Merging AOSP Security Patches into Custom ROMs Primer on HTTP Security Headers Image Zoom-In effect with HUGO HackTheBox (HTB) - Legacy HackTheBox (HTB) - Lame Cryptohack - Keyed Permutations [5 pts] Cryptohack - Resisting Bruteforce [10 pts] Cryptohack - RSA Starter 1 [10 pts] Cryptohack - Base64 [10 pts] Cryptohack - Bytes and Big Integers [10 pts] Cryptohack - Hex [5 pts] Cryptohack- XOR Starter [10 pts] HackTheBox (HTB) - Horizontall HackTheBox (HTB) - Forge HackTheBox (HTB) - Previse HackTheBox (HTB) - BountyHunter HackTheBox (HTB) - Explore HackTheBox (HTB) - Cap
Setting Up Build Environment - AOSP Rom Development
[Aditya Telange](https://x.com/adityatelange) · 2020-04-17 · via Homepage on Aditya Telange

Introduction

Probably many guides are available on the Internet right now ! Motivation of writing the article is to share my experiences and some tips and tricks I have received from android development community.

I will be considering Linux build environment for the sake of this article. (as most of developers use local machine as well as servers which are Linux based.) Also you should be using a Linux based OS especially Debian based, if you are just starting as more support is available for it !

System Requirements

You can view requirements preferred by AOSP here

Establishing a Build Environment

Now most of ROM development takes place via cloud servers such as GCP (Google Cloud Platform), Azure cloud and other cloud providers, as compilation requires a lot of Disk space with processing power, but people who meet the requirements do compile on their local machine such as desktops and also laptops.

Installing dependencies

For a debian based environment such as Ubuntu( AOSP recommends Ubuntu LTS (14.04) and above ) the following are packages required =>

Use package manager apt to install these packages. More or Less could be necessary depending on which ROM you are building and their implementation

sudo apt-get install \
adb autoconf automake axel bc bison build-essential ccache clang cmake curl \
expat flex g++ g++-multilib gawk gcc gcc-multilib git git-core git-lfs \
gnupg gperf htop imagemagick kmod lib32ncurses5-dev lib32readline-dev \
lib32z1-dev libc6-dev libcap-dev libexpat1-dev libgmp-dev liblz4-* liblz4-tool \
liblzma* libmpc-dev libmpfr-dev libncurses5-dev libsdl1.2-dev libssl-dev \
libtinfo5 libtool libwxgtk3.0-dev libxml-simple-perl libxml2 libxml2-utils \
lzip lzma* lzop maven ncftp ncurses-dev patch patchelf pkg-config pngcrush \
pngquant python python3 python-all-dev re2c rsync schedtool squashfs-tools subversion \
texinfo unzip w3m xsltproc zip zlib1g-dev zram-config

Also a simple automated script is available at android_build_env.sh by Akhil Narang.

For people who want to have a separate build environment can use Virtual Machines or Docker container.

Docker setup

Here is a Docker Environment Script ready to be used as a build host ; )

Installing Source Control Tools

For managing the huge source of android requires using Git and a tool called Repo which is a Google-built repository-management tool that runs on top of Git.

We have already installed Git with all the dependencies.

Installing repo:

mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo

Setup Git

git config --global user.name "Your Name"
git config --global user.email "you@example.com"

Note: remember the email you use above will be used for git commits(if you do so), and will be available to anyone if you push to github.

Now that you have setup tools and dependencies needed, next step is getting the source code !


Refrerences