mobile spaces

20
A Sneak Peek Into Android Internals GDG Dec-2012 By Yoav Weiss MobileSpaces Founder & CTO

Upload: ron-reiter

Post on 18-Dec-2014

1.641 views

Category:

Documents


2 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Mobile Spaces

A Sneak Peek Into Android Internals

GDG Dec-2012By Yoav Weiss

MobileSpaces Founder & CTO

Page 2: Mobile Spaces

What we're going to talk about

● Virtualizing Android● Understanding Android internals

through dynamic tracing

Page 3: Mobile Spaces

What is MobileSpaces

● Solving BYOD through a unique virtualization platform

● Any app, any device, no root(!)● Funded by Accel Partners

Page 4: Mobile Spaces

Short demo of

Page 5: Mobile Spaces

Android Security Model in a nutshell

● The Android security model is based on linux kernel separation

● Apps and services run in usermode● Each app is assigned a unique uid and a

home directory● Android takes advantage of linux gids● Android permissions are enforced by uid

rather than package

Page 6: Mobile Spaces

Application Initialization ProcessStep 1 - ActivityManager asks the System Server to start Activity/Service/Receiver/Provider

* ActivityManager is actually a service running in the system_server process

Page 7: Mobile Spaces

Application Initialization Process

Step 2 - System Server checks which package provides that functionality

Page 8: Mobile Spaces

Application Initialization Process

Step 3 - System Server tells Zygote to load the package

Page 9: Mobile Spaces

Application Initialization Process

Step 4 - Zygote forks and creates the new application process

Page 10: Mobile Spaces

Application Initialization ProcessStep 5 - The application is set up:

● Check permissions ● Set gid● Set uid● Load the package

Page 11: Mobile Spaces

Application Initialization Process

Step 6 - The application starts listening for instructions from ActivityManager (Activity lifecycle messages)

Page 12: Mobile Spaces

Virtualizing AndroidSince Android apps and services run in usermode, they must interact with the world via syscalls.

Page 13: Mobile Spaces

Binder Flow Example

Step 1 - Camera app asks MediaServer to access the camera

Page 14: Mobile Spaces

Binder Flow Example

Step 2 - MediaServer asks system_server if camera app is allow to access the camera

Page 15: Mobile Spaces

Binder Flow Example

Step 3 - system_server grants the permission

Page 16: Mobile Spaces

Binder Flow Example

Step 4 - MediaServer opens the camera driver and configures it

Page 17: Mobile Spaces

Binder Flow Example

Step 5 - MediaServer returns the file descriptor to the camera app which can now use the camera

Page 18: Mobile Spaces

Live Demos Using the

platform

Page 19: Mobile Spaces

Summary

● We virtualized Android. No root required● We used the VM to peek into the system

MobileSpaces is hiring!

Visit us at: http://www.mobilespaces.somContact us: [email protected]

Page 20: Mobile Spaces

Q&A