相关疑难解决方法(0)

在Android中挂载加密的obb apk扩展文件

我使用jobb工具创建了一个加密的.obb文件.我使用以下代码来安装obb文件:

    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() …
Run Code Online (Sandbox Code Playgroud)

encryption android apk-expansion-files

4
推荐指数
1
解决办法
3423
查看次数

标签 统计

android ×1

apk-expansion-files ×1

encryption ×1