Repository: ibotpeaches/apktool
Issue: Bugs during apktool.jar compieltion from sources

@iBotPeaches 

With latest updates on source code (3 days ago) I got this error during compilation on final tests
```
 [MENTION=292510]brut[/MENTION].androlib.aapt1.BuildAndDecodeTest > classMethod FAILED
    java.lang.NullPointerException
        at brut.androlib.res.decoder.ResFileDecoder.decode(ResFileDecoder.java:132)
        at brut.androlib.res.decoder.ResFileDecoder.decode(ResFileDecoder.java:115)
        at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:258)
        at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:131)
        at brut.androlib.ApkDecoder.decode(ApkDecoder.java:124)
        at brut.androlib.aapt1.BuildAndDecodeTest.beforeClass(BuildAndDecodeTest.java:61)

brut.androlib.aapt1.LargeIntsInManifestTest > checkIfLargeIntsAreHandledTest FAILED
    java.lang.NullPointerException
        at brut.androlib.res.decoder.ResFileDecoder.decode(ResFileDecoder.java:132)
        at brut.androlib.res.decoder.ResFileDecoder.decode(ResFileDecoder.java:115)
        at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:258)
        at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:131)
        at brut.androlib.ApkDecoder.decode(ApkDecoder.java:124)
        at brut.androlib.aapt1.LargeIntsInManifestTest.checkIfLargeIntsAreHandledTest(LargeIntsInManifestTest.java:66)

brut.androlib.aapt1.ProviderAttributeTest > isProviderStringReplacementWorking FAILED
    java.lang.NullPointerException
        at brut.androlib.res.decoder.ResFileDecoder.decode(ResFileDecoder.java:132)
        at brut.androlib.res.decoder.ResFileDecoder.decode(ResFileDecoder.java:115)
        at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:258)
        at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:131)
        at brut.androlib.ApkDecoder.decode(ApkDecoder.java:124)
        at brut.androlib.aapt1.ProviderAttributeTest.isProviderStringReplacementWorking(ProviderAttributeTest.java:70)

brut.androlib.aapt1.UnknownCompressionTest > doubleExtensionStoredTest FAILED
    brut.directory.PathNotExist: Entry not found: assets/bin/Data/two.extension.file
        at brut.directory.ZipRODirectory.getCompressionLevel(ZipRODirectory.java:108)
        at brut.androlib.aapt1.UnknownCompressionTest.doubleExtensionStoredTest(UnknownCompressionTest.java:80)

brut.androlib.aapt1.UnknownCompressionTest > pkmExtensionDeflatedTest FAILED
    brut.directory.PathNotExist: Entry not found: assets/bin/Data/test.pkm
        at brut.directory.ZipRODirectory.getCompressionLevel(ZipRODirectory.java:108)
        at brut.androlib.aapt1.UnknownCompressionTest.pkmExtensionDeflatedTest(UnknownCompressionTest.java:69)

59 tests completed, 5 failed
```

Changed files:
brut.j.util/src/main/java/brut/util/BrutIO.java, brut.j.dir/src/main/java/brut/directory/ZipUtils.java

diff --git a/brut.j.dir/src/main/java/brut/directory/ZipUtils.java b/brut.j.dir/src/main/java/brut/directory/ZipUtils.java
index 7898b19d..57cfd017 100644
--- a/brut.j.dir/src/main/java/brut/directory/ZipUtils.java
+++ b/brut.j.dir/src/main/java/brut/directory/ZipUtils.java
@@ -54,7 +54,8 @@ public class ZipUtils {
             throws BrutException, IOException {
         for (final File file : folder.listFiles()) {
             if (file.isFile()) {
-                final ZipEntry zipEntry = new ZipEntry(BrutIO.sanitizeUnknownFile(folder, file.getPath().substring(prefixLength)));
+                final String cleanedPath = BrutIO.sanitizeUnknownFile(folder, file.getPath().substring(prefixLength));
+                final ZipEntry zipEntry = new ZipEntry(BrutIO.normalizePath(cleanedPath));
 
                 // aapt binary by default takes in parameters via -0 arsc to list extensions that shouldn't be
                 // compressed. We will replicate that behavior
diff --git a/brut.j.util/src/main/java/brut/util/BrutIO.java b/brut.j.util/src/main/java/brut/util/BrutIO.java
index e58c7964..20d5b09f 100644
--- a/brut.j.util/src/main/java/brut/util/BrutIO.java
+++ b/brut.j.util/src/main/java/brut/util/BrutIO.java
@@ -97,6 +97,16 @@ public class BrutIO {
         return canonicalEntryPath.substring(canonicalDirPath.length());
     }
 
+    public static String normalizePath(String path) {
+        char separator = File.separatorChar;
+
+        if (separator != '/') {
+            return path.replace(separator, '/');
+        }
+
+        return path;
+    }
+
     public static void copy(File inputFile, ZipOutputStream outputFile) throws IOException {
         try (
                 FileInputStream fis = new FileInputStream(inputFile)