vdexExtractor
vdexExtractor copied to clipboard
Compact Dex on Windows
@anestisb Hi Dev,
As you now compiling AOSP in windows is not available so we can not compile the compact dex converter
for android Pie for windows.
could you add support to compiling it on windows or create a project on Github like vdexExtractor
so we can compile it on Cygwin
too as i do with vdexExtractor
?
The Cdex converter tool is utilizing the upstream AOSP libdexlayout to create the Dex IR and export back to a standard Dex file. Since AOSP doesn't support Windows builds, and libdexlayout cannot be build as a standalone lib it requires a heavy rewrite, which is not something trivial for an IR library. Unfortunately, no other OSS Dex IR libs exist to use instead.
I'll keep this one open as a potential future enhancement, although it's something that takes time, which I don't have available at the moment.
Also check https://github.com/anestisb/vdexExtractor/issues/25#issuecomment-417369119 to understand why the de-odexing anchor is not a priority for me.
Ok thanks for answer.
I will clone the AOSP sources and try to cross compiling in linux to windows. I will tell you if that goes successfully.
@anestisb @breakersvd Hi buddies, I have managed to run unmodified 32-bit Linux version of cdex converter on Windows. The key is to use the awesome flinux. Essentially, flinux is a dynamic Linux syscall converter like WSL, but it is a purely userland app and supports Windows 7. The limitation of flinux is that it only supports 32-bit ELF binaries.
I can confirm that flinux 0.21 can run a statically linked 32-bit compact_dex_converter
flawlessly on 32-bit Windows 7 SP1. If flinux complains "executable not found", try to put everything in the same directory, cd
to that directory and run again.
By the way, I think a 32-bit binary could also help solving @superr's problem in #29. I followed @Furniel's suggestions to remove some x86 flags.
I included flinux 0.21 and several prebuilt compact_dex_converter
in my project:
https://github.com/linusyang92/mipay-extract/tree/master/tools/cdex
The 32-bit Linux version compact_dex_converter_linux
is built from AOSP android-9.0.0_r8
branch. Patches are from @anestisb's gist. I slightly changed the compact_dex_converters
entry in Android.bp
to generate the 32-bit binary only:
compile_multilib: "32",
multilib: {
lib32: {
suffix: "32",
},
lib64: {
suffix: "64",
},
},
This is just a workaround at the moment, not a proper solution. It would be better if someone could cross-compile the ART library in Cygwin/MinGW.
@linusyang
Tested with android 9 for Pixel XL
"services.cdex" and worked successfully, thanks a lot
I have no idea about this,it doesn't contained any issues,I am chinese
@Nightmare-MYS You need to put everything in the same directory. flinux
has problems with path conversions. You may instead run the command like:
flinux compact_dex_converter_linux_32 AppIndexProvider_classes.cdex
@linusyang This is a big headache, and I want to write it in batch
Later, I also found out his problem after this,