[Android]什么是OOB(Opaque binary blob)文件?

http://stackoverflow.com/questions/4524981/what-is-obbopaque-binary-blob-in-android-develop-site

 

OBB lets you package up large files and store them on the public SDcard in a way that only your app can decrypt and use them. After building the AOSP the mkobb.sh and obbtool allow you to create (on Linux) OBB files.

After setting up things like PATH, permissions and kernel modules, creating is basicly:

$ mkobb.sh -d /data/myfiles -k my_secret_key -o /data/data.obb
$ obbtool a -n com.example.myapp -v 1 -s seed_from_mkobb /data/data.obb

After which you can store the data.obb on SDcard and only access the files from your app with use of the my_secret_key

storage = (StorageManager) getSystemService( STORAGE_SERVICE );
storage.mountObb( obbFilepath, "my_secret_key", myListener );
obbContentPath = storage.getMountedObbPath( obbFilepath );

Although other apps can destroy the data.obb on SD card only the app can access them and the content is as secure as if stored in app private.

Only on API level 9 and up and with the WRITE_EXTERNAL_STORAGE to access OBB files from SD.

你可能感兴趣的:([Android]什么是OOB(Opaque binary blob)文件?)