Android Storage –
StorageManager & OBB
William.L
wiliwe@gmail.com
Date: 2011-11-08
Outline
Introduction
Usage of OBB
Good Point of OBB
Introduction
What is StorageManager?
Since Android Gingerbread 2.3
The interface to the system’s storage service,
MountService, for And...
What is OBB? (1/3)
Opaque Binary Blob, since Gingerbread 2.3
A file contains a filesystem that maybe be
encrypted on disk ...
What is OBB? (2/3)
Other names
Disk Image / Virtual Drive / Virtual Disk Image /
Virtual Optical Drive file (虛擬光碟虛擬光碟虛擬光碟虛...
What is OBB? (3/3)
……….
File
File
File
Folder
File
File
File
An OBB File
Usage (1/6)
The following steps are steps to create an OBB
file
Based on Androind Honeycomb 3.2
environment and its tools
...
Usage (2/6)
Enter "obbdir" folder and create some files
Here are hello321test.txt, hello.txt, test123.txt for example
Crea...
Usage (3/6)
The output messages after executing "mkobb.sh“ may look
like:
“3c7150b91013237e” of the last line is the salt ...
Usage (4/6)
Cause to the identity to execute “mkobb.sh” is root,
the created OBB file's owner is root
So we change the own...
Usage (5/6)
obbtool Parameters
-n with "package name" of your application (APK)
-v with user defined version number of the...
Usage (6/6)
Now, you can use the OBB file with corresponding
OBB APKs with the valid key(assigned when using
mkobb.sh) and...
Good Point of OBB
Security
Only the APK with the valid key and matched
package name could open the signed OBB file
contain...
An OBB APK Example (1/3)
An OBB APK Example (2/3)
An OBB APK Example (3/3)
Mounted OBB file
OBB Testing File Source (GitHub)
https://github.com/wiliwe/android-obb-example.g...
Reference
http://julianshen.blogspot.com/2011/01/android-
gingerbread-storagemanager-and.html
http://stackoverflow.com/que...
Upcoming SlideShare
Loading in...5
×

Android Storage - StorageManager & OBB

4,337

Published on

An introduction to Android Storage Manager and OBB(Opaque Binary Blob) and its usage.

Published in: Technology
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
4,337
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
73
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Android Storage - StorageManager & OBB

  1. 1. Android Storage – StorageManager & OBB William.L wiliwe@gmail.com Date: 2011-11-08
  2. 2. Outline Introduction Usage of OBB Good Point of OBB
  3. 3. Introduction
  4. 4. What is StorageManager? Since Android Gingerbread 2.3 The interface to the system’s storage service, MountService, for Android applications Handle storage-related items such as Opaque Binary Blobs (OBB) Code AndroidSrc/frameworks/base/core/java/android/os/storage/St orageManager.java Usage By calling getService(Context.STORAGE_SERVICE) STORAGE_SERVICE represents “storage” Ex : StorageManager stMgr = (StorageManager)getService(Context.STORAGE_SERVIC E)
  5. 5. What is OBB? (1/3) Opaque Binary Blob, since Gingerbread 2.3 A file contains a filesystem that maybe be encrypted on disk and mounted on-demand from an application A good way of providing large amounts of binary assets without packaging them into APKs as they may be multiple gigabytes
  6. 6. What is OBB? (2/3) Other names Disk Image / Virtual Drive / Virtual Disk Image / Virtual Optical Drive file (虛擬光碟虛擬光碟虛擬光碟虛擬光碟) Mount on the Linux LOOP device(total 7 devices) Ex : sudo losetup /dev/loop0 Virtual-Disk-File sudo mount /dev/loop0 /mnt/Mount-Point
  7. 7. What is OBB? (3/3) ………. File File File Folder File File File An OBB File
  8. 8. Usage (1/6) The following steps are steps to create an OBB file Based on Androind Honeycomb 3.2 environment and its tools Load needed modules : sudo modprobe cryptoloop sudo modprobe twofish sudo modprobe vfat Under your home directory, create a folder named "obbdir“
  9. 9. Usage (2/6) Enter "obbdir" folder and create some files Here are hello321test.txt, hello.txt, test123.txt for example Create an OBB file using the command sudo AndroidSrc/frameworks/base/tools/obbtool/mkobb.sh -d OBB-Directory -k Password -o ObbFile Ex : sudo AndroidSrc/frameworks/base/tools/obbtool/mkobb.sh -d ~/obbdir/ -k 1234 -o obbtest.obb “1234” is the password / key used by an OBB application to open this OBB file
  10. 10. Usage (3/6) The output messages after executing "mkobb.sh“ may look like: “3c7150b91013237e” of the last line is the salt key and need to write down for later OBB file signing process
  11. 11. Usage (4/6) Cause to the identity to execute “mkobb.sh” is root, the created OBB file's owner is root So we change the owner of "obbtest.obb" before doing next step sudo chown YourName:YourName obbtest.obb Sign the created OBB file using "obbtool“ tool AndroidSrc/out/host/linux-x86/bin/obbtool a -n APK-Package-Name -v 1 ObbFile -s SaltKeyFrom-mkobb.sh Ex : AndroidSrc/out/host/linux-x86/bin/obbtool a -n com.example.android.obbapp -v 1 obbtest.obb -s 3c7150b91013237e
  12. 12. Usage (5/6) obbtool Parameters -n with "package name" of your application (APK) -v with user defined version number of the OBB file -s with the salt key generated by "mkobb.sh" Output messages after executing "obbtool" will look like If you want to REMOVE signature, do : AndroidSrc/out/host/linux-x86/bin/obbtool r ObbFile Ex : AndroidSrc/out/host/linux-x86/bin/obbtool r obbtest.obb
  13. 13. Usage (6/6) Now, you can use the OBB file with corresponding OBB APKs with the valid key(assigned when using mkobb.sh) and Package-Name (assigned when using obbtool)
  14. 14. Good Point of OBB Security Only the APK with the valid key and matched package name could open the signed OBB file containing private or important files
  15. 15. An OBB APK Example (1/3)
  16. 16. An OBB APK Example (2/3)
  17. 17. An OBB APK Example (3/3) Mounted OBB file OBB Testing File Source (GitHub) https://github.com/wiliwe/android-obb-example.git
  18. 18. Reference http://julianshen.blogspot.com/2011/01/android- gingerbread-storagemanager-and.html http://stackoverflow.com/questions/4524981/what-is- obbopaque-binary-blob-in-android-develop-site http://developer.android.com/reference/android/os/st orage/StorageManager.html http://en.wikipedia.org/wiki/Opaque_binary_blob
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×