[Android Software Development] claytonjn:
Hopefully someone here can help me out. I'm trying to do some SystemUI mods on my Galaxy S4 stock TouchWiz 4.3. Initially I was using APK Multi-Tool, which I've been using for months to build theme apks. Simply trying to decompile/recompile the SystemUI.apk without making any changes resulted in the error here when trying to recompile:

--------------------------------------------------------------------------
|Mon 01/13/2014 -- 18:43:27.72|
--------------------------------------------------------------------------
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
A subdirectory or file modified-system-apk-files-here already exists.
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [C:\Users\Clayton\AppData\Local\Temp\brut_util_Jar_1529915768623558036.tmp, p, --forced-package-id, 127, --min-sdk-version, 18, --target-sdk-version, 18, --version-code, 18, --version-name, 4.3-I9505XXUEMKE, -F, C:\Users\Clayton\AppData\Local\Temp\APKTOOL3202054876401017180.tmp, -0, arsc, -I, C:\Users\Clayton\apktool\framework\1.apk, -S, D:\Clayton\Android\APKMT-WIP_1-13-14\projects\SystemUI.apk\res, -M, D:\Clayton\Android\APKMT-WIP_1-13-14\projects\SystemUI.apk\AndroidManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:434)
at brut.androlib.Androlib.buildResources(Androlib.java:362)
at brut.androlib.Androlib.build(Androlib.java:285)
at brut.androlib.Androlib.build(Androlib.java:258)
at brut.apktool.Main.cmdBuild(Main.java:236)
at brut.apktool.Main.main(Main.java:88)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [C:\Users\Clayton\AppData\Local\Temp\brut_util_Jar_1529915768623558036.tmp, p, --forced-package-id, 127, --min-sdk-version, 18, --target-sdk-version, 18, --version-code, 18, --version-name, 4.3-I9505XXUEMKE, -F, C:\Users\Clayton\AppData\Local\Temp\APKTOOL3202054876401017180.tmp, -0, arsc, -I, C:\Users\Clayton\apktool\framework\1.apk, -S, D:\Clayton\Android\APKMT-WIP_1-13-14\projects\SystemUI.apk\res, -M, D:\Clayton\Android\APKMT-WIP_1-13-14\projects\SystemUI.apk\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:469)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:415)
... 5 more
Caused by: brut.common.BrutException: could not exec command: [C:\Users\Clayton\AppData\Local\Temp\brut_util_Jar_1529915768623558036.tmp, p, --forced-package-id, 127, --min-sdk-version, 18, --target-sdk-version, 18, --version-code, 18, --version-name, 4.3-I9505XXUEMKE, -F, C:\Users\Clayton\AppData\Local\Temp\APKTOOL3202054876401017180.tmp, -0, arsc, -I, C:\Users\Clayton\apktool\framework\1.apk, -S, D:\Clayton\Android\APKMT-WIP_1-13-14\projects\SystemUI.apk\res, -M, D:\Clayton\Android\APKMT-WIP_1-13-14\projects\SystemUI.apk\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:93)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:463)
... 6 more
Caused by: java.io.IOException: Cannot run program "C:\Users\Clayton\AppData\Local\Temp\brut_util_Jar_1529915768623558036.tmp": CreateProcess error=5, Access is denied
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at brut.util.OS.exec(OS.java:84)
... 7 more
Caused by: java.io.IOException: CreateProcess error=5, Access is denied
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 11 more

After trying the APK Multi-Tool Experimental and WIP-2.0 branches to no avail I decided to boot up my old Ubuntu virtual box I used to use to build ParanoidAndroid. I got apktool (1.5.2) and aapt running, installed frameworks from my ROM and had no issues decompiling SystemUI with the command apktool d SystemUI.apk. I then ran the command apktool b SystemUI test.apk and got the following error (it appears to be the same as with APK Multi-Tool, which is why I'm posting here.

clayton@ClaytonsVirtualUbuntu:~$ apktool b SystemUI test.apk
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, --min-sdk-version, 18, --target-sdk-version, 18, -F, /tmp/APKTOOL536109092813387498.tmp, -0, arsc, -I, /home/clayton/apktool/framework/1.apk, -S, /home/clayton/SystemUI/res, -M, /home/clayton/SystemUI/AndroidManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:358)
at brut.androlib.Androlib.buildResources(Androlib.java:283)
at brut.androlib.Androlib.build(Androlib.java:206)
at brut.androlib.Androlib.build(Androlib.java:176)
at brut.apktool.Main.cmdBuild(Main.java:228)
at brut.apktool.Main.main(Main.java:79)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, --min-sdk-version, 18, --target-sdk-version, 18, -F, /tmp/APKTOOL536109092813387498.tmp, -0, arsc, -I, /home/clayton/apktool/framework/1.apk, -S, /home/clayton/SystemUI/res, -M, /home/clayton/SystemUI/AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:357)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:336)
... 5 more
Caused by: brut.common.BrutException: could not exec command: [aapt, p, --min-sdk-version, 18, --target-sdk-version, 18, -F, /tmp/APKTOOL536109092813387498.tmp, -0, arsc, -I, /home/clayton/apktool/framework/1.apk, -S, /home/clayton/SystemUI/res, -M, /home/clayton/SystemUI/AndroidManifest.xml]
at brut.util.OS.exec(OS.java:93)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:355)
... 6 more
Caused by: java.io.IOException: Cannot run program "aapt": java.io.IOException: error=13, Permission denied
at java.lang.ProcessBuilder.start(ProcessBuilder.java:488)
at java.lang.Runtime.exec(Runtime.java:612)
at java.lang.Runtime.exec(Runtime.java:485)
at brut.util.OS.exec(OS.java:84)
... 7 more
Caused by: java.io.IOException: java.io.IOException: error=13, Permission denied
at java.lang.UNIXProcess.<init>(UNIXProcess.java:164)
at java.lang.ProcessImpl.start(ProcessImpl.java:81)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:470)
... 10 more

I tried using the 2014-01-07 build of apktool 2.0.0 and got this error:

clayton@ClaytonsVirtualUbuntu:~$ apktool b SystemUI test.apk
Exception in thread "main" java.lang.UnsupportedClassVersionError: brut/apktool/Main : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:643)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
Could not find the main class: brut.apktool.Main. Program will exit.

Can anyone give me any advice at all as to what I'm doing wrong?

Thanks!