在Android中使用加密的OBB文件

在Android中使用加密的OBB文件

我想知道人们是否已经成功地在Android中创建/挂载加密的OBB (不透明二进制Blob)文件?这是这个question 1的后续:What is OBB(Opaque Binary Blob) in Android develop site?,按照我在那篇文章中的指示,我执行了以下命令(从ICS4.01基线开始,在Ubuntu10.10-32bit和Ubuntu12.4-64bit上都尝试过):

代码语言:javascript复制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/从这里,我将out.obb文件复制到我手机上的/sdcard/。并使用以下代码进行挂载:

代码语言:javascript复制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

}其最终结果是:

代码语言:javascript复制 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有人觉得这有什么问题吗?看起来应该行得通了!

注意:我确实有android.permission.WRITE_EXTERNAL_STORAGE,而且我还可以从以下位置获得预期信息:

代码语言:javascript复制ObbInfo info = ObbScanner.getObbInfo("/sdcard/out.obb"); // this returns expected info, so the file is there and able to be read.编辑:链接到Android-开发人员组问题here

相关推荐

云南这里蝴蝶大爆发!是香妃出现了吗?
beat365最新版2022

云南这里蝴蝶大爆发!是香妃出现了吗?

📅 09-28 👁️ 4297
一声叹息:国产麒麟系统为何饱受争议?
best365网页版登录官方网

一声叹息:国产麒麟系统为何饱受争议?

📅 08-09 👁️ 5824
衣服(未知信息)
365bet游戏官方开户

衣服(未知信息)

📅 08-08 👁️ 4544
电脑指纹解锁用不了?别急,这里有妙招!
365bet游戏官方开户

电脑指纹解锁用不了?别急,这里有妙招!

📅 10-23 👁️ 9545