SlideShare a Scribd company logo
1 of 38
Download to read offline
Deep Dive into the AOSP
Android Open Source Project
Dr. Ketan Parmar
Sr. Tech Lead – InfoStretch Solutions Pvt. Ltd.
@kpbird
+ketanparmar
www.kpbird.com
Understand AOSP
Requirement
Initializing a Build Environment
Download Source Tree
Download Device Drivers
Build AOSP
Install AOSP
Understand AOSP
Requirement
Initializing a Build Environment
Download Source Tree
Download Device Drivers
Build AOSP
Install AOSP
Android open source project
• Android is an open-source software stack for a wide range of mobile
devices and a corresponding open-source project led by Google
• It’s commonly referred as AOSP
• AOSP has 450+ projects
• www.source.android.com
• www.b.android.com
• https://android-review.googlesource.com/
Understand AOSP
Requirement
Initializing a Build Environment
Download Source Tree
Download Device Drivers
Build AOSP
Install AOSP
Requirement
• Operating System: Linux (Ubuntu) or Mac
• Environment : 64 bit
• Disk Space for Source : 40 GB
• Disk Space for Build : 100 GB
• Software Requirements :
• Python 2.6 -- 2.7
• GNU Make 3.81 -- 3.82
• JDK 7
• Git 1.7 or newer
Repo, Gerrit, Manifest
• Repo is a repository management tool that google has built on top of
Git. Repo unifies the many Git repositories when necessary, does the
uploads to our revision control system.
• Gerrit is a web-based code review system for projects that use git.
Gerrit encourages more centralized use of Git by allowing all
authorized users to submit changes, which are automatically merged
if they pass code review
• Manifest – A manifest file is an XML file, describing a list of
repositories to sync our working directory with.
Understand AOSP
Requirement
Initializing a Build Environment
Download Source Tree
Download Device Drivers
Build AOSP
Install AOSP
Initializing a Build Environment
• Install JDK-7
$ sudo apt-get update
$ sudo apt-get install openjdk-7-jdk
• Required package for Ubuntu 14.x
$ sudo apt-get install bison g++-multilib git
gperf libxml2-utils
Install Repo
• Make sure you have a bin/ directory in your home directory and that
it is included in your path:
$ mkdir ~/bin
$ PATH=~/bin:$PATH
• Download the Repo tool and ensure that it is executable:
$ curl https://storage.googleapis.com/git-repo-
downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
Understand AOSP
Requirement
Initializing a Build Environment
Download Source Tree
Download Device Drivers
Build AOSP
Install AOSP
Initialization Repo Client
• Create an empty directory to hold your working files. If you're using
MacOS, this has to be on a case-sensitive filesystem. Give it any name
you like:
$ mkdir AOSP
$ cd AOSP
• Run repo “init” to bring down the latest version of Repo with all its
most recent bug fixes.
$ repo init -u
https://android.googlesource.com/platform/manife
st
Download Source Tree
• Download Source Tree
$ repo sync –j(--jobs)
• It will download almost 40 GB.
Deep Dive into the Source Tree
Deep Dive into the Source Tree
• Bionic - the C-runtime for Android. Note that Android is not using
glibc like most Linux distributions.
• Bootable - boot and startup related code.
• Build - the build system implementation including all the core make
file templates.
• Cts - the compatability tests. The test suite to ensure that a build
complies with the Android specification.
• Dalvik - the source code for the implementation of the Dalvik Virtual
Machine
Deep Dive into the Source Tree
• Development - projects related to development such as the source
code for the sdk and ndk tools
• Device - product specific code for different devices.
• External - contains source code for all external open source projects
such as SQLite, Freetype and webkit.
• Frameworks - this folder is essential to Android since it contains the
sources for the framework. Here you will find the implementation of
key services such as the System Server with the Package- and Activity
managers.
Deep Dive into the Source Tree
• Hardware - hardware related source code such as the Android
hardware abstraction layer specification and implementation.
• Out - the build output will be placed here after you run make.
• Packages - contains the source code for the default applications such
as contacts, calendar, browser.
• Prebuilt - contains files that are distributed in binary form for
convenience.
• System - source code files for the core Android system. That is the
minimal Linux system that is started before the Dalvik VM and any
java based services are enabled.
Understand AOSP
Requirement
Initializing a Build Environment
Download Source Tree
Download Device Drivers
Build AOSP
Install AOSP
Build for Device
Download Drivers for the Device
https://developers.google.com/android/nexus/drivers
Extract Drivers for the Device
Extract Drivers for the Device
Understand AOSP
Requirement
Initializing a Build Environment
Download Source Tree
Download Device Drivers
Build AOSP
Install AOSP
Build AOSP
• Initialize Build Environment
$ source build/envsetup.sh
or
$ . build/envsetup.sh
• Choose Target
$ lunch
Build AOSP
Build AOSP
• Choose Target
$ lunch
• Press 8 and enter
• Start build with make command
$ make -j4
Wait…….
Output
Understand AOSP
Requirement
Initializing a Build Environment
Download Source Tree
Download Device Drivers
Build AOSP
Install AOSP
Install AOSP Build in Nexus 5
fastboot oem unlock
fastboot flash recovery recovery.img
fastboot flash boot boot.img
fastboot flash cache cache.img
fastboot flash userdata userdata.img
fastboot flash system system.img
fastboot reboot
Enjoy… You own build…
Repo Commands
sync
init
upload
diff
download
start
status
$repo help COMMAND
Helper functions
• croot: change directory to the top of the tree
• m: execute 'make' from the top of the tree
• mm - builds all of the modules in the current directory
• mmm <dir1>: build all of the modules in the supplied directories
• cgrep <pattern>: grep on all local C/C++ files
• jgrep <pattern>: grep on all local Java files
• resgrep <pattern>: grep on all local res/*.xml files
• godir <filename>: go to the directory containing a file
Dr. Ketan Parmar
Sr. Tech Lead – InfoStretch Solutions Pvt. Ltd.
@kpbird
+ketanparmar
www.kpbird.com
Thank You

More Related Content

What's hot

Embedded Android Workshop with Pie
Embedded Android Workshop with PieEmbedded Android Workshop with Pie
Embedded Android Workshop with PieOpersys inc.
 
Android's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALAndroid's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALOpersys inc.
 
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Opersys inc.
 
Gitlab ci, cncf.sk
Gitlab ci, cncf.skGitlab ci, cncf.sk
Gitlab ci, cncf.skJuraj Hantak
 
Learning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessLearning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessNanik Tolaram
 
Learning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverLearning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverNanik Tolaram
 
Android Booting Sequence
Android Booting SequenceAndroid Booting Sequence
Android Booting SequenceJayanta Ghoshal
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android WorkshopOpersys inc.
 
Continuous Integration/Deployment with Gitlab CI
Continuous Integration/Deployment with Gitlab CIContinuous Integration/Deployment with Gitlab CI
Continuous Integration/Deployment with Gitlab CIDavid Hahn
 
CD using ArgoCD(KnolX).pdf
CD using ArgoCD(KnolX).pdfCD using ArgoCD(KnolX).pdf
CD using ArgoCD(KnolX).pdfKnoldus Inc.
 
Android Automotive
Android AutomotiveAndroid Automotive
Android AutomotiveOpersys inc.
 
Android Boot Time Optimization
Android Boot Time OptimizationAndroid Boot Time Optimization
Android Boot Time OptimizationKan-Ru Chen
 

What's hot (20)

Embedded Android Workshop with Pie
Embedded Android Workshop with PieEmbedded Android Workshop with Pie
Embedded Android Workshop with Pie
 
Android Things : Building Embedded Devices
Android Things : Building Embedded DevicesAndroid Things : Building Embedded Devices
Android Things : Building Embedded Devices
 
Android's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALAndroid's HIDL: Treble in the HAL
Android's HIDL: Treble in the HAL
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
 
Gitlab ci, cncf.sk
Gitlab ci, cncf.skGitlab ci, cncf.sk
Gitlab ci, cncf.sk
 
Learning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessLearning AOSP - Android Booting Process
Learning AOSP - Android Booting Process
 
Learning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverLearning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device Driver
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
Android Binder: Deep Dive
Android Binder: Deep DiveAndroid Binder: Deep Dive
Android Binder: Deep Dive
 
Low Level View of Android System Architecture
Low Level View of Android System ArchitectureLow Level View of Android System Architecture
Low Level View of Android System Architecture
 
Android Booting Sequence
Android Booting SequenceAndroid Booting Sequence
Android Booting Sequence
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android Workshop
 
Continuous Integration/Deployment with Gitlab CI
Continuous Integration/Deployment with Gitlab CIContinuous Integration/Deployment with Gitlab CI
Continuous Integration/Deployment with Gitlab CI
 
CD using ArgoCD(KnolX).pdf
CD using ArgoCD(KnolX).pdfCD using ArgoCD(KnolX).pdf
CD using ArgoCD(KnolX).pdf
 
Embedded Android : System Development - Part IV (Android System Services)
Embedded Android : System Development - Part IV (Android System Services)Embedded Android : System Development - Part IV (Android System Services)
Embedded Android : System Development - Part IV (Android System Services)
 
Binder: Android IPC
Binder: Android IPCBinder: Android IPC
Binder: Android IPC
 
Android Automotive
Android AutomotiveAndroid Automotive
Android Automotive
 
Android Boot Time Optimization
Android Boot Time OptimizationAndroid Boot Time Optimization
Android Boot Time Optimization
 
Explore Android Internals
Explore Android InternalsExplore Android Internals
Explore Android Internals
 

Viewers also liked

From Android NDK To AOSP
From Android NDK To AOSPFrom Android NDK To AOSP
From Android NDK To AOSPMin-Yih Hsu
 
How to build rock solid apps & keep 100m+ users happy
How to build rock solid apps & keep 100m+ users happyHow to build rock solid apps & keep 100m+ users happy
How to build rock solid apps & keep 100m+ users happyIordanis (Jordan) Giannakakis
 
Battery Optimization for Android Apps - Devoxx14
Battery Optimization for Android Apps - Devoxx14Battery Optimization for Android Apps - Devoxx14
Battery Optimization for Android Apps - Devoxx14Murat Aydın
 
A Deep Dive into Open Source Android Development
A Deep Dive into Open Source Android DevelopmentA Deep Dive into Open Source Android Development
A Deep Dive into Open Source Android DevelopmentDavid Wu
 
Android content providers
Android content providersAndroid content providers
Android content providersKurt Mbanje
 
Android Embedded - Einführung in Android als Embedded-Plattform
Android Embedded - Einführung in Android als Embedded-PlattformAndroid Embedded - Einführung in Android als Embedded-Plattform
Android Embedded - Einführung in Android als Embedded-Plattforminovex GmbH
 
Android porting-on-embedded-platform v2-0633850602027036930
Android porting-on-embedded-platform v2-0633850602027036930Android porting-on-embedded-platform v2-0633850602027036930
Android porting-on-embedded-platform v2-0633850602027036930weitulislide
 
Content providers in Android
Content providers in AndroidContent providers in Android
Content providers in AndroidAlexey Ustenko
 
Embedded Android Market Development
Embedded Android Market DevelopmentEmbedded Android Market Development
Embedded Android Market DevelopmentVIA Embedded
 
Embedded Android Real-Time Streaming Optimization
Embedded Android Real-Time Streaming OptimizationEmbedded Android Real-Time Streaming Optimization
Embedded Android Real-Time Streaming OptimizationVIA Embedded
 
Android Internals at Linaro Connect Asia 2013
Android Internals at Linaro Connect Asia 2013Android Internals at Linaro Connect Asia 2013
Android Internals at Linaro Connect Asia 2013Opersys inc.
 
Brillo / Weave Internals
Brillo / Weave InternalsBrillo / Weave Internals
Brillo / Weave InternalsOpersys inc.
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowOpersys inc.
 
The Third Network: LSO, SDN and NFV
The Third Network: LSO, SDN and NFVThe Third Network: LSO, SDN and NFV
The Third Network: LSO, SDN and NFVOPNFV
 
Remote Management of Embedded Android Devices
Remote Management of Embedded Android DevicesRemote Management of Embedded Android Devices
Remote Management of Embedded Android DevicesVIA Embedded
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in AndroidOpersys inc.
 
LAS16-400: Mini Conference 3 AOSP (Session 1)
LAS16-400: Mini Conference 3 AOSP (Session 1)LAS16-400: Mini Conference 3 AOSP (Session 1)
LAS16-400: Mini Conference 3 AOSP (Session 1)Linaro
 
Content provider in_android
Content provider in_androidContent provider in_android
Content provider in_androidPRITI TELMORE
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with NougatOpersys inc.
 

Viewers also liked (20)

From Android NDK To AOSP
From Android NDK To AOSPFrom Android NDK To AOSP
From Android NDK To AOSP
 
How to build rock solid apps & keep 100m+ users happy
How to build rock solid apps & keep 100m+ users happyHow to build rock solid apps & keep 100m+ users happy
How to build rock solid apps & keep 100m+ users happy
 
Battery Optimization for Android Apps - Devoxx14
Battery Optimization for Android Apps - Devoxx14Battery Optimization for Android Apps - Devoxx14
Battery Optimization for Android Apps - Devoxx14
 
A Deep Dive into Open Source Android Development
A Deep Dive into Open Source Android DevelopmentA Deep Dive into Open Source Android Development
A Deep Dive into Open Source Android Development
 
Android content providers
Android content providersAndroid content providers
Android content providers
 
Android Embedded - Einführung in Android als Embedded-Plattform
Android Embedded - Einführung in Android als Embedded-PlattformAndroid Embedded - Einführung in Android als Embedded-Plattform
Android Embedded - Einführung in Android als Embedded-Plattform
 
Android porting-on-embedded-platform v2-0633850602027036930
Android porting-on-embedded-platform v2-0633850602027036930Android porting-on-embedded-platform v2-0633850602027036930
Android porting-on-embedded-platform v2-0633850602027036930
 
Content providers in Android
Content providers in AndroidContent providers in Android
Content providers in Android
 
Embedded Android Market Development
Embedded Android Market DevelopmentEmbedded Android Market Development
Embedded Android Market Development
 
Embedded android development (e book)
Embedded android development (e book)Embedded android development (e book)
Embedded android development (e book)
 
Embedded Android Real-Time Streaming Optimization
Embedded Android Real-Time Streaming OptimizationEmbedded Android Real-Time Streaming Optimization
Embedded Android Real-Time Streaming Optimization
 
Android Internals at Linaro Connect Asia 2013
Android Internals at Linaro Connect Asia 2013Android Internals at Linaro Connect Asia 2013
Android Internals at Linaro Connect Asia 2013
 
Brillo / Weave Internals
Brillo / Weave InternalsBrillo / Weave Internals
Brillo / Weave Internals
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with Marshmallow
 
The Third Network: LSO, SDN and NFV
The Third Network: LSO, SDN and NFVThe Third Network: LSO, SDN and NFV
The Third Network: LSO, SDN and NFV
 
Remote Management of Embedded Android Devices
Remote Management of Embedded Android DevicesRemote Management of Embedded Android Devices
Remote Management of Embedded Android Devices
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
 
LAS16-400: Mini Conference 3 AOSP (Session 1)
LAS16-400: Mini Conference 3 AOSP (Session 1)LAS16-400: Mini Conference 3 AOSP (Session 1)
LAS16-400: Mini Conference 3 AOSP (Session 1)
 
Content provider in_android
Content provider in_androidContent provider in_android
Content provider in_android
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with Nougat
 

Similar to Deep Dive into the AOSP

Docker module 1
Docker module 1Docker module 1
Docker module 1Liang Bo
 
ASP.NET 5 auf Raspberry PI & docker
ASP.NET 5 auf Raspberry PI & dockerASP.NET 5 auf Raspberry PI & docker
ASP.NET 5 auf Raspberry PI & dockerJürgen Gutsch
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014biicode
 
Deploying to Ubuntu on Linode
Deploying to Ubuntu on LinodeDeploying to Ubuntu on Linode
Deploying to Ubuntu on LinodeWO Community
 
Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and ...
Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and ...Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and ...
Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and ...Manuel Garcia
 
The development environment
The development environmentThe development environment
The development environmentLee Pelser
 
Deliver Python Apps with Docker
Deliver Python Apps with DockerDeliver Python Apps with Docker
Deliver Python Apps with DockerAnton Egorov
 
Webinar: Creating an Effective Docker Build Pipeline for Java Apps
Webinar: Creating an Effective Docker Build Pipeline for Java AppsWebinar: Creating an Effective Docker Build Pipeline for Java Apps
Webinar: Creating an Effective Docker Build Pipeline for Java AppsCodefresh
 
Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011pundiramit
 
Windows container security
Windows container securityWindows container security
Windows container securityDocker, Inc.
 
Reactive summit 2020 microsoft orleans the easy way
Reactive summit 2020   microsoft orleans the easy wayReactive summit 2020   microsoft orleans the easy way
Reactive summit 2020 microsoft orleans the easy wayJohn Azariah
 
LuisRodriguezLocalDevEnvironmentsDrupalOpenDays
LuisRodriguezLocalDevEnvironmentsDrupalOpenDaysLuisRodriguezLocalDevEnvironmentsDrupalOpenDays
LuisRodriguezLocalDevEnvironmentsDrupalOpenDaysLuis Rodríguez Castromil
 
24HOP Introduction to Linux for SQL Server DBAs
24HOP Introduction to Linux for SQL Server DBAs24HOP Introduction to Linux for SQL Server DBAs
24HOP Introduction to Linux for SQL Server DBAsKellyn Pot'Vin-Gorman
 
yocto_scale_handout-with-notes
yocto_scale_handout-with-notesyocto_scale_handout-with-notes
yocto_scale_handout-with-notesSteve Arnold
 
Rhodes mobile Framework
Rhodes mobile FrameworkRhodes mobile Framework
Rhodes mobile FrameworkYoshi Sakai
 
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...Cheng-Yi Yu
 
Dockerizing Oracle Database
Dockerizing Oracle Database Dockerizing Oracle Database
Dockerizing Oracle Database gvenzl
 
Joget Workflow v6 Training Slides - 16 - Preparing Development Environment
Joget Workflow v6 Training Slides - 16 - Preparing Development EnvironmentJoget Workflow v6 Training Slides - 16 - Preparing Development Environment
Joget Workflow v6 Training Slides - 16 - Preparing Development EnvironmentJoget Workflow
 

Similar to Deep Dive into the AOSP (20)

Docker module 1
Docker module 1Docker module 1
Docker module 1
 
ASP.NET 5 auf Raspberry PI & docker
ASP.NET 5 auf Raspberry PI & dockerASP.NET 5 auf Raspberry PI & docker
ASP.NET 5 auf Raspberry PI & docker
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
Deploying to Ubuntu on Linode
Deploying to Ubuntu on LinodeDeploying to Ubuntu on Linode
Deploying to Ubuntu on Linode
 
Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and ...
Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and ...Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and ...
Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and ...
 
The development environment
The development environmentThe development environment
The development environment
 
Deliver Python Apps with Docker
Deliver Python Apps with DockerDeliver Python Apps with Docker
Deliver Python Apps with Docker
 
Webinar: Creating an Effective Docker Build Pipeline for Java Apps
Webinar: Creating an Effective Docker Build Pipeline for Java AppsWebinar: Creating an Effective Docker Build Pipeline for Java Apps
Webinar: Creating an Effective Docker Build Pipeline for Java Apps
 
Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011
 
Windows container security
Windows container securityWindows container security
Windows container security
 
Reactive summit 2020 microsoft orleans the easy way
Reactive summit 2020   microsoft orleans the easy wayReactive summit 2020   microsoft orleans the easy way
Reactive summit 2020 microsoft orleans the easy way
 
Core os dna_oscon
Core os dna_osconCore os dna_oscon
Core os dna_oscon
 
LuisRodriguezLocalDevEnvironmentsDrupalOpenDays
LuisRodriguezLocalDevEnvironmentsDrupalOpenDaysLuisRodriguezLocalDevEnvironmentsDrupalOpenDays
LuisRodriguezLocalDevEnvironmentsDrupalOpenDays
 
24HOP Introduction to Linux for SQL Server DBAs
24HOP Introduction to Linux for SQL Server DBAs24HOP Introduction to Linux for SQL Server DBAs
24HOP Introduction to Linux for SQL Server DBAs
 
Building an iOS Build Server
Building an iOS Build ServerBuilding an iOS Build Server
Building an iOS Build Server
 
yocto_scale_handout-with-notes
yocto_scale_handout-with-notesyocto_scale_handout-with-notes
yocto_scale_handout-with-notes
 
Rhodes mobile Framework
Rhodes mobile FrameworkRhodes mobile Framework
Rhodes mobile Framework
 
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
 
Dockerizing Oracle Database
Dockerizing Oracle Database Dockerizing Oracle Database
Dockerizing Oracle Database
 
Joget Workflow v6 Training Slides - 16 - Preparing Development Environment
Joget Workflow v6 Training Slides - 16 - Preparing Development EnvironmentJoget Workflow v6 Training Slides - 16 - Preparing Development Environment
Joget Workflow v6 Training Slides - 16 - Preparing Development Environment
 

Recently uploaded

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 

Recently uploaded (20)

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 

Deep Dive into the AOSP

  • 1. Deep Dive into the AOSP Android Open Source Project
  • 2. Dr. Ketan Parmar Sr. Tech Lead – InfoStretch Solutions Pvt. Ltd. @kpbird +ketanparmar www.kpbird.com
  • 3. Understand AOSP Requirement Initializing a Build Environment Download Source Tree Download Device Drivers Build AOSP Install AOSP
  • 4. Understand AOSP Requirement Initializing a Build Environment Download Source Tree Download Device Drivers Build AOSP Install AOSP
  • 5. Android open source project • Android is an open-source software stack for a wide range of mobile devices and a corresponding open-source project led by Google • It’s commonly referred as AOSP • AOSP has 450+ projects • www.source.android.com • www.b.android.com • https://android-review.googlesource.com/
  • 6.
  • 7.
  • 8.
  • 9. Understand AOSP Requirement Initializing a Build Environment Download Source Tree Download Device Drivers Build AOSP Install AOSP
  • 10. Requirement • Operating System: Linux (Ubuntu) or Mac • Environment : 64 bit • Disk Space for Source : 40 GB • Disk Space for Build : 100 GB • Software Requirements : • Python 2.6 -- 2.7 • GNU Make 3.81 -- 3.82 • JDK 7 • Git 1.7 or newer
  • 11. Repo, Gerrit, Manifest • Repo is a repository management tool that google has built on top of Git. Repo unifies the many Git repositories when necessary, does the uploads to our revision control system. • Gerrit is a web-based code review system for projects that use git. Gerrit encourages more centralized use of Git by allowing all authorized users to submit changes, which are automatically merged if they pass code review • Manifest – A manifest file is an XML file, describing a list of repositories to sync our working directory with.
  • 12. Understand AOSP Requirement Initializing a Build Environment Download Source Tree Download Device Drivers Build AOSP Install AOSP
  • 13. Initializing a Build Environment • Install JDK-7 $ sudo apt-get update $ sudo apt-get install openjdk-7-jdk • Required package for Ubuntu 14.x $ sudo apt-get install bison g++-multilib git gperf libxml2-utils
  • 14. Install Repo • Make sure you have a bin/ directory in your home directory and that it is included in your path: $ mkdir ~/bin $ PATH=~/bin:$PATH • Download the Repo tool and ensure that it is executable: $ curl https://storage.googleapis.com/git-repo- downloads/repo > ~/bin/repo $ chmod a+x ~/bin/repo
  • 15. Understand AOSP Requirement Initializing a Build Environment Download Source Tree Download Device Drivers Build AOSP Install AOSP
  • 16. Initialization Repo Client • Create an empty directory to hold your working files. If you're using MacOS, this has to be on a case-sensitive filesystem. Give it any name you like: $ mkdir AOSP $ cd AOSP • Run repo “init” to bring down the latest version of Repo with all its most recent bug fixes. $ repo init -u https://android.googlesource.com/platform/manife st
  • 17. Download Source Tree • Download Source Tree $ repo sync –j(--jobs) • It will download almost 40 GB.
  • 18. Deep Dive into the Source Tree
  • 19. Deep Dive into the Source Tree • Bionic - the C-runtime for Android. Note that Android is not using glibc like most Linux distributions. • Bootable - boot and startup related code. • Build - the build system implementation including all the core make file templates. • Cts - the compatability tests. The test suite to ensure that a build complies with the Android specification. • Dalvik - the source code for the implementation of the Dalvik Virtual Machine
  • 20. Deep Dive into the Source Tree • Development - projects related to development such as the source code for the sdk and ndk tools • Device - product specific code for different devices. • External - contains source code for all external open source projects such as SQLite, Freetype and webkit. • Frameworks - this folder is essential to Android since it contains the sources for the framework. Here you will find the implementation of key services such as the System Server with the Package- and Activity managers.
  • 21. Deep Dive into the Source Tree • Hardware - hardware related source code such as the Android hardware abstraction layer specification and implementation. • Out - the build output will be placed here after you run make. • Packages - contains the source code for the default applications such as contacts, calendar, browser. • Prebuilt - contains files that are distributed in binary form for convenience. • System - source code files for the core Android system. That is the minimal Linux system that is started before the Dalvik VM and any java based services are enabled.
  • 22. Understand AOSP Requirement Initializing a Build Environment Download Source Tree Download Device Drivers Build AOSP Install AOSP
  • 24. Download Drivers for the Device https://developers.google.com/android/nexus/drivers
  • 25. Extract Drivers for the Device
  • 26. Extract Drivers for the Device
  • 27. Understand AOSP Requirement Initializing a Build Environment Download Source Tree Download Device Drivers Build AOSP Install AOSP
  • 28. Build AOSP • Initialize Build Environment $ source build/envsetup.sh or $ . build/envsetup.sh • Choose Target $ lunch
  • 30. Build AOSP • Choose Target $ lunch • Press 8 and enter • Start build with make command $ make -j4
  • 33. Understand AOSP Requirement Initializing a Build Environment Download Source Tree Download Device Drivers Build AOSP Install AOSP
  • 34. Install AOSP Build in Nexus 5 fastboot oem unlock fastboot flash recovery recovery.img fastboot flash boot boot.img fastboot flash cache cache.img fastboot flash userdata userdata.img fastboot flash system system.img fastboot reboot
  • 35. Enjoy… You own build…
  • 37. Helper functions • croot: change directory to the top of the tree • m: execute 'make' from the top of the tree • mm - builds all of the modules in the current directory • mmm <dir1>: build all of the modules in the supplied directories • cgrep <pattern>: grep on all local C/C++ files • jgrep <pattern>: grep on all local Java files • resgrep <pattern>: grep on all local res/*.xml files • godir <filename>: go to the directory containing a file
  • 38. Dr. Ketan Parmar Sr. Tech Lead – InfoStretch Solutions Pvt. Ltd. @kpbird +ketanparmar www.kpbird.com Thank You