Merge pull request #1390 from iBotPeaches/issue/1389

Patch aapt for 32/64 unix/mac and add support for unknown chars.
This commit is contained in:
Connor Tumbleson 2016-12-23 08:54:39 -05:00 committed by GitHub
commit 4d5a822e4f
9 changed files with 18 additions and 5 deletions

View File

@ -773,9 +773,17 @@ final public class AndrolibResources {
try {
if (OSDetection.isMacOSX()) {
aaptBinary = Jar.getResourceAsFile("/prebuilt/aapt/macosx/aapt");
if (OSDetection.is64Bit()) {
aaptBinary = Jar.getResourceAsFile("/prebuilt/aapt/macosx/64/aapt");
} else {
aaptBinary = Jar.getResourceAsFile("/prebuilt/aapt/macosx/32/aapt");
}
} else if (OSDetection.isUnix()) {
aaptBinary = Jar.getResourceAsFile("/prebuilt/aapt/linux/aapt");
if (OSDetection.is64Bit()) {
aaptBinary = Jar.getResourceAsFile("/prebuilt/aapt/linux/64/aapt");
} else {
aaptBinary = Jar.getResourceAsFile("/prebuilt/aapt/linux/32/aapt");
}
} else if (OSDetection.isWindows()) {
aaptBinary = Jar.getResourceAsFile("/prebuilt/aapt/windows/aapt.exe");
} else {

View File

@ -18,17 +18,22 @@ package brut.util;
public class OSDetection {
private static String OS = System.getProperty("os.name").toLowerCase();
private static String Bit = System.getProperty("sun.arch.data.model").toLowerCase();
public static boolean isWindows() {
return (OS.indexOf("win") >= 0);
return (OS.contains("win"));
}
public static boolean isMacOSX() {
return (OS.indexOf("mac") >= 0);
return (OS.contains("mac"));
}
public static boolean isUnix() {
return (OS.indexOf("nix") >= 0 || OS.indexOf("nux") >= 0 || OS.indexOf("aix") > 0 || (OS.indexOf("sunos") >= 0));
return (OS.contains("nix") || OS.contains("nux") || OS.contains("aix") || (OS.contains("sunos")));
}
public static boolean is64Bit() {
return Bit.equalsIgnoreCase("64");
}
public static String returnOS() {