2015-09-18 13 views
5

ho implementato espansione apk con successo e il file scaricato da OBB Storage-> Android-> Obb-> PackageName-> main.1.com.packagename.obbdi file OBB non sono Estratto di errore è "di convalida di file XAPK non riuscita"

Ma quando vado ad estrarre sto ricevendo il problema è "Not a Zip archive".

ZipResourceFile zrf = nuovo 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

risposta

3

ho avuto la soluzione dopo 2 giorni

unico problema è che -

file di .obb sono creare direzione sbagliata

il file OBB creare passo
-Tutte le risorse memorizzano in una cartella.
-Zip questa cartella
-Solo Rinominare .obb di file .zip

Felice con questa soluzione

Problemi correlati