将Zip文件添加到Phonegap应用时被修改了吗? [英] Zip file modified when added to Phonegap app?

查看:100
本文介绍了将Zip文件添加到Phonegap应用时被修改了吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个Phonegap应用程序,该应用程序在/assets/www/文件夹中包含一个zip存档.启动应用程序后,文件将复制到fileSystem根目录.当我尝试读取标题时,似乎文件已被修改.

I am writing a Phonegap app that includes a zip archive in the /assets/www/ folder. When the app is launched the file is copied to the fileSystem root. When I try to read the header, it appears that the file has been modified.

这是我计算机上的十六进制转储:

Here's the hexdump on my computer:

# hexdump -C Archive.zip| more
00000000  50 4b 03 04 14 00 00 00  08 00 4c b7 b1 40 84 1d  |PK........L..@..|
00000010  9b 1a 21 00 00 00 a0 01  00 00 0a 00 1c 00 73 61  |..!...........sa|

这是/sdcard/中文件的十六进制转储:

Here's the hexdump of the file in /sdcard/:

00000000  50 4b 03 04 14 00 00 00  08 00 4c ef bf bd ef bf  |PK........L.....|
00000010  bd 40 ef bf bd 1d ef bf  bd 1a 21 00 00 00 ef bf  |.@........!.....|
00000020  bd 01 00 00 0a 00 1c 00  73 61 6d 70 6c 65 2e 74  |........sample.t|

休斯顿!我们有一个问题!

HOUSTON! WE HAVE A PROBLEM!

那么,谁动了我的奶酪?发生了什么?由于.apk文件是压缩文件夹,因此将zip文件添加到zip文件中是否有潜在的破坏性副作用?

So, who moved my cheese? What happened? Since .apk files are zipped folders, is there a potentially destructive side-effect of adding a zip file into a zip file?

推荐答案

Android使用特殊的zip对齐方式.这可能是您的问题.

Android uses a special zip alignment. This could be your problem.

这篇关于将Zip文件添加到Phonegap应用时被修改了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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