使用zlib列出android中apk文件的目录结构 [英] use zlib to list directory structure of apk file in android

查看:59
本文介绍了使用zlib列出android中apk文件的目录结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发一个 Android 项目.

I am current working on an Android project.

既然android apk文件本质上是一个zip文件,文件扩展名不同,那么是否可以用zlib来归档asset文件夹的目录结构?

Since the android apk file is essentially a zip file with a different file extension, is it possible to use zlib to file the directory structure of the asset folder?

目标是编写一些接口,例如 opendir() 和 readdir() 以便我可以执行以下操作:

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);
}

除了所有操作都在一个 zip 文件中进行.

except that all the operations take place inside a zip file.

推荐答案

您可以使用 libzip (它本身使用 zlib) 来处理 zip 文件.它可以你想要的一切以及更多.

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

这篇关于使用zlib列出android中apk文件的目录结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆