Update
Android 14 Internals is out on udemy! Customize Cuttlefish in the cloud
Video recordings from my last training
In the labs, you get to build an HIDL service (Android 8), a persistent Java app (can't be killed), a Java SDK Library (Android 10) and AIDL for HAL service (android 11).
You will learn how to set the right SE Linux rules or macro to solve all these AVC denied errors.
You get to use gdb and strace to debug native code.
What is the Android Open Source Project?
Hardware Prerequisites
Download Ubuntu 20.04 and VMWare
Setup an Ubuntu 20 Installation on VMWare
Setting up a Linux Build Environment
Download the Repo Launcher
Downloading the android-12.0.0_r15 branch of the Android Source Code
The Device Folder
Cuttlefish, Android Emulator and a Physical Device
The 'hmm' Command
Starting a Cuttlefish Build
Examining the Build's Output
Setup acloud for Local Instances (Android 12)
acloud Create: Booting Cuttlefish (Android 12)
launch_cvd --start_webrtc=true : Booting Cuttlefish without acloud
Developer Options
ADB Shell
Useful Tips
Windows Troubleshooting
Authorizing Real Device for ADB Connection
User IDs and the Discretionary Access Control
Mandatory Access Control - SE Linux
Process Status (ps) and Private Application Files in /data/data
Find ps & Top Commands' Source Codes
Android Make Build System
AndroidProducts.mk and COMMON_LUNCH_CHOICES
PRODUCT_MAKEFILES and Makefile Inheritance
Generic System Image (GSI)
Android Partitions
Dynamic Partitions, "super.img", A/B System Updates and "fastbootd"
Assignment: Download the Android Common Kernel; Build and Replace Cuttlefish, GKI & Kernel Objects
ICpu.hal : [email protected] HIDL Interface
eightman.mk : Android Makefile in Cuttlefish
Cpu.h : Extending ICpu
Cpu.cpp : HAL Implementation
service.cpp : HAL Implementation Wrapper
Android.bp: Service executable cc_binary
[email protected]: Vendor Interface (VINTF) Object
[email protected]: Init Daemon
DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE
dmesg & sepolicy/vendor/file_contexts
sepolicy/vendor/hal_cpu_default.te & avc denied
audit2allow & property_contexts
hwbinder_use macro
hal_cpu_hwservice & add_hwservice macro
CpuTester
Enable Access Permissions to the kernel driver (DAC)
Enable Access Permission to the kernel driver (MAC)
com_eightman_Cpu.cpp: Thin Native HIDL Client
onload.cpp: JNI_OnLoad
Android.bp: cc_library_shared
Cpu.java: Java Wrapper for Native Calls
Android.bp: java_sdk_library & com.eightman api
EightmanServices.java : The Application Class
EightmanBroadcastReceiver.java : Receiving setScalingGovernor Broadcast
AndroidManifest.xml : com.eightman Persistent Android App
strings.xml : Strings Resources File
Android.bp : android_app
eightmanservices.te : SE Linux
Test the App
activity_cpu.xml, styles.xml & colors.xml : cpu Control Layout
CpuActivity.java : cpu Control Activity
AndroidMainfest.xml : Adding CpuActivity
HIDL Vibrator on AOSP
Android.bp : Adding HIDL Java Libs
activity_cpu.xml : Adding New TextViews
EightmanServices.java : Instantiating a Java HIDL Proxy
CpuActivity.java : Adding Java HIDL Proxy Calls
Android.bp: Moving the App from the Vendor to the System_ext Partition (SSI)
dex2jar & jdgui
hidl2aidl, aidl_interface
service.cpp : Service Holder Template
Android.bp : vendor.eightman.cpu-service
vendor.eightman.cpu-service.rc : Running the Service as a Native Daemon
vendor.eightman.cpu-service.xml : Defining a New vintf AIDL Object
device_framework_matrix.xml : Adding the AIDL Service
SE Linux rules: hal_cpu_service
Cpu.h : Extending BnCpu (binder native)
Cpu.cpp : Service Implementation
service.cpp : Adding the Service to the vndservicemanager
Android.bp : Adding the AIDL Jar
EightmanServices.java : Adding a New AIDL Java Proxy to the Application
CpuActivity.java & activity_cpu.xml : Adding the AIDL Call in our UI
eightmanservices.te : Adding SE Linux Rules
Forcing a Crash
Debugging native HIDL/AIDL service with LLDB
Debugging Native Code with GDB (OLD)
dumpsys Support for Vendor Service
Tracing System Calls with strace
Drozer install script
Drozer - available modules
Pull any app from a none-rooted device
Install apktool
Decode an APK (reverse engineer)
service list
dumpsys SurfaceFlinger
dumpsys activity
Power Management
Sensors Path
Setup cuttlefish (Android 13)
launch_cvd - booting Cuttlefish (Android 13)
The breadth and depth of material is astounding. I had a great time going through the course and will likely continue to revisit sections repeatedly for the ...
Read MoreThe breadth and depth of material is astounding. I had a great time going through the course and will likely continue to revisit sections repeatedly for the clear and concise explanation and examples.
Read LessWell structured course, good contents and author usually responds within few hours to any question.
Well structured course, good contents and author usually responds within few hours to any question.
Read LessGil Zhaiek
Yes, with the Thinkific platform, you'll need to sign up to access the free preview.
You'll get to define different types of architectural modules, including an HIDL service from Android 8, Java SDK library from Android 10, and an AIDL for HAL service from Android 11
The latest - Android 12.