OBB file are not Extract Error is “XAPK file Valid

2019-04-13 14:08发布

I implemented apk expansion successfully and OBB file downloaded at Storage->Android->Obb->PackageName->main.1.com.packagename.obb

But when i go to extract i am getting issue is "Not a Zip archive".

ZipResourceFile zrf = new ZipResourceFile(fileName);

public ZipResourceFile(String zipFileName) throws IOException {
        addPatchFile(zipFileName);
    }

    void addPatchFile(String zipFileName) throws IOException {
        File file = new File(zipFileName);
        RandomAccessFile f = new RandomAccessFile(file, "r");
        long fileLength = f.length();

        if (fileLength < kEOCDLen) {
            throw new java.io.IOException();
        }

        long readAmount = kMaxEOCDSearch;
        if (readAmount > fileLength)
            readAmount = fileLength;

        /*
         * Make sure this is a Zip archive.
         */
        f.seek(0);

        int header = read4LE(f);
        if (header == kEOCDSignature) {
            Log.i(LOG_TAG, "Found Zip archive, but it looks empty");
            throw new IOException();
        } else if (header != kLFHSignature) {
            Log.v(LOG_TAG, "Not a Zip archive");
            throw new IOException();
        }

enter image description here

1条回答
聊天终结者
2楼-- · 2019-04-13 14:47

I got the Solution after 2 days

only problem is that -

.obb file are create wrong direction

the obb file create step
-All Resources store in one folder.
-Zip this folder
-Only Rename .obb to .zip file

Happy with this solution

查看更多
登录 后发表回答