动态生成的Dalvik字节code到正在运行的Dalvik / Android应用程序 [英] Dynamically Generating Dalvik Bytecode into a running Dalvik/Android application

查看:102
本文介绍了动态生成的Dalvik字节code到正在运行的Dalvik / Android应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题已经被问(并回答)很多次动态生成和加载Java字节codeS在运行时到运行的Dalvik虚拟机,但有什么办法来加载DEX文件/字节codeS成在运行的应用程序?

This question has been asked(and answered) many times about dynamically generating and loading java bytecodes at runtime into a running Dalvik VM, but is there any way to load dex files/bytecodes into an app at runtime?

感谢

推荐答案

在Dalvik团队希望打造一流的运行时间code生成库。我们跟踪的功能要求为 Android的错误6322 。不幸的是,我们有一个很长的性能和正确性问题清单,所以我不能给你一个时间表的时候,我们会花时间在这个问题上。

The Dalvik team would like to build a first-class runtime code generation library. We're tracking the feature request as Android bug 6322. Unfortunately, we have a very long list of performance and correctness issues, so I can't give you a timeline for when we'll spend time on this issue.

有一些替代品,但他们都将采取一些工作:

There are some alternatives, but they will all take some work:

  • 运行您在标准JVM的应用程序和行使各种运行code一代那里。转储从内存中的.class文件到文件,然后运行DX上这些文件。如果你是相当复杂的,你可以集成所有这些工作到您的构建。

  • Run your application on a standard JVM and exercise all runtime code generation there. Dump the .class files from memory to files, and then run dx on those files. If you're quite sophisticated, you could integrate all of this work into your build.

包括开源DX工具,一个项目库,并从编程应用程序中的应用程序的类加载器执行它,可能。这将膨胀您的应用程序的二进制文件。

Include the open source dx tool as a project library, and execute it programatically from within your application, possibly in your application's classloader. This will bloat your application's binary.

这篇关于动态生成的Dalvik字节code到正在运行的Dalvik / Android应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆