读取加密的压缩.obb文件

时间:2013-11-29 18:22:05

标签: android encryption apk apk-expansion-files

我有两个文件(例如),我想放在我的apk主扩展文件中。让这些文件为 img1.jpg img2.jpg 。我使用以下命令压缩它们:

zip -n .jpg main.123.in.example.app.obb *.jpg

(版本代码为123,包为in.example.app)。这会创建一个obb文件: main.123.in.example.app.obb

我将此代码放在适当的路径上。我可以通过调用以下内容轻松访问文件 img1.jpg img2.jpg

File root = Environment.getExternalStorageDirectory();
File expPath = new File(root.toString() + "/Android/obb/in.example.app");
String pathToObb = expPath + File.separator + "main.123.in.example.app.obb";
ZipResourceFile zip = new ZipResourceFile(pathToObb);
InputStream iStream = zip.getInputStream("img1.jpg");
Bitmap bmp = BitmapFactory.decodeStream(iStream, null, options);// options to decode

这完美无缺。现在,如何读取使用以下内容创建的加密zip文件:

zip -n -encrypt .jpg main.123.in.example.app.obb *.jpg

我们有什么方法可以阅读这样的加密zip文件吗?或者我们是否依靠jobb tool进行加密并使用StorageManager挂载加密的obb并从那里读取?

0 个答案:

没有答案