android obb在哪,在Android中使用加密的OBB文件

我想知道人们是否成功地在Android中创建/加载加密的OBB(不透明二进制Blob)文件?这是一个跟进这个question 1:What is OBB(Opaque Binary Blob) in Android develop site?,继那个帖子我执行下面的方向(从ICS 4.01基线,在Ubuntu 10.10-32bit和Ubuntu 12.4-64bit尝试都):在Android中使用加密的OBB文件

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 /。并用下面的代码安装:

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

}

这样做的最终结果是:

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,也是我得到预期的信息:

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

编辑:链接到Android的开发者群体的问题here

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值