mirror of
https://github.com/revanced/Apktool.git
synced 2025-05-01 14:44:26 +02:00
fix: do not try to get existing AAPT binary if a path to it is provided
This commit is contained in:
parent
355dae94b0
commit
ad7520357f
@ -365,7 +365,14 @@ public class AaptInvoker {
|
|||||||
List<String> cmd = new ArrayList<>();
|
List<String> cmd = new ArrayList<>();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String aaptCommand = AaptManager.getAaptExecutionCommand(aaptPath, getAaptBinaryFile());
|
// Instead of AaptManager.getAaptExecutionCommand(aaptPath, getAaptBinaryFile());
|
||||||
|
// it is needed to use the following command, because getAaptBinaryFile()
|
||||||
|
// may throw BrutException even when not used by AaptManager.getAaptExecutionCommand
|
||||||
|
File aaptFile;
|
||||||
|
if (aaptPath.isEmpty() || !(aaptFile = new File(aaptPath)).exists())
|
||||||
|
aaptFile = getAaptBinaryFile();
|
||||||
|
String aaptCommand = aaptFile.getPath();
|
||||||
|
|
||||||
cmd.add(aaptCommand);
|
cmd.add(aaptCommand);
|
||||||
} catch (BrutException ex) {
|
} catch (BrutException ex) {
|
||||||
LOGGER.warning("aapt: " + ex.getMessage() + " (defaulting to $PATH binary)");
|
LOGGER.warning("aapt: " + ex.getMessage() + " (defaulting to $PATH binary)");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user