iBotPeaches/Apktool — pull request #83 by chrisch1974 (2014-05-21 08:30:01+00:00)
Title: DirUtil: fixed exception when decompiling with -r and no res folder exists in the apk

When you try to decompile an apk with the parameter -r and the apk doesn't have a res folder (there are some like the GoogleOneTimeInitializer.apk on the HTC One M8) then the decompile crashes with an exception:
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.DirectoryException: Error copying file: res
at brut.androlib.Androlib.decodeResourcesRaw(Androlib.java:110)

This patch checks when the filename is res that it exists in the apk. I made only the check for the res as I think if other files are missing then there should be an exception.

The same applies also to the compile of the apk when working with -r and no res folder.