BundleDecompiler icon indicating copy to clipboard operation
BundleDecompiler copied to clipboard

Unable to Decompile AAB

Open nickrandolph opened this issue 5 years ago • 8 comments

Hi, I've been trying to get this to work but each time I get an error saying Invalid Arguments. I've included the extract from our build process below so you can see the stack trace.

Are you able to publish the source code for this so the community can assist with issues like this?

2020-01-20T20:43:26.2940000Z java -jar /Users/runner/runners/2.163.1/work/r1/a/sample-app/Android_output/BundleDecompiler.jar decompile -in='/Users/runner/runners/2.163.1/work/r1/a/sample-app/Android_output/com.companyname.appname.aab' -out='/Users/runner/runners/2.163.1/work/r1/a/extractPath' 2020-01-20T20:43:26.2940290Z ========================== Starting Command Output =========================== 2020-01-20T20:43:26.3583000Z [command]/bin/bash --noprofile --norc /Users/runner/runners/2.163.1/work/_temp/6d5c9fd3-6c0e-4565-a0f4-51af876288f6.sh 2020-01-20T20:43:27.1950450Z Exception in thread "main" com.bundle.exception.EncodeDecodeException: 'INVALID ARGUMENTS' 2020-01-20T20:43:27.1952040Z at com.bundle.main.BundleDecompiler.doRunBundleDecompiler(BundleDecompiler.java:65) 2020-01-20T20:43:27.1952150Z at com.bundle.main.BundleDecompiler.main(BundleDecompiler.java:38)

nickrandolph avatar Jan 20 '20 20:01 nickrandolph

Arguments is invalid please use "--in=" in place of "-in=" same for out "--out="

TamilanPeriyasamy avatar Jan 21 '20 08:01 TamilanPeriyasamy

Argh... thank you - somehow the -- got auto-replaced with - in my editor. I'll give that a shot. Would you be interested in open sourcing the source code for this work? Asking because if we're going to take a dependency on this, we'd prefer to know that we can access the source code if needed.

nickrandolph avatar Jan 21 '20 22:01 nickrandolph

It got further before failing:

2020-01-22T00:58:33.6852560Z java -jar /Users/runner/runners/2.163.1/work/r1/a/inspector-build/Android_output/BundleDecompiler.jar decompile --in='/Users/runner/runners/2.163.1/work/r1/a/inspector-build/Android_output/com.companyname.appname.aab' --out='/Users/runner/runners/2.163.1/work/r1/a/extractPath' 2020-01-22T00:58:33.6853020Z ========================== Starting Command Output =========================== 2020-01-22T00:58:33.7401010Z [command]/bin/bash --noprofile --norc /Users/runner/runners/2.163.1/work/_temp/bbe107fa-8649-4099-ad70-4b1c4f68c7a9.sh 2020-01-22T00:58:34.5480010Z Input AppBundle path: /Users/runner/runners/2.163.1/work/r1/a/inspector-build/Android_output/com.companyname.appname.aab 2020-01-22T00:58:34.5502680Z tools installing..,/Users/runner/.tmp/BundleDecompiler 2020-01-22T00:58:47.6344200Z Failed..., 2020-01-22T00:58:47.6362700Z decompile Smali sources... 2020-01-22T00:58:50.7334860Z decompile bundle Resources... 2020-01-22T00:58:50.7498140Z load framework table... 2020-01-22T00:58:50.7607310Z Build failed..., 2020-01-22T00:58:50.7638430Z load application table... 2020-01-22T00:58:50.7735600Z Build failed..., 2020-01-22T00:58:50.7759770Z decode AndroidManifest.xml... 2020-01-22T00:58:51.0487410Z decode resources xmls... 2020-01-22T00:58:53.6331210Z decode values xmls... 2020-01-22T00:58:53.6437230Z Exception in thread "main" javax.xml.transform.TransformerException: java.io.FileNotFoundException: /Users/runner/runners/2.163.1/work/r1/a/extractPath/base/res/values/public.xml (No such file or directory) 2020-01-22T00:58:53.6538500Z at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getOutputHandler(TransformerImpl.java:513) 2020-01-22T00:58:53.6640040Z at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:328) 2020-01-22T00:58:53.6640970Z at com.bundle.xmlbuilder.XMLBuilder.createXMLFile(XMLBuilder.java:62) 2020-01-22T00:58:53.6641350Z at com.bundle.resources.comman.ApplicationResources.parsePublicXmlFile(ApplicationResources.java:223) 2020-01-22T00:58:53.6641850Z at com.bundle.resources.comman.ApplicationResources.parseValuesXmlResources(ApplicationResources.java:136) 2020-01-22T00:58:53.6642210Z at com.bundle.decompile.DecompileManger.decompileResources(DecompileManger.java:49) 2020-01-22T00:58:53.6642600Z at com.bundle.decompile.DecompileManger.decompile(DecompileManger.java:21) 2020-01-22T00:58:53.6643040Z at com.bundle.main.BundleDecompiler.doRunBundleDecompiler(BundleDecompiler.java:94) 2020-01-22T00:58:53.6643390Z at com.bundle.main.BundleDecompiler.main(BundleDecompiler.java:38) 2020-01-22T00:58:53.6643740Z Caused by: java.io.FileNotFoundException: /Users/runner/runners/2.163.1/work/r1/a/extractPath/base/res/values/public.xml (No such file or directory) 2020-01-22T00:58:53.6644200Z at java.io.FileOutputStream.open0(Native Method) 2020-01-22T00:58:53.6644550Z at java.io.FileOutputStream.open(FileOutputStream.java:270) 2020-01-22T00:58:53.6651650Z at java.io.FileOutputStream.(FileOutputStream.java:213) 2020-01-22T00:58:53.6652210Z at java.io.FileOutputStream.(FileOutputStream.java:101) 2020-01-22T00:58:53.6652600Z at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getOutputHandler(TransformerImpl.java:486) 2020-01-22T00:58:53.6652940Z ... 8 more 2020-01-22T00:58:53.6655030Z --------- 2020-01-22T00:58:53.6688930Z java.io.FileNotFoundException: /Users/runner/runners/2.163.1/work/r1/a/extractPath/base/res/values/public.xml (No such file or directory) 2020-01-22T00:58:53.6719510Z at java.io.FileOutputStream.open0(Native Method) 2020-01-22T00:58:53.6755780Z at java.io.FileOutputStream.open(FileOutputStream.java:270) 2020-01-22T00:58:53.6756670Z at java.io.FileOutputStream.(FileOutputStream.java:213) 2020-01-22T00:58:53.6757330Z at java.io.FileOutputStream.(FileOutputStream.java:101) 2020-01-22T00:58:53.6757890Z at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getOutputHandler(TransformerImpl.java:486) 2020-01-22T00:58:53.6758340Z at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:328) 2020-01-22T00:58:53.6758870Z at com.bundle.xmlbuilder.XMLBuilder.createXMLFile(XMLBuilder.java:62) 2020-01-22T00:58:53.6759300Z at com.bundle.resources.comman.ApplicationResources.parsePublicXmlFile(ApplicationResources.java:223) 2020-01-22T00:58:53.6759750Z at com.bundle.resources.comman.ApplicationResources.parseValuesXmlResources(ApplicationResources.java:136) 2020-01-22T00:58:53.6760270Z at com.bundle.decompile.DecompileManger.decompileResources(DecompileManger.java:49) 2020-01-22T00:58:53.6760690Z at com.bundle.decompile.DecompileManger.decompile(DecompileManger.java:21) 2020-01-22T00:58:53.6761830Z at com.bundle.main.BundleDecompiler.doRunBundleDecompiler(BundleDecompiler.java:94) 2020-01-22T00:58:53.6762380Z at com.bundle.main.BundleDecompiler.main(BundleDecompiler.java:38) 2020-01-22T00:58:53.6838070Z ##[error]Bash exited with code '1'. 2020-01-22T00:58:53.6902040Z ##[section]Finishing: Command Line Script

nickrandolph avatar Jan 22 '20 03:01 nickrandolph

  1. which OS you are using?
  2. Attach failed .aab file here in zip format.

TamilanPeriyasamy avatar Jan 22 '20 12:01 TamilanPeriyasamy

@TamilanPeriyasamy I've tried running on both Windows (local dev machine) and MacOS (Azure DevOps build agent). What's best email for me to send the .aab too? You can DM me on Twitter at https://twitter.com/thenickrandolph

nickrandolph avatar Jan 22 '20 20:01 nickrandolph

java -jar /Users//chengcl/Downloads/appbundle/BundleDecompiler.jar d --in=Downloads/appbundle/debug.aab --out=/Users//chengcl/Downloads/appbundle/debug Input AppBundle path: Downloads/appbundle/debug.aab Failed..., decompile Smali sources... decompile bundle Resources... load framework table... Build failed..., load application table... Build failed..., decode AndroidManifest.xml... decode resources xmls... decode values xmls... Exception in thread "main" javax.xml.transform.TransformerException: java.io.FileNotFoundException: /Users/chengcl/Downloads/appbundle/debug/base/res/values/public.xml (No such file or directory) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getOutputHandler(TransformerImpl.java:521) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:336) at com.bundle.xmlbuilder.XMLBuilder.createXMLFile(XMLBuilder.java:62) at com.bundle.resources.comman.ApplicationResources.parsePublicXmlFile(ApplicationResources.java:223) at com.bundle.resources.comman.ApplicationResources.parseValuesXmlResources(ApplicationResources.java:136) at com.bundle.decompile.DecompileManger.decompileResources(DecompileManger.java:49) at com.bundle.decompile.DecompileManger.decompile(DecompileManger.java:21) at com.bundle.main.BundleDecompiler.doRunBundleDecompiler(BundleDecompiler.java:94) at com.bundle.main.BundleDecompiler.main(BundleDecompiler.java:38) Caused by: java.io.FileNotFoundException: /Users/chengcl/Downloads/appbundle/debug/base/res/values/public.xml (No such file or directory) at java.io.FileOutputStream.open0(Native Method) at java.io.FileOutputStream.open(FileOutputStream.java:270) at java.io.FileOutputStream.(FileOutputStream.java:213) at java.io.FileOutputStream.(FileOutputStream.java:101) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getOutputHandler(TransformerImpl.java:494) ... 8 more

java.io.FileNotFoundException: /Users/chengcl/Downloads/appbundle/debug/base/res/values/public.xml (No such file or directory) at java.io.FileOutputStream.open0(Native Method) at java.io.FileOutputStream.open(FileOutputStream.java:270) at java.io.FileOutputStream.(FileOutputStream.java:213) at java.io.FileOutputStream.(FileOutputStream.java:101) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getOutputHandler(TransformerImpl.java:494) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:336) at com.bundle.xmlbuilder.XMLBuilder.createXMLFile(XMLBuilder.java:62) at com.bundle.resources.comman.ApplicationResources.parsePublicXmlFile(ApplicationResources.java:223) at com.bundle.resources.comman.ApplicationResources.parseValuesXmlResources(ApplicationResources.java:136) at com.bundle.decompile.DecompileManger.decompileResources(DecompileManger.java:49) at com.bundle.decompile.DecompileManger.decompile(DecompileManger.java:21) at com.bundle.main.BundleDecompiler.doRunBundleDecompiler(BundleDecompiler.java:94) at com.bundle.main.BundleDecompiler.main(BundleDecompiler.java:38)

chengcl avatar Apr 02 '20 03:04 chengcl

@nickrandolph you can decompile success now? i get the same issue with you now.

chengcl avatar Apr 02 '20 05:04 chengcl

Latest version published, check now. BundleDecompiler-0.0.2.jar.

TamilanPeriyasamy avatar Sep 02 '21 18:09 TamilanPeriyasamy