Book Cover

Android Internals.pdf

by Jonathan Levin
20.0 minutes

Key Points

Okay, here's a summary of "Android Internals, Volume I" along with a breakdown of the key takeaways, structured to be helpful and engaging:

Android Internals, Volume I: A Quick Dive

This book by Jonathan Levin is your guide to understanding the inner workings of the Android OS, focusing on the perspective of a power user. It's like getting a peek behind the curtain to see how Android really ticks!

What you'll get from it:

  • A solid understanding of Android's architecture.
  • Skills to troubleshoot and customize your device.
  • An appreciation for the complexity and elegance of the Android OS.
  • Confidence to dive deeper into Android development or security.

Core Content

Here are some of the core concepts and areas explored in the book:

  1. Android's Architectural Evolution:

    • Each version (Cupcake to Lollipop & beyond, with M updates) introduces improvements and features, impacting performance, security, and functionality.
    • Gingerbread brought concurrent garbage collection (better app response) & NFC support. Honeycomb added multi-core support & storage encryption. KitKat aimed at broader device compatibility. Lollipop brought ART.
    • M promises runtime permission enforcement, extended data encryption, and Doze mode for better battery life. *The book shows ways to determine device details, even on customized builds, using terminal commands, and demonstrates how to use /proc to read such properties
  2. Android vs. Linux:

    • Android builds upon Linux, but customizes it extensively.
    • Android provides a complete software stack (kernel, GUI, frameworks) simplifying app development
    • Android has its own runtime (Dalvik, ART) and hardware abstraction layer (HAL).
  3. Partitions and File Systems:

    • Android devices are partitioned in a certain way, like the scheme partitions used by vendors, including Google.
    • Explains the reasons for the need for separate partitions, such as boot, system, data, cache, vendor, recovery...
    • File systems (Ext4, F2FS) structure these partitions and are critical for data management.
    • Protected filesystems (OBB, ASEC) provide added security (but have limitations on rooted devices).
    • The book shows how to explore device partitions, which can be found in /proc/partitions.
    • Details are given as to various Linux "pseudo-filesystems": /proc, /sys, and others.
  4. Boot, Backup, and Recovery:

    • The book also describes the Android boot images (kernel, RAM disk, system partition).
    • The book shows how to boot the devices on a known "safe" copy of the operating system.
    • Details to backup / restore process, including tips for customizing images.
  5. /init Process:

    • /init is the first process to start. It starts the system in user mode, like a UN*X system.
    • The book includes deep dives into /init.rc files and USB communication.
  6. Daemons (Native Services):

    • The book gives detailed reference to the functions of daemons.
    • Discusses essential daemons like adbd, servicemanager, healthd, vold, surfaceflinger, etc. *Adetailed explanation for each of them
  7. Framework Service Architecture:

    • A gentle introduction to the framework service architecture is given.
    • Explains the roles of the TFSWJDFNBOBHFS and TZTFN@TFSWFS processes.
  8. Android Through a Linux Lens:

    • The book explains the Android system processes and apps through the /proc filesystem and Linux tools.
    • Covers /proc symlinks, virtual memory management, memory statistics, and tracing system calls.
  9. Security:

    • Linux permissions, capabilities, and SELinux are reviewed.
    • Discusses Dalvik-level permissions, code signing, and user-level security (lock screen, multi-user support).
    • Details root methods and device boot.

Q&A

  • Q: This book is for "power users." Does that mean I need to be a super-advanced Android hacker to understand it?

    • A: Not at all! The book explains everything clearly, but it does assume you're interested in going deeper than just using apps.
  • Q: Can I really customize my Android after reading this book?

    • A: The book provides the knowledge and tools for customization, such as, unpacking boot images, but actual customization may depend on your device's limitations (locked bootloader, etc.).
  • Q: Is this book still relevant with newer versions of Android coming out all the time?

    • A: The book is written to be as updated as possible, focusing on core concepts that stay consistent across versions. Also check the companion website NewAndroidBook.com for updates.
  • Q: What's the deal with the "Volume I" in the title? What's coming in Volume II?

    • A: Volume I focuses on the power user's perspective. Volume II (coming soon!) dives into the programmer's view, looking at the structure of Android's frameworks.

MindMap

Target Audience

The book is targeted towards power users, administrators, and anyone interested in gaining a deeper understanding of the Android operating system's internal workings. It is suitable for those who want to explore the OS design, filesystem structure, boot sequence, and native services without necessarily being developers.

Author Background

Jonathan Levin started hacking in his teens and has experience with UNIX, Linux, Windows, and OS X. He consults and trains in security and is the CTO of Technologeeks.com. He is also the author of "Mac OS X and iOS Internals."

Historical Context

The book was written during a period of rapid evolution in the Android landscape, transitioning from KitKat to Lollipop and then to Android M. This constant evolution posed challenges in keeping the book up-to-date. The book reflects the state of Android up to Android M Preview Release 1 (June 2015).

Chapter Summary

Audio

Comming Soon...