SlideShare a Scribd company logo
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?
Ad

More Related Content

What's hot (19)

Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
Opersys 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 IoT
Opersys 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 Internals
Opersys inc.
 
Brillo/Weave Internals
Brillo/Weave InternalsBrillo/Weave Internals
Brillo/Weave Internals
Opersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
Opersys inc.
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with Nougat
Opersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
Opersys inc.
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with Marshmallow
Karim Yaghmour
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
Opersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
Karim Yaghmour
 
Android Internals
Android InternalsAndroid Internals
Android Internals
Opersys inc.
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
Opersys inc.
 
Android Things Internals
Android Things InternalsAndroid Things Internals
Android Things Internals
Opersys inc.
 
Embedded Android Workshop with Oreo
Embedded Android Workshop with OreoEmbedded Android Workshop with Oreo
Embedded Android Workshop with Oreo
Opersys inc.
 
Project Ara
Project AraProject Ara
Project Ara
Opersys inc.
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in Android
Opersys 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 HAL
Opersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
Opersys 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 IoT
Opersys 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 Internals
Opersys inc.
 
Brillo/Weave Internals
Brillo/Weave InternalsBrillo/Weave Internals
Brillo/Weave Internals
Opersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
Opersys inc.
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with Nougat
Opersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
Opersys inc.
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with Marshmallow
Karim Yaghmour
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
Opersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
Karim Yaghmour
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
Opersys inc.
 
Android Things Internals
Android Things InternalsAndroid Things Internals
Android Things Internals
Opersys inc.
 
Embedded Android Workshop with Oreo
Embedded Android Workshop with OreoEmbedded Android Workshop with Oreo
Embedded Android Workshop with Oreo
Opersys inc.
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in Android
Opersys 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 HAL
Opersys 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
Opersys inc.
 
Embedded Android Workshop at AnDevCon VI
Embedded Android Workshop at AnDevCon VIEmbedded Android Workshop at AnDevCon VI
Embedded Android Workshop at AnDevCon VI
Opersys inc.
 
Extending Android's Platform Toolsuite
Extending Android's Platform ToolsuiteExtending Android's Platform Toolsuite
Extending Android's Platform Toolsuite
Opersys inc.
 
Embedded Android Workshop at ABS 2014
Embedded Android Workshop at ABS 2014Embedded Android Workshop at ABS 2014
Embedded Android Workshop at ABS 2014
Opersys inc.
 
Android Microconf at Linux Plumber 2012
Android Microconf at Linux Plumber 2012Android Microconf at Linux Plumber 2012
Android Microconf at Linux Plumber 2012
Opersys inc.
 
Android On Development Boards at AnDevCon3
Android On Development Boards at AnDevCon3Android On Development Boards at AnDevCon3
Android On Development Boards at AnDevCon3
Opersys inc.
 
Embedded Android Workshop with Lollipop
Embedded Android Workshop with LollipopEmbedded Android Workshop with Lollipop
Embedded Android Workshop with Lollipop
Opersys 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 VI
Opersys 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 2013
Opersys inc.
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android Workshop
Opersys 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 2014
Opersys inc.
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android Workshop
Opersys inc.
 
Embedded Android Workshop with Lollipop
Embedded Android Workshop with LollipopEmbedded Android Workshop with Lollipop
Embedded Android Workshop with Lollipop
Opersys inc.
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
Opersys 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 2014
Opersys inc.
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with Marshmallow
Opersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
Opersys 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 VI
Opersys inc.
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
Opersys 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 2014
Opersys inc.
 
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
Opersys inc.
 
Embedded Android Workshop at AnDevCon VI
Embedded Android Workshop at AnDevCon VIEmbedded Android Workshop at AnDevCon VI
Embedded Android Workshop at AnDevCon VI
Opersys inc.
 
Extending Android's Platform Toolsuite
Extending Android's Platform ToolsuiteExtending Android's Platform Toolsuite
Extending Android's Platform Toolsuite
Opersys inc.
 
Embedded Android Workshop at ABS 2014
Embedded Android Workshop at ABS 2014Embedded Android Workshop at ABS 2014
Embedded Android Workshop at ABS 2014
Opersys inc.
 
Android Microconf at Linux Plumber 2012
Android Microconf at Linux Plumber 2012Android Microconf at Linux Plumber 2012
Android Microconf at Linux Plumber 2012
Opersys inc.
 
Android On Development Boards at AnDevCon3
Android On Development Boards at AnDevCon3Android On Development Boards at AnDevCon3
Android On Development Boards at AnDevCon3
Opersys inc.
 
Embedded Android Workshop with Lollipop
Embedded Android Workshop with LollipopEmbedded Android Workshop with Lollipop
Embedded Android Workshop with Lollipop
Opersys 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 VI
Opersys 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 2013
Opersys inc.
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android Workshop
Opersys 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 2014
Opersys inc.
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android Workshop
Opersys inc.
 
Embedded Android Workshop with Lollipop
Embedded Android Workshop with LollipopEmbedded Android Workshop with Lollipop
Embedded Android Workshop with Lollipop
Opersys inc.
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
Opersys 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 2014
Opersys inc.
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with Marshmallow
Opersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
Opersys 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 VI
Opersys inc.
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
Opersys 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 2014
Opersys inc.
 
Ad

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
Opersys 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 AnDevCon3
Opersys inc.
 
Inside Android's UI
Inside Android's UIInside Android's UI
Inside Android's UI
Opersys inc.
 
Inside Android's UI / ABS 2013
Inside Android's UI / ABS 2013Inside Android's UI / ABS 2013
Inside Android's UI / ABS 2013
Opersys inc.
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux Developers
Opersys inc.
 
Leveraging Android's Linux Heritage
Leveraging Android's Linux HeritageLeveraging Android's Linux Heritage
Leveraging Android's Linux Heritage
Opersys 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 AnDevConII
Opersys 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 2011
Opersys 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 2012
Opersys 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 IV
Opersys 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 2011
Opersys inc.
 
Begining Android Development
Begining Android DevelopmentBegining Android Development
Begining Android Development
Hayi Nukman
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
Opersys inc.
 
BeagleBoard Workshop ESC Boston 2011
BeagleBoard Workshop ESC Boston 2011BeagleBoard Workshop ESC Boston 2011
BeagleBoard Workshop ESC Boston 2011
Opersys 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 2013
Opersys inc.
 
Android Platform Debugging & Development
Android Platform Debugging & Development Android Platform Debugging & Development
Android Platform Debugging & Development
Qualcomm Developer Network
 
Android Attacks
Android AttacksAndroid Attacks
Android Attacks
Michael Scovetta
 
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
Opersys inc.
 
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
Opersys 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 AnDevCon3
Opersys inc.
 
Inside Android's UI
Inside Android's UIInside Android's UI
Inside Android's UI
Opersys inc.
 
Inside Android's UI / ABS 2013
Inside Android's UI / ABS 2013Inside Android's UI / ABS 2013
Inside Android's UI / ABS 2013
Opersys inc.
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux Developers
Opersys inc.
 
Leveraging Android's Linux Heritage
Leveraging Android's Linux HeritageLeveraging Android's Linux Heritage
Leveraging Android's Linux Heritage
Opersys 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 AnDevConII
Opersys 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 2011
Opersys 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 2012
Opersys 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 IV
Opersys 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 2011
Opersys inc.
 
Begining Android Development
Begining Android DevelopmentBegining Android Development
Begining Android Development
Hayi Nukman
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
Opersys inc.
 
BeagleBoard Workshop ESC Boston 2011
BeagleBoard Workshop ESC Boston 2011BeagleBoard Workshop ESC Boston 2011
BeagleBoard Workshop ESC Boston 2011
Opersys 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 2013
Opersys 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 I
Opersys inc.
 
Ad

More from Opersys inc. (10)

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

Recently uploaded (20)

Designing AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDesigning AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Dinusha Kumarasiri
 
Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025
kashifyounis067
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRYLEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
NidaFarooq10
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Andre Hora
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Lionel Briand
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Not So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java WebinarNot So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java Webinar
Tier1 app
 
Top 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docxTop 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docx
Portli
 
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Dele Amefo
 
How can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptxHow can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptx
laravinson24
 
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDesigning AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Dinusha Kumarasiri
 
Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025
kashifyounis067
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRYLEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
NidaFarooq10
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Andre Hora
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Lionel Briand
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Not So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java WebinarNot So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java Webinar
Tier1 app
 
Top 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docxTop 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docx
Portli
 
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Dele Amefo
 
How can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptxHow can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptx
laravinson24
 

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?