refactor: remove aapt provider implementation
This commit is contained in:
parent
37470c018d
commit
4dca2b2d27
|
@ -45,18 +45,6 @@ import java.util.zip.ZipFile;
|
|||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
final public class AndrolibResources {
|
||||
// The aapt provider. Default is AaptManager for Mac, Linux & Windows.
|
||||
// May be overridden.
|
||||
private static AaptProvider AAPT_PROVIDER = new AaptManager();
|
||||
|
||||
public static AaptProvider getAaptProvider() {
|
||||
return AAPT_PROVIDER;
|
||||
}
|
||||
|
||||
public static void setAaptProvider(AaptProvider aaptProvider) {
|
||||
AAPT_PROVIDER = aaptProvider;
|
||||
}
|
||||
|
||||
public ResTable getResTable(ExtFile apkFile) throws AndrolibException {
|
||||
return getResTable(apkFile, true);
|
||||
}
|
||||
|
@ -1026,9 +1014,9 @@ final public class AndrolibResources {
|
|||
private File getAaptBinaryFile() throws AndrolibException {
|
||||
try {
|
||||
if (getAaptVersion() == 2) {
|
||||
return getAaptProvider().getAapt2();
|
||||
return AaptManager.getAapt2();
|
||||
}
|
||||
return getAaptProvider().getAapt1();
|
||||
return AaptManager.getAapt1();
|
||||
} catch (BrutException ex) {
|
||||
throw new AndrolibException(ex);
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ import java.io.File;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AaptManager implements AaptProvider {
|
||||
public class AaptManager {
|
||||
|
||||
private static File getAapt(Integer version) throws BrutException {
|
||||
File aaptBinary;
|
||||
|
@ -109,13 +109,11 @@ public class AaptManager implements AaptProvider {
|
|||
return getAppVersionFromString(version);
|
||||
}
|
||||
|
||||
@Override
|
||||
public File getAapt2() throws BrutException {
|
||||
public static File getAapt2() throws BrutException {
|
||||
return getAapt(2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public File getAapt1() throws BrutException {
|
||||
public static File getAapt1() throws BrutException {
|
||||
return getAapt(1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
package brut.util;
|
||||
|
||||
import brut.common.BrutException;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public interface AaptProvider {
|
||||
File getAapt2() throws BrutException;
|
||||
default File getAapt1() throws BrutException {
|
||||
throw new BrutException(new UnsupportedOperationException("Aapt1 is not supported on this device"));
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue