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?

More Related Content

PDF
Embedded Android Workshop
PDF
Android Platform Debugging and Development
PDF
Embedded Android Workshop with Nougat
PDF
Embedded Android Workshop with Marshmallow
PDF
Embedded Android Workshop with Nougat
PDF
Android Platform Debugging and Development
PDF
Brillo / Weave Internals
PDF
Embedded Android Workshop with Marshmallow
Embedded Android Workshop
Android Platform Debugging and Development
Embedded Android Workshop with Nougat
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with Nougat
Android Platform Debugging and Development
Brillo / Weave Internals
Embedded Android Workshop with Marshmallow

What's hot (19)

PDF
Android Platform Debugging and Development
PDF
Android Treble: Blessing or Trouble?
PDF
Android Things: Android for IoT
PDF
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
PDF
Android Things Internals
PDF
Brillo/Weave Internals
PDF
Android Platform Debugging and Development
PDF
Embedded Android Workshop with Nougat
PDF
Android Platform Debugging and Development
PDF
Embedded Android Workshop with Marshmallow
PDF
Android Platform Debugging and Development
PDF
Android Platform Debugging and Development
PDF
Android Internals
PDF
Memory Management in Android
PDF
Android Things Internals
PDF
Embedded Android Workshop with Oreo
PDF
Project Ara
PDF
Scheduling in Android
PDF
Android's HIDL: Treble in the HAL
Android Platform Debugging and Development
Android Treble: Blessing or Trouble?
Android Things: Android for IoT
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Android Things Internals
Brillo/Weave Internals
Android Platform Debugging and Development
Embedded Android Workshop with Nougat
Android Platform Debugging and Development
Embedded Android Workshop with Marshmallow
Android Platform Debugging and Development
Android Platform Debugging and Development
Android Internals
Memory Management in Android
Android Things Internals
Embedded Android Workshop with Oreo
Project Ara
Scheduling in Android
Android's HIDL: Treble in the HAL
Ad

Viewers also liked (20)

PDF
Is Android the New King of Embedded OSes at Embedded World 2014
PDF
Embedded Android Workshop at AnDevCon VI
PDF
Extending Android's Platform Toolsuite
PDF
Embedded Android Workshop at ABS 2014
PDF
Android Microconf at Linux Plumber 2012
PDF
Android On Development Boards at AnDevCon3
PDF
Embedded Android Workshop with Lollipop
PDF
Leveraging Android's Linux Heritage at AnDevCon VI
PDF
Embedded Android Workshop at Embedded World Conference 2013
PDF
Embedded Android Workshop
PDF
Embedded Android Workshop at Embedded World 2014
PDF
Embedded Android Workshop
PDF
Embedded Android Workshop with Lollipop
PDF
Memory Management in Android
PDF
Android Platform Debugging and Development at ABS 2014
PDF
Embedded Android Workshop with Marshmallow
PDF
Android Platform Debugging and Development
PDF
Is Android the New Embedded Linux? at AnDevCon VI
PDF
Memory Management in Android
PDF
Running Code in the Android Stack at ABS 2014
Is Android the New King of Embedded OSes at Embedded World 2014
Embedded Android Workshop at AnDevCon VI
Extending Android's Platform Toolsuite
Embedded Android Workshop at ABS 2014
Android Microconf at Linux Plumber 2012
Android On Development Boards at AnDevCon3
Embedded Android Workshop with Lollipop
Leveraging Android's Linux Heritage at AnDevCon VI
Embedded Android Workshop at Embedded World Conference 2013
Embedded Android Workshop
Embedded Android Workshop at Embedded World 2014
Embedded Android Workshop
Embedded Android Workshop with Lollipop
Memory Management in Android
Android Platform Debugging and Development at ABS 2014
Embedded Android Workshop with Marshmallow
Android Platform Debugging and Development
Is Android the New Embedded Linux? at AnDevCon VI
Memory Management in Android
Running Code in the Android Stack at ABS 2014
Ad

Similar to Developing Android Platform Tools (20)

PDF
Android Platform Debugging & Development
PDF
An Introduction To Android
PDF
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
PDF
Android Platform Debugging and Development
PDF
Understanding the Android System Server
PDF
Android Internals at Linaro Connect Asia 2013
PDF
Embedded Android in Real Life - Live Embedded Event 2021
PDF
Programming Android Zigurd Mednieks Laird Dornin Blake Meike
PDF
Android Platform Debugging and Development at ELCE 2013
PPTX
Android village @nullcon 2012
PDF
Android Internals
PPTX
128-ch4.pptx
PDF
Running Code in the Android Stack at ELCE 2013
PDF
Blake Nakamura Masumi Programming Android 2nd Edition Mednieks Zigurd
PDF
Android Internals (This is not the droid you’re loking for...)
PDF
CNIT 128 Ch 4: Android
PPTX
01 introduction & setup - Android
PDF
Android Patching & Client-Side CyberSecurity
PPTX
Introduction to Android (before 2015)
PPTX
[Wroclaw #1] Android Security Workshop
Android Platform Debugging & Development
An Introduction To Android
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Android Platform Debugging and Development
Understanding the Android System Server
Android Internals at Linaro Connect Asia 2013
Embedded Android in Real Life - Live Embedded Event 2021
Programming Android Zigurd Mednieks Laird Dornin Blake Meike
Android Platform Debugging and Development at ELCE 2013
Android village @nullcon 2012
Android Internals
128-ch4.pptx
Running Code in the Android Stack at ELCE 2013
Blake Nakamura Masumi Programming Android 2nd Edition Mednieks Zigurd
Android Internals (This is not the droid you’re loking for...)
CNIT 128 Ch 4: Android
01 introduction & setup - Android
Android Patching & Client-Side CyberSecurity
Introduction to Android (before 2015)
[Wroclaw #1] Android Security Workshop

More from Opersys inc. (10)

PDF
Android Automotive
PDF
Android 10 Internals Update
PDF
Android Security Internals
PDF
Embedded Android Workshop with Pie
PDF
Scheduling in Android
PDF
Brillo / Weave Internals
PDF
Memory Management in Android
PDF
Memory Management in Android
PDF
Memory Management in Android
PDF
Project Ara
Android Automotive
Android 10 Internals Update
Android Security Internals
Embedded Android Workshop with Pie
Scheduling in Android
Brillo / Weave Internals
Memory Management in Android
Memory Management in Android
Memory Management in Android
Project Ara

Recently uploaded (20)

PDF
top salesforce developer skills in 2025.pdf
PDF
System and Network Administration Chapter 2
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
ISO 45001 Occupational Health and Safety Management System
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
Transform Your Business with a Software ERP System
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPT
Introduction Database Management System for Course Database
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
top salesforce developer skills in 2025.pdf
System and Network Administration Chapter 2
Which alternative to Crystal Reports is best for small or large businesses.pdf
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
ManageIQ - Sprint 268 Review - Slide Deck
How Creative Agencies Leverage Project Management Software.pdf
PTS Company Brochure 2025 (1).pdf.......
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
ISO 45001 Occupational Health and Safety Management System
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Transform Your Business with a Software ERP System
Adobe Illustrator 28.6 Crack My Vision of Vector Design
How to Choose the Right IT Partner for Your Business in Malaysia
How to Migrate SBCGlobal Email to Yahoo Easily
Introduction Database Management System for Course Database
Design an Analysis of Algorithms II-SECS-1021-03
Odoo Companies in India – Driving Business Transformation.pdf
2025 Textile ERP Trends: SAP, Odoo & Oracle
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...

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?