[
  {
    "Id": "287590",
    "ThreadId": "83710",
    "Html": "<p>Hi guys,</p>\r\n<p>I'm trying to read some apk files.</p>\r\n<p>Apk files are the applications in android, this files are ZIP-files with binaries and resources of each application. These files are similar to .jar files of Java.</p>\r\n<p>I have detected 2 odd behaviors:</p>\r\n<p><strong>1)</strong> When I load this file: <a title=\"http://jros.org/files/android/Calculator.apk\" href=\"http://jros.org/files/android/Calculator.apk\">http://jros.org/files/android/Calculator.apk</a>, the ZipFile class doesn&acute;t&nbsp;contains&nbsp;entries for directory entries, when I select entry.IsDirectory == true I get an empty list.&nbsp;However I get the next entries:</p>\r\n<p style=\"padding-left:30px\">META-INF/MANIFEST.MF</p>\r\n<p style=\"padding-left:30px\">META-INF/CERT.SF</p>\r\n<p style=\"padding-left:30px\">META-INF/CERT.RSA</p>\r\n<p style=\"padding-left:30px\">AndroidManifest.xml</p>\r\n<p style=\"padding-left:30px\">...</p>\r\n<p style=\"padding-left:30px\">...</p>\r\n<p>But the ZipFile entry list don&acute;t containt &quot;META-INF&quot; directory entry.</p>\r\n<p><strong>2) </strong>I get a ZipException when I try to load this file: <a title=\"http://jros.org/files/android/Calendar.apk\" href=\"http://jros.org/files/android/Calendar.apk\">http://jros.org/files/android/Calendar.apk</a>. If I use the constructor from ZipFile class the exception says: &quot;C:\\Temp\\SkinDroid\\extract\\SystemApp\\Calendar.apk is not a valid zip file&quot;, and if I use Load static method in ZipFile class the exception says: &quot;Index out of bounds&quot;</p>\r\n<p>&nbsp;</p>\r\n<p>I think that these files are a valid zip files, I manage these in linux with Zip command line util from Info-Zip and don&acute;t have any problem.</p>\r\n<p>Can you help me?</p>\r\n<p>Thanks in advance.</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2010-02-09T04:28:09.87-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "287830",
    "ThreadId": "83710",
    "Html": "This discussion has been copied to a work item. Click <a href=\"http://dotnetzip.codeplex.com/WorkItem/View.aspx?WorkItemId=10181\">here</a> to go to the work item and continue the discussion.",
    "PostedDate": "2010-02-09T13:30:59.47-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "287858",
    "ThreadId": "83710",
    "Html": "<p>jros,</p>\r\n<p>Regarding the first issue.&nbsp; Depending on the creator of the zip file, there may or may not be an entry for the directory.&nbsp; In the zip file model, directories are not actually containers.&nbsp; It's possible to have a file entry with the name &quot;META-INF/CERT.SF&quot; without having a directory entry with the name &quot;META-INF&quot; (or &quot;META-INF/&quot;) .&nbsp; So the behavior you observed is expected.</p>\r\n<p>Regarding the 2nd issue.&nbsp; The format used by that Calendar.apk file is something I had not seen before.&nbsp; The zip spec describes a structure called an &quot;extra field&quot;, optionally included into each zip entry.&nbsp; The spec calls for a header id of 2 bytes, and a datasize of 2 bytes, followed by datasize bytes.&nbsp; For additional records in the &quot;extra field&quot;, it just repeats that series.&nbsp;&nbsp;In your zip file, some of the &quot;extra field&quot; had only 2 bytes, where there should be 4 (header id + datasize), according to the spec.</p>\r\n<p>This is a clear case of an incorrectly formatted zip file.&nbsp;&nbsp; That infozip handles it is not evidence of correctness.&nbsp;&nbsp; At the same time DotNetZip needs to be more tolerant of those kinds of formatting problems, so I modified the code to do that.&nbsp; Just so you're aware:&nbsp; you won't necessarily get the same flexibility out of other zip tools or libraries.&nbsp;&nbsp; Also, it looks like evidence of less-than-fully-bulletproof code in whatever tool you used to create that apk file.</p>\r\n<p>I am testing the changes to DotNetZip now; I'll post an update to the DotNetZip release when the tests complete successfully, probably later tonight.</p>\r\n<p>Thanks for the report!</p>\r\n<p>-Cheeso</p>",
    "PostedDate": "2010-02-09T14:41:46.083-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "287991",
    "ThreadId": "83710",
    "Html": "<p>The fix I have made should correct the problem you reported.</p>\r\n<p>This fix is now available in the updated release, v1.9.1.3.&nbsp; <a href=\"http://dotnetzip.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=27890\">http://dotnetzip.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=27890</a></p>\r\n<p>Please test it and let me know if it works for you.</p>",
    "PostedDate": "2010-02-09T18:46:08.12-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "288070",
    "ThreadId": "83710",
    "Html": "<p>Hi Chesso,</p>\r\n<p>I have test it but now I get odd characters in FileName property of ZipEntry, see this image: <a title=\"http://jros.org/files/android/WrongFilenameDotnetZip.png\" href=\"http://jros.org/files/android/WrongFilenameDotnetZip.png\">http://jros.org/files/android/WrongFilenameDotnetZip.png</a></p>\r\n<p>Thanks for your fast response and support.</p>",
    "PostedDate": "2010-02-09T23:40:56.38-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "288202",
    "ThreadId": "83710",
    "Html": "<p>I'll need more information on this new problem.</p>\r\n<p>Which file gives you that problem?&nbsp; Can you show me the code that causes it?</p>\r\n<p>Have you done an update to the zipfile with DotNetZip?&nbsp; Etc.&nbsp;</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2010-02-10T05:26:40.29-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "288293",
    "ThreadId": "83710",
    "Html": "<p>Cheeso, all is right, sorry.</p>\r\n<p>I don&acute;t know what happened, but work fine now.</p>\r\n<p>&nbsp;</p>\r\n<p>Thank you very much.</p>",
    "PostedDate": "2010-02-10T08:24:11.12-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "288313",
    "ThreadId": "83710",
    "Html": "<p>I'm glad to hear it, thanks for the reply.&nbsp; And good luck with DotNetZip.</p>",
    "PostedDate": "2010-02-10T08:56:37.37-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]