• Like
Pjproject su Android: uno scontro su più livelli
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

Pjproject su Android: uno scontro su più livelli

  • 662 views
Published

Bachelor's degree thesis

Bachelor's degree thesis

Published in Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
662
On SlideShare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
8
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Pjproject su Android Uno scontro su più livelli Giacomo Bergami Alma Mater Studiorum - Università di Bologna November 13th , 2012Giacomo Bergami (Univ. Bologna) Pjproject su Android November 13th , 2012 1/9
  • 2. Table of Contents1 Main Goals and Subproblems Main Goals Subproblems2 Android Architecture Overview Service Interaction Audio Management3 Outcomes Giacomo Bergami (Univ. Bologna) Pjproject su Android November 13th , 2012 2/9
  • 3. Main Goals Can a pjsip-based VoIP application (pjsua) run on Android? The question “seems legitimate”, as pjsua is a non-standard Java-Android application. It’s a C-native app. Can I crosscompile a GNU/Linux application to Android? Does a native application directly interact with the Kernel? How does Android know that I want to gain access to the microphone? How can I dodge Android’s controls?Giacomo Bergami (Univ. Bologna) Pjproject su Android November 13th , 2012 3/9
  • 4. Subproblems Android SDK Emulator Communication between emulators. Audio hardware emulation is not provided. Olivetti Olitab (Medion Life Tab) No factory image No sourcecode support Non standard “rooting” procedure (nvflash) ⇒ Samsung Galaxy Nexus.Giacomo Bergami (Univ. Bologna) Pjproject su Android November 13th , 2012 4/9
  • 5. Android ArchitectureSome terminology Rooting Upsyscall Java/Java with JNI/Native Application. Kernel Android/AOSP source/Android Middleware Giacomo Bergami (Univ. Bologna) Pjproject su Android November 13th , 2012 5/9
  • 6. Overview Native Apps (pjsua) 1 2 Pjproject (pjsip) ModificationsAndroid Architecture Overview (Kernel+AOSP) 1 Redefinition of entry-point Permission Controller _start inside Android NDK. 2 Resizing “Conference” Buffer for DVM previous overflow. JNI+libs media_server + services Android Audio Libraries 3 Removal of the access limit to GNU/Linux audio sampling to a client only. Windows 4 Data obtainer Permission Checker Code Analysis HW audio libs 3 4 Analysis on the IPC Buffer for /dev/binder 5 sampled audio. Android Kernel 5 Client/Service Interaction. Hardware Giacomo Bergami (Univ. Bologna) Pjproject su Android November 13th , 2012 6/9
  • 7. Service Interaction Java App+Framework ZygoteInit SystemServer Permission ControllerNative Apps media_server app_processJNI/Native AndroidRuntime (DVM) SystemServer Binder JNI AudioPolicy AudioFlinger Service libhardware _legacy libbinder Kernel /dev/binder
  • 8. Service Interaction Java App+Framework ServerThread.run() ZygoteInit SystemServer Permission fork() ControllerNative Apps SystemServer.main() start/join- executeTransact() ThreadPool() media_server app_processJNI/Native runtime->start() startVm() Call Java AndroidRuntime (DVM) ::istantiate() startReg() ZygoteInit.main() init1() SystemServer Binder JNI AudioPolicy AudioFlinger start/join- ::transact() Service ThreadPool() ::onTransact() publish() libhardware _legacy libbinder Kernel /dev/binder Giacomo Bergami (Univ. Bologna) Pjproject su Android November 13th , 2012 7/9
  • 9. Audio Management Wilhelm AudioPolicyService AudioFlinger AudioRecord ClientThread RecordHandle RecordThread libnbaiolibhardware AudioPolicy libbinder & /dev/binder _legacy ManagerBase
  • 10. Audio Management Wilhelm Realize Start set() AudioPolicyService AudioFlinger AudioRecord getInput() openRecord() re run()getInput() openInput() co rd i ng Al lo we ClientThread RecordHandle d () RecordThread libnbaio checkPermission() getActiveInput()libhardware AudioPolicy libbinder & /dev/binder _legacy ManagerBaseGiacomo Bergami (Univ. Bologna) Pjproject su Android November 13th , 2012 8/9
  • 11. OutcomesAs a final result, porting has been successful: Multi Android-host testing (Galaxy Nexus + Olivetti Olipad + WLAN) VoIP calls through SIP and Pjproject/pjsipOutcomes: Modify wilhelm and extend AOSP with a service as a mediator. Avoiding rooting and upsyscalls with libraries modification. Relation between Java Applications services’ and IPCThreadState. Giacomo Bergami (Univ. Bologna) Pjproject su Android November 13th , 2012 9/9