mirror of
https://github.com/revanced/Apktool.git
synced 2024-12-11 13:27:47 +01:00
fix: remove unused util methods/exceptions
This commit is contained in:
parent
3d3dd07cf2
commit
64eda064eb
@ -39,37 +39,10 @@ abstract public class Jar {
|
||||
return file;
|
||||
}
|
||||
|
||||
public static File getResourceAsFile(String name) throws BrutException {
|
||||
return getResourceAsFile(name, Class.class);
|
||||
}
|
||||
|
||||
public static void load(String libPath) {
|
||||
if (mLoaded.contains(libPath)) {
|
||||
return;
|
||||
}
|
||||
|
||||
File libFile;
|
||||
try {
|
||||
libFile = getResourceAsFile(libPath);
|
||||
} catch (BrutException ex) {
|
||||
throw new UnsatisfiedLinkError(ex.getMessage());
|
||||
}
|
||||
|
||||
System.load(libFile.getAbsolutePath());
|
||||
}
|
||||
|
||||
public static File extractToTmp(String resourcePath) throws BrutException {
|
||||
return extractToTmp(resourcePath, Class.class);
|
||||
}
|
||||
|
||||
public static File extractToTmp(String resourcePath, Class clazz) throws BrutException {
|
||||
return extractToTmp(resourcePath, "brut_util_Jar_", clazz);
|
||||
}
|
||||
|
||||
public static File extractToTmp(String resourcePath, String tmpPrefix) throws BrutException {
|
||||
return extractToTmp(resourcePath, tmpPrefix, Class.class);
|
||||
}
|
||||
|
||||
public static File extractToTmp(String resourcePath, String tmpPrefix, Class clazz) throws BrutException {
|
||||
try {
|
||||
InputStream in = clazz.getResourceAsStream(resourcePath);
|
||||
|
@ -49,7 +49,7 @@ public class OS {
|
||||
dir.delete();
|
||||
}
|
||||
|
||||
public static void rmfile(String file) throws BrutException {
|
||||
public static void rmfile(String file) {
|
||||
File del = new File(file);
|
||||
del.delete();
|
||||
}
|
||||
@ -83,21 +83,21 @@ public class OS {
|
||||
}
|
||||
}
|
||||
|
||||
public static void cpdir(String src, String dest) throws BrutException {
|
||||
cpdir(new File(src), new File(dest));
|
||||
}
|
||||
|
||||
public static void exec(String[] cmd) throws BrutException {
|
||||
Process ps = null;
|
||||
int exitValue = -99;
|
||||
Process ps;
|
||||
int exitValue;
|
||||
|
||||
try {
|
||||
ProcessBuilder builder = new ProcessBuilder(cmd);
|
||||
ps = builder.start();
|
||||
|
||||
new StreamForwarder(ps.getErrorStream(), "ERROR").start();
|
||||
new StreamForwarder(ps.getInputStream(), "OUTPUT").start();
|
||||
|
||||
exitValue = ps.waitFor();
|
||||
if (exitValue != 0)
|
||||
if (exitValue != 0) {
|
||||
throw new BrutException("could not exec (exit code = " + exitValue + "): " + Arrays.toString(cmd));
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
throw new BrutException("could not exec: " + Arrays.toString(cmd), ex);
|
||||
} catch (InterruptedException ex) {
|
||||
|
Loading…
Reference in New Issue
Block a user