mirror of
https://github.com/revanced/Apktool.git
synced 2025-05-02 15:04:24 +02:00
Merge pull request #1764 from iBotPeaches/issue-1471
Fix Build Issues on Windows
This commit is contained in:
commit
a84e3c56fd
@ -54,7 +54,8 @@ public class ZipUtils {
|
|||||||
throws BrutException, IOException {
|
throws BrutException, IOException {
|
||||||
for (final File file : folder.listFiles()) {
|
for (final File file : folder.listFiles()) {
|
||||||
if (file.isFile()) {
|
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
|
// aapt binary by default takes in parameters via -0 arsc to list extensions that shouldn't be
|
||||||
// compressed. We will replicate that behavior
|
// compressed. We will replicate that behavior
|
||||||
|
@ -97,6 +97,16 @@ public class BrutIO {
|
|||||||
return canonicalEntryPath.substring(canonicalDirPath.length());
|
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 {
|
public static void copy(File inputFile, ZipOutputStream outputFile) throws IOException {
|
||||||
try (
|
try (
|
||||||
FileInputStream fis = new FileInputStream(inputFile)
|
FileInputStream fis = new FileInputStream(inputFile)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user