Tags
Language
Tags
April 2024
Su Mo Tu We Th Fr Sa
31 1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 1 2 3 4

Android Os Internals Version 14 - From Apps Down To Kernel

Posted By: ELK1nG
Android Os Internals Version 14 - From Apps Down To Kernel

Android Os Internals Version 14 - From Apps Down To Kernel
Published 3/2024
MP4 | Video: h264, 1920x1080 | Audio: AAC, 44.1 KHz
Language: English | Size: 916.75 MB | Duration: 1h 30m

Run Android 14 in the cloud, create system services, solve SELinux errors and debug native crashes.

What you'll learn

Understand Android OS Architecture and control Linux kernel drivers

Develop a C++ service and make it persistent with an rc file

Build a Kotlin application with system control UI

Use AIDL for HAL communication be in line to AOSP design patterns and the CTS

Learn how to solve SELinux avc denied errors

Requirements

Software Developer

Description

This comprehensive course is designed to guide participants through the intricacies of setting up a development environment on Ubuntu 20.04 within Google Cloud, diving deep into the Android Open Source Project (AOSP), and mastering the art of Android platform development.Through a structured series of lectures and labs, learners will embark on a journey that covers a broad spectrum of topics from VM setup and source code compilation to advanced security and debugging techniques.Section 1 lays the foundational knowledge required to navigate Google Cloud's compute engine, install the gcloud CLI, and create a VMX-enabled Ubuntu VM, ensuring students are well-prepared for Android platform development.Section 2 progresses to downloading and building the Android 14 source code. Participants will learn how to bring the Cuttlefish device to life, providing a practical environment for testing and development.In Section 3, the course shifts focus to transforming Ubuntu Server into a Desktop environment and installing ASfP, equipping learners with the tools necessary for Android platform development.Section 4 introduces essential tools like the 'hmm' command and adb, enhancing the learners’ ability to interact with and control Android devices and environments effectively.Security basics are demystified in Section 5, where participants explore user IDs, discretionary and mandatory access control, and how Android secures application data and processes, providing a solid understanding of Android's security model.Section 6 delves into images and partitions of Android, revealing the complexities of system updates, and partition management.Sections 7 through 14 consist of hands-on labs ranging from creating a CPU HAL interface with AIDL, developing service daemons, setting correct SELinux permissions, to creating and registering the CPU service implementation. Each lab is meticulously designed to reinforce learning, encourage exploration, and develop a thorough understanding of Android platform development.Moreover, the labs tackles debugging tools and strategies, including forcing crashes and using llvm-addr2line, as well as debugging native services with lldb, preparing students to troubleshoot and optimize Android platform applications and services efficiently.By the end of this course, participants will have gained not only theoretical knowledge but also practical experience in Android platform development, security models, debugging, and application deployment, enabling them to contribute to the Android ecosystem or undertake custom Android platform projects with confidence.

Overview

Section 1: Set up VMX enabled Ubuntu 20.04 in Google Cloud

Lecture 1 Create a Google Cloud account with compute engine enabled

Lecture 2 Install the gcloud CLI and connect to the AOSP project on your Google Cloud

Lecture 3 Create an Ubuntu 20.04 VM with VMX enabled

Section 2: Download the Android 14 source code, build and run the cuttlefish device

Lecture 4 Download the android-14.0.0_r21 branch

Lecture 5 Build and run the Cuttlefish VM

Section 3: Ubuntu Desktop + Android Studio for Platform (ASfP)

Lecture 6 Convert Ubuntu Server to Ubuntu Desktop

Lecture 7 Install and configure the Android Studio for Platform

Section 4: Tools - hmm, adb

Lecture 8 The 'hmm' Command

Lecture 9 Authorizing Real Device for ADB Connection

Section 5: Security basics

Lecture 10 User IDs and the Discretionary Access Control

Lecture 11 Mandatory Access Control - SELinux

Lecture 12 Process Status (ps) and Private Application Files in /data/data

Section 6: Images and partitions

Lecture 13 PRODUCT_MAKEFILES and Makefile Inheritance

Lecture 14 Generic System Image (GSI)

Lecture 15 Android Partitions

Lecture 16 Dynamic Partitions, "super.img", A/B System Updates and "fastbootd"

Section 7: Lab 1: AIDL for HAL - creating a CPU HAL Interface Definition

Lecture 17 About the Main Lab

Lecture 18 Change the CPU scaling governor via the command line (adb shell)

Lecture 19 Define an aidl_interface module in Android.bp

Lecture 20 Define a CPU interface in ICpu.aidl

Lecture 21 Build the CPU Interface using mm

Lecture 22 Add the AIDL interface to the Cuttlefish build

Section 8: Lab 2: Creating the service daemon

Lecture 23 Create an empty service holder in service.cpp

Lecture 24 Define a new CPU Service executable in Android.bp

Lecture 25 Define an init.rc persistent service pointing to the CPU service executable

Lecture 26 Define a Vendor Interface (VINTF) xml object

Lecture 27 Add the CPU Service to the Cuttlefish build

Section 9: Lab 3: Setting correct SELinux permissions

Lecture 28 Print the logcat and correctly label the service executable

Lecture 29 Define new SELinux types and use SELinux macros

Lecture 30 Use audit2allow to solve "avc: denied" errors

Section 10: Lab 4: Create and register the CPU service implementation

Lecture 31 Define the CPU class header file

Lecture 32 Define the CPU class implementation file

Lecture 33 Register the CPU service with the Service Manager

Lecture 34 Define a new CPU service interface SELinux type in the Service Manager

Section 11: Lab 5: Test the CPU service and fix permissions errors

Lecture 35 Create CpuTester executable

Lecture 36 Change the Scaling Governor file permissions

Section 12: Lab 6: Create a services system app with a Broadcast Receiver

Lecture 37 Extend the Application class

Lecture 38 Create a Broadcast Receiver to handle external requests

Lecture 39 Defne a persistent Android App in AndroidManifest.xml

Lecture 40 Create a strings.xml resources file

Lecture 41 Define an Android App module in Android.bp

Lecture 42 Set SELinux rules for the system app

Lecture 43 Test the services app by sending a broadcast

Section 13: Lab 7: Add Activity Control UI to the Platform app

Lecture 44 Create the resource files

Lecture 45 Extend the Activity class

Lecture 46 Add the activity to the AndroidManifest.xml file

Lecture 47 Test the Activity

Section 14: Lab 8: Debugging Tools

Lecture 48 Forcing a crash and using llvm-addr2line

Lecture 49 Debugging native service with lldb

Anyone wanting to understand the Android OS for work, hobby or to gain experience