File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed
brut.apktool/apktool-lib/src/main/java/brut/androlib/res
brut.j.util/src/main/java/brut/util Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -45,11 +45,11 @@ public static File getBinaryFile() throws AndrolibException {
4545
4646 StringBuilder binPath = new StringBuilder ("/prebuilt/" );
4747 if (OSDetection .isUnix ()) {
48- binPath .append ("linux" );
48+ binPath .append ("linux" ); // ELF 64-bit LSB executable, x86-64
4949 } else if (OSDetection .isMacOSX ()) {
50- binPath .append ("macosx" );
50+ binPath .append ("macosx" ); // fat binary x86_64 + arm64
5151 } else if (OSDetection .isWindows ()) {
52- binPath .append ("windows" );
52+ binPath .append ("windows" ); // x86_64
5353 } else {
5454 throw new AndrolibException ("Could not identify platform: " + OSDetection .returnOS ());
5555 }
@@ -61,7 +61,7 @@ public static File getBinaryFile() throws AndrolibException {
6161
6262 File binFile ;
6363 try {
64- binFile = Jar .getResourceAsFile (AaptManager .class , binPath .toString ());
64+ binFile = Jar .getResourceAsFile (AaptManager .class , binPath .toString (), binName + "_" );
6565 } catch (BrutException ex ) {
6666 throw new AndrolibException (ex );
6767 }
Original file line number Diff line number Diff line change @@ -36,9 +36,13 @@ private Jar() {
3636 }
3737
3838 public static File getResourceAsFile (Class <?> clz , String name ) throws BrutException {
39+ return getResourceAsFile (clz , name , "brut_util_Jar_" );
40+ }
41+
42+ public static File getResourceAsFile (Class <?> clz , String name , String tmpPrefix ) throws BrutException {
3943 File file = sExtracted .get (name );
4044 if (file == null ) {
41- file = extractToTmp (clz , name );
45+ file = extractToTmp (clz , name , tmpPrefix );
4246 sExtracted .put (name , file );
4347 }
4448 return file ;
Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ public static void exec(String[] cmd) throws BrutException {
145145
146146 int exitValue = ps .waitFor ();
147147 if (exitValue != 0 ) {
148- throw new BrutException ("could not exec (exit code = " + exitValue + "): " + Arrays .toString (cmd ));
148+ throw new BrutException ("Execution failed (exit code = " + exitValue + "): " + Arrays .toString (cmd ));
149149 }
150150 } catch (IOException ex ) {
151151 throw new BrutException ("could not exec: " + Arrays .toString (cmd ), ex );
You can’t perform that action at this time.
0 commit comments