0

我正在尝试在终端 IDE(android)上运行 Jess,但是当我尝试运行以下命令时:

terminal++@192.168.0.102:~/sdcard/myJess$ dx --dex --output=jess.dex Jess71p2/lib/jess.jar

我收到消息:

warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute. (This class was probably produced by a broken compiler.)
warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute. (This class was probably produced by a broken compiler.)
warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute. (This class was probably produced by a broken compiler.)
warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute. (This class was probably produced by a broken compiler.)
warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute. (This class was probably produced by a broken compiler.)

UNEXPECTED TOP-LEVEL ERROR:
java.lang.OutOfMemoryError
    at java.util.HashMap.makeTable(HashMap.java:569)
    at java.util.HashMap.doubleCapacity(HashMap.java:589)
    at java.util.HashMap.put(HashMap.java:419)
    at com.android.dx.rop.code.RegisterSpec.intern(RegisterSpec.java:71)
    at com.android.dx.rop.code.RegisterSpec.makeLocalOptional(RegisterSpec.java:124)
    at com.android.dx.rop.code.RegisterSpec.withReg(RegisterSpec.java:482)
    at com.android.dx.ssa.SsaRenamer$BlockRenamer$RenamingMapper.map(SsaRenamer.java:325)
    at com.android.dx.ssa.RegisterMapper.map(RegisterMapper.java:53)
    at com.android.dx.ssa.NormalSsaInsn.mapSourceRegisters(NormalSsaInsn.java:43)
    at com.android.dx.ssa.SsaRenamer$BlockRenamer.visitNonMoveInsn(SsaRenamer.java:555)
    at com.android.dx.ssa.NormalSsaInsn.accept(NormalSsaInsn.java:199)
    at com.android.dx.ssa.SsaBasicBlock.forEachInsn(SsaBasicBlock.java:957)
    at com.android.dx.ssa.SsaRenamer$BlockRenamer.process(SsaRenamer.java:341)
    at com.android.dx.ssa.SsaRenamer$1.visitBlock(SsaRenamer.java:146)
    at com.android.dx.ssa.SsaMethod.forEachBlockDepthFirstDom(SsaMethod.java:787)
    at com.android.dx.ssa.SsaRenamer.run(SsaRenamer.java:143)
    at com.android.dx.ssa.SsaConverter.convertToSsaMethod(SsaConverter.java:53)
    at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:100)
    at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:74)
    at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:269)
    at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:131)
    at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:85)
    at com.android.dx.command.dexer.Main.processClass(Main.java:299)
    at com.android.dx.command.dexer.Main.processFileBytes(Main.java:278)
    at com.android.dx.command.dexer.Main.access$100(Main.java:56)
    at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:229)
    at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:250)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:136)
    at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:113)
    at com.android.dx.command.dexer.Main.processOne(Main.java:247)
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)
    at com.android.dx.command.dexer.Main.run(Main.java:139)
    at com.android.dx.command.dexer.Main.main(Main.java:120)
    at com.android.dx.command.Main.main(Main.java:89)
    at com.spartacusrex.spartacuside.external.dx.main(dx.java:14)
    at dalvik.system.NativeStart.main(Native Method)

我尝试过其他方法,例如通过 ssh 连接到其他机器,但它不可用且速度不如本地。有谁知道解决方案或其他方法?

4

2 回答 2

1

Jess 7 与 Android 不兼容。Jess 8 将在现在任何一天发布。所以请留意 www.jessrules.com。

于 2013-10-06T21:02:52.100 回答
0

您需要添加 --no-strict选项dx,如果您遇到 OutOfMemory 异常,您应该编辑脚本dx并扩展内存范围:

dalvikvm -Xss262912 -Xmx500M -cp $APK com.spartacusrex.spartacuside.external.dx $@

更改-Xmx500M为您需要的内存

也就是说,直到您停止接收 OOM 异常。

对我来说,当从 JDK 的 tools.jar 中提取 tools.jar 时,它的限制是-Xmx900M在此之后,无法分配更多的内存,因为我的手机有大约 900-990MB 的可用空间。

  • 对类文件进行 dex 化后的下一步是从 jess.jar 重新打包任何剩余的资源文件,因为 dex 文件没有资源。
  • jar使用命令或使用 winrar 或任何文件资源管理器观察该文件的内容java并找到资源文件夹。您可能会找到多个这样resources的文件夹,提取所有这些文件夹。
  • 确保您的 dex 文件具有名称classes.dex,然后将所有文件重新打包到一个新的 jess_for_android.jar 中,将所有资源保留在与原始 jess.jar 文件中相同的目录树中

  • 最后,当您尝试使用它时,请使用dalvikvmcommand ,而不是 the ,java否则您(可能)会收到错误:

    dalvikvm -cp path_To_your_repacked_jar Main_className $@
    

内存选项 -Xss 和 -Xmx 是可选的。

希望这会有所帮助,如果您让 Jess 工具正常工作,请提供指向它的链接。

于 2016-05-09T04:17:22.833 回答