-
Notifications
You must be signed in to change notification settings - Fork 18k
archive/zip: no such file/directory Java-generated zip (apk) files #9943
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
go version go1.4.1 darwin/amd64 |
Can you share an example file that's failing to open? |
https://www.dropbox.com/sh/qwkkzdyn3g7alef/AABGTMQOsVfOLgm1ct-S7tXfa?dl=0 Two apk files and the code file godex.go are both available. |
I don't think thats a problem with the zip package. The error comes from the os.OpenFile("META-INF/MANIFEST.MF",...) call. Note that the META-INF directory does not exist. |
I tried your program on one of the files provided, and there appears to be no problem opening the file with the zip package. You need to create the directories as @ebfe said, and close file descriptors sooner. |
apologies but i tried this with 2 zip files which are getting unzipped fine with relevant folders getting created. also in goswiff apk file dex and xml files are getting uncompressed if i do a continue instead of printing the error. |
Error while unzipping a apk and jar files. Normal zip files are getting unzipped perfect.
:no such file or directory error
package main
import (
"archive/zip"
"flag"
"fmt"
"os"
"io"
"path/filepath"
//"strings"
//"log"
)
func main() {
flag.Parse() //parse command line arguments
zipfile := flag.Arg(0)
//check zip file name is passed as argument
if zipfile == "" {
fmt.Println("Usage: godex pathofapk")
os.Exit(1)
}
//open reader to read zip file
reader, err := zip.OpenReader(zipfile)
if err != nil {
fmt.Println(err)
os.Exit(1)
} // check for valid zip file
defer reader.Close()
}
The text was updated successfully, but these errors were encountered: