SlideShare ist ein Scribd-Unternehmen logo
1 von 14
Downloaden Sie, um offline zu lesen
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+

Weitere ähnliche Inhalte

Was ist angesagt?

/path/to/content - the Apache Jackrabbit content repository
/path/to/content - the Apache Jackrabbit content repository/path/to/content - the Apache Jackrabbit content repository
/path/to/content - the Apache Jackrabbit content repositoryJukka Zitting
 
Linux binary Exploitation - Basic knowledge
Linux binary Exploitation - Basic knowledgeLinux binary Exploitation - Basic knowledge
Linux binary Exploitation - Basic knowledgeAngel Boy
 
Velocity 2017 Performance analysis superpowers with Linux eBPF
Velocity 2017 Performance analysis superpowers with Linux eBPFVelocity 2017 Performance analysis superpowers with Linux eBPF
Velocity 2017 Performance analysis superpowers with Linux eBPFBrendan Gregg
 
Operating Systems - A Primer
Operating Systems - A PrimerOperating Systems - A Primer
Operating Systems - A PrimerSaumil Shah
 
RISC-V on Edge: Porting EVE and Alpine Linux to RISC-V
RISC-V on Edge: Porting EVE and Alpine Linux to RISC-VRISC-V on Edge: Porting EVE and Alpine Linux to RISC-V
RISC-V on Edge: Porting EVE and Alpine Linux to RISC-VScyllaDB
 
Using eBPF to Measure the k8s Cluster Health
Using eBPF to Measure the k8s Cluster HealthUsing eBPF to Measure the k8s Cluster Health
Using eBPF to Measure the k8s Cluster HealthScyllaDB
 
Using cgroups in docker container
Using cgroups in docker containerUsing cgroups in docker container
Using cgroups in docker containerVinay Jindal
 
一小時學不會的 Vim
一小時學不會的 Vim一小時學不會的 Vim
一小時學不會的 VimLi Hsuan Hung
 
Content Storage With Apache Jackrabbit
Content Storage With Apache JackrabbitContent Storage With Apache Jackrabbit
Content Storage With Apache JackrabbitJukka Zitting
 
[오픈소스컨설팅]Scouter 설치 및 사용가이드(JBoss)
[오픈소스컨설팅]Scouter 설치 및 사용가이드(JBoss)[오픈소스컨설팅]Scouter 설치 및 사용가이드(JBoss)
[오픈소스컨설팅]Scouter 설치 및 사용가이드(JBoss)Ji-Woong Choi
 
SEH overwrite and its exploitability
SEH overwrite and its exploitabilitySEH overwrite and its exploitability
SEH overwrite and its exploitabilityFFRI, Inc.
 
Ruby on Rails Presentation
Ruby on Rails PresentationRuby on Rails Presentation
Ruby on Rails Presentationadamcookeuk
 
JavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for DummiesJavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for DummiesCharles Nutter
 
텔레그램을 이용한 양방향 모니터링 시스템 구축
텔레그램을 이용한 양방향 모니터링 시스템 구축텔레그램을 이용한 양방향 모니터링 시스템 구축
텔레그램을 이용한 양방향 모니터링 시스템 구축I Goo Lee
 
Linux Kernel Tour
Linux Kernel TourLinux Kernel Tour
Linux Kernel Toursamrat das
 
ELFの動的リンク
ELFの動的リンクELFの動的リンク
ELFの動的リンク7shi
 

Was ist angesagt? (20)

/path/to/content - the Apache Jackrabbit content repository
/path/to/content - the Apache Jackrabbit content repository/path/to/content - the Apache Jackrabbit content repository
/path/to/content - the Apache Jackrabbit content repository
 
Linux binary Exploitation - Basic knowledge
Linux binary Exploitation - Basic knowledgeLinux binary Exploitation - Basic knowledge
Linux binary Exploitation - Basic knowledge
 
Velocity 2017 Performance analysis superpowers with Linux eBPF
Velocity 2017 Performance analysis superpowers with Linux eBPFVelocity 2017 Performance analysis superpowers with Linux eBPF
Velocity 2017 Performance analysis superpowers with Linux eBPF
 
Learn C Programming Language by Using GDB
Learn C Programming Language by Using GDBLearn C Programming Language by Using GDB
Learn C Programming Language by Using GDB
 
Operating Systems - A Primer
Operating Systems - A PrimerOperating Systems - A Primer
Operating Systems - A Primer
 
RISC-V on Edge: Porting EVE and Alpine Linux to RISC-V
RISC-V on Edge: Porting EVE and Alpine Linux to RISC-VRISC-V on Edge: Porting EVE and Alpine Linux to RISC-V
RISC-V on Edge: Porting EVE and Alpine Linux to RISC-V
 
ARM and SoC Traning Part I -- Overview
ARM and SoC Traning Part I -- OverviewARM and SoC Traning Part I -- Overview
ARM and SoC Traning Part I -- Overview
 
Using eBPF to Measure the k8s Cluster Health
Using eBPF to Measure the k8s Cluster HealthUsing eBPF to Measure the k8s Cluster Health
Using eBPF to Measure the k8s Cluster Health
 
Android IPC Mechanism
Android IPC MechanismAndroid IPC Mechanism
Android IPC Mechanism
 
Using cgroups in docker container
Using cgroups in docker containerUsing cgroups in docker container
Using cgroups in docker container
 
淺談探索 Linux 系統設計之道
淺談探索 Linux 系統設計之道 淺談探索 Linux 系統設計之道
淺談探索 Linux 系統設計之道
 
一小時學不會的 Vim
一小時學不會的 Vim一小時學不會的 Vim
一小時學不會的 Vim
 
Content Storage With Apache Jackrabbit
Content Storage With Apache JackrabbitContent Storage With Apache Jackrabbit
Content Storage With Apache Jackrabbit
 
[오픈소스컨설팅]Scouter 설치 및 사용가이드(JBoss)
[오픈소스컨설팅]Scouter 설치 및 사용가이드(JBoss)[오픈소스컨설팅]Scouter 설치 및 사용가이드(JBoss)
[오픈소스컨설팅]Scouter 설치 및 사용가이드(JBoss)
 
SEH overwrite and its exploitability
SEH overwrite and its exploitabilitySEH overwrite and its exploitability
SEH overwrite and its exploitability
 
Ruby on Rails Presentation
Ruby on Rails PresentationRuby on Rails Presentation
Ruby on Rails Presentation
 
JavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for DummiesJavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for Dummies
 
텔레그램을 이용한 양방향 모니터링 시스템 구축
텔레그램을 이용한 양방향 모니터링 시스템 구축텔레그램을 이용한 양방향 모니터링 시스템 구축
텔레그램을 이용한 양방향 모니터링 시스템 구축
 
Linux Kernel Tour
Linux Kernel TourLinux Kernel Tour
Linux Kernel Tour
 
ELFの動的リンク
ELFの動的リンクELFの動的リンク
ELFの動的リンク
 

Andere mochten auch

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
 

Andere mochten auch (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von 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.
 

Mehr von 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
 

Kürzlich hochgeladen

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
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
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
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
Dust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEDust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEaurabinda banchhor
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
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
 
Presentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxPresentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxRosabel UA
 
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
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataBabyAnnMotar
 

Kürzlich hochgeladen (20)

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
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
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
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
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
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
Dust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEDust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSE
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
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
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Presentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxPresentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptx
 
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)
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped data
 

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+