Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android. ERROR_COULD_NOT_MOUNT while mounting complex ciphered obb file

Tags:

android

I develop Android app, which uses ciphered obb file. This obb file consists of 3 files (I created it with jobb tool). On the most devices all is ok, but on the three devices there is ERROR_COULD_NOT_MOUNT. And I don't understand how to fix it. I want to distribute app without any errors :) Please, help me to do it! :)

That I have tryed: 1) Unmount and mount obb file; 2) Create obb file from the folder without "read-only" attribute. But all of it won't work.

Steps to reproduce the problem (including sample code if appropriate). 1) Create folder, put into it 3 different files. 2) Create obb file from the folder from step 1. 3) Try to mount this file from the app (sample code below).

 

    final File mainFile = new File(Environment.getExternalStorageDirectory() + "/Android/obb/" + packageName + "/"
                    + "main." + versionCode + "." + packageName + ".obb");
    OnObbStateChangeListener listener = new OnObbStateChangeListener() {
        @Override
        public void onObbStateChange(String path, int state) {
            super.onObbStateChange(path, state);
            if (state == OnObbStateChangeListener.MOUNTED) {
                doNextSteps();
            } else if (state ==    OnObbStateChangeListener.ERROR_COULD_NOT_MOUNT) {
                Toast.makeText(getApplicationContext(), "ERROR_COULD_NOT_MOUNT", Toast.LENGTH_LONG).show();
            } 
         }
    };

    if (!storageManager.isObbMounted(mainFile.getAbsolutePath())) {
        storageManager.unmountObb(mainFile.getAbsolutePath(), true, listener);
        storageManager.mountObb(mainFile.getAbsolutePath(), "password_string", listener);
    } else {
        doNextSteps();
    }

What happened. I have "ERROR_COULD_NOT_MOUNT" error on the following devices: 1) HTC PJ401 One S; 2) Samsung GT-I9505 Galaxy S IV; 3) Samsung SM-N9005 Galaxy Note 3. But on Samsung SM-N900T Galaxy Note 3 and Samsung GT-I9500 Galaxy S IV all is ok.

like image 357
pretty_fennec Avatar asked Oct 02 '22 11:10

pretty_fennec


1 Answers

So, after all my investigations I can say. All I can to do is workaround. And I have created one file from the these 3 files by

copy /B file1+file2+file3 result_file.obb

And then I use this file as non-ciphered obb. After all this manipulations all works well.

like image 70
pretty_fennec Avatar answered Oct 11 '22 15:10

pretty_fennec