SlideShare uma empresa Scribd logo
1 de 14
Baixar para ler offline
Android Services Black Magic
by Aleksandar (Saša) Gargenta, Marakana Inc.


            Android Builders Summit
              February 14th, 2012
             Redwood Shores, CA

                  Screencast @
              http://mrkn.co/munz7
About
Aleksandar (Saša) Gargenta
 •   Developer and instructor of Android Internals and Security training at Marakana
 •   Founder and co-organizer of San Francisco Android User Group (sfandroid.org)
 •   Founder and co-organizer of San Francisco Java User Group (sfjava.org)
 •   Co-founder and co-organizer of San Francisco HTML5 User Group (sfhtml5.org)
 •   Speaker at AnDevCon, AndroidOpen, Android Builders Summit, etc.
 •   Server-side Java and Linux, since 1997
 •   Android/embedded Java and Linux, since 2009
 •   Worked on SMS, WAP Push, MMS, OTA provisioning in previous life
 •   @agargenta on Twitter
 •   aleksandar.gargenta@gmail.com on Google+




Marakana - Helping people get better at what they do
 •   Training on cutting edge open source software (like Android!)
 •   Rockstar team of experts, on staff
 •   Content is king
 •   http://marakana.com/
Android Stack
                               Applications

                                                                        Content
   Home         Contacts           Phone          Browser
                                                                       Providers


                           Application Framework

  Activity      Window             Vibrator            WiFi               Battery
  Service       Service            Service            Service             Service

 Package       Telephony          Resource            Location         Notification
 Service        Service           Manager             Service           Service


                               Native Layer
Surface        Media                                             Android Runtime
                              SQLite           SSL
Flinger      Framework

                                                                    Core Libs
OpenGL         vold            netd           WebKit

                                                                      Dalvik
 libwifi      libcamera         libgps          libc                    VM




   Display       Camera        Linux Kernel             GPS               Binder
   Driver         Driver                                Driver            Driver

   Keypad         WiFi                                  Audio             Power
    Driver        Driver                                Driver            Mgmt
Vibrator on Android
                                                                                               com.example.app (/data/app/ExampleApp.apk)                                                                                                                          system_server

                                                                                                                DalvikVM                                                                                                                                              DalvikVM

                                                                                                               classes.dex                                                                                                                              /system/framework/framework.jar

                                                                                                    com.example.app.ExampleActivity                                                                                                                      android.os.IVibratorService.Stub




                                                                                                                                                                                                                                                                                                          extends
                                                    calls




                                                                                                     /system/framework/framework.jar                                                                                                                      /system/framework/services.jar




                                                                                                                                                              registers "vibrator" service via ServiceManager
                                                                                                           android.os.Vibrator                                                                                                                           com.android.server.SystemServer




                                                                                                                                                                                                                 creates
                                                                                                                                              calls
                                                                                                  android.os.IVibratorService.Stub.Proxy                                                                                                                com.android.server.VibratorService
                                                          looks up "vibrator" service via SM




                                                                                                                                                                                                                                                                                                          calls/links to
gets a reference to the ServiceManager (handle=0)




                                                                                                                                                                                                                                                         /system/lib/libandroid_servers.so
                                                                                                     /system/lib/libandroid_runtime.so




                                                                                                                                                                                                                references
                                                                                                                                               uses (calls)
                                                                                                                                                                                                                                                    com_android_server_VibratorService.cpp
                                                                                                          /system/lib/libbinder.so




                                                                                                                                                                                                                                                                                                        calls
                                                                                                            /system/lib/lib*.so                                                                                                                         /system/lib/libhardware_legacy.so
                                                                                                                                                                                                                                                                      vibrator.c




                                                                                                                                                                                                                             invokes transaction




                                                                                                                                                                                                                                                                                                       uses (io write)
                                                                                                       /system/bin/servicemanager                                                                                                                        /system/lib/libandroid_runtime.so

                                                                                                            service_manager.c                                                                                                                                  /system/lib/libbinder.so
                                                    references




                                                                                                             /system/lib/lib*.so                                                                                                                                  /system/lib/lib*.so



                                                                                                                   /dev/binder                                                                                                                        /sys/class/timed_output/vibrator/enable
                                                                                                                                                              Kernel
                                                    registers as binder context manager
                                                                                                                                                                                                                                                   gets a reference to the ServiceManager (handle=0)
Power on Android
                                                                                            com.example.app (/data/app/ExampleApp.apk)                                                                                                                 system_server

                                                                                                             DalvikVM                                                                                                                                     DalvikVM
                                                                                                                                                                                                                                             /system/framework/framework.jar
                                                                                                            classes.dex
                                                                                                                                                                                                                                              android.os.IPowerManager.Stub
                                                                                                 com.example.app.ExampleActivity
                                                                                                                                                                                                                                                      android.os.Power
                                                    calls




                                                                                                                                                                                                                                                                                                                  calls
                                                                                                  /system/framework/framework.jar                                                                                                             /system/framework/services.jar




                                                                                                                                                                                                                                                                                     extends
                                                                                                                                              creates

                                                                                                                                                           registers "power" service via ServiceManager
                                                                                                    android.os.PowerManager                                                                                                                  com.android.server.SystemServer




                                                                                                                                                                                                           creates
                                                                                                android.os.PowerManager.WakeLock                                                                                                            com.android.server.PowerManagerService
                                                          looks up "power" service via SM




                                                                                                                                                                                                                                                                                               calls/links to
gets a reference to the ServiceManager (handle=0)




                                                                                               android.os.IPowerManager.Stub.Proxy        calls

                                                                                                                                                                                                                                             /system/lib/libandroid_runtime.so
                                                                                                  /system/lib/libandroid_runtime.so




                                                                                                                                                                                                          references
                                                                                                                                                                                                                                                  android_os_Power.cpp
                                                                                                       /system/lib/libbinder.so




                                                                                                                                                                                                                                                                                                 calls
                                                                                                         /system/lib/lib*.so                                                                                                                /system/lib/libhardware_legacy.so


                                                                                                                                            uses (calls)
                                                                                                                                                                                                                                                           power.c




                                                                                                                                                                                                                                                                                                uses (io write)
                                                                                                    /system/bin/servicemanager                                                                                                               /system/lib/libandroid_runtime.so

                                                                                                        service_manager.c                                                                                                                          /system/lib/libbinder.so
                                                                                                                                                                                                                       invokes
                                                    references




                                                                                                          /system/lib/lib*.so                                                                                                                         /system/lib/lib*.so



                                                                                                                /dev/binder                                                                                                                         /sys/power/wake_lock
                                                                                                                                                           Kernel
                                                    registers as binder context manager
                                                                                                                                                                                                                                 gets a reference to the ServiceManager (handle=0)
Alarm on Android
                                                                                                            com.android.deskclock                                                                                                                         system_server
                                                                                                        (/system/app/DeskClock.apk)
                                                                                                                                                                                                                                                             DalvikVM
                                                                                                                   DalvikVM
                                                                                                                                                                                                                                                /system/framework/framework.jar
                                                                                                                  classes.dex
                                                                                                                                                                                                                                                android.app.IAlarmManager.Stub
                                                                                      calls




                                                                                                     com.android.deskclock.AlarmClock

                                                                                                       com.android.deskclock.Alarms




                                                                                                                                                                                                                                                                                        extends
                                                                                                                                                                                                                                                 /system/framework/services.jar
                                                                                      uses




                                                                                                                                               calls
                                                                                                      /system/framework/framework.jar




                                                                                                                                                              registers "alarm" service via ServiceManager
                                                                                                                                                                                                                                                com.android.server.SystemServer




                                                                                                                                                                                                              creates
                                                                                                          android.app.ContextImpl

                                                                                                        android.app.AlarmManager                                                                                                                      .AlarmManagerService
                                                    looks up "alarm" service via SM




                                                                                                                                                 calls




                                                                                                                                                                                                                                                                                        calls/links to
gets a reference to the ServiceManager (handle=0)




                                                                                                   android.app.IAlarmManager.Stub.Proxy

                                                                                                      /system/lib/libandroid_runtime.so




                                                                                                                                                                                                             references
                                                                                                                                                                                                                                                /system/lib/libandroid_servers.so
                                                                                                            /system/lib/libbinder.so



                                                                                                                                               uses (calls)
                                                                                                                                                                                                                                           com_android_server_AlarmManagerService.cpp

                                                                                                               /system/lib/lib*.so


                                                                                                        /system/bin/servicemanager                                                                                                              /system/lib/libandroid_runtime.so




                                                                                                                                                                                                                                                                                         uses (ioctl)
                                                                                                              service_manager.c                                                                                                                       /system/lib/libbinder.so
                                                                                                                                                                                                                          invokes
                                                                                      references




                                                                                                               /system/lib/lib*.so                                                                                                                       /system/lib/lib*.so



                                                                                                                      /dev/binder                                                                                                                            /dev/alarm
                                                                                                                                                              Kernel
                                                                                      registers as binder context manager
                                                                                                                                                                                                                                    gets a reference to the ServiceManager (handle=0)
Package Manager on Android
                                                                                                 com.android.packageinstaller                                                                                                     system_server
                                                                                              (/system/app/PackageInstaller.apk)
                                                                                                                                                                                                                                     DalvikVM
                                                                                                             DalvikVM
                                                                                                            classes.dex                                                                                                /system/framework/framework.jar
                                                                                                    .PackageInstallerActivity                                                                                         android.content.pm.IPackageManager.Stub
                                                     calls




                                                                                                        .InstallAppProgress




                                                                                                                                                                                                                                                                            extends
                                                                                                                                                    extends
                                                                                                                                                                                                                         /system/framework/services.jar
                                                                                               /system/framework/framework.jar
                                                    calls




                                                                                                                                                                                     creates
                                                                                             android.content.pm.PackageManager                                                                                          com.android.server.SystemServer

                                                                                             android.app.ApplicationPackageManager                                                                                    com.android.server.pm.PackageManagerService




                                                                                                                                                    calls




                                                                                                                                                                                                                                                                         calls
                                                         looks up "package" service via SM




                                                                                                                                                                             registers "package" service via SM
gets a reference to the ServiceManager (handle=0)




                                                                                             android.content.pm.IPackageManager.Stub.Proxy
                                                                                                                                                                                                                         com.android.server.pm.Installer

                                                                                                /system/lib/libandroid_runtime.so
                                                                                                                                                                                                                        /system/lib/libandroid_runtime.so




                                                                                                                                                                                       references
                                                                                                      /system/lib/libbinder.so



                                                                                                                                             uses (calls)
                                                                                                                                                                                                                              /system/lib/libbinder.so
                                                                                                         /system/lib/lib*.so




                                                                                                                                                                                                                                                                         send messages
                                                                                                                                                                                                                                 /system/lib/lib*.so




                                                                                                                                                               invokes transaction
                                                                                                   /system/bin/servicemanager

                                                                                                        service_manager.c                                                                                                              installd
                                                                                                                                                                                                                                      installd.c
                                                      references




                                                                                                         /system/lib/lib*.so
                                                                                                                                                                                                                                                          get messages


                                                                                                                 /dev/binder                                                                                                    /dev/socket/installd
                                                                                                                                                              Kernel
                                                     registers as binder context manager
                                                                                                                                                                                                                  gets a reference to the ServiceManager (handle=0)
WiFi Management on Android
                                                                                          com.example.app (/data/app/ExampleApp.apk)                                                                                                     system_server
                                                                                                                                                                                                                                            DalvikVM
                                                                                                           DalvikVM
                                                                                                                                                                                                                                /system/framework/framework.jar
                                                                                                          classes.dex
                                                                                                                                                                                                                                android.net.wifi.IWifiManager.Stub
                                                                                               com.example.app.ExampleActivity
                                                                                                                                                                                                                                android.net.wifi.WifiStateMachine




                                                                                                                                                                                                        calls
                                                    calls




                                                                                                /system/framework/framework.jar                                                                                                     android.net.wifi.WifiNative




                                                                                                                                                                                                                                                                                       extends
                                                                                                                                                                                          creates




                                                                                                                                                      calls
                                                                                                    android.net.wifi.WifiManager                                                                                                   /system/framework/services.jar




                                                                                                                                                                                                                                                                               calls
                                                                                                                                                                                                                                com.android.server.SystemServer
                                                                                            android.net.wifi.IWifiManager.Stub.Proxy




                                                                                                                                                                                                                                                                                                 calls/links to
gets a reference to the ServiceManager (handle=0)


                                                          looks up "wifi" service via SM




                                                                                                                                                                                                                                 com.android.server.WifiService




                                                                                                                                                         registers "wifi" service via SM
                                                                                                /system/lib/libandroid_runtime.so                                                                                               /system/lib/libandroid_servers.so
                                                                                                                                                                                                                                   android_net_wifi_Wifi.cpp




                                                                                                                                       uses (calls)
                                                                                                     /system/lib/libbinder.so




                                                                                                                                                                                                                                                                                       calls
                                                                                                                                                                                          references
                                                                                                                                                                                                                                /system/lib/libhardware_legacy.so
                                                                                                       /system/lib/lib*.so                                                                                                                    wifi.c




                                                                                                                                                                                                                                                                                                 calls
                                                                                                                                                                                                                                   /system/lib/libwpa_client.so
                                                                                                  /system/bin/servicemanager                                                                                                               wpa_ctrl.c




                                                                                                                                                                                                                                                                                               sends commands
                                                                                                      service_manager.c                                                                                                                /system/lib/lib*.so
                                                                                                                                                                                                  invokes
                                                    references




                                                                                                        /system/lib/lib*.so
                                                                                                                                                                                                                                        wpa_supplicant


                                                                                                              /dev/binder                                                                                                 bcmdhd               /dev/socket/wpa_wlan0
                                                                                                                                                                                      Kernel
                                                    registers as binder context manager
                                                                                                                                                                                                                calls (ioctl)                                       read commands
                                                                                                                                                                                                                as nl80211
Location on Android
                                                                                               com.example.app (/data/app/ExampleApp.apk)                                                                                         system_server

                                                                                                                DalvikVM                                                                                                            DalvikVM
                                                                                                                                                                                                                         /system/framework/framework.jar
                                                                                                               classes.dex
                                                                                                                                                                                                                              .LocationManager.Stub
                                                                                                    com.example.app.ExampleActivity




                                                                                                                                                                                                          creates




                                                                                                                                                                                                                                                                extends
                                                                                                                                                                                                                          /system/framework/services.jar
                                                    calls




                                                                                                     /system/framework/framework.jar                                                                                    com.android.server.SystemServer




                                                                                                                                               calls
                                                                                                    android.location.LocationManager                                                                                        .LocationManagerService




                                                                                                                                                                                                                                                             calls
                                                                                                                                                                                                                          .location.GpsLocationProvider




                                                                                                                                                           registers "location" service via SM
                                                          looks up "location" service via SM
gets a reference to the ServiceManager (handle=0)




                                                                                                       .LocationManager.Stub.Proxy




                                                                                                                                                                                                                                                             links to
                                                                                                                                                                                                                                                               calls
                                                                                                                                                                                                                         /system/lib/libandroid_servers.so
                                                                                                     /system/lib/libandroid_runtime.so                                                                                  _location_GpsLocationProvider.cpp




                                                                                                                                            uses (calls)



                                                                                                                                                                                                 references
                                                                                                          /system/lib/libbinder.so




                                                                                                                                                                                                                                                             loads
                                                                                                                                                                                                                                                              calls
                                                                                                                                                                                                                           /vendor/lib/hw/gps.omap4.so
                                                                                                            /system/lib/lib*.so                                                                                           impl of include/hardware/gps.h

                                                                                                                                                                                                                            /system/lib/libhardware.so
                                                                                                       /system/bin/servicemanager




                                                                                                                                                                                                                                                              uses (io)
                                                                                                                                                                                                                         /system/lib/libandroid_runtime.so
                                                                                                           service_manager.c                                                                                                  /system/lib/libbinder.so
                                                                                                                                                                                                              invokes
                                                    references




                                                                                                             /system/lib/lib*.so                                                                                                /system/lib/lib*.so



                                                                                                                   /dev/binder                                                                                                       /dev/ttyo0
                                                                                                                                                           Kernel
                                                    registers as binder context manager
Audio Policy on Android
                                                                                          com.example.app (/data/app/ExampleApp.apk)                                                                                                    system_server
                                                                                                                                                                                                                                          DalvikVM
                                                                                                            DalvikVM                                                                                                           /system/framework/framework.jar




                                                                                                                                                                                                                                                                                   extends
                                                                                                           classes.dex                                                                                                         android.media.IAudioService.Stub
                                                                                               com.example.app.ExampleActivity
                                                                                                                                                                                                                                   android.media.AudioService




                                                                                                                                                                                                                                                                                         calls
                                                     calls




                                                                                                                                                                                 creates
                                                                                                /system/framework/framework.jar                                                                                                    android.media.AudioSystem




                                                                                                                                                                                                                                                                                 links to/calls
                                                                                                 android.media.AudioManager                                                                                                     /system/framework/services.jar




                                                                                                                                                 calls
                                                                                                                                                                                                                               com.android.server.SystemServer
                                                                                              android.media.IAudioService.Stub.Proxy
                                                        looks up "audio" service via SM
gets a reference to the ServiceManager (handle=0)




                                                                                                                                                                                                                               /system/lib/libandroid_runtime.so




                                                                                                                                                                 registers "audio" service via SM
                                                                                                                                                                                                                               android_media_AudioSystem.cpp




                                                                                                                                                                                                                                                                                 calls
                                                                                                /system/lib/libandroid_runtime.so
                                                                                                                                                                                                                                    /system/lib/libmedia.so
                                                                                                                                                                                                                                     android.AudioSystem




                                                                                                                                                                                                                                                                                         calls
                                                                                                     /system/lib/libbinder.so                                                                                                    android.BpAudioPolicyService



                                                                                                                                                  uses (calls)
                                                                                                        /system/lib/lib*.so




                                                                                                                                                                                                    references
                                                                                                                                                                                                                                         mediaserver




                                                                                                                                                                                                                                                                                 calls
                                                                                                                                                                                                                                                                            extends
                                                                                                                                                                                                                                    /system/lib/libmedia.so
                                                                                                                                                                                                                                 android.BnAudioPolicyService
                                                                                                   /system/bin/servicemanager                                                                                                     /system/lib/libaudioflinger.so
                                                                                                                                                                                                                                   android.AudioPolicyService




                                                                                                                                                                                                                                                                                                  calls
                                                                                                       service_manager.c
                                                                                                                                                                                                                 invokes     /system/lib/hw/audio_policy.default.so
                                                                                                                                                                                                                           android_audio_legacy.AudioPolicyManagerDefault




                                                                                                                                                                                                                                                                                 calls
                                                                                                        /system/lib/lib*.so
                                                                                                                                                                                                                              /system/lib/hw/audio.primary.tuna.so
                                                                                                                                                                                                                                           audio_hw.c




                                                                                                                                                                                                                                                                                 uses (ioctl) calls
                                                                         references                                           looks up "media.audio_policy"
                                                                                                                                                                                                                                    /system/lib/libtinyalsa.so
                                                    registers as binder context manager                                                                                                                                                      mixer.c


                                                                                                               /dev/binder                                                                                                         /dev/snd/controlC0 (ALSA)
                                                                                                                                                                       Kernel
Audio Playback on Android
com.ex.app (/data/app/ExampleApp.apk)                                           mediaserver
               DalvikVM                                                                  /system/lib/libmediaplayerservice.so
                                               /system/lib/libmedia.so
              classes.dex
                                          android.BnMediaPlayerService                        android.MediaPlayerService
     com.ex.app.ExampleActivity
                                              android.BnMediaPlayer                       android.MediaPlayerService.Client
   /system/framework/framework.jar         .AudioTrack      .AudioSystem                       android.StagefrightPlayer
     android.media.MediaPlayer
                                                                                          .MediaPlayerService.AudioOutput
                                             /system/lib/libstagefright.so

      /system/lib/libmedia_jni.so        .AwesomePlayer          .AudioPlayer         /system/lib/libstagefright_soft_mp3dec.so
   android_media_MediaPlayer.cpp          .MediaSource           .MP3Source                         android.SoftMP3
                                           .OMXCodec          .MP3Extractor
       /system/lib/libmedia.so                                                                /system/lib/libaudioflinger.so
       android.BpMediaPlayer                                                            .AudioFlinger       .AudioPolicyService

    android.BpMediaPlayerService
                                         /system/lib/hw/audio.primary.tuna.so            /system/lib/              /system/lib/
                                                    audio_hw.c                       libstagefrighthw.so        libOMX_Core.so
          /system/lib/lib*.so
                                                                                      android.TIOMXPlugin           OMX_Core.c

                                               /system/lib/libtinyalsa.so               /system/lib/hw/audio_policy.default.so
     /system/bin/servicemanager
         service_manager.c                               pcm.c                        android_audio_legacy.AudioPolicyManagerDefault

          /system/lib/lib*.so




              /dev/binder                   /dev/snd/pcmC0D0p (ALSA)                          /dev/snd/controlC0 (ALSA)
                                                          Kernel
Telephony on Android
                       PhoneApp                                                                          system_server
                (/system/app/Phone.apk)
                                                                                                        DalvikVM
                          DalvikVM                                                           /system/framework/framework.jar
                          classes.dex                                                           android.media.AudioService
                                                                               uses
                      CallController


                      CallController


                          PhoneUtils

calls       /system/framework/framework.jar


        com.android.internal.telephony.CallManager
                                                          calls
             android.media.AudioManager

           com.android.internal.telephony.Phone
calls
                          implements                                                                           rild
        com.android.internal.telephony.gsm.GSMPhone
                                                                                                              rild.c




                                                                                                                                        calls
                    GsmCallTracker
                                                            Socket messages




                                                                                                       /system/lib/libril.so
                                                                                loads



                             RIL




                                                                                                                                        uses
                                                                                                /system/lib/libsecril-client.so
          RILSender                      RILReceiver
                                                                                                     /vendor/lib/libsec-ril.so

        Socket messages                 Socket messages                                               uses


                   /dev/socket/rild                                                     /dev/ttys0                      Audio drivers
                                                                              Kernel
DevicePolicy on Android
                                                                                                     com.example.enterpriseapp                                                                                                                            system_server
                                                                                                   (/data/app/EnterpriseApp.apk)
                                                                                                                                                                                                                                                          DalvikVM
                                                                                                               DalvikVM
                                                                                                                                                                                                                                               /system/framework/framework.jar
                                                                                                              classes.dex
                                                                                                                                                                                                                                              android.app.admin.DevicePolicyManager.Stub
                                                                                                           .ExampleActivity
                                                       calls




                                                                                                                                                                                                                                                  android.os.RecoverySystem




                                                                                                                                                                                                                                                                                                   calls
                                                                                                                                                                                                                                                                                                  calls
                                                                                                                                                                                                                                                   android.os.PowerManager




                                                                                                                                                                                                                                                                                                                  extends
                                                                                                 /system/framework/framework.jar




                                                                                                                                                                                  calls
                                                                                                                                                                                                                                              com.android.internal.app.ShutdownThread
                                                                                               android.app.admin.DevicePolicyManager
                                                                                                                                                                                                                                                        android.os.Power
                                                    looks up "device_policy" service via SM




                                                                                                                                                   calls




                                                                                                                                                                                                                                                                                                calls
                                                                                                                                                                registers "device_policy" service via SM

                                                                                                                                                                                                                 creates




                                                                                                                                                                                                                                                                                             calls
                                                                                                                                                                                                                                                /system/framework/services.jar
gets a reference to the ServiceManager (handle=0)




                                                                                              android.app.admin.DevicePolicyManager.Stub.Proxy
                                                                                                                                                                                                                                               com.android.server.SystemServer
                                                                                                                                                                                                                                             com.android.server.DevicePolicyManagerService
                                                                                                 /system/lib/libandroid_runtime.so
                                                                                                                                                                                                                                              com.android.server.PowerManagerService
                                                                                                       /system/lib/libbinder.so




                                                                                                                                                                                                                                                                                              links to/calls
                                                                                                                                                                                                                       references
                                                                                                          /system/lib/lib*.so                                                                                                                  /system/lib/libandroid_runtime.so

                                                                                                                                                 uses (calls)



                                                                                                                                                                                                           invokes transaction
                                                                                                                                                                                                                                                     android_os_Power.cpp




                                                                                                                                                                                                                                    reboot
                                                                                                    /system/bin/servicemanager                                                                                                                          /system/lib/lib*.so

                                                                                                         service_manager.c                                                                                                                                   recovery




                                                                                                                                                                                                                                                                                                               writes
                                                                     references




                                                                                                                                                                                                                                                                                                  reads
                                                                                                           /system/lib/lib*.so                                                                                                                               recovery.c



                                                                                                                                                                                                                                                   /cache/recovery/command
                                                                                                                   /dev/binder
                                                                                                                                                                /dev/block/platform/omap/omap_hsmmc.0/by-name/userdata                                                                        erases
                                                                                                                                                                 Kernel                                                                                                                      formats
                                                                   registers as binder context manager
                                                                                                                                                                                                                                    gets a reference to the ServiceManager (handle=0)
Thank You




For the complete screencast of this presentation go to
                http://mrkn.co/munz7




                @agargenta on Twitter
        aleksandar.gargenta@gmail.com on G+

Mais conteúdo relacionado

Mais procurados

Practical Malware Analysis Ch13
Practical Malware Analysis Ch13Practical Malware Analysis Ch13
Practical Malware Analysis Ch13Sam Bowne
 
Marakana Android Internals
Marakana Android InternalsMarakana Android Internals
Marakana Android InternalsMarko Gargenta
 
DMA Survival Guide
DMA Survival GuideDMA Survival Guide
DMA Survival GuideKernel TLV
 
Android power management
Android power managementAndroid power management
Android power managementJerrin George
 
Berkeley Packet Filters
Berkeley Packet FiltersBerkeley Packet Filters
Berkeley Packet FiltersKernel TLV
 
Android Boot Time Optimization
Android Boot Time OptimizationAndroid Boot Time Optimization
Android Boot Time OptimizationKan-Ru Chen
 
Credenz'18 MELA Finals PPT
Credenz'18 MELA Finals PPT Credenz'18 MELA Finals PPT
Credenz'18 MELA Finals PPT Hemang Pandit
 
OPTEE on QEMU - Build Tutorial
OPTEE on QEMU - Build TutorialOPTEE on QEMU - Build Tutorial
OPTEE on QEMU - Build TutorialDalton Valadares
 
Intel® QuickAssist Technology Introduction, Applications, and Lab, Including ...
Intel® QuickAssist Technology Introduction, Applications, and Lab, Including ...Intel® QuickAssist Technology Introduction, Applications, and Lab, Including ...
Intel® QuickAssist Technology Introduction, Applications, and Lab, Including ...Michelle Holley
 
Experience with jemalloc
Experience with jemallocExperience with jemalloc
Experience with jemallocKit Chan
 
Android crash debugging
Android crash debuggingAndroid crash debugging
Android crash debuggingAshish Agrawal
 
MacOS forensics and anti-forensics (DC Lviv 2019) presentation
MacOS forensics and anti-forensics (DC Lviv 2019) presentationMacOS forensics and anti-forensics (DC Lviv 2019) presentation
MacOS forensics and anti-forensics (DC Lviv 2019) presentationOlehLevytskyi1
 
Reducing the boot time of Linux devices
Reducing the boot time of Linux devicesReducing the boot time of Linux devices
Reducing the boot time of Linux devicesChris Simmonds
 
LAS16-504: Secure Storage updates in OP-TEE
LAS16-504: Secure Storage updates in OP-TEELAS16-504: Secure Storage updates in OP-TEE
LAS16-504: Secure Storage updates in OP-TEELinaro
 

Mais procurados (20)

Practical Malware Analysis Ch13
Practical Malware Analysis Ch13Practical Malware Analysis Ch13
Practical Malware Analysis Ch13
 
Linux IO
Linux IOLinux IO
Linux IO
 
Android Task Hijacking
Android Task HijackingAndroid Task Hijacking
Android Task Hijacking
 
Marakana Android Internals
Marakana Android InternalsMarakana Android Internals
Marakana Android Internals
 
DMA Survival Guide
DMA Survival GuideDMA Survival Guide
DMA Survival Guide
 
Android power management
Android power managementAndroid power management
Android power management
 
Berkeley Packet Filters
Berkeley Packet FiltersBerkeley Packet Filters
Berkeley Packet Filters
 
iOS jailbreaking
iOS jailbreakingiOS jailbreaking
iOS jailbreaking
 
Android Boot Time Optimization
Android Boot Time OptimizationAndroid Boot Time Optimization
Android Boot Time Optimization
 
Credenz'18 MELA Finals PPT
Credenz'18 MELA Finals PPT Credenz'18 MELA Finals PPT
Credenz'18 MELA Finals PPT
 
Literary Quiz
Literary QuizLiterary Quiz
Literary Quiz
 
OPTEE on QEMU - Build Tutorial
OPTEE on QEMU - Build TutorialOPTEE on QEMU - Build Tutorial
OPTEE on QEMU - Build Tutorial
 
Intel® QuickAssist Technology Introduction, Applications, and Lab, Including ...
Intel® QuickAssist Technology Introduction, Applications, and Lab, Including ...Intel® QuickAssist Technology Introduction, Applications, and Lab, Including ...
Intel® QuickAssist Technology Introduction, Applications, and Lab, Including ...
 
Experience with jemalloc
Experience with jemallocExperience with jemalloc
Experience with jemalloc
 
Android presentation
Android presentationAndroid presentation
Android presentation
 
Android crash debugging
Android crash debuggingAndroid crash debugging
Android crash debugging
 
MacOS forensics and anti-forensics (DC Lviv 2019) presentation
MacOS forensics and anti-forensics (DC Lviv 2019) presentationMacOS forensics and anti-forensics (DC Lviv 2019) presentation
MacOS forensics and anti-forensics (DC Lviv 2019) presentation
 
Reducing the boot time of Linux devices
Reducing the boot time of Linux devicesReducing the boot time of Linux devices
Reducing the boot time of Linux devices
 
LAS16-504: Secure Storage updates in OP-TEE
LAS16-504: Secure Storage updates in OP-TEELAS16-504: Secure Storage updates in OP-TEE
LAS16-504: Secure Storage updates in OP-TEE
 
Recon
ReconRecon
Recon
 

Destaque

Permission enforcement s in android new (1)
Permission   enforcement s  in android new (1)Permission   enforcement s  in android new (1)
Permission enforcement s in android new (1)Siddhartha Kakarla
 
Android. behind the scenes_programatica 2012
Android. behind the scenes_programatica 2012Android. behind the scenes_programatica 2012
Android. behind the scenes_programatica 2012Agora Group
 
Hierarchy Viewer Internals
Hierarchy Viewer InternalsHierarchy Viewer Internals
Hierarchy Viewer InternalsKyungmin Lee
 
Debugging webOS applications
Debugging webOS applicationsDebugging webOS applications
Debugging webOS applicationsfpatton
 
Internals - Exploring the webOS Browser and JavaScript
Internals - Exploring the webOS Browser and JavaScriptInternals - Exploring the webOS Browser and JavaScript
Internals - Exploring the webOS Browser and JavaScriptfpatton
 
Capable Web: Chrome Apps and Firefox Webapp
Capable Web: Chrome Apps and Firefox WebappCapable Web: Chrome Apps and Firefox Webapp
Capable Web: Chrome Apps and Firefox WebappFred Lin
 
Automated Historical Performance Analysis with kmemtracer
Automated Historical Performance Analysis with kmemtracerAutomated Historical Performance Analysis with kmemtracer
Automated Historical Performance Analysis with kmemtracerKyungmin Lee
 
Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven DevelopmentMarakana Inc.
 
Introducing chrome apps (ogura)
Introducing chrome apps (ogura)Introducing chrome apps (ogura)
Introducing chrome apps (ogura)Kazuhiro Ogura
 
Introduction To Google Chrome Os
Introduction To Google Chrome OsIntroduction To Google Chrome Os
Introduction To Google Chrome OsSaurabh Jinturkar
 
Google Chrome Extensions
Google Chrome ExtensionsGoogle Chrome Extensions
Google Chrome ExtensionsSamantha Morra
 
Android security in depth
Android security in depthAndroid security in depth
Android security in depthSander Alberink
 
Intro To webOS
Intro To webOSIntro To webOS
Intro To webOSfpatton
 
TEDx Manchester: AI & The Future of Work
TEDx Manchester: AI & The Future of WorkTEDx Manchester: AI & The Future of Work
TEDx Manchester: AI & The Future of WorkVolker Hirsch
 

Destaque (20)

Permission enforcement s in android new (1)
Permission   enforcement s  in android new (1)Permission   enforcement s  in android new (1)
Permission enforcement s in android new (1)
 
JRuby at Square
JRuby at SquareJRuby at Square
JRuby at Square
 
Android. behind the scenes_programatica 2012
Android. behind the scenes_programatica 2012Android. behind the scenes_programatica 2012
Android. behind the scenes_programatica 2012
 
Hierarchy Viewer Internals
Hierarchy Viewer InternalsHierarchy Viewer Internals
Hierarchy Viewer Internals
 
Debugging webOS applications
Debugging webOS applicationsDebugging webOS applications
Debugging webOS applications
 
Internals - Exploring the webOS Browser and JavaScript
Internals - Exploring the webOS Browser and JavaScriptInternals - Exploring the webOS Browser and JavaScript
Internals - Exploring the webOS Browser and JavaScript
 
Capable Web: Chrome Apps and Firefox Webapp
Capable Web: Chrome Apps and Firefox WebappCapable Web: Chrome Apps and Firefox Webapp
Capable Web: Chrome Apps and Firefox Webapp
 
Automated Historical Performance Analysis with kmemtracer
Automated Historical Performance Analysis with kmemtracerAutomated Historical Performance Analysis with kmemtracer
Automated Historical Performance Analysis with kmemtracer
 
Palm WebOS Overview
Palm WebOS OverviewPalm WebOS Overview
Palm WebOS Overview
 
What is a shell script
What is a shell scriptWhat is a shell script
What is a shell script
 
Chrome extensions
Chrome extensionsChrome extensions
Chrome extensions
 
Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven Development
 
Introducing chrome apps (ogura)
Introducing chrome apps (ogura)Introducing chrome apps (ogura)
Introducing chrome apps (ogura)
 
Introduction To Google Chrome Os
Introduction To Google Chrome OsIntroduction To Google Chrome Os
Introduction To Google Chrome Os
 
Google Chrome Extensions
Google Chrome ExtensionsGoogle Chrome Extensions
Google Chrome Extensions
 
Web o sppt
Web o spptWeb o sppt
Web o sppt
 
Android security in depth
Android security in depthAndroid security in depth
Android security in depth
 
Intro To webOS
Intro To webOSIntro To webOS
Intro To webOS
 
Android Audio System
Android Audio SystemAndroid Audio System
Android Audio System
 
TEDx Manchester: AI & The Future of Work
TEDx Manchester: AI & The Future of WorkTEDx Manchester: AI & The Future of Work
TEDx Manchester: AI & The Future of Work
 

Semelhante a Android Services Black Magic by Aleksandar Gargenta

Deep Dive Into Android Security
Deep Dive Into Android SecurityDeep Dive Into Android Security
Deep Dive Into Android SecurityMarakana Inc.
 
Java one brazil_keynote_dochez
Java one brazil_keynote_dochezJava one brazil_keynote_dochez
Java one brazil_keynote_dochezJerome Dochez
 
vFabric - Ideal Platform for SaaS Apps
vFabric - Ideal Platform for SaaS AppsvFabric - Ideal Platform for SaaS Apps
vFabric - Ideal Platform for SaaS AppsVMware vFabric
 
Wakanda - apps.berlin.js - 2012-11-29
Wakanda - apps.berlin.js - 2012-11-29Wakanda - apps.berlin.js - 2012-11-29
Wakanda - apps.berlin.js - 2012-11-29Alexandre Morgaut
 
Android Introduction
Android IntroductionAndroid Introduction
Android Introductionaswapnal
 
Rails in the bowels
Rails in the bowelsRails in the bowels
Rails in the bowelsCreditas
 
SPEC INDIA Java Case Study
SPEC INDIA Java Case StudySPEC INDIA Java Case Study
SPEC INDIA Java Case StudySPEC INDIA
 
Eclipse & die Microsoft cloud
Eclipse & die Microsoft cloudEclipse & die Microsoft cloud
Eclipse & die Microsoft cloudPatric Boscolo
 
Java EE7: Developing for the Cloud
Java EE7: Developing for the CloudJava EE7: Developing for the Cloud
Java EE7: Developing for the CloudDmitry Buzdin
 
Polysource-IT Profile
Polysource-IT ProfilePolysource-IT Profile
Polysource-IT ProfileHelen
 
Polysource-IT Profile
Polysource-IT ProfilePolysource-IT Profile
Polysource-IT ProfileHelen
 
Dev ops for cross platform mobile modeveast 12
Dev ops for cross platform mobile   modeveast 12Dev ops for cross platform mobile   modeveast 12
Dev ops for cross platform mobile modeveast 12Sanjeev Sharma
 
Modern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScriptModern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScriptmartinlippert
 
Amdatu - ApacheCon NA 2011
Amdatu - ApacheCon NA 2011Amdatu - ApacheCon NA 2011
Amdatu - ApacheCon NA 2011Bram de Kruijff
 
Classloader leak detection in websphere application server
Classloader leak detection in websphere application serverClassloader leak detection in websphere application server
Classloader leak detection in websphere application serverRohit Kelapure
 
Polysource It Profile
Polysource It ProfilePolysource It Profile
Polysource It Profileelenarys
 
Poly Source It Profile
Poly Source It ProfilePoly Source It Profile
Poly Source It Profilemoseskhedi
 

Semelhante a Android Services Black Magic by Aleksandar Gargenta (20)

Deep Dive Into Android Security
Deep Dive Into Android SecurityDeep Dive Into Android Security
Deep Dive Into Android Security
 
Java one brazil_keynote_dochez
Java one brazil_keynote_dochezJava one brazil_keynote_dochez
Java one brazil_keynote_dochez
 
vFabric - Ideal Platform for SaaS Apps
vFabric - Ideal Platform for SaaS AppsvFabric - Ideal Platform for SaaS Apps
vFabric - Ideal Platform for SaaS Apps
 
V fabric overview
V fabric overviewV fabric overview
V fabric overview
 
T04f
T04fT04f
T04f
 
Wakanda - apps.berlin.js - 2012-11-29
Wakanda - apps.berlin.js - 2012-11-29Wakanda - apps.berlin.js - 2012-11-29
Wakanda - apps.berlin.js - 2012-11-29
 
Android Introduction
Android IntroductionAndroid Introduction
Android Introduction
 
Rails in the bowels
Rails in the bowelsRails in the bowels
Rails in the bowels
 
SPEC INDIA Java Case Study
SPEC INDIA Java Case StudySPEC INDIA Java Case Study
SPEC INDIA Java Case Study
 
Core Android
Core AndroidCore Android
Core Android
 
Eclipse & die Microsoft cloud
Eclipse & die Microsoft cloudEclipse & die Microsoft cloud
Eclipse & die Microsoft cloud
 
Java EE7: Developing for the Cloud
Java EE7: Developing for the CloudJava EE7: Developing for the Cloud
Java EE7: Developing for the Cloud
 
Polysource-IT Profile
Polysource-IT ProfilePolysource-IT Profile
Polysource-IT Profile
 
Polysource-IT Profile
Polysource-IT ProfilePolysource-IT Profile
Polysource-IT Profile
 
Dev ops for cross platform mobile modeveast 12
Dev ops for cross platform mobile   modeveast 12Dev ops for cross platform mobile   modeveast 12
Dev ops for cross platform mobile modeveast 12
 
Modern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScriptModern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScript
 
Amdatu - ApacheCon NA 2011
Amdatu - ApacheCon NA 2011Amdatu - ApacheCon NA 2011
Amdatu - ApacheCon NA 2011
 
Classloader leak detection in websphere application server
Classloader leak detection in websphere application serverClassloader leak detection in websphere application server
Classloader leak detection in websphere application server
 
Polysource It Profile
Polysource It ProfilePolysource It Profile
Polysource It Profile
 
Poly Source It Profile
Poly Source It ProfilePoly Source It Profile
Poly Source It Profile
 

Mais de Marakana Inc.

Martin Odersky: What's next for Scala
Martin Odersky: What's next for ScalaMartin Odersky: What's next for Scala
Martin Odersky: What's next for ScalaMarakana Inc.
 
Why Java Needs Hierarchical Data
Why Java Needs Hierarchical DataWhy Java Needs Hierarchical Data
Why Java Needs Hierarchical DataMarakana Inc.
 
Pictures from "Learn about RenderScript" meetup at SF Android User Group
Pictures from "Learn about RenderScript" meetup at SF Android User GroupPictures from "Learn about RenderScript" meetup at SF Android User Group
Pictures from "Learn about RenderScript" meetup at SF Android User GroupMarakana Inc.
 
Android UI Tips, Tricks and Techniques
Android UI Tips, Tricks and TechniquesAndroid UI Tips, Tricks and Techniques
Android UI Tips, Tricks and TechniquesMarakana Inc.
 
2010 07-18.wa.rails tdd-6
2010 07-18.wa.rails tdd-62010 07-18.wa.rails tdd-6
2010 07-18.wa.rails tdd-6Marakana Inc.
 
Efficient Rails Test-Driven Development - Week 6
Efficient Rails Test-Driven Development - Week 6Efficient Rails Test-Driven Development - Week 6
Efficient Rails Test-Driven Development - Week 6Marakana Inc.
 
Graphicsand animations devoxx2010 (1)
Graphicsand animations devoxx2010 (1)Graphicsand animations devoxx2010 (1)
Graphicsand animations devoxx2010 (1)Marakana Inc.
 
What's this jQuery? Where it came from, and how it will drive innovation
What's this jQuery? Where it came from, and how it will drive innovationWhat's this jQuery? Where it came from, and how it will drive innovation
What's this jQuery? Where it came from, and how it will drive innovationMarakana Inc.
 
jQuery State of the Union - Yehuda Katz
jQuery State of the Union - Yehuda KatzjQuery State of the Union - Yehuda Katz
jQuery State of the Union - Yehuda KatzMarakana Inc.
 
Pics from: "James Gosling on Apple, Apache, Google, Oracle and the Future of ...
Pics from: "James Gosling on Apple, Apache, Google, Oracle and the Future of ...Pics from: "James Gosling on Apple, Apache, Google, Oracle and the Future of ...
Pics from: "James Gosling on Apple, Apache, Google, Oracle and the Future of ...Marakana Inc.
 
Efficient Rails Test Driven Development (class 4) by Wolfram Arnold
Efficient Rails Test Driven Development (class 4) by Wolfram ArnoldEfficient Rails Test Driven Development (class 4) by Wolfram Arnold
Efficient Rails Test Driven Development (class 4) by Wolfram ArnoldMarakana Inc.
 
Efficient Rails Test Driven Development (class 3) by Wolfram Arnold
Efficient Rails Test Driven Development (class 3) by Wolfram ArnoldEfficient Rails Test Driven Development (class 3) by Wolfram Arnold
Efficient Rails Test Driven Development (class 3) by Wolfram ArnoldMarakana Inc.
 
Learn about JRuby Internals from one of the JRuby Lead Developers, Thomas Enebo
Learn about JRuby Internals from one of the JRuby Lead Developers, Thomas EneboLearn about JRuby Internals from one of the JRuby Lead Developers, Thomas Enebo
Learn about JRuby Internals from one of the JRuby Lead Developers, Thomas EneboMarakana Inc.
 
Replacing Java Incrementally
Replacing Java IncrementallyReplacing Java Incrementally
Replacing Java IncrementallyMarakana Inc.
 
Learn to Build like you Code with Apache Buildr
Learn to Build like you Code with Apache BuildrLearn to Build like you Code with Apache Buildr
Learn to Build like you Code with Apache BuildrMarakana Inc.
 
Learn How to Unit Test Your Android Application (with Robolectric)
Learn How to Unit Test Your Android Application (with Robolectric)Learn How to Unit Test Your Android Application (with Robolectric)
Learn How to Unit Test Your Android Application (with Robolectric)Marakana Inc.
 
Learn Learn how to build your mobile back-end with MongoDB
Learn Learn how to build your mobile back-end with MongoDBLearn Learn how to build your mobile back-end with MongoDB
Learn Learn how to build your mobile back-end with MongoDBMarakana Inc.
 
A hands on overview of the semantic web
A hands on overview of the semantic webA hands on overview of the semantic web
A hands on overview of the semantic webMarakana Inc.
 

Mais de Marakana Inc. (20)

Martin Odersky: What's next for Scala
Martin Odersky: What's next for ScalaMartin Odersky: What's next for Scala
Martin Odersky: What's next for Scala
 
Why Java Needs Hierarchical Data
Why Java Needs Hierarchical DataWhy Java Needs Hierarchical Data
Why Java Needs Hierarchical Data
 
Securing Android
Securing AndroidSecuring Android
Securing Android
 
Pictures from "Learn about RenderScript" meetup at SF Android User Group
Pictures from "Learn about RenderScript" meetup at SF Android User GroupPictures from "Learn about RenderScript" meetup at SF Android User Group
Pictures from "Learn about RenderScript" meetup at SF Android User Group
 
Android UI Tips, Tricks and Techniques
Android UI Tips, Tricks and TechniquesAndroid UI Tips, Tricks and Techniques
Android UI Tips, Tricks and Techniques
 
2010 07-18.wa.rails tdd-6
2010 07-18.wa.rails tdd-62010 07-18.wa.rails tdd-6
2010 07-18.wa.rails tdd-6
 
Efficient Rails Test-Driven Development - Week 6
Efficient Rails Test-Driven Development - Week 6Efficient Rails Test-Driven Development - Week 6
Efficient Rails Test-Driven Development - Week 6
 
Graphicsand animations devoxx2010 (1)
Graphicsand animations devoxx2010 (1)Graphicsand animations devoxx2010 (1)
Graphicsand animations devoxx2010 (1)
 
What's this jQuery? Where it came from, and how it will drive innovation
What's this jQuery? Where it came from, and how it will drive innovationWhat's this jQuery? Where it came from, and how it will drive innovation
What's this jQuery? Where it came from, and how it will drive innovation
 
jQuery State of the Union - Yehuda Katz
jQuery State of the Union - Yehuda KatzjQuery State of the Union - Yehuda Katz
jQuery State of the Union - Yehuda Katz
 
Pics from: "James Gosling on Apple, Apache, Google, Oracle and the Future of ...
Pics from: "James Gosling on Apple, Apache, Google, Oracle and the Future of ...Pics from: "James Gosling on Apple, Apache, Google, Oracle and the Future of ...
Pics from: "James Gosling on Apple, Apache, Google, Oracle and the Future of ...
 
Efficient Rails Test Driven Development (class 4) by Wolfram Arnold
Efficient Rails Test Driven Development (class 4) by Wolfram ArnoldEfficient Rails Test Driven Development (class 4) by Wolfram Arnold
Efficient Rails Test Driven Development (class 4) by Wolfram Arnold
 
Efficient Rails Test Driven Development (class 3) by Wolfram Arnold
Efficient Rails Test Driven Development (class 3) by Wolfram ArnoldEfficient Rails Test Driven Development (class 3) by Wolfram Arnold
Efficient Rails Test Driven Development (class 3) by Wolfram Arnold
 
Learn about JRuby Internals from one of the JRuby Lead Developers, Thomas Enebo
Learn about JRuby Internals from one of the JRuby Lead Developers, Thomas EneboLearn about JRuby Internals from one of the JRuby Lead Developers, Thomas Enebo
Learn about JRuby Internals from one of the JRuby Lead Developers, Thomas Enebo
 
Replacing Java Incrementally
Replacing Java IncrementallyReplacing Java Incrementally
Replacing Java Incrementally
 
Learn to Build like you Code with Apache Buildr
Learn to Build like you Code with Apache BuildrLearn to Build like you Code with Apache Buildr
Learn to Build like you Code with Apache Buildr
 
Learn How to Unit Test Your Android Application (with Robolectric)
Learn How to Unit Test Your Android Application (with Robolectric)Learn How to Unit Test Your Android Application (with Robolectric)
Learn How to Unit Test Your Android Application (with Robolectric)
 
Learn Learn how to build your mobile back-end with MongoDB
Learn Learn how to build your mobile back-end with MongoDBLearn Learn how to build your mobile back-end with MongoDB
Learn Learn how to build your mobile back-end with MongoDB
 
A hands on overview of the semantic web
A hands on overview of the semantic webA hands on overview of the semantic web
A hands on overview of the semantic web
 
Jena framework
Jena frameworkJena framework
Jena framework
 

Último

4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptxDhatriParmar
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptxmary850239
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxMichelleTuguinay1
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxkarenfajardo43
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Association for Project Management
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDhatriParmar
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfPrerana Jadhav
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 

Último (20)

4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx
 
prashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Professionprashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Profession
 
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of EngineeringFaculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdf
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 

Android Services Black Magic by Aleksandar Gargenta

  • 1. Android Services Black Magic by Aleksandar (Saša) Gargenta, Marakana Inc. Android Builders Summit February 14th, 2012 Redwood Shores, CA Screencast @ http://mrkn.co/munz7
  • 2. About Aleksandar (Saša) Gargenta • Developer and instructor of Android Internals and Security training at Marakana • Founder and co-organizer of San Francisco Android User Group (sfandroid.org) • Founder and co-organizer of San Francisco Java User Group (sfjava.org) • Co-founder and co-organizer of San Francisco HTML5 User Group (sfhtml5.org) • Speaker at AnDevCon, AndroidOpen, Android Builders Summit, etc. • Server-side Java and Linux, since 1997 • Android/embedded Java and Linux, since 2009 • Worked on SMS, WAP Push, MMS, OTA provisioning in previous life • @agargenta on Twitter • aleksandar.gargenta@gmail.com on Google+ Marakana - Helping people get better at what they do • Training on cutting edge open source software (like Android!) • Rockstar team of experts, on staff • Content is king • http://marakana.com/
  • 3. Android Stack Applications Content Home Contacts Phone Browser Providers Application Framework Activity Window Vibrator WiFi Battery Service Service Service Service Service Package Telephony Resource Location Notification Service Service Manager Service Service Native Layer Surface Media Android Runtime SQLite SSL Flinger Framework Core Libs OpenGL vold netd WebKit Dalvik libwifi libcamera libgps libc VM Display Camera Linux Kernel GPS Binder Driver Driver Driver Driver Keypad WiFi Audio Power Driver Driver Driver Mgmt
  • 4. Vibrator on Android com.example.app (/data/app/ExampleApp.apk) system_server DalvikVM DalvikVM classes.dex /system/framework/framework.jar com.example.app.ExampleActivity android.os.IVibratorService.Stub extends calls /system/framework/framework.jar /system/framework/services.jar registers "vibrator" service via ServiceManager android.os.Vibrator com.android.server.SystemServer creates calls android.os.IVibratorService.Stub.Proxy com.android.server.VibratorService looks up "vibrator" service via SM calls/links to gets a reference to the ServiceManager (handle=0) /system/lib/libandroid_servers.so /system/lib/libandroid_runtime.so references uses (calls) com_android_server_VibratorService.cpp /system/lib/libbinder.so calls /system/lib/lib*.so /system/lib/libhardware_legacy.so vibrator.c invokes transaction uses (io write) /system/bin/servicemanager /system/lib/libandroid_runtime.so service_manager.c /system/lib/libbinder.so references /system/lib/lib*.so /system/lib/lib*.so /dev/binder /sys/class/timed_output/vibrator/enable Kernel registers as binder context manager gets a reference to the ServiceManager (handle=0)
  • 5. Power on Android com.example.app (/data/app/ExampleApp.apk) system_server DalvikVM DalvikVM /system/framework/framework.jar classes.dex android.os.IPowerManager.Stub com.example.app.ExampleActivity android.os.Power calls calls /system/framework/framework.jar /system/framework/services.jar extends creates registers "power" service via ServiceManager android.os.PowerManager com.android.server.SystemServer creates android.os.PowerManager.WakeLock com.android.server.PowerManagerService looks up "power" service via SM calls/links to gets a reference to the ServiceManager (handle=0) android.os.IPowerManager.Stub.Proxy calls /system/lib/libandroid_runtime.so /system/lib/libandroid_runtime.so references android_os_Power.cpp /system/lib/libbinder.so calls /system/lib/lib*.so /system/lib/libhardware_legacy.so uses (calls) power.c uses (io write) /system/bin/servicemanager /system/lib/libandroid_runtime.so service_manager.c /system/lib/libbinder.so invokes references /system/lib/lib*.so /system/lib/lib*.so /dev/binder /sys/power/wake_lock Kernel registers as binder context manager gets a reference to the ServiceManager (handle=0)
  • 6. Alarm on Android com.android.deskclock system_server (/system/app/DeskClock.apk) DalvikVM DalvikVM /system/framework/framework.jar classes.dex android.app.IAlarmManager.Stub calls com.android.deskclock.AlarmClock com.android.deskclock.Alarms extends /system/framework/services.jar uses calls /system/framework/framework.jar registers "alarm" service via ServiceManager com.android.server.SystemServer creates android.app.ContextImpl android.app.AlarmManager .AlarmManagerService looks up "alarm" service via SM calls calls/links to gets a reference to the ServiceManager (handle=0) android.app.IAlarmManager.Stub.Proxy /system/lib/libandroid_runtime.so references /system/lib/libandroid_servers.so /system/lib/libbinder.so uses (calls) com_android_server_AlarmManagerService.cpp /system/lib/lib*.so /system/bin/servicemanager /system/lib/libandroid_runtime.so uses (ioctl) service_manager.c /system/lib/libbinder.so invokes references /system/lib/lib*.so /system/lib/lib*.so /dev/binder /dev/alarm Kernel registers as binder context manager gets a reference to the ServiceManager (handle=0)
  • 7. Package Manager on Android com.android.packageinstaller system_server (/system/app/PackageInstaller.apk) DalvikVM DalvikVM classes.dex /system/framework/framework.jar .PackageInstallerActivity android.content.pm.IPackageManager.Stub calls .InstallAppProgress extends extends /system/framework/services.jar /system/framework/framework.jar calls creates android.content.pm.PackageManager com.android.server.SystemServer android.app.ApplicationPackageManager com.android.server.pm.PackageManagerService calls calls looks up "package" service via SM registers "package" service via SM gets a reference to the ServiceManager (handle=0) android.content.pm.IPackageManager.Stub.Proxy com.android.server.pm.Installer /system/lib/libandroid_runtime.so /system/lib/libandroid_runtime.so references /system/lib/libbinder.so uses (calls) /system/lib/libbinder.so /system/lib/lib*.so send messages /system/lib/lib*.so invokes transaction /system/bin/servicemanager service_manager.c installd installd.c references /system/lib/lib*.so get messages /dev/binder /dev/socket/installd Kernel registers as binder context manager gets a reference to the ServiceManager (handle=0)
  • 8. WiFi Management on Android com.example.app (/data/app/ExampleApp.apk) system_server DalvikVM DalvikVM /system/framework/framework.jar classes.dex android.net.wifi.IWifiManager.Stub com.example.app.ExampleActivity android.net.wifi.WifiStateMachine calls calls /system/framework/framework.jar android.net.wifi.WifiNative extends creates calls android.net.wifi.WifiManager /system/framework/services.jar calls com.android.server.SystemServer android.net.wifi.IWifiManager.Stub.Proxy calls/links to gets a reference to the ServiceManager (handle=0) looks up "wifi" service via SM com.android.server.WifiService registers "wifi" service via SM /system/lib/libandroid_runtime.so /system/lib/libandroid_servers.so android_net_wifi_Wifi.cpp uses (calls) /system/lib/libbinder.so calls references /system/lib/libhardware_legacy.so /system/lib/lib*.so wifi.c calls /system/lib/libwpa_client.so /system/bin/servicemanager wpa_ctrl.c sends commands service_manager.c /system/lib/lib*.so invokes references /system/lib/lib*.so wpa_supplicant /dev/binder bcmdhd /dev/socket/wpa_wlan0 Kernel registers as binder context manager calls (ioctl) read commands as nl80211
  • 9. Location on Android com.example.app (/data/app/ExampleApp.apk) system_server DalvikVM DalvikVM /system/framework/framework.jar classes.dex .LocationManager.Stub com.example.app.ExampleActivity creates extends /system/framework/services.jar calls /system/framework/framework.jar com.android.server.SystemServer calls android.location.LocationManager .LocationManagerService calls .location.GpsLocationProvider registers "location" service via SM looks up "location" service via SM gets a reference to the ServiceManager (handle=0) .LocationManager.Stub.Proxy links to calls /system/lib/libandroid_servers.so /system/lib/libandroid_runtime.so _location_GpsLocationProvider.cpp uses (calls) references /system/lib/libbinder.so loads calls /vendor/lib/hw/gps.omap4.so /system/lib/lib*.so impl of include/hardware/gps.h /system/lib/libhardware.so /system/bin/servicemanager uses (io) /system/lib/libandroid_runtime.so service_manager.c /system/lib/libbinder.so invokes references /system/lib/lib*.so /system/lib/lib*.so /dev/binder /dev/ttyo0 Kernel registers as binder context manager
  • 10. Audio Policy on Android com.example.app (/data/app/ExampleApp.apk) system_server DalvikVM DalvikVM /system/framework/framework.jar extends classes.dex android.media.IAudioService.Stub com.example.app.ExampleActivity android.media.AudioService calls calls creates /system/framework/framework.jar android.media.AudioSystem links to/calls android.media.AudioManager /system/framework/services.jar calls com.android.server.SystemServer android.media.IAudioService.Stub.Proxy looks up "audio" service via SM gets a reference to the ServiceManager (handle=0) /system/lib/libandroid_runtime.so registers "audio" service via SM android_media_AudioSystem.cpp calls /system/lib/libandroid_runtime.so /system/lib/libmedia.so android.AudioSystem calls /system/lib/libbinder.so android.BpAudioPolicyService uses (calls) /system/lib/lib*.so references mediaserver calls extends /system/lib/libmedia.so android.BnAudioPolicyService /system/bin/servicemanager /system/lib/libaudioflinger.so android.AudioPolicyService calls service_manager.c invokes /system/lib/hw/audio_policy.default.so android_audio_legacy.AudioPolicyManagerDefault calls /system/lib/lib*.so /system/lib/hw/audio.primary.tuna.so audio_hw.c uses (ioctl) calls references looks up "media.audio_policy" /system/lib/libtinyalsa.so registers as binder context manager mixer.c /dev/binder /dev/snd/controlC0 (ALSA) Kernel
  • 11. Audio Playback on Android com.ex.app (/data/app/ExampleApp.apk) mediaserver DalvikVM /system/lib/libmediaplayerservice.so /system/lib/libmedia.so classes.dex android.BnMediaPlayerService android.MediaPlayerService com.ex.app.ExampleActivity android.BnMediaPlayer android.MediaPlayerService.Client /system/framework/framework.jar .AudioTrack .AudioSystem android.StagefrightPlayer android.media.MediaPlayer .MediaPlayerService.AudioOutput /system/lib/libstagefright.so /system/lib/libmedia_jni.so .AwesomePlayer .AudioPlayer /system/lib/libstagefright_soft_mp3dec.so android_media_MediaPlayer.cpp .MediaSource .MP3Source android.SoftMP3 .OMXCodec .MP3Extractor /system/lib/libmedia.so /system/lib/libaudioflinger.so android.BpMediaPlayer .AudioFlinger .AudioPolicyService android.BpMediaPlayerService /system/lib/hw/audio.primary.tuna.so /system/lib/ /system/lib/ audio_hw.c libstagefrighthw.so libOMX_Core.so /system/lib/lib*.so android.TIOMXPlugin OMX_Core.c /system/lib/libtinyalsa.so /system/lib/hw/audio_policy.default.so /system/bin/servicemanager service_manager.c pcm.c android_audio_legacy.AudioPolicyManagerDefault /system/lib/lib*.so /dev/binder /dev/snd/pcmC0D0p (ALSA) /dev/snd/controlC0 (ALSA) Kernel
  • 12. Telephony on Android PhoneApp system_server (/system/app/Phone.apk) DalvikVM DalvikVM /system/framework/framework.jar classes.dex android.media.AudioService uses CallController CallController PhoneUtils calls /system/framework/framework.jar com.android.internal.telephony.CallManager calls android.media.AudioManager com.android.internal.telephony.Phone calls implements rild com.android.internal.telephony.gsm.GSMPhone rild.c calls GsmCallTracker Socket messages /system/lib/libril.so loads RIL uses /system/lib/libsecril-client.so RILSender RILReceiver /vendor/lib/libsec-ril.so Socket messages Socket messages uses /dev/socket/rild /dev/ttys0 Audio drivers Kernel
  • 13. DevicePolicy on Android com.example.enterpriseapp system_server (/data/app/EnterpriseApp.apk) DalvikVM DalvikVM /system/framework/framework.jar classes.dex android.app.admin.DevicePolicyManager.Stub .ExampleActivity calls android.os.RecoverySystem calls calls android.os.PowerManager extends /system/framework/framework.jar calls com.android.internal.app.ShutdownThread android.app.admin.DevicePolicyManager android.os.Power looks up "device_policy" service via SM calls calls registers "device_policy" service via SM creates calls /system/framework/services.jar gets a reference to the ServiceManager (handle=0) android.app.admin.DevicePolicyManager.Stub.Proxy com.android.server.SystemServer com.android.server.DevicePolicyManagerService /system/lib/libandroid_runtime.so com.android.server.PowerManagerService /system/lib/libbinder.so links to/calls references /system/lib/lib*.so /system/lib/libandroid_runtime.so uses (calls) invokes transaction android_os_Power.cpp reboot /system/bin/servicemanager /system/lib/lib*.so service_manager.c recovery writes references reads /system/lib/lib*.so recovery.c /cache/recovery/command /dev/binder /dev/block/platform/omap/omap_hsmmc.0/by-name/userdata erases Kernel formats registers as binder context manager gets a reference to the ServiceManager (handle=0)
  • 14. Thank You For the complete screencast of this presentation go to http://mrkn.co/munz7 @agargenta on Twitter aleksandar.gargenta@gmail.com on G+