2015-09-18 21 views
5

Tôi đã triển khai gói ứng dụng thành công và tệp OBB được tải xuống tại Storage-> Android-> Obb-> PackageName-> main.1.com.packagename.obbTệp OBB không phải là Lỗi trích xuất là "Xác thực tệp XAPK không thành công"

Nhưng khi tôi đi để giải nén tôi nhận được vấn đề là "Không phải là một kho lưu trữ Zip".

ZipResourceFile zrf = new ZipResourceFile (tên tệp);

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

Trả lời

3

tôi có các giải pháp sau 2 ngày

chỉ vấn đề là -

tập tin .obb là tạo ra sai hướng

file obb tạo bước
-Tất cả tài nguyên lưu trữ trong một thư mục.
-Zip thư mục này
-Only Đổi tên .obb để .zip tập tin

hạnh phúc với giải pháp này

Các vấn đề liên quan