我成功实现了apk扩容,并从Storage->Android->Obb->PackageName->main.1.com.packagename.obb下载了OBB文件。
但当我去提取我得到的问题是“不是一个Zip存档”。
ZipResourceFile zrf =新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();
}

发布于 2015-09-19 17:32:01
2天后我得到了解决方案
唯一的问题是-
.obb文件创建方向错误
obb文件创建步骤
-All资源存储在一个文件夹中。
-Zip此文件夹
-Only将.obb重命名为.zip文件
对此解决方案感到满意
https://stackoverflow.com/questions/32645069
复制相似问题