Revert "fix: normalize paths for uncompressed assets & unknown files"

This reverts commit ca25a26944.
This commit is contained in:
Connor Tumbleson 2018-04-06 14:58:11 -04:00
parent 46ebcb0fab
commit 72196f3544
2 changed files with 5 additions and 8 deletions

View File

@ -653,8 +653,7 @@ public class Androlib {
// loop through unknown files
for (Map.Entry<String,String> unknownFileInfo : files.entrySet()) {
String normalizedPath = BrutIO.normalizePath(unknownFileInfo.getKey());
String cleanedPath = BrutIO.sanitizeUnknownFile(unknownFileDir, normalizedPath);
String cleanedPath = BrutIO.sanitizeUnknownFile(unknownFileDir, unknownFileInfo.getKey());
File inputFile = new File(unknownFileDir, cleanedPath);
if (inputFile.isDirectory()) {
continue;
@ -685,16 +684,15 @@ public class Androlib {
File assetFileDir = new File(appDir, ASSET_DIRNAME);
for (String asset : files) {
String normalizedPath = BrutIO.normalizePath(asset);
String cleanedPath = BrutIO.sanitizeUnknownFile(assetFileDir, normalizedPath);
String cleanedPath = BrutIO.sanitizeUnknownFile(assetFileDir, asset);
File inputFile = new File(appDir, cleanedPath);
if (inputFile.isDirectory()) {
continue;
}
LOGGER.fine(String.format("Copying uncompressed asset: %s", normalizedPath));
ZipEntry newEntry = getStoredZipEntry(normalizedPath, inputFile);
LOGGER.fine(String.format("Copying uncompressed asset: %s", asset));
ZipEntry newEntry = getStoredZipEntry(cleanedPath, inputFile);
outputFile.putNextEntry(newEntry);
BrutIO.copy(inputFile, outputFile);
outputFile.closeEntry();

View File

@ -16,7 +16,6 @@
*/
package brut.androlib.res.data;
import brut.util.BrutIO;
import java.util.LinkedHashMap;
import java.util.Map;
@ -28,7 +27,7 @@ public class ResUnknownFiles {
private final Map<String, String> mUnknownFiles = new LinkedHashMap<>();
public void addUnknownFileInfo(String file, String value) {
mUnknownFiles.put(BrutIO.normalizePath(file), value);
mUnknownFiles.put(file, value);
}
public Map<String, String> getUnknownFiles() {