mirror of
https://github.com/revanced/Apktool.git
synced 2025-06-13 05:27:36 +02:00
Fixes issue #395 - checks for aapt during build
This commit is contained in:
@ -115,6 +115,11 @@ public class BuildAndDecodeTest {
|
||||
public void xmlReferencesTest() throws BrutException {
|
||||
compareXmlFiles("res/xml/references.xml");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void aaptPresent() throws BrutException {
|
||||
checkIfAaptPresent();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void qualifiersTest() throws BrutException {
|
||||
@ -122,6 +127,19 @@ public class BuildAndDecodeTest {
|
||||
"-xlarge-long-land-desk-night-xhdpi-finger-keyssoft-12key" +
|
||||
"-navhidden-dpad/strings.xml");
|
||||
}
|
||||
|
||||
private void checkIfAaptPresent() throws BrutException {
|
||||
try
|
||||
{
|
||||
Process proc = Runtime.getRuntime().exec("aapt");
|
||||
BufferedReader br = new BufferedReader(new InputStreamReader(proc.getErrorStream()));
|
||||
String line = null;
|
||||
while ( (line = br.readLine()) != null){}
|
||||
} catch (Exception ex){
|
||||
System.out.println("Please install 'aapt' to your path. See project website for more information.");
|
||||
throw new BrutException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
private void compareValuesFiles(String path) throws BrutException {
|
||||
compareXmlFiles("res/" + path,
|
||||
|
Reference in New Issue
Block a user