Successfully reported this slideshow.
USB storage on Android Magnus Jahnen
USB mass storage
on Android
Implementation of an Android Framework for USB
storage ac...
USB storage on Android Magnus Jahnen
USB storage on Android
1. Introduction
2. Basics of USB
3. USB mass storage class
4. ...
USB storage on Android Magnus Jahnen
Introduction
• USB features in Android since 3.1 Honeycomb
• Mass storage access: Cur...
USB storage on Android Magnus Jahnen
Basics of USB
• Stands for: Universal Serial Bus
• Standard by the USB Implementers f...
USB storage on Android Magnus Jahnen
Client Device Hierarchy
5
USB storage on Android Magnus Jahnen
Endpoints
• Unidirectional communication pipes
• Different types
• Control
• Interrup...
USB storage on Android Magnus Jahnen
USB mass storage class
• Determined by class and subclass in interface
descriptor
• T...
USB storage on Android Magnus Jahnen
Bulk-only transfer
• USB interface must have IN and OUT bulk endpoint
• Different pro...
USB storage on Android Magnus Jahnen
SCSI transparent command set
• Command Block Wrapper (CBW)
• Includes SCSI command
• ...
USB storage on Android Magnus Jahnen
SCSI commands
• INQUIRY
• READ CAPACITY(10)
• READ(10)
• REQUEST SENSE
• TEST UNIT RE...
USB storage on Android Magnus Jahnen
FAT32 file system
• Belongs to FAT family
• Developed by Microsoft
• Released in 1996 ...
USB storage on Android Magnus Jahnen
General layout
12
USB storage on Android Magnus Jahnen
FAT
13
USB storage on Android Magnus Jahnen
Data Area
• Structured in clusters
• Directories and files
• Directories have a defined...
USB storage on Android Magnus Jahnen
Implementation
15
partition
handling of partitions
and partition tables
fs
file syste...
USB storage on Android Magnus Jahnen
Driver package
16
uses
creates
ScsiInquiry
+ScsiInquiry(): ctor
+serialize(ByteBuffer...
USB storage on Android Magnus Jahnen
Results
• Supported features:
• Bulk-only transfer
• FAT32 (MBR)
• Usual directory/fil...
USB storage on Android Magnus Jahnen
Demonstration
18
USB storage on Android Magnus Jahnen
Thank you for your attention!
Questions?
19
USB storage on Android Magnus Jahnen
Image resources
(In the order they appear)
• http://diepresse.com/layout/diepresse/fil...
Upcoming SlideShare
Loading in …5
×

USB mass storage on Android

491 views

Published on

Implementation of an Android Framework for USB storage access without root rights

Bachelor thesis
23.04.2014

Framework: https://github.com/mjdev/libaums

Published in: Software
  • Be the first to comment

USB mass storage on Android

  1. 1. USB storage on Android Magnus Jahnen USB mass storage on Android Implementation of an Android Framework for USB storage access without root rights 1 Bachelor thesis 23.04.2014
  2. 2. USB storage on Android Magnus Jahnen USB storage on Android 1. Introduction 2. Basics of USB 3. USB mass storage class 4. FAT32 file system 5. Implementation 6. Results 2
  3. 3. USB storage on Android Magnus Jahnen Introduction • USB features in Android since 3.1 Honeycomb • Mass storage access: Currently two proprietary applications available • USB-Stick Plugin-TC (Plugin for Total Commander) • Nexus Media Importer 3
  4. 4. USB storage on Android Magnus Jahnen Basics of USB • Stands for: Universal Serial Bus • Standard by the USB Implementers forum • Host (master) and multiple clients (slaves) • Host powers the client and manages communication process • USB On the go as part of USB 2.0 4
  5. 5. USB storage on Android Magnus Jahnen Client Device Hierarchy 5
  6. 6. USB storage on Android Magnus Jahnen Endpoints • Unidirectional communication pipes • Different types • Control • Interrupt • Bulk • Isochronous 6
  7. 7. USB storage on Android Magnus Jahnen USB mass storage class • Determined by class and subclass in interface descriptor • Two different types • Control/Bulk/Interrupt (CBI) [obsolete] • Bulk-only transfer (BBB) 7
  8. 8. USB storage on Android Magnus Jahnen Bulk-only transfer • USB interface must have IN and OUT bulk endpoint • Different protocols (specified by interface subclass) • Reduced Block Commands (RBC) • SCSI transparent command set (most commonly used) 8
  9. 9. USB storage on Android Magnus Jahnen SCSI transparent command set • Command Block Wrapper (CBW) • Includes SCSI command • Command Status Wrapper (CSW) • Actual supported standard resp. SCSI commands determined by issuing an INQUIRY 9
  10. 10. USB storage on Android Magnus Jahnen SCSI commands • INQUIRY • READ CAPACITY(10) • READ(10) • REQUEST SENSE • TEST UNIT READY • WRITE(10) 10
  11. 11. USB storage on Android Magnus Jahnen FAT32 file system • Belongs to FAT family • Developed by Microsoft • Released in 1996 with Windows 95B • Most commonly used on mass storage devices for maximum compatibility 11
  12. 12. USB storage on Android Magnus Jahnen General layout 12
  13. 13. USB storage on Android Magnus Jahnen FAT 13
  14. 14. USB storage on Android Magnus Jahnen Data Area • Structured in clusters • Directories and files • Directories have a defined structure • Files save raw data from user 14
  15. 15. USB storage on Android Magnus Jahnen Implementation 15 partition handling of partitions and partition tables fs file system abstraction driver low level block device communication
  16. 16. USB storage on Android Magnus Jahnen Driver package 16 uses creates ScsiInquiry +ScsiInquiry(): ctor +serialize(ByteBuffer buffer): void CommandBlockWrapper #CommandBlockWrapper(...): ctor +serialize(ByteBuffer buffer): void ScsiBlockDevice BlockDeviceDriverFactory «interface» BlockDeviceDriver +init(): void +read(long deviceOffset, ByteBuffer buffer): void +write(long deviceOffset, ByteBuffer buffer): void +getBlockSize(): int
  17. 17. USB storage on Android Magnus Jahnen Results • Supported features: • Bulk-only transfer • FAT32 (MBR) • Usual directory/file operations • Features tested on various devices • Requirements: • Android 3.1 or later • Hardware and software enabled USB host support 17
  18. 18. USB storage on Android Magnus Jahnen Demonstration 18
  19. 19. USB storage on Android Magnus Jahnen Thank you for your attention! Questions? 19
  20. 20. USB storage on Android Magnus Jahnen Image resources (In the order they appear) • http://diepresse.com/layout/diepresse/files/mobilesleben/android-logo.png • http://developer.android.com/guide/topics/connectivity/usb/index.html • https://play.google.com/store/apps/details?id=de.hechler.tcplugins.full.usb • https://play.google.com/store/apps/details?id=com.homeysoft.nexususb.importer • http://en.wikipedia.org/wiki/File:USB.png • http://www.sprut.de/electronic/interfaces/usb/deskriptor.htm • http://www.iconarchive.com/show/icons8-metro-style-icons-by-visualpharm/Computer-Hardware- Mouse-icon.html (http://www.visualpharm.com/) • http://www.softicons.com/system-icons/web0.2ama-icons-by-chrfb/usb-stick-icon • http://www.iconarchive.com/show/icons8-metro-style-icons-by-visualpharm/Phones-Headset- icon.html (http://www.visualpharm.com/) • http://www.clker.com/cliparts/d/5/f/b/1195437711991895099Machovka_harddisk.svg.hi.png • http://www.center.hu/images/cikkek/win95/win95logo.jpg • http://ferienwohnungen-koehnke.de/kurbeitrag/ • http://www.tecnigen.com/wp-content/uploads/2013/07/usbandroid.png 20

×