SlideShare a Scribd company logo
1 of 60
Download to read offline
Hacking Android OS
  http://gplus.to/JimmyLIVE




             August 13, 2011
          Room TTN1, ITSC-CMU
Topics (1)
Why Android?
Introduction to AOSP
(Android Open-Source Project)
Compiling AOSP and Creating ROM
Architecture of Android OS
Android SDK, NDK, ADK
Introduction to CyanogenMod
Input Method Customization
Creating your own Launcher
Theme and Live Wall Paper
Topics (2)

Rooting Android Devices
HBoot, FastBoot, Recovery, S-OFF, Unlock
Bootloader
How to cook the Android ROM
Super User, ODEX, Deodex, Zip-align, Signing
How to trap SMS
Sensors in Android Phone
Introduction to Arduino and Android ADK
(Android Accessory Developer Kit)
Why Hacking?
Why Hacking?

To   know how it works
To   customize it
To   make it better
To   enhance it
To   have some FUN!

Not to do something illegal.
Not to do piracy.
The first step to

Thai Android OS
What will you get from this class?

  You will get NOTHING from this class but many
  links to where to read more

  You will break your phone’s warrantee

  You may BRICK your phone

  You may create the best phone on earth from the
  bad SH*T phone in your hands

  You may go to jail...
In case of Emergency
Why Android?
Android


Android is an open-source software stack
(OS, Middle ware, Applications) created for
mobile phones and other devices. The Android
Open Source Project (AOSP), led by Google,
is tasked with the maintenance and further
development of Android.
Why Android?

“We created Android in response to our own
experiences launching mobile apps. We wanted
to make sure that there was no central point
of failure, so that no industry player can
restrict or control the innovations of any
other. That's why we created Android, and
made its source code open.”

                                   - Google -
Why I love Android?



      I hate Dumbo!
Safe and Fun (for Kids)
Fully automatic turning left (with up & down)
Need to queue and pay
Have to be a “Good Boy” to get riding...
http://www.youtube.com/watch?v=15bQjiwzgUA




Un-safe but more Fun (not for Kids)
Turn left by yourself
Need brave heart
Have to be a “Good Boy” to buy BMW 1M
AOSP
(Android Open Source Project)
AOSP

The goal of the Android Open Source Project
is to create a successful real-world product
that improves the mobile experience for end
users.

To get and compile Android source code:
http:/ /source.android.com/source/
initializing.html
Android Release History
1.0 (branch name unknown, backnaming it Apple Pie)
1.1 (branch name unknown, backnaming Banana bread)
1.5 (Cupcake branch)
1.6 (Donut branch)
2.0 (Eclair branch)
2.1 (Eclair branch)
2.2 (Froyo branch)
2.3 (Gingerbread branch)
3.0 (Honeycomb branch)
3.1 (Honeycomb branch)
3.2 (Honeycomb branch)
(Ice Cream Sandwich)
To start

Get Android Source

Compile it

Unlock your phone
(lost your phone’s warantee)

Install the result ROM to your phone

(lost all of Google and Bundled apps)
Compile AOSP


$ . build/envsetup.sh

$ lunch
(Select target device)

$ make -j4
What is Crespo?



Developer Devices
  Dream (HTC G1)
  Sapphire
  Passion (Google Nexus One)
  Crespo (Google Nexus S)
  Crespo4G (Google Nexus S 4G)
Reboot to Bootloader

$ adb reboot bootloader

Use hardware button
Unlock Bootloader


$ fastboot oem unlock
  On Nexus One, the operation voids the warranty and
  is irreversible.
  On Nexus S and Nexus S 4G, the bootloader can be
  locked back with
  $ fastboot oem lock
Flash your built ROM


$ fastboot flashall -w

  Congratulations!
  You lost all Google and bundled apps!
Goo-inside.me



Google’s stuff and more...
Recovery



Rom Manager

ClockWorkMod Recovery
Try Flash


Google Apps

Restore your phone by flash OTA ROM

How to solve problem when you BRICK your
phone
HBoot, FastBoot, SPL
Hboot is the init script of the device. In others words, it
makes possible to the device power on and load all the
"programs"

Fastboot is protocol used to update the flash file system in
Android devices from a host over USB

The SPL, or Second Program Loader, in conjunction with the
IPL comprise a device's bootloader. Aside from bootstrapping
Android, the bootloader also fulfills various diagnostic
functions. One of these functions is the manipulation of data
in the device's internal flash ram. Depending on the SPL
installed, the user can apply a signed NBH file, flash nand
images, and more. Note that the SPL is installed and operates
independently of the Android build that runs atop it.
FastBoot



Fastboot Cheat Sheet
http://andblogs.net/fastboot/
Radio, SPL, Recovery
           http://goondroid.com/root



Radio

SPL

  System, Cache, Data

Recovery

ROM
Android Boot Process
http://www.androidenea.com/2009/06/android-boot-process-from-power-on.html



Boot ROM - load first stage bootloader into
system RAM
Bootloader
   First stage bootloader - init memory
   Second stage bootloader - load kernel to
   RAM
Linux Kernel
The Init process
Zygote and Dalvik VM
The System Server
Boot completed
Android Architecture
Create your own Android
 BeagleBoard
 http://beagleboard.org/



 Panda Board
 http://www.pandaboard.org/

 http://www.digikey.com/us/en/ph/texas-
 instruments/pandaboard.html
CyanogenMod

CyanogenMod is an aftermarket
firmware for a number of cell
phones based on the open-source
Android operating system. It
offers features not found in the
official Android based firmwares
of vendors of these cell phones.

http://www.cyanogenmod.com/
MIUI
MIUI, Redefining Android.

MIUI is one of the most popular Android ROMs in
the world.

It is based on Android 2.3 and has a unique UI
that looks and feels great to use. MIUI is
updated every Friday based on the feedback from
its users, it is then translated to English by our
translation team for you all to use and love. So
what are you waiting for, head over to the ROMS
section and download MIUI for your phone.

http://miuiandroid.com/
AOSP


Workflow
http://www.androidenea.com/2010/05/
android-open-source-project-workflow.html
Fixing Issue
Fixing Issue
Google TV & Android


The software that Google TV runs is a
version of Android that has been enhanced
to support video search, HDTV signaling, and
a full Google Chrome browser. It current'y
doesn't support certain Android features like
installing third party apps.
Writing Android Apps
Android Developer site
http://developer.android.com/index.html

Android SDK
http://developer.android.com/sdk/index.html

ADT plugin for Eclipse
http://developer.android.com/sdk/eclipse-adt.html

Android NDK
http://developer.android.com/sdk/eclipse-adt.html

Android Open Accesory Development Kit (ADK)
http://developer.android.com/guide/topics/usb/adk.html
Android App Building Box
Replace & Reuse
  Components
Customize AOSP

Our Goal: Thai Android OS
  Thai IME
  Thai Launcher
  Thai Theme & Live Wallpaper
  Thai Web Browser
  Thai Date & Time
  Thai Character Display
  Thai Sorting
  Thai Essential Apps
Customize IME
             (Brief Examples)



packages/inputmethods/LatinIME

Add xml-th

Customize Keyboard layout for THAI

(and many detail to fix and add such as word
suggestion vocabulary and behavior)
Launcher Customization
 ADW Launcher is a good place to start
 http://forum.xda-developers.com/
 showthread.php?t=645550

 http://code.google.com/p/adw-launcher-
 android/


 Source code:
 https://github.com/AnderWeb/
 android_packages_apps_Launcher
ADW.Launcher
ADW Theme

ADW Theme Guide
http://code.google.com/p/adw-launcher-
android/wiki/ADWThemeGuide

Theme Template
https://github.com/AnderWeb/ADW.Theme-
Template
LIVE Wallpaper


Start at “Cube LIVE Wallpaper” sample code
from Android SDK

Tutorial
http://blog.androgames.net/58/android-live-
wallpaper-tutorial/
How to Root
Revolutionary
http://forum.xda-developers.com/
showthread.php?t=1191732

SuperBoot
http://android-dls.com/wiki/index.php?
title=Use_Superboot_to_get_root

Galaxy S II
http://forum.xda-developers.com/
showthread.php?t=1103399
HTC Bootloader Unlock


(Coming soon)
http://htcdev.com/

While waiting, use Revolutionary :P
http://www.momobiles.com/s-off-htc-flyer-
with-revolutionary-tool/
Cooking Android

Unlock Bootloader (S-OFF)

Flash Custom Recovery

Cook a rooted ROM

Flash ROM

Have Fun!
dsixda’s Kitchen

A good start for Android ROM Cooker


“This is NOT a tool to automatically turn you into a full-
fledged ROM developer. ROM development normally involves
work from the ground up and involves time, research and
patience. I am just giving the tools to help the average
person get things done quickly from an existing base.”

                                                     dsixda
Reading about Cooking
How to cook ROM (Hero)
http://forum.xda-developers.com/
showthread.php?t=551711

How to cook ROM (Magic)
http://forum.xda-developers.com/
showthread.php?t=566235

Extract ROM file from HTC’s RUU
http://lukasz.szmit.eu/2010/04/extracting-
rom-files-from-htc-android.html
Signed Update.zip
The "signed update" type ROM image always contains the
following components:

boot.img - This file is a binary representation of the root file
system of the device. It contains the system kernel and all
files required to start the core part of Android

system - This is a directory containing all files found
under /system on a running Android device. It has exactly
the same layout.

META-INF - This is directory containing the update manifest
and script. The manifest is a file which lists all file included
in the update, with their SHA1 checksums. The update script
is used to apply the update on a device
ODEX File
"Normal" apps have an APK with a manifest, resources, and a
"classes.dex" inside. The classes.dex is optimized by the package
manager on first use, and ends up in /data/dalvik-cache/.

"System" apps have the DEX optimization performed ahead of time. The
resulting ".odex" file is stored next to the APK, the classes.dex is
removed from the APK, and the whole thing works without having to put
more stuff in your /data partition.

The optimized DEX files cannot easily be converted back to unoptimized
DEX, and I'm not sure there's any benefit in doing so. Both kinds of
DEX files can be examined with "dexdump".

More detail can be found in dalvik/docs/dexopt.html in the source
tree, or on the web at:

http://android.git.kernel.org/?p=platform/dalvik.git;a=blob_plain;f=docs/
dexopt.html;hb=HEAD
De-odex


Deodex Instruction
http://code.google.com/p/smali/wiki/
DeodexInstructions
Boot Logo & Animation


How to create
http://forum.samdroid.net/f55/tutorial-how-
create-custom-bootlogo-bootanimation-863/
Trapping SMS



Broadcast Receiver

SMS Received --> Your app --> FUN!
ADK & Arduino

Arduino Mega ADK
http://labs.arduino.cc/ADK/Index



Processing for Android
http://wiki.processing.org/w/Android
What’s next?

All source code available at
http://clicknect.com

Next Training
  Image Processing using OpenCV
  Introduction to OpenGL ES
  Introduction to WebGL
  Introduction to HTML5 Canvas
  (You can suggest topics)
Thank you
Enjoy your hacking!

More Related Content

What's hot

Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Opersys inc.
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in AndroidOpersys inc.
 
Android media framework overview
Android media framework overviewAndroid media framework overview
Android media framework overviewJerrin George
 
Q4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsQ4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsLinaro
 
Android's Multimedia Framework
Android's Multimedia FrameworkAndroid's Multimedia Framework
Android's Multimedia FrameworkOpersys inc.
 
Embedded Android Workshop with Pie
Embedded Android Workshop with PieEmbedded Android Workshop with Pie
Embedded Android Workshop with PieOpersys inc.
 
Android PPT Presentation 2018
Android PPT Presentation 2018Android PPT Presentation 2018
Android PPT Presentation 2018Rao Purna
 
Learning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverLearning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverNanik Tolaram
 
Understanding the Android System Server
Understanding the Android System ServerUnderstanding the Android System Server
Understanding the Android System ServerOpersys inc.
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android WorkshopOpersys inc.
 
Android Booting Sequence
Android Booting SequenceAndroid Booting Sequence
Android Booting SequenceJayanta Ghoshal
 
Android Security Internals
Android Security InternalsAndroid Security Internals
Android Security InternalsOpersys inc.
 
Android Development: The Basics
Android Development: The BasicsAndroid Development: The Basics
Android Development: The BasicsMike Desjardins
 

What's hot (20)

Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in Android
 
Android media framework overview
Android media framework overviewAndroid media framework overview
Android media framework overview
 
Q4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsQ4.11: Porting Android to new Platforms
Q4.11: Porting Android to new Platforms
 
Android's Multimedia Framework
Android's Multimedia FrameworkAndroid's Multimedia Framework
Android's Multimedia Framework
 
Embedded Android Workshop with Pie
Embedded Android Workshop with PieEmbedded Android Workshop with Pie
Embedded Android Workshop with Pie
 
Init of Android
Init of AndroidInit of Android
Init of Android
 
Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)
 
Android Audio System
Android Audio SystemAndroid Audio System
Android Audio System
 
Android PPT Presentation 2018
Android PPT Presentation 2018Android PPT Presentation 2018
Android PPT Presentation 2018
 
Binder: Android IPC
Binder: Android IPCBinder: Android IPC
Binder: Android IPC
 
Learning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverLearning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device Driver
 
Understanding the Android System Server
Understanding the Android System ServerUnderstanding the Android System Server
Understanding the Android System Server
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android Workshop
 
Android Booting Sequence
Android Booting SequenceAndroid Booting Sequence
Android Booting Sequence
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
Android Security Internals
Android Security InternalsAndroid Security Internals
Android Security Internals
 
Design and Concepts of Android Graphics
Design and Concepts of Android GraphicsDesign and Concepts of Android Graphics
Design and Concepts of Android Graphics
 
Android Development: The Basics
Android Development: The BasicsAndroid Development: The Basics
Android Development: The Basics
 
Android Presentation
Android PresentationAndroid Presentation
Android Presentation
 

Viewers also liked

Android OTA updates
Android OTA updatesAndroid OTA updates
Android OTA updatesGary Bisson
 
Growth Hacking For Mobile - Hack 2 Validate & Hack 2 Grow
Growth Hacking For Mobile - Hack 2 Validate & Hack 2 GrowGrowth Hacking For Mobile - Hack 2 Validate & Hack 2 Grow
Growth Hacking For Mobile - Hack 2 Validate & Hack 2 Growandreehuk
 
Android Hacking
Android HackingAndroid Hacking
Android Hackingantitree
 
Viruses
VirusesViruses
Viruses/ /
 
Hacking & its types
Hacking & its typesHacking & its types
Hacking & its typesSai Sakoji
 
The art of android hacking
The art of  android hackingThe art of  android hacking
The art of android hackingAbhinav Mishra
 
Hacking with Remote Admin Tools (RAT)
 Hacking with Remote Admin Tools (RAT) Hacking with Remote Admin Tools (RAT)
Hacking with Remote Admin Tools (RAT)Zoltan Balazs
 
Accessing Hardware on Android
Accessing Hardware on AndroidAccessing Hardware on Android
Accessing Hardware on AndroidGary Bisson
 
Android Hacking + Pentesting
Android Hacking + Pentesting Android Hacking + Pentesting
Android Hacking + Pentesting Sina Manavi
 
Android forensics an Custom Recovery Image
Android forensics an Custom Recovery ImageAndroid forensics an Custom Recovery Image
Android forensics an Custom Recovery ImageMohamed Khaled
 
Ultimate Guide to Setup DarkComet with NoIP
Ultimate Guide to Setup DarkComet with NoIPUltimate Guide to Setup DarkComet with NoIP
Ultimate Guide to Setup DarkComet with NoIPPich Pra Tna
 
Cryptovirology - by Malathi
Cryptovirology - by MalathiCryptovirology - by Malathi
Cryptovirology - by MalathiSanthosh Sundar
 

Viewers also liked (20)

How To Build Android for ARM Chip boards
How To Build Android for ARM Chip boardsHow To Build Android for ARM Chip boards
How To Build Android for ARM Chip boards
 
Mobile Hacking
Mobile HackingMobile Hacking
Mobile Hacking
 
Mobile phone Data Hacking
Mobile phone Data HackingMobile phone Data Hacking
Mobile phone Data Hacking
 
Android Custom Kernel/ROM design
Android Custom Kernel/ROM designAndroid Custom Kernel/ROM design
Android Custom Kernel/ROM design
 
Android OTA updates
Android OTA updatesAndroid OTA updates
Android OTA updates
 
Growth Hacking For Mobile - Hack 2 Validate & Hack 2 Grow
Growth Hacking For Mobile - Hack 2 Validate & Hack 2 GrowGrowth Hacking For Mobile - Hack 2 Validate & Hack 2 Grow
Growth Hacking For Mobile - Hack 2 Validate & Hack 2 Grow
 
Stealing sensitive data from android phones the hacker way
Stealing sensitive data from android phones   the hacker wayStealing sensitive data from android phones   the hacker way
Stealing sensitive data from android phones the hacker way
 
Android Hacking
Android HackingAndroid Hacking
Android Hacking
 
Hacking Mobile Apps
Hacking Mobile AppsHacking Mobile Apps
Hacking Mobile Apps
 
Viruses
VirusesViruses
Viruses
 
Hacking ppt
Hacking pptHacking ppt
Hacking ppt
 
Hacking & its types
Hacking & its typesHacking & its types
Hacking & its types
 
The art of android hacking
The art of  android hackingThe art of  android hacking
The art of android hacking
 
Hacking with Remote Admin Tools (RAT)
 Hacking with Remote Admin Tools (RAT) Hacking with Remote Admin Tools (RAT)
Hacking with Remote Admin Tools (RAT)
 
Accessing Hardware on Android
Accessing Hardware on AndroidAccessing Hardware on Android
Accessing Hardware on Android
 
Android Hacking + Pentesting
Android Hacking + Pentesting Android Hacking + Pentesting
Android Hacking + Pentesting
 
Android forensics an Custom Recovery Image
Android forensics an Custom Recovery ImageAndroid forensics an Custom Recovery Image
Android forensics an Custom Recovery Image
 
Ultimate Guide to Setup DarkComet with NoIP
Ultimate Guide to Setup DarkComet with NoIPUltimate Guide to Setup DarkComet with NoIP
Ultimate Guide to Setup DarkComet with NoIP
 
Cryptovirology - by Malathi
Cryptovirology - by MalathiCryptovirology - by Malathi
Cryptovirology - by Malathi
 
Chiang Mai Maker Club
Chiang Mai Maker ClubChiang Mai Maker Club
Chiang Mai Maker Club
 

Similar to Hacking Android OS

Rooting an Android phone
Rooting an Android phoneRooting an Android phone
Rooting an Android phoneArnav Gupta
 
Android Rooting Technology
Android Rooting TechnologyAndroid Rooting Technology
Android Rooting TechnologyTarak Tar
 
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...Paris Open Source Summit
 
PRESENTATION ON ANDROID
PRESENTATION ON ANDROIDPRESENTATION ON ANDROID
PRESENTATION ON ANDROIDRajat Kumar
 
Introduction to Android (in-short) - Itvedant, Thane | Mumbai | Navi Mumbai
Introduction to Android (in-short) - Itvedant, Thane | Mumbai | Navi MumbaiIntroduction to Android (in-short) - Itvedant, Thane | Mumbai | Navi Mumbai
Introduction to Android (in-short) - Itvedant, Thane | Mumbai | Navi MumbaiItvedant
 
Android Embedded - Smart Hubs als Schaltzentrale des IoT
Android Embedded - Smart Hubs als Schaltzentrale des IoTAndroid Embedded - Smart Hubs als Schaltzentrale des IoT
Android Embedded - Smart Hubs als Schaltzentrale des IoTinovex GmbH
 
Android and it’s applications
Android and it’s applicationsAndroid and it’s applications
Android and it’s applicationsamee yaami
 
Presentation on android
Presentation on androidPresentation on android
Presentation on androidsonyhontok
 
Development environment
Development environmentDevelopment environment
Development environmentmaamir farooq
 
Android app development ppt
Android app development pptAndroid app development ppt
Android app development pptsaitej15
 
Software training report
Software training reportSoftware training report
Software training reportNatasha Bains
 
Android introduction and rooting technology
Android introduction and rooting technologyAndroid introduction and rooting technology
Android introduction and rooting technologyGagandeep Nanda
 
WhitePaper : Security issues in android custom rom
WhitePaper : Security issues in android custom romWhitePaper : Security issues in android custom rom
WhitePaper : Security issues in android custom romAnant Shrivastava
 
android Rajeshppt
android Rajeshpptandroid Rajeshppt
android RajeshpptRaj K
 
ANDROID MOBILE OPERATING SYSTEM
ANDROID MOBILE OPERATING SYSTEMANDROID MOBILE OPERATING SYSTEM
ANDROID MOBILE OPERATING SYSTEMpreeta sinha
 

Similar to Hacking Android OS (20)

Rooting an Android phone
Rooting an Android phoneRooting an Android phone
Rooting an Android phone
 
Android Rooting Technology
Android Rooting TechnologyAndroid Rooting Technology
Android Rooting Technology
 
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
 
PRESENTATION ON ANDROID
PRESENTATION ON ANDROIDPRESENTATION ON ANDROID
PRESENTATION ON ANDROID
 
Android
AndroidAndroid
Android
 
Introduction to Android (in-short) - Itvedant, Thane | Mumbai | Navi Mumbai
Introduction to Android (in-short) - Itvedant, Thane | Mumbai | Navi MumbaiIntroduction to Android (in-short) - Itvedant, Thane | Mumbai | Navi Mumbai
Introduction to Android (in-short) - Itvedant, Thane | Mumbai | Navi Mumbai
 
Android Embedded - Smart Hubs als Schaltzentrale des IoT
Android Embedded - Smart Hubs als Schaltzentrale des IoTAndroid Embedded - Smart Hubs als Schaltzentrale des IoT
Android Embedded - Smart Hubs als Schaltzentrale des IoT
 
Android and it’s applications
Android and it’s applicationsAndroid and it’s applications
Android and it’s applications
 
Webinar on Google Android SDK
Webinar on Google Android SDKWebinar on Google Android SDK
Webinar on Google Android SDK
 
Presentation on android
Presentation on androidPresentation on android
Presentation on android
 
Development environment
Development environmentDevelopment environment
Development environment
 
Android app development ppt
Android app development pptAndroid app development ppt
Android app development ppt
 
Android Stsucture
Android StsuctureAndroid Stsucture
Android Stsucture
 
Software training report
Software training reportSoftware training report
Software training report
 
Introduction to Android Environment
Introduction to Android EnvironmentIntroduction to Android Environment
Introduction to Android Environment
 
Android introduction and rooting technology
Android introduction and rooting technologyAndroid introduction and rooting technology
Android introduction and rooting technology
 
Security Issues in Android Custom Rom - Whitepaper
Security Issues in Android Custom Rom - WhitepaperSecurity Issues in Android Custom Rom - Whitepaper
Security Issues in Android Custom Rom - Whitepaper
 
WhitePaper : Security issues in android custom rom
WhitePaper : Security issues in android custom romWhitePaper : Security issues in android custom rom
WhitePaper : Security issues in android custom rom
 
android Rajeshppt
android Rajeshpptandroid Rajeshppt
android Rajeshppt
 
ANDROID MOBILE OPERATING SYSTEM
ANDROID MOBILE OPERATING SYSTEMANDROID MOBILE OPERATING SYSTEM
ANDROID MOBILE OPERATING SYSTEM
 

Recently uploaded

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 

Recently uploaded (20)

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 

Hacking Android OS

  • 1. Hacking Android OS http://gplus.to/JimmyLIVE August 13, 2011 Room TTN1, ITSC-CMU
  • 2. Topics (1) Why Android? Introduction to AOSP (Android Open-Source Project) Compiling AOSP and Creating ROM Architecture of Android OS Android SDK, NDK, ADK Introduction to CyanogenMod Input Method Customization Creating your own Launcher Theme and Live Wall Paper
  • 3. Topics (2) Rooting Android Devices HBoot, FastBoot, Recovery, S-OFF, Unlock Bootloader How to cook the Android ROM Super User, ODEX, Deodex, Zip-align, Signing How to trap SMS Sensors in Android Phone Introduction to Arduino and Android ADK (Android Accessory Developer Kit)
  • 5. Why Hacking? To know how it works To customize it To make it better To enhance it To have some FUN! Not to do something illegal. Not to do piracy.
  • 6. The first step to Thai Android OS
  • 7. What will you get from this class? You will get NOTHING from this class but many links to where to read more You will break your phone’s warrantee You may BRICK your phone You may create the best phone on earth from the bad SH*T phone in your hands You may go to jail...
  • 8. In case of Emergency
  • 10. Android Android is an open-source software stack (OS, Middle ware, Applications) created for mobile phones and other devices. The Android Open Source Project (AOSP), led by Google, is tasked with the maintenance and further development of Android.
  • 11. Why Android? “We created Android in response to our own experiences launching mobile apps. We wanted to make sure that there was no central point of failure, so that no industry player can restrict or control the innovations of any other. That's why we created Android, and made its source code open.” - Google -
  • 12. Why I love Android? I hate Dumbo!
  • 13. Safe and Fun (for Kids) Fully automatic turning left (with up & down) Need to queue and pay Have to be a “Good Boy” to get riding...
  • 14. http://www.youtube.com/watch?v=15bQjiwzgUA Un-safe but more Fun (not for Kids) Turn left by yourself Need brave heart Have to be a “Good Boy” to buy BMW 1M
  • 16. AOSP The goal of the Android Open Source Project is to create a successful real-world product that improves the mobile experience for end users. To get and compile Android source code: http:/ /source.android.com/source/ initializing.html
  • 17. Android Release History 1.0 (branch name unknown, backnaming it Apple Pie) 1.1 (branch name unknown, backnaming Banana bread) 1.5 (Cupcake branch) 1.6 (Donut branch) 2.0 (Eclair branch) 2.1 (Eclair branch) 2.2 (Froyo branch) 2.3 (Gingerbread branch) 3.0 (Honeycomb branch) 3.1 (Honeycomb branch) 3.2 (Honeycomb branch) (Ice Cream Sandwich)
  • 18. To start Get Android Source Compile it Unlock your phone (lost your phone’s warantee) Install the result ROM to your phone (lost all of Google and Bundled apps)
  • 19. Compile AOSP $ . build/envsetup.sh $ lunch (Select target device) $ make -j4
  • 20. What is Crespo? Developer Devices Dream (HTC G1) Sapphire Passion (Google Nexus One) Crespo (Google Nexus S) Crespo4G (Google Nexus S 4G)
  • 21. Reboot to Bootloader $ adb reboot bootloader Use hardware button
  • 22. Unlock Bootloader $ fastboot oem unlock On Nexus One, the operation voids the warranty and is irreversible. On Nexus S and Nexus S 4G, the bootloader can be locked back with $ fastboot oem lock
  • 23. Flash your built ROM $ fastboot flashall -w Congratulations! You lost all Google and bundled apps!
  • 26. Try Flash Google Apps Restore your phone by flash OTA ROM How to solve problem when you BRICK your phone
  • 27. HBoot, FastBoot, SPL Hboot is the init script of the device. In others words, it makes possible to the device power on and load all the "programs" Fastboot is protocol used to update the flash file system in Android devices from a host over USB The SPL, or Second Program Loader, in conjunction with the IPL comprise a device's bootloader. Aside from bootstrapping Android, the bootloader also fulfills various diagnostic functions. One of these functions is the manipulation of data in the device's internal flash ram. Depending on the SPL installed, the user can apply a signed NBH file, flash nand images, and more. Note that the SPL is installed and operates independently of the Android build that runs atop it.
  • 29. Radio, SPL, Recovery http://goondroid.com/root Radio SPL System, Cache, Data Recovery ROM
  • 30. Android Boot Process http://www.androidenea.com/2009/06/android-boot-process-from-power-on.html Boot ROM - load first stage bootloader into system RAM Bootloader First stage bootloader - init memory Second stage bootloader - load kernel to RAM Linux Kernel The Init process Zygote and Dalvik VM The System Server Boot completed
  • 32. Create your own Android BeagleBoard http://beagleboard.org/ Panda Board http://www.pandaboard.org/ http://www.digikey.com/us/en/ph/texas- instruments/pandaboard.html
  • 33. CyanogenMod CyanogenMod is an aftermarket firmware for a number of cell phones based on the open-source Android operating system. It offers features not found in the official Android based firmwares of vendors of these cell phones. http://www.cyanogenmod.com/
  • 34. MIUI MIUI, Redefining Android. MIUI is one of the most popular Android ROMs in the world. It is based on Android 2.3 and has a unique UI that looks and feels great to use. MIUI is updated every Friday based on the feedback from its users, it is then translated to English by our translation team for you all to use and love. So what are you waiting for, head over to the ROMS section and download MIUI for your phone. http://miuiandroid.com/
  • 38. Google TV & Android The software that Google TV runs is a version of Android that has been enhanced to support video search, HDTV signaling, and a full Google Chrome browser. It current'y doesn't support certain Android features like installing third party apps.
  • 39. Writing Android Apps Android Developer site http://developer.android.com/index.html Android SDK http://developer.android.com/sdk/index.html ADT plugin for Eclipse http://developer.android.com/sdk/eclipse-adt.html Android NDK http://developer.android.com/sdk/eclipse-adt.html Android Open Accesory Development Kit (ADK) http://developer.android.com/guide/topics/usb/adk.html
  • 41. Replace & Reuse Components
  • 42. Customize AOSP Our Goal: Thai Android OS Thai IME Thai Launcher Thai Theme & Live Wallpaper Thai Web Browser Thai Date & Time Thai Character Display Thai Sorting Thai Essential Apps
  • 43. Customize IME (Brief Examples) packages/inputmethods/LatinIME Add xml-th Customize Keyboard layout for THAI (and many detail to fix and add such as word suggestion vocabulary and behavior)
  • 44. Launcher Customization ADW Launcher is a good place to start http://forum.xda-developers.com/ showthread.php?t=645550 http://code.google.com/p/adw-launcher- android/ Source code: https://github.com/AnderWeb/ android_packages_apps_Launcher
  • 46. ADW Theme ADW Theme Guide http://code.google.com/p/adw-launcher- android/wiki/ADWThemeGuide Theme Template https://github.com/AnderWeb/ADW.Theme- Template
  • 47. LIVE Wallpaper Start at “Cube LIVE Wallpaper” sample code from Android SDK Tutorial http://blog.androgames.net/58/android-live- wallpaper-tutorial/
  • 49. HTC Bootloader Unlock (Coming soon) http://htcdev.com/ While waiting, use Revolutionary :P http://www.momobiles.com/s-off-htc-flyer- with-revolutionary-tool/
  • 50. Cooking Android Unlock Bootloader (S-OFF) Flash Custom Recovery Cook a rooted ROM Flash ROM Have Fun!
  • 51. dsixda’s Kitchen A good start for Android ROM Cooker “This is NOT a tool to automatically turn you into a full- fledged ROM developer. ROM development normally involves work from the ground up and involves time, research and patience. I am just giving the tools to help the average person get things done quickly from an existing base.” dsixda
  • 52. Reading about Cooking How to cook ROM (Hero) http://forum.xda-developers.com/ showthread.php?t=551711 How to cook ROM (Magic) http://forum.xda-developers.com/ showthread.php?t=566235 Extract ROM file from HTC’s RUU http://lukasz.szmit.eu/2010/04/extracting- rom-files-from-htc-android.html
  • 53. Signed Update.zip The "signed update" type ROM image always contains the following components: boot.img - This file is a binary representation of the root file system of the device. It contains the system kernel and all files required to start the core part of Android system - This is a directory containing all files found under /system on a running Android device. It has exactly the same layout. META-INF - This is directory containing the update manifest and script. The manifest is a file which lists all file included in the update, with their SHA1 checksums. The update script is used to apply the update on a device
  • 54. ODEX File "Normal" apps have an APK with a manifest, resources, and a "classes.dex" inside. The classes.dex is optimized by the package manager on first use, and ends up in /data/dalvik-cache/. "System" apps have the DEX optimization performed ahead of time. The resulting ".odex" file is stored next to the APK, the classes.dex is removed from the APK, and the whole thing works without having to put more stuff in your /data partition. The optimized DEX files cannot easily be converted back to unoptimized DEX, and I'm not sure there's any benefit in doing so. Both kinds of DEX files can be examined with "dexdump". More detail can be found in dalvik/docs/dexopt.html in the source tree, or on the web at: http://android.git.kernel.org/?p=platform/dalvik.git;a=blob_plain;f=docs/ dexopt.html;hb=HEAD
  • 56. Boot Logo & Animation How to create http://forum.samdroid.net/f55/tutorial-how- create-custom-bootlogo-bootanimation-863/
  • 57. Trapping SMS Broadcast Receiver SMS Received --> Your app --> FUN!
  • 58. ADK & Arduino Arduino Mega ADK http://labs.arduino.cc/ADK/Index Processing for Android http://wiki.processing.org/w/Android
  • 59. What’s next? All source code available at http://clicknect.com Next Training Image Processing using OpenCV Introduction to OpenGL ES Introduction to WebGL Introduction to HTML5 Canvas (You can suggest topics)