SlideShare a Scribd company logo
1 of 37
Download to read offline
Developing Android
Platform Tools
Android Builders Summit 2015
François-Denis Gonthier
@fdgonthier
2
AboutAbout
● Author and maintainer of:
● github.com/opersys/raidl
3
Agenda
● What's out there?
●
What's the problem?
●
Our Objectives
● Initial Set of Pain Points
● raidl – AIDL file lookup
●
Architecture for Creating Monitoring Tools
●
Process Explorer
●
File Explorer
● Binder Explorer
●
The Road Ahead
4
1. What's Out There Now?
● Official App Dev Tools
● Official Platform Dev Tools
●
3rd
Party App Dev Tools
●
3rd
Party Platform Dev Tools
5
1.1. Official App Dev tools
● Eclipse Android Development Kit
● Android Studio (IntelliJ)
● DDMS
● Plenty of documentation
6
1.2. Official Platform Dev Tools
● Tools on the previous pages
● gdb / gdbserver
● ftrace, systrace, atrace
● perf
7
1.3. 3rd
Party App Dev Tools
● CrossWalk / Cordova
● Delphi
● Xamarin.Android
● etc.
8
1.4. 3rd
Party Platform Dev Tools
● Qualcomm tools
● Intel tools, Nvidia tools, etc
● ARM Tools – DS-5
● JTAG -- Lauterbach
9
2. What's The Problem?
● Google obviously catering to app developers
– App dev tools have nice finish
– Platform dev tools ...
● Official tools heavily tied to app dev IDE
– Requires IDE-specific knowledge to extend/customize
– Assumes official IDE is being used and/or is present
● Platform is huge
10
2. What's The Problem
● Documentation is often spartan
● Existing platform dev tools assume internals
understanding
– Do you truly know how to use “dumpsys procstats”,
“dumpsys meminfo” or “vdc”
● Most platform tools can only be used on the
command line
● Most 3rd party tools assume on-screen rendering of
information
11
3. Our Objectives
● Reduce barrier to entry for platform development
● Catter for unmet patform developer needs
● Easy to use platform dev tools
● Build on lightweight/mainstream technologies:
– No IDE-specific tie-in
– Extensible language
– Large ecosystem of reusable packages/add-ons
● Avoid monopolizing device screen
12
4. Initial Set of Pain Points
● Looking up AIDL interfaces
● Monitoring Processes
● Viewing / Manipulating the Filesystem
● Understanding Binder Relationships
13
4.1. Getting AIDL files
● find -name “*File.aidl”
● godir
● Android documentation
– Focused on app developers
– Doesn't cover everything
14
4.2. Process Monitoring
● ps / top
● htop (Cyanogenmod)
● Studio/Eclipse/DDMS/Monitor integrated
● On the Play Store...
– ... hundreds of candidates
– Few are aimed at developers
15
4.3. Filesystem Monitoring/Browsing
● ls, find
● adb push/pull
● On the Play Store...
– ... hundreds of candidates
– Few are aimed at developers
16
4.4. Binder Relationships
17
5. Raidl - Features
● Returns the AIDL interface of a service
– AIDL based service
– Best effort for other services (Activity service)
– No interface for C++ service
– No parameters names
18
5.1. Example Output
root@generic:/data/local/tmp # ./raidl iface -n power
// Service: power, Interface: android.os.IPowerManager
package android.os;
interface IPowerManager {
void acquireWakeLock(IBinder p1, int n2, String s3, String s4, WorkSource p5, String
s6); // 1
void acquireWakeLockWithUid(IBinder p1, int n2, String s3, String s4, int n5); // 2
void releaseWakeLock(IBinder p1, int n2); // 3
void updateWakeLockUids(IBinder p1, int[] p2); // 4
void powerHint(int n1, int n2); // 5
void updateWakeLockWorkSource(IBinder p1, WorkSource p2, String s3); // 6
boolean isWakeLockLevelSupported(int n1); // 7
void userActivity(long n1, int n2, int n3); // 8
void wakeUp(long n1); // 9
void goToSleep(long n1, int n2, int n3); // 10
void nap(long n1); // 11
boolean isInteractive(); // 12
boolean isPowerSaveMode(); // 13
boolean setPowerSaveMode(boolean p1); // 14
void reboot(boolean p1, String s2, boolean p3); // 15
void shutdown(boolean p1, boolean p2); // 16
void crash(String s1); // 17
void setStayOnSetting(int n1); // 18
void setMaximumScreenOffTimeoutFromDeviceAdmin(int n1); // 19
void setTemporaryScreenBrightnessSettingOverride(int n1); // 20
void setTemporaryScreenAutoBrightnessAdjustmentSettingOverride(float p1); // 21
void setAttentionLight(boolean p1, int n2); // 22
}
19
5.2. Raidl - Demo
20
5.3. Raidl – How Does It Work?
ServiceStubClass = Raidl.class.getClassLoader()
.loadClass(serviceClass.getCanonicalName()+"$Stub");
for (Field serviceField : serviceStubClass.getDeclaredFields()) {
// Get the fields that look like transaction code.
}
for (Method serviceMethod : serviceClass.getMethods())
serviceMethods.put(serviceMethod.getName(), serviceMethod);
for (Integer serviceCode : serviceCodesMethods.keySet()) {
// ...
if (serviceMethod != null && isRemoteMethod(serviceMethod))
aidlService.addMethod(serviceCode, serviceMethod);
}
21
5.4. Raild - Integrate in AOSP Build
LOCAL_PATH:= $(call my­dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(call all­java­files­under, src)
LOCAL_PACKAGE_NAME := raidl
LOCAL_MODULE_TAGS := optional
LOCAL_PROGUARD_ENABLED := disabled
include $(BUILD_PACKAGE)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := raidl
LOCAL_MODULE_PATH := $(TARGET_OUT)/bin
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_MODULE := raidl
LOCAL_MODULE_TAGS := optional
include $(BUILD_PREBUILT)
22
5.5. Raild - Running an .apk
● .apk == .jar (with some DEX code)
● DexClassLoader:“A class loader that loads
classes from .jar and .apk files [...]”
● Ergo:
export CLASSPATH=/system/app/raidl.apk:/system/app/raidl/raidl.apk
exec app_process /system/app com.opersys.raidl.Raidl "$@"
23
6. Architecture for Creating
Monitoring Tools
24
6.1. Tool architecture
● Backend: Node.js + Express
● Frontend: Backbone.js + w2ui
● AJAX communication
● Websocket or Server-Sent events
25
6.2. Node.js in Android – Why?
● One language to rule them all: Javascript
● 132 510 Node.js packages
● Ease of use
● Web 2.0 support (SSE, WebSockets)
● Speed
– V8
– Binary modules
● Runtime independence
● Few actual alternatives: Go, C/C++, Python, etc.
26
6.3. Node.js – It's easy!
var express = require('express');
var app = express();
app.get('/home', function(req, res) {
 res.send('Hello World');
});
app.listen(process.env.PORT || 8080);
27
6.4. Node.js in Android – Why not?
● Still pretty slow
● Runtime independence
– Node is within its Linux bottle
● Difficult to package in Android
● It's Javascript
– WAT! https://www.destroyallsoftware.com/talks/wat
28
6.5. How to use Node.js on Android
● Older versions (0.8), binaries available
– Too old for comfort
● Development version (0.11, now 0.12) was
patched with Android support
● Backported to 0.10
● V0.10 Binaries are avaible!
● Io.js and Node v0.12: TBD.
● https://github.com/fdgonthier/node
29
6.6. Distribution
● Extracted in local files
● Multiple binary packages
– ARM, ARM + PIE, ia32, ia32 + PIE
● Started by a simple Android application
● Able to start as root
30
7. Process Explorer
● Browser based process manager
● Displays logcat (live!)
● Process statistics
– /proc based
● Needs root access for better function
● Works on Chrome and Firefox
31
7. Process Explorer - Demo
32
8. File Explorer
● Browser based file manager for Android
systems
● File upload/download
● File updates (live!)
● Needs root access for better function
33
8. File Explorer - Demo
34
9. Binder Explorer
● In development...
● Analysis of the links between Binder Services
and Android applications
● Uses data from
/sys/kernel/debug/binder
● Pushing further: JSLibBinder
35
9. Binder Explorer - Demo
36
9.1. Reaching Inside Android
● JSLibBinder – libbinder for Android
var Binder = require("jslibbinder"), 
var sm = new Binder.ServiceManager();
var services = sm.list();
var i = 0;
console.log("Found " + services.length + " services:");
services.forEach(function (s) {
    console.log((i++) + "t" + s 
                + ": [" + sm.getService(s).getInterface() + "]");
});
37
10. The Road Ahead
● New Features:
– Raidl – service to JS Binder interfaces
– Process Explorer new version has:
● More /proc data: memory, network, process maps, etc.
– File Explorer ...
– Binder explorer:
● Allow JS calls to Binder
● New Tools:
– We've got our ideas ;D
– We'd like to hear from you: What are you looking for?

More Related Content

What's hot

Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?Opersys inc.
 
Android Things: Android for IoT
Android Things: Android for IoTAndroid Things: Android for IoT
Android Things: Android for IoTOpersys inc.
 
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Opersys inc.
 
Android Things Internals
Android Things InternalsAndroid Things Internals
Android Things InternalsOpersys inc.
 
Brillo/Weave Internals
Brillo/Weave InternalsBrillo/Weave Internals
Brillo/Weave InternalsOpersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with NougatOpersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowKarim Yaghmour
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentKarim Yaghmour
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in AndroidOpersys inc.
 
Android Things Internals
Android Things InternalsAndroid Things Internals
Android Things InternalsOpersys inc.
 
Embedded Android Workshop with Oreo
Embedded Android Workshop with OreoEmbedded Android Workshop with Oreo
Embedded Android Workshop with OreoOpersys inc.
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in AndroidOpersys inc.
 
Android's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALAndroid's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALOpersys inc.
 

What's hot (19)

Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?
 
Android Things: Android for IoT
Android Things: Android for IoTAndroid Things: Android for IoT
Android Things: Android for IoT
 
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
 
Android Things Internals
Android Things InternalsAndroid Things Internals
Android Things Internals
 
Brillo/Weave Internals
Brillo/Weave InternalsBrillo/Weave Internals
Brillo/Weave Internals
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with Nougat
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with Marshmallow
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
 
Android Things Internals
Android Things InternalsAndroid Things Internals
Android Things Internals
 
Embedded Android Workshop with Oreo
Embedded Android Workshop with OreoEmbedded Android Workshop with Oreo
Embedded Android Workshop with Oreo
 
Project Ara
Project AraProject Ara
Project Ara
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in Android
 
Android's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALAndroid's HIDL: Treble in the HAL
Android's HIDL: Treble in the HAL
 

Viewers also liked

Is Android the New King of Embedded OSes at Embedded World 2014
Is Android the New King of Embedded OSes at Embedded World 2014Is Android the New King of Embedded OSes at Embedded World 2014
Is Android the New King of Embedded OSes at Embedded World 2014Opersys inc.
 
Embedded Android Workshop at AnDevCon VI
Embedded Android Workshop at AnDevCon VIEmbedded Android Workshop at AnDevCon VI
Embedded Android Workshop at AnDevCon VIOpersys inc.
 
Extending Android's Platform Toolsuite
Extending Android's Platform ToolsuiteExtending Android's Platform Toolsuite
Extending Android's Platform ToolsuiteOpersys inc.
 
Embedded Android Workshop at ABS 2014
Embedded Android Workshop at ABS 2014Embedded Android Workshop at ABS 2014
Embedded Android Workshop at ABS 2014Opersys inc.
 
Android Microconf at Linux Plumber 2012
Android Microconf at Linux Plumber 2012Android Microconf at Linux Plumber 2012
Android Microconf at Linux Plumber 2012Opersys inc.
 
Android On Development Boards at AnDevCon3
Android On Development Boards at AnDevCon3Android On Development Boards at AnDevCon3
Android On Development Boards at AnDevCon3Opersys inc.
 
Embedded Android Workshop with Lollipop
Embedded Android Workshop with LollipopEmbedded Android Workshop with Lollipop
Embedded Android Workshop with LollipopOpersys inc.
 
Leveraging Android's Linux Heritage at AnDevCon VI
Leveraging Android's Linux Heritage at AnDevCon VILeveraging Android's Linux Heritage at AnDevCon VI
Leveraging Android's Linux Heritage at AnDevCon VIOpersys inc.
 
Embedded Android Workshop at Embedded World Conference 2013
Embedded Android Workshop at Embedded World Conference 2013Embedded Android Workshop at Embedded World Conference 2013
Embedded Android Workshop at Embedded World Conference 2013Opersys inc.
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android WorkshopOpersys inc.
 
Embedded Android Workshop at Embedded World 2014
Embedded Android Workshop at Embedded World 2014Embedded Android Workshop at Embedded World 2014
Embedded Android Workshop at Embedded World 2014Opersys inc.
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android WorkshopOpersys inc.
 
Embedded Android Workshop with Lollipop
Embedded Android Workshop with LollipopEmbedded Android Workshop with Lollipop
Embedded Android Workshop with LollipopOpersys inc.
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in AndroidOpersys inc.
 
Android Platform Debugging and Development at ABS 2014
Android Platform Debugging and Development at ABS 2014Android Platform Debugging and Development at ABS 2014
Android Platform Debugging and Development at ABS 2014Opersys inc.
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowOpersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Is Android the New Embedded Linux? at AnDevCon VI
Is Android the New Embedded Linux? at AnDevCon VIIs Android the New Embedded Linux? at AnDevCon VI
Is Android the New Embedded Linux? at AnDevCon VIOpersys inc.
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in AndroidOpersys inc.
 
Running Code in the Android Stack at ABS 2014
Running Code in the Android Stack at ABS 2014Running Code in the Android Stack at ABS 2014
Running Code in the Android Stack at ABS 2014Opersys inc.
 

Viewers also liked (20)

Is Android the New King of Embedded OSes at Embedded World 2014
Is Android the New King of Embedded OSes at Embedded World 2014Is Android the New King of Embedded OSes at Embedded World 2014
Is Android the New King of Embedded OSes at Embedded World 2014
 
Embedded Android Workshop at AnDevCon VI
Embedded Android Workshop at AnDevCon VIEmbedded Android Workshop at AnDevCon VI
Embedded Android Workshop at AnDevCon VI
 
Extending Android's Platform Toolsuite
Extending Android's Platform ToolsuiteExtending Android's Platform Toolsuite
Extending Android's Platform Toolsuite
 
Embedded Android Workshop at ABS 2014
Embedded Android Workshop at ABS 2014Embedded Android Workshop at ABS 2014
Embedded Android Workshop at ABS 2014
 
Android Microconf at Linux Plumber 2012
Android Microconf at Linux Plumber 2012Android Microconf at Linux Plumber 2012
Android Microconf at Linux Plumber 2012
 
Android On Development Boards at AnDevCon3
Android On Development Boards at AnDevCon3Android On Development Boards at AnDevCon3
Android On Development Boards at AnDevCon3
 
Embedded Android Workshop with Lollipop
Embedded Android Workshop with LollipopEmbedded Android Workshop with Lollipop
Embedded Android Workshop with Lollipop
 
Leveraging Android's Linux Heritage at AnDevCon VI
Leveraging Android's Linux Heritage at AnDevCon VILeveraging Android's Linux Heritage at AnDevCon VI
Leveraging Android's Linux Heritage at AnDevCon VI
 
Embedded Android Workshop at Embedded World Conference 2013
Embedded Android Workshop at Embedded World Conference 2013Embedded Android Workshop at Embedded World Conference 2013
Embedded Android Workshop at Embedded World Conference 2013
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android Workshop
 
Embedded Android Workshop at Embedded World 2014
Embedded Android Workshop at Embedded World 2014Embedded Android Workshop at Embedded World 2014
Embedded Android Workshop at Embedded World 2014
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android Workshop
 
Embedded Android Workshop with Lollipop
Embedded Android Workshop with LollipopEmbedded Android Workshop with Lollipop
Embedded Android Workshop with Lollipop
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
 
Android Platform Debugging and Development at ABS 2014
Android Platform Debugging and Development at ABS 2014Android Platform Debugging and Development at ABS 2014
Android Platform Debugging and Development at ABS 2014
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with Marshmallow
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Is Android the New Embedded Linux? at AnDevCon VI
Is Android the New Embedded Linux? at AnDevCon VIIs Android the New Embedded Linux? at AnDevCon VI
Is Android the New Embedded Linux? at AnDevCon VI
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
 
Running Code in the Android Stack at ABS 2014
Running Code in the Android Stack at ABS 2014Running Code in the Android Stack at ABS 2014
Running Code in the Android Stack at ABS 2014
 

Similar to Developing Android Platform Tools

Android Internals at Linaro Connect Asia 2013
Android Internals at Linaro Connect Asia 2013Android Internals at Linaro Connect Asia 2013
Android Internals at Linaro Connect Asia 2013Opersys inc.
 
Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3Opersys inc.
 
Inside Android's UI
Inside Android's UIInside Android's UI
Inside Android's UIOpersys inc.
 
Inside Android's UI / ABS 2013
Inside Android's UI / ABS 2013Inside Android's UI / ABS 2013
Inside Android's UI / ABS 2013Opersys inc.
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux DevelopersOpersys inc.
 
Leveraging Android's Linux Heritage
Leveraging Android's Linux HeritageLeveraging Android's Linux Heritage
Leveraging Android's Linux HeritageOpersys inc.
 
Android Variants, Hacks, Tricks and Resources presented at AnDevConII
Android Variants, Hacks, Tricks and Resources presented at AnDevConIIAndroid Variants, Hacks, Tricks and Resources presented at AnDevConII
Android Variants, Hacks, Tricks and Resources presented at AnDevConIIOpersys inc.
 
Leveraging Android's Linux Heritage at ELC-E 2011
Leveraging Android's Linux Heritage at ELC-E 2011Leveraging Android's Linux Heritage at ELC-E 2011
Leveraging Android's Linux Heritage at ELC-E 2011Opersys inc.
 
Android Hacks, Variants, Tricks and Resources ESC SV 2012
Android Hacks, Variants, Tricks and Resources ESC SV 2012Android Hacks, Variants, Tricks and Resources ESC SV 2012
Android Hacks, Variants, Tricks and Resources ESC SV 2012Opersys inc.
 
Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)
Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)
Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)Ron Munitz
 
Leveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IVLeveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IVOpersys inc.
 
Building Android for the Cloud: Android as a Server (Mobile World Congress 2014)
Building Android for the Cloud: Android as a Server (Mobile World Congress 2014)Building Android for the Cloud: Android as a Server (Mobile World Congress 2014)
Building Android for the Cloud: Android as a Server (Mobile World Congress 2014)Ron Munitz
 
Android jumpstart at ESC Boston 2011
Android jumpstart at ESC Boston 2011Android jumpstart at ESC Boston 2011
Android jumpstart at ESC Boston 2011Opersys inc.
 
Begining Android Development
Begining Android DevelopmentBegining Android Development
Begining Android DevelopmentHayi Nukman
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
BeagleBoard Workshop ESC Boston 2011
BeagleBoard Workshop ESC Boston 2011BeagleBoard Workshop ESC Boston 2011
BeagleBoard Workshop ESC Boston 2011Opersys inc.
 
Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Opersys inc.
 
Android Jumpstart ESC SV 2012 Part I
Android Jumpstart ESC SV 2012 Part IAndroid Jumpstart ESC SV 2012 Part I
Android Jumpstart ESC SV 2012 Part IOpersys inc.
 

Similar to Developing Android Platform Tools (20)

Android Internals at Linaro Connect Asia 2013
Android Internals at Linaro Connect Asia 2013Android Internals at Linaro Connect Asia 2013
Android Internals at Linaro Connect Asia 2013
 
Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3
 
Inside Android's UI
Inside Android's UIInside Android's UI
Inside Android's UI
 
Inside Android's UI / ABS 2013
Inside Android's UI / ABS 2013Inside Android's UI / ABS 2013
Inside Android's UI / ABS 2013
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux Developers
 
Leveraging Android's Linux Heritage
Leveraging Android's Linux HeritageLeveraging Android's Linux Heritage
Leveraging Android's Linux Heritage
 
Android Variants, Hacks, Tricks and Resources presented at AnDevConII
Android Variants, Hacks, Tricks and Resources presented at AnDevConIIAndroid Variants, Hacks, Tricks and Resources presented at AnDevConII
Android Variants, Hacks, Tricks and Resources presented at AnDevConII
 
Leveraging Android's Linux Heritage at ELC-E 2011
Leveraging Android's Linux Heritage at ELC-E 2011Leveraging Android's Linux Heritage at ELC-E 2011
Leveraging Android's Linux Heritage at ELC-E 2011
 
Android Hacks, Variants, Tricks and Resources ESC SV 2012
Android Hacks, Variants, Tricks and Resources ESC SV 2012Android Hacks, Variants, Tricks and Resources ESC SV 2012
Android Hacks, Variants, Tricks and Resources ESC SV 2012
 
Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)
Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)
Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)
 
Leveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IVLeveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IV
 
Building Android for the Cloud: Android as a Server (Mobile World Congress 2014)
Building Android for the Cloud: Android as a Server (Mobile World Congress 2014)Building Android for the Cloud: Android as a Server (Mobile World Congress 2014)
Building Android for the Cloud: Android as a Server (Mobile World Congress 2014)
 
Android jumpstart at ESC Boston 2011
Android jumpstart at ESC Boston 2011Android jumpstart at ESC Boston 2011
Android jumpstart at ESC Boston 2011
 
Begining Android Development
Begining Android DevelopmentBegining Android Development
Begining Android Development
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
BeagleBoard Workshop ESC Boston 2011
BeagleBoard Workshop ESC Boston 2011BeagleBoard Workshop ESC Boston 2011
BeagleBoard Workshop ESC Boston 2011
 
Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013
 
Android Platform Debugging & Development
Android Platform Debugging & Development Android Platform Debugging & Development
Android Platform Debugging & Development
 
Android Attacks
Android AttacksAndroid Attacks
Android Attacks
 
Android Jumpstart ESC SV 2012 Part I
Android Jumpstart ESC SV 2012 Part IAndroid Jumpstart ESC SV 2012 Part I
Android Jumpstart ESC SV 2012 Part I
 

More from Opersys inc.

Android Automotive
Android AutomotiveAndroid Automotive
Android AutomotiveOpersys inc.
 
Android 10 Internals Update
Android 10 Internals UpdateAndroid 10 Internals Update
Android 10 Internals UpdateOpersys inc.
 
Android Security Internals
Android Security InternalsAndroid Security Internals
Android Security InternalsOpersys inc.
 
Embedded Android Workshop with Pie
Embedded Android Workshop with PieEmbedded Android Workshop with Pie
Embedded Android Workshop with PieOpersys inc.
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in AndroidOpersys inc.
 
Brillo / Weave Internals
Brillo / Weave InternalsBrillo / Weave Internals
Brillo / Weave InternalsOpersys inc.
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in AndroidOpersys inc.
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in AndroidOpersys inc.
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in AndroidOpersys inc.
 

More from Opersys inc. (10)

Android Automotive
Android AutomotiveAndroid Automotive
Android Automotive
 
Android 10 Internals Update
Android 10 Internals UpdateAndroid 10 Internals Update
Android 10 Internals Update
 
Android Security Internals
Android Security InternalsAndroid Security Internals
Android Security Internals
 
Embedded Android Workshop with Pie
Embedded Android Workshop with PieEmbedded Android Workshop with Pie
Embedded Android Workshop with Pie
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in Android
 
Brillo / Weave Internals
Brillo / Weave InternalsBrillo / Weave Internals
Brillo / Weave Internals
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
 
Project Ara
Project AraProject Ara
Project Ara
 

Recently uploaded

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 

Recently uploaded (20)

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 

Developing Android Platform Tools

  • 1. Developing Android Platform Tools Android Builders Summit 2015 François-Denis Gonthier @fdgonthier
  • 2. 2 AboutAbout ● Author and maintainer of: ● github.com/opersys/raidl
  • 3. 3 Agenda ● What's out there? ● What's the problem? ● Our Objectives ● Initial Set of Pain Points ● raidl – AIDL file lookup ● Architecture for Creating Monitoring Tools ● Process Explorer ● File Explorer ● Binder Explorer ● The Road Ahead
  • 4. 4 1. What's Out There Now? ● Official App Dev Tools ● Official Platform Dev Tools ● 3rd Party App Dev Tools ● 3rd Party Platform Dev Tools
  • 5. 5 1.1. Official App Dev tools ● Eclipse Android Development Kit ● Android Studio (IntelliJ) ● DDMS ● Plenty of documentation
  • 6. 6 1.2. Official Platform Dev Tools ● Tools on the previous pages ● gdb / gdbserver ● ftrace, systrace, atrace ● perf
  • 7. 7 1.3. 3rd Party App Dev Tools ● CrossWalk / Cordova ● Delphi ● Xamarin.Android ● etc.
  • 8. 8 1.4. 3rd Party Platform Dev Tools ● Qualcomm tools ● Intel tools, Nvidia tools, etc ● ARM Tools – DS-5 ● JTAG -- Lauterbach
  • 9. 9 2. What's The Problem? ● Google obviously catering to app developers – App dev tools have nice finish – Platform dev tools ... ● Official tools heavily tied to app dev IDE – Requires IDE-specific knowledge to extend/customize – Assumes official IDE is being used and/or is present ● Platform is huge
  • 10. 10 2. What's The Problem ● Documentation is often spartan ● Existing platform dev tools assume internals understanding – Do you truly know how to use “dumpsys procstats”, “dumpsys meminfo” or “vdc” ● Most platform tools can only be used on the command line ● Most 3rd party tools assume on-screen rendering of information
  • 11. 11 3. Our Objectives ● Reduce barrier to entry for platform development ● Catter for unmet patform developer needs ● Easy to use platform dev tools ● Build on lightweight/mainstream technologies: – No IDE-specific tie-in – Extensible language – Large ecosystem of reusable packages/add-ons ● Avoid monopolizing device screen
  • 12. 12 4. Initial Set of Pain Points ● Looking up AIDL interfaces ● Monitoring Processes ● Viewing / Manipulating the Filesystem ● Understanding Binder Relationships
  • 13. 13 4.1. Getting AIDL files ● find -name “*File.aidl” ● godir ● Android documentation – Focused on app developers – Doesn't cover everything
  • 14. 14 4.2. Process Monitoring ● ps / top ● htop (Cyanogenmod) ● Studio/Eclipse/DDMS/Monitor integrated ● On the Play Store... – ... hundreds of candidates – Few are aimed at developers
  • 15. 15 4.3. Filesystem Monitoring/Browsing ● ls, find ● adb push/pull ● On the Play Store... – ... hundreds of candidates – Few are aimed at developers
  • 17. 17 5. Raidl - Features ● Returns the AIDL interface of a service – AIDL based service – Best effort for other services (Activity service) – No interface for C++ service – No parameters names
  • 18. 18 5.1. Example Output root@generic:/data/local/tmp # ./raidl iface -n power // Service: power, Interface: android.os.IPowerManager package android.os; interface IPowerManager { void acquireWakeLock(IBinder p1, int n2, String s3, String s4, WorkSource p5, String s6); // 1 void acquireWakeLockWithUid(IBinder p1, int n2, String s3, String s4, int n5); // 2 void releaseWakeLock(IBinder p1, int n2); // 3 void updateWakeLockUids(IBinder p1, int[] p2); // 4 void powerHint(int n1, int n2); // 5 void updateWakeLockWorkSource(IBinder p1, WorkSource p2, String s3); // 6 boolean isWakeLockLevelSupported(int n1); // 7 void userActivity(long n1, int n2, int n3); // 8 void wakeUp(long n1); // 9 void goToSleep(long n1, int n2, int n3); // 10 void nap(long n1); // 11 boolean isInteractive(); // 12 boolean isPowerSaveMode(); // 13 boolean setPowerSaveMode(boolean p1); // 14 void reboot(boolean p1, String s2, boolean p3); // 15 void shutdown(boolean p1, boolean p2); // 16 void crash(String s1); // 17 void setStayOnSetting(int n1); // 18 void setMaximumScreenOffTimeoutFromDeviceAdmin(int n1); // 19 void setTemporaryScreenBrightnessSettingOverride(int n1); // 20 void setTemporaryScreenAutoBrightnessAdjustmentSettingOverride(float p1); // 21 void setAttentionLight(boolean p1, int n2); // 22 }
  • 20. 20 5.3. Raidl – How Does It Work? ServiceStubClass = Raidl.class.getClassLoader() .loadClass(serviceClass.getCanonicalName()+"$Stub"); for (Field serviceField : serviceStubClass.getDeclaredFields()) { // Get the fields that look like transaction code. } for (Method serviceMethod : serviceClass.getMethods()) serviceMethods.put(serviceMethod.getName(), serviceMethod); for (Integer serviceCode : serviceCodesMethods.keySet()) { // ... if (serviceMethod != null && isRemoteMethod(serviceMethod)) aidlService.addMethod(serviceCode, serviceMethod); }
  • 21. 21 5.4. Raild - Integrate in AOSP Build LOCAL_PATH:= $(call my­dir) include $(CLEAR_VARS) LOCAL_SRC_FILES := $(call all­java­files­under, src) LOCAL_PACKAGE_NAME := raidl LOCAL_MODULE_TAGS := optional LOCAL_PROGUARD_ENABLED := disabled include $(BUILD_PACKAGE) include $(CLEAR_VARS) LOCAL_SRC_FILES := raidl LOCAL_MODULE_PATH := $(TARGET_OUT)/bin LOCAL_MODULE_CLASS := EXECUTABLES LOCAL_MODULE := raidl LOCAL_MODULE_TAGS := optional include $(BUILD_PREBUILT)
  • 22. 22 5.5. Raild - Running an .apk ● .apk == .jar (with some DEX code) ● DexClassLoader:“A class loader that loads classes from .jar and .apk files [...]” ● Ergo: export CLASSPATH=/system/app/raidl.apk:/system/app/raidl/raidl.apk exec app_process /system/app com.opersys.raidl.Raidl "$@"
  • 23. 23 6. Architecture for Creating Monitoring Tools
  • 24. 24 6.1. Tool architecture ● Backend: Node.js + Express ● Frontend: Backbone.js + w2ui ● AJAX communication ● Websocket or Server-Sent events
  • 25. 25 6.2. Node.js in Android – Why? ● One language to rule them all: Javascript ● 132 510 Node.js packages ● Ease of use ● Web 2.0 support (SSE, WebSockets) ● Speed – V8 – Binary modules ● Runtime independence ● Few actual alternatives: Go, C/C++, Python, etc.
  • 26. 26 6.3. Node.js – It's easy! var express = require('express'); var app = express(); app.get('/home', function(req, res) {  res.send('Hello World'); }); app.listen(process.env.PORT || 8080);
  • 27. 27 6.4. Node.js in Android – Why not? ● Still pretty slow ● Runtime independence – Node is within its Linux bottle ● Difficult to package in Android ● It's Javascript – WAT! https://www.destroyallsoftware.com/talks/wat
  • 28. 28 6.5. How to use Node.js on Android ● Older versions (0.8), binaries available – Too old for comfort ● Development version (0.11, now 0.12) was patched with Android support ● Backported to 0.10 ● V0.10 Binaries are avaible! ● Io.js and Node v0.12: TBD. ● https://github.com/fdgonthier/node
  • 29. 29 6.6. Distribution ● Extracted in local files ● Multiple binary packages – ARM, ARM + PIE, ia32, ia32 + PIE ● Started by a simple Android application ● Able to start as root
  • 30. 30 7. Process Explorer ● Browser based process manager ● Displays logcat (live!) ● Process statistics – /proc based ● Needs root access for better function ● Works on Chrome and Firefox
  • 32. 32 8. File Explorer ● Browser based file manager for Android systems ● File upload/download ● File updates (live!) ● Needs root access for better function
  • 34. 34 9. Binder Explorer ● In development... ● Analysis of the links between Binder Services and Android applications ● Uses data from /sys/kernel/debug/binder ● Pushing further: JSLibBinder
  • 36. 36 9.1. Reaching Inside Android ● JSLibBinder – libbinder for Android var Binder = require("jslibbinder"),  var sm = new Binder.ServiceManager(); var services = sm.list(); var i = 0; console.log("Found " + services.length + " services:"); services.forEach(function (s) {     console.log((i++) + "t" + s                  + ": [" + sm.getService(s).getInterface() + "]"); });
  • 37. 37 10. The Road Ahead ● New Features: – Raidl – service to JS Binder interfaces – Process Explorer new version has: ● More /proc data: memory, network, process maps, etc. – File Explorer ... – Binder explorer: ● Allow JS calls to Binder ● New Tools: – We've got our ideas ;D – We'd like to hear from you: What are you looking for?