Use zlib to display directory structure of apk file in android

I am currently working on an Android project.

Since an Android apk file is essentially a zip file with a different file extension, can zlib be used to create a directory structure in the assets folder?

The goal is to write some interfaces like opendir () and readdir () so that I can do something like:

DIR* dir = zip_opendir("somedirectory");
struct dirent* entry;
while (0 != (entry = zip_readdir(dir))){
    __android_log_print(ANDROID_LOG_ERROR, "DIR", "entry: %s\n", entry->d_name);
}

      

except that all operations are done inside the zip file.

+3


source to share


1 answer


You can use libzip (which itself uses zlib ) to work with zip files. It does everything you need and more .



+1


source







All Articles