如何在 Android 平台工具中构建 dexdump?

How to build dexdump in Android platform-tools?

我已经克隆了 https://github.com/android/platform_dalvik。 然后我对 DexDump.cpp 文件进行了一些更改,我想用这些更改来构建它,但我失败了。

我尝试使用:

make -f Android.mk

在根目录中,但出现以下错误:

Android.mk:25: /libdex/Android.mk: No such file or directory

Android.mk:25: /dexgen/Android.mk: No such file or directory

Android.mk:25: /dexdump/Android.mk: No such file or directory

Android.mk:25: /dx/Android.mk: No such file or directory

Android.mk:25: /tools/Android.mk: No such file or directory

即使所有这些 Android.mk 文件都存在。另外,我很确定我在调用 'make'.

时位于正确的目录中

我对 C 和 C++ 的经验很少,所以其中很多东西对我来说都是全新的。 这里有人成功构建了 dexdump 吗?帮助将不胜感激。

我联系了 Google 开发人员,他帮助我构建了它。这是他给我的电子邮件:

Start here: https://source.android.com/source/building.html Once you have set up the build environment (the steps before "Build the code"), use the bash functions imported by envsetup. Don't run make, that's not how it's intended to be used for projects. Run mma. The result will be in out/host/linux-x86/bin. Note that the dalvik/ dexdump will be deprecated some time soon, and the dexdump2 version inside art/ will replace it.

您也可以 运行 "mma dexdump" 它应该只构建 dexdump。只需在 DexDump.cpp

中更改代码以满足您的需要