SlideShare ist ein Scribd-Unternehmen logo
1 von 12
Android. Behind The Scenes
              R
              a
              d
              u
              M
              O
               I
              S
              A
              N
              A
Agenda

     Android Short Intro
     Use-case: QEmu
     Android Init System
     Application Launch




2
Android Short Intro
     Home                        Contacts                  Phone                           Browser                ...
Applications
                      Telephon         Resourc                               Notificatio
    Activity                                             Location
                          y               e                                       n
    Manager                                              Manager
                                                                             Manager
                      Manager          Manager

            Package          Window           Content                View
            Manager          Manager         Providers              System
                                                                                                     Android Runtime
Android Framework
                                                                                                      Core Libraries
                                           Media
     Surface Manager                                                   SQLite
                                        Framework                                                     Dalvik Virtual
                                                                                                        Machine
      Open GL | ES                      Free Type                     Webkit

             SGL                            SSL                         libc

Libraries
                                                                                                                Linux Kernel
       Display                          Camera                        Flash Memory                      Binder(IPC)
        Driver                           Driver                           Driver                           Driver

       Keypad                            WiFi                            Audio                            Power
        Driver                          Driver                          Drivers                         Management




3
Use-case: QEmu

    So what exactly is QEmu?
    QEMU is a processor emulator which has two different
    operating modes:
     full system emulation, which emulates a full system including
    the corresponding hard disk image
     user mode emulation, which allows you to run a simple
    cross-compiled executable




4
Use-case: QEmu
    mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
    echo ":ARM:M:18:(::/data/qemu-arm:" > /proc/sys/fs/binfmt_misc/register

    mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
    echo ":CLR:M::MZ::/usr/bin/mono:" > /proc/sys/fs/binfmt_misc/register

              Name is the name of the binary format
                                           The magic number
                                                                            program that is to be run with the
                                                                            matching file as an argument

        :name:type:offset:magic:mask:interpreter:
                                                      What part of magic number is significant

                                   Where to look for the magic number

                          E or M




5
Use-case: QEmu
           Why?
     Sandbox binary applications
     Debugging/tracing binary applications
     Run Android Apps with native arm binary on x86
    Platforms

          How?
    Two approaches:
    Intercept the Fork starting the Application Process
    Run a second emulated Zygote




6
Android Init System
     bootl
     oader




    Linux
    kernel



      init




          init.rc
    Init.<machine>.rc




7
Android Init file
    service ril-daemon /system/bin/rild
      socket rild stream 660 root radio
      socket rild-debug stream 660 radio system
      user root
      group radio cache inet misc audio sdcard_rw net_admin net_raw qcom_oncrpc diag


    service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server
       socket zygote stream 660 root system
       onrestart write /sys/android_power/request_state wake
       onrestart write /sys/power/state on
       onrestart restart media
       onrestart restart netd


    service media /system/bin/mediaserver
       user media
       group system audio camera graphics inet net_bt net_bt_admin net_raw
       ioprio rt 4




8
Android Init System
                                                            Power
     bootl                                                 Manager
     oader                                                 Telephon
                                                               y         App
                                                           Registry
                                                Core        Activity
                                               Services                  App
                     Native                                Manager
                                instantiate
    Linux           Daemons    AppRuntime                  Window
    kernel                                                 Manager       App

                                                             ...
                               system_serv
      init          Zygote          er
                                                             Mount
                                                             Service
                                                           Connectivit
                     Other                                      y
                                              Additional    Service
                    processe     Select                     Location
                                               Services
                        s        Loop                       Manager
                                 Mode                         Audio
                                                             Service
          init.rc
    Init.<machine>.rc                                          ...




9
Application Launch

     Laun                                                                                 Application                  onCreate()

     cher                                                                                  Classes

                                                                                                    load
                                                                                                    into
                                                                                                    ram


                                          Activity        bindApplication()                 Activity
     launch activity by intent




                                                                                                           callActivityOnCreate()
                                                                                            Thread                                  Instrumentati
                                          Manager         thread.attach()                    Dalvik                                       on
                                          Service
                                                                                              VM




                                                                              forkAndSpecialize()
                                                              Zygote




                                                     zygote
                                 Binder              socket




10
Application Launch
     Laun
     cher




                                          Activity
     launch activity by intent




                                          Manager
                                          Service


                                                      zygote               forkAndSpecialize()
                                                                 Zygote
                                                      socket


                                                     zygote_e
                                                      zygote    Zygote_e   forkAndSpecialize()
                                                        mu       Zygote
                                                      socket      mu
                                                      socket
                                 Binder




11
12

Weitere ähnliche Inhalte

Was ist angesagt?

V Labs Product Presentation
V Labs  Product PresentationV Labs  Product Presentation
V Labs Product Presentation
Wil Huijben
 

Was ist angesagt? (11)

TOMOYO Linux on Android
TOMOYO Linux on AndroidTOMOYO Linux on Android
TOMOYO Linux on Android
 
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
 
Android for Java Developers
Android for Java DevelopersAndroid for Java Developers
Android for Java Developers
 
Android Deep Dive
Android Deep DiveAndroid Deep Dive
Android Deep Dive
 
Android For Java Developers
Android For Java DevelopersAndroid For Java Developers
Android For Java Developers
 
V Labs Product Presentation
V Labs  Product PresentationV Labs  Product Presentation
V Labs Product Presentation
 
Develop Community-based Android Distribution and Upstreaming Experience
Develop Community-based Android Distribution and Upstreaming Experience Develop Community-based Android Distribution and Upstreaming Experience
Develop Community-based Android Distribution and Upstreaming Experience
 
Android: A 9,000-foot Overview
Android: A 9,000-foot OverviewAndroid: A 9,000-foot Overview
Android: A 9,000-foot Overview
 
SDN
SDNSDN
SDN
 
Discover System Facilities inside Your Android Phone
Discover System Facilities inside Your Android Phone Discover System Facilities inside Your Android Phone
Discover System Facilities inside Your Android Phone
 
An FPGA-based Scalable Simulation Accelerator for Tile Architectures @HEART2011
An FPGA-based Scalable Simulation Accelerator for Tile Architectures @HEART2011An FPGA-based Scalable Simulation Accelerator for Tile Architectures @HEART2011
An FPGA-based Scalable Simulation Accelerator for Tile Architectures @HEART2011
 

Ähnlich wie Android. behind the scenes_programatica 2012

An Introduction To Android
An Introduction To AndroidAn Introduction To Android
An Introduction To Android
GoogleTecTalks
 
Mee go是您的新机遇
Mee go是您的新机遇Mee go是您的新机遇
Mee go是您的新机遇
OpenSourceCamp
 
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Opersys inc.
 

Ähnlich wie Android. behind the scenes_programatica 2012 (20)

Google Io Introduction To Android
Google Io Introduction To AndroidGoogle Io Introduction To Android
Google Io Introduction To Android
 
An Introduction To Android
An Introduction To AndroidAn Introduction To Android
An Introduction To Android
 
Open Android
Open AndroidOpen Android
Open Android
 
Mee go是您的新机遇
Mee go是您的新机遇Mee go是您的新机遇
Mee go是您的新机遇
 
Deep Dive Into Android Security
Deep Dive Into Android SecurityDeep Dive Into Android Security
Deep Dive Into Android Security
 
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
 
Android for Java Developers at OSCON 2010
Android for Java Developers at OSCON 2010Android for Java Developers at OSCON 2010
Android for Java Developers at OSCON 2010
 
Android and Intel Inside
Android and Intel InsideAndroid and Intel Inside
Android and Intel Inside
 
Android For Managers Slides
Android For Managers SlidesAndroid For Managers Slides
Android For Managers Slides
 
Deep Dive into WinRT
Deep Dive into WinRTDeep Dive into WinRT
Deep Dive into WinRT
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
Understanding the Android System Server
Understanding the Android System ServerUnderstanding the Android System Server
Understanding the Android System Server
 
Xtopia2010 wp7
Xtopia2010 wp7Xtopia2010 wp7
Xtopia2010 wp7
 
Venus-c: Using open source clouds in eScience
Venus-c: Using open source clouds in eScienceVenus-c: Using open source clouds in eScience
Venus-c: Using open source clouds in eScience
 
MeeGo AppLab Desktop Summit 2011 - Submission and Validation
MeeGo AppLab Desktop Summit 2011 - Submission and ValidationMeeGo AppLab Desktop Summit 2011 - Submission and Validation
MeeGo AppLab Desktop Summit 2011 - Submission and Validation
 
Android Services Black Magic by Aleksandar Gargenta
Android Services Black Magic by Aleksandar GargentaAndroid Services Black Magic by Aleksandar Gargenta
Android Services Black Magic by Aleksandar Gargenta
 
ANODE – Continuous Deployment with Node.js over Azure, Yosef Dinerstein
ANODE – Continuous Deployment with Node.js over Azure, Yosef DinersteinANODE – Continuous Deployment with Node.js over Azure, Yosef Dinerstein
ANODE – Continuous Deployment with Node.js over Azure, Yosef Dinerstein
 
What’s New ?Linux on System z
What’s New ?Linux on System zWhat’s New ?Linux on System z
What’s New ?Linux on System z
 
Introduction to Windows 8 Development
Introduction to Windows 8 Development
Introduction to Windows 8 Development
Introduction to Windows 8 Development
 
Nos Windows
Nos WindowsNos Windows
Nos Windows
 

Mehr von Agora Group

Curs Digital Forensics
Curs Digital ForensicsCurs Digital Forensics
Curs Digital Forensics
Agora Group
 
Class IT - Enemy inside the wire
Class IT - Enemy inside the wireClass IT - Enemy inside the wire
Class IT - Enemy inside the wire
Agora Group
 
Infologica - auditarea aplicatiilor mobile
Infologica - auditarea aplicatiilor mobileInfologica - auditarea aplicatiilor mobile
Infologica - auditarea aplicatiilor mobile
Agora Group
 
Agora Securitate yugo neumorni
Agora Securitate yugo neumorniAgora Securitate yugo neumorni
Agora Securitate yugo neumorni
Agora Group
 
Security threats in the LAN
Security threats in the LANSecurity threats in the LAN
Security threats in the LAN
Agora Group
 

Mehr von Agora Group (20)

How to Digitally Transform and Stay Competitive with a Zero-code Digital Busi...
How to Digitally Transform and Stay Competitive with a Zero-code Digital Busi...How to Digitally Transform and Stay Competitive with a Zero-code Digital Busi...
How to Digitally Transform and Stay Competitive with a Zero-code Digital Busi...
 
Microservicii reutilizabile in arhitecturi bazate pe procese
Microservicii reutilizabile in arhitecturi bazate pe proceseMicroservicii reutilizabile in arhitecturi bazate pe procese
Microservicii reutilizabile in arhitecturi bazate pe procese
 
The role of BPM in Paradigms Shift
The role of BPM in Paradigms ShiftThe role of BPM in Paradigms Shift
The role of BPM in Paradigms Shift
 
Prezentare Ensight_BPM-20171004
Prezentare Ensight_BPM-20171004Prezentare Ensight_BPM-20171004
Prezentare Ensight_BPM-20171004
 
Curs OSINT
Curs OSINTCurs OSINT
Curs OSINT
 
Curs Digital Forensics
Curs Digital ForensicsCurs Digital Forensics
Curs Digital Forensics
 
The next generation of Companies management: state of the art in BPM
The next generation of Companies management: state of the art in BPMThe next generation of Companies management: state of the art in BPM
The next generation of Companies management: state of the art in BPM
 
Speed Dialing the Enterprise
Speed Dialing the EnterpriseSpeed Dialing the Enterprise
Speed Dialing the Enterprise
 
ABPMP Romania
ABPMP RomaniaABPMP Romania
ABPMP Romania
 
Arhitectura proceselor în Sistemul Informațional de Sănătate
Arhitectura proceselor în Sistemul Informațional de SănătateArhitectura proceselor în Sistemul Informațional de Sănătate
Arhitectura proceselor în Sistemul Informațional de Sănătate
 
IBM’s Smarter Process Reinvent Business
IBM’s Smarter Process Reinvent BusinessIBM’s Smarter Process Reinvent Business
IBM’s Smarter Process Reinvent Business
 
eHealth 2014_Radu Dop
eHealth 2014_Radu DopeHealth 2014_Radu Dop
eHealth 2014_Radu Dop
 
Importanța registrelor pentru pacienți
Importanța registrelor pentru paciențiImportanța registrelor pentru pacienți
Importanța registrelor pentru pacienți
 
CYBERCRIME AND THE HEALTHCARE INDUSTRY: Sistemul de sănătate, noua țintă a at...
CYBERCRIME AND THE HEALTHCARE INDUSTRY: Sistemul de sănătate, noua țintă a at...CYBERCRIME AND THE HEALTHCARE INDUSTRY: Sistemul de sănătate, noua țintă a at...
CYBERCRIME AND THE HEALTHCARE INDUSTRY: Sistemul de sănătate, noua țintă a at...
 
Perspective naționale și internaționale ale informaticii și standardelor medi...
Perspective naționale și internaționale ale informaticii și standardelor medi...Perspective naționale și internaționale ale informaticii și standardelor medi...
Perspective naționale și internaționale ale informaticii și standardelor medi...
 
UTI_Dosarul electronic de sanatate
UTI_Dosarul electronic de sanatateUTI_Dosarul electronic de sanatate
UTI_Dosarul electronic de sanatate
 
Class IT - Enemy inside the wire
Class IT - Enemy inside the wireClass IT - Enemy inside the wire
Class IT - Enemy inside the wire
 
Infologica - auditarea aplicatiilor mobile
Infologica - auditarea aplicatiilor mobileInfologica - auditarea aplicatiilor mobile
Infologica - auditarea aplicatiilor mobile
 
Agora Securitate yugo neumorni
Agora Securitate yugo neumorniAgora Securitate yugo neumorni
Agora Securitate yugo neumorni
 
Security threats in the LAN
Security threats in the LANSecurity threats in the LAN
Security threats in the LAN
 

Kürzlich hochgeladen

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Kürzlich hochgeladen (20)

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

Android. behind the scenes_programatica 2012

  • 1. Android. Behind The Scenes R a d u M O I S A N A
  • 2. Agenda Android Short Intro Use-case: QEmu Android Init System Application Launch 2
  • 3. Android Short Intro Home Contacts Phone Browser ... Applications Telephon Resourc Notificatio Activity Location y e n Manager Manager Manager Manager Manager Package Window Content View Manager Manager Providers System Android Runtime Android Framework Core Libraries Media Surface Manager SQLite Framework Dalvik Virtual Machine Open GL | ES Free Type Webkit SGL SSL libc Libraries Linux Kernel Display Camera Flash Memory Binder(IPC) Driver Driver Driver Driver Keypad WiFi Audio Power Driver Driver Drivers Management 3
  • 4. Use-case: QEmu So what exactly is QEmu? QEMU is a processor emulator which has two different operating modes: full system emulation, which emulates a full system including the corresponding hard disk image user mode emulation, which allows you to run a simple cross-compiled executable 4
  • 5. Use-case: QEmu mount -t binfmt_misc none /proc/sys/fs/binfmt_misc echo ":ARM:M:18:(::/data/qemu-arm:" > /proc/sys/fs/binfmt_misc/register mount -t binfmt_misc none /proc/sys/fs/binfmt_misc echo ":CLR:M::MZ::/usr/bin/mono:" > /proc/sys/fs/binfmt_misc/register Name is the name of the binary format The magic number program that is to be run with the matching file as an argument :name:type:offset:magic:mask:interpreter: What part of magic number is significant Where to look for the magic number E or M 5
  • 6. Use-case: QEmu Why? Sandbox binary applications Debugging/tracing binary applications Run Android Apps with native arm binary on x86 Platforms How? Two approaches: Intercept the Fork starting the Application Process Run a second emulated Zygote 6
  • 7. Android Init System bootl oader Linux kernel init init.rc Init.<machine>.rc 7
  • 8. Android Init file service ril-daemon /system/bin/rild socket rild stream 660 root radio socket rild-debug stream 660 radio system user root group radio cache inet misc audio sdcard_rw net_admin net_raw qcom_oncrpc diag service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server socket zygote stream 660 root system onrestart write /sys/android_power/request_state wake onrestart write /sys/power/state on onrestart restart media onrestart restart netd service media /system/bin/mediaserver user media group system audio camera graphics inet net_bt net_bt_admin net_raw ioprio rt 4 8
  • 9. Android Init System Power bootl Manager oader Telephon y App Registry Core Activity Services App Native Manager instantiate Linux Daemons AppRuntime Window kernel Manager App ... system_serv init Zygote er Mount Service Connectivit Other y Additional Service processe Select Location Services s Loop Manager Mode Audio Service init.rc Init.<machine>.rc ... 9
  • 10. Application Launch Laun Application onCreate() cher Classes load into ram Activity bindApplication() Activity launch activity by intent callActivityOnCreate() Thread Instrumentati Manager thread.attach() Dalvik on Service VM forkAndSpecialize() Zygote zygote Binder socket 10
  • 11. Application Launch Laun cher Activity launch activity by intent Manager Service zygote forkAndSpecialize() Zygote socket zygote_e zygote Zygote_e forkAndSpecialize() mu Zygote socket mu socket Binder 11
  • 12. 12