mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-22 09:47:34 +01:00
manually replace %20 w/ space
This commit is contained in:
parent
3ba82b08e3
commit
78a7724725
@ -98,7 +98,11 @@ public abstract class TestUtils {
|
|||||||
|
|
||||||
URL dirURL = class_.getClassLoader().getResource(dirPath);
|
URL dirURL = class_.getClassLoader().getResource(dirPath);
|
||||||
if (dirURL != null && dirURL.getProtocol().equals("file")) {
|
if (dirURL != null && dirURL.getProtocol().equals("file")) {
|
||||||
|
try {
|
||||||
DirUtil.copyToDir(new FileDirectory(dirURL.getFile()), out);
|
DirUtil.copyToDir(new FileDirectory(dirURL.getFile()), out);
|
||||||
|
} catch (UnsupportedEncodingException ex) {
|
||||||
|
throw new BrutException(ex);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,10 +115,10 @@ public abstract class TestUtils {
|
|||||||
String jarPath;
|
String jarPath;
|
||||||
try {
|
try {
|
||||||
jarPath = URLDecoder.decode(dirURL.getPath().substring(5, dirURL.getPath().indexOf("!")), "UTF-8");
|
jarPath = URLDecoder.decode(dirURL.getPath().substring(5, dirURL.getPath().indexOf("!")), "UTF-8");
|
||||||
|
DirUtil.copyToDir(new FileDirectory(jarPath), out);
|
||||||
} catch (UnsupportedEncodingException ex) {
|
} catch (UnsupportedEncodingException ex) {
|
||||||
throw new BrutException(ex);
|
throw new BrutException(ex);
|
||||||
}
|
}
|
||||||
DirUtil.copyToDir(new FileDirectory(jarPath), out);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,29 +16,20 @@
|
|||||||
|
|
||||||
package brut.directory;
|
package brut.directory;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.*;
|
||||||
import java.io.FileInputStream;
|
import java.net.URLDecoder;
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.OutputStream;
|
|
||||||
import java.nio.file.Paths;
|
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
|
|
||||||
public class FileDirectory extends AbstractDirectory {
|
public class FileDirectory extends AbstractDirectory {
|
||||||
private File mDir;
|
private File mDir;
|
||||||
|
|
||||||
public FileDirectory(String dir) throws DirectoryException {
|
public FileDirectory(ExtFile dir, String folder) throws DirectoryException, UnsupportedEncodingException {
|
||||||
this(Paths.get(dir).toFile());
|
this(new File(dir.toString().replaceAll("%20", " "), folder));
|
||||||
}
|
}
|
||||||
|
|
||||||
public FileDirectory(ExtFile dir, String folder) throws DirectoryException {
|
public FileDirectory(String dir) throws DirectoryException, UnsupportedEncodingException {
|
||||||
this(dir.toString(), folder);
|
this(new File(URLDecoder.decode(dir, "UTF-8")));
|
||||||
}
|
|
||||||
|
|
||||||
public FileDirectory(String dir, String folder) throws DirectoryException {
|
|
||||||
this(Paths.get(dir, folder).toFile());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public FileDirectory(File dir) throws DirectoryException {
|
public FileDirectory(File dir) throws DirectoryException {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user