pg加密扩展的安装_在Android中安装加密的obb apk扩展文件

I have created an encrypted .obb file using the jobb tool. I use the following code to mount the obb file:

public void mountExpansion() {

final StorageManager storageManager = (StorageManager) getContext()

.getSystemService(Context.STORAGE_SERVICE);

String packageName = "name.of.the.package";

String filePath = Environment.getExternalStorageDirectory()

+ "/Android/obb/" + packageName + "/" + "main."

+ version + "." + packageName + ".obb";

final File mainFile = new File(filePath);

if (mainFile.exists()) {

Log.d("STORAGE", "FILE: " + filePath + " Exists");

} else {

Log.d("STORAGE", "FILE: " + filePath + " DOESNT EXIST");

}

String key = "thisIsMyPassword";

if (!storageManager.isObbMounted(mainFile.getAbsolutePath())) {

if (mainFile.exists()) {

if(storageManager.mountObb(mainFile.getAbsolutePath(), key,

new OnObbStateChangeListener() {

@Override

public void onObbStateChange(String path, int state) {

super.onObbStateChange(path, state);

Log.d("PATH = ",path);

Log.d("STATE = ", state+"");

expansionFilePath = storageManager.getMountedObbPath(path);

if (state == OnObbStateChangeListener.MOUNTED) {

expansionFilePath = storageManager

.getMountedObbPath(path);

Log.d("STORAGE","-->MOUNTED");

}

else {

Log.d("##", "Path: " + path + "; state: " + state);

}

}

}))

{

Log.d("STORAGE_MNT","SUCCESSFULLY QUEUED");

}

else

{

Log.d("STORAGE_MNT","FAILED");

}

} else {

Log.d("STORAGE", "Patch file not found");

}

}

}

I am getting the following output:

FILE: filePath Exists

SUCCESSFULLY QUEUED

But nothing inside onObbStateChangeListener is getting called. I am calling this function from a custom view and testing this on Nexus 4/ KitKat.

What could be the reason for this behaviour?

解决方案

There seems to be a bug with OBB mounting that was introduced with KitKat. Currently no workarounds are known however it should be fixed with the next incremental update.

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值