Using Encrypted OBB Files in Android

I was wondering if people were successful in creating / installing encrypted OBP (Opaque Binary Blob) files in Android? This is a consequence of this question 1 : What is an OBP (Opaque Binary Blob) on an Android site? , Following the instructions in this post, I did the following (from the ICS 4.01 baseline, tried on both Ubuntu 10.10-32bit and Ubuntu 12.4-64bit):

sudo modprobe cryptoloop
sudo modprobe twofish
sudo modprobe vfat
./mkobb.sh -d /tmp/obb/ -kblahblah -o /tmp/out.obb -v
obbtool a -n com.test.blah -v 1 -s 997ff9b1516a6788 /tmp/out.obb # 997ff... is the salt from the mkobb step
obbtool i /temp/out.obb # verify the obb file
adb push /temp/out.obb /sdcard/

Here I copy the out.obb file to / sdcard / on my phone. And install using the following code:

String obbFile = Environment.getExternalStorageDirectory() + "/out.obb";
mgr = (StorageManager) getSystemService(Context.STORAGE_SERVICE);  // mgr is a member varible of my main activity
Log.i("OBB", "trying to mount : " + obbFile + " does it exist? " + new File(obbFile).exists());

if (mgr.mountObb(obbFile, "blahblah", new OnObbStateChangeListener(){

    @Override
    public void onObbStateChange(String path, int state) {
        Log.i("OBB", String.format("onObbStateChange:Path [%s] State=%d", path, state));
        if (state == OnObbStateChangeListener.ERROR_COULD_NOT_MOUNT){
            Log.i("OBB", "THIS IS THE ERROR I GET");
        }
    }})) 
{
    Log.i("OBB", "Attempting to mount");
} else {
    Log.i("OBB", "Mount failed");   // this isn't happening
}

The end result of this is:

 E/MountService( 2004): Couldn't mount OBB file: -1
 I/OBB     (21219): onObbStateChange:Path [/mnt/sdcard/out.obb] State=21
 I/OBB     (21219): THIS IS THE ERROR I GET

Anyone see any problems with this? Looks like it should work!

Note. I have android.permission.WRITE_EXTERNAL_STORAGE, and also I get the expected information from:

ObbInfo info = ObbScanner.getObbInfo("/sdcard/out.obb"); // this returns expected info, so the file is there and able to be read.

: Android

+5
1

(--), obb (out.obb), .

, VolumeManager:: mountObb().

if (Fat::format(dmDevice, 0)) {
    SLOGE("OBB FAT format failed (%s)", strerror(errno));
    return -1;
}

, android?

+1

All Articles