Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compact Dex on Windows #38

Open
breakersvd opened this issue Sep 16, 2018 · 8 comments
Open

Compact Dex on Windows #38

breakersvd opened this issue Sep 16, 2018 · 8 comments

Comments

@breakersvd
Copy link

@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 ?

@anestisb
Copy link
Owner

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.

@anestisb
Copy link
Owner

Also check #25 (comment) to understand why the de-odexing anchor is not a priority for me.

@breakersvd
Copy link
Author

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.

@linusyang
Copy link

linusyang commented Sep 18, 2018

@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.

@breakersvd
Copy link
Author

@linusyang
Tested with android 9 for Pixel XL "services.cdex" and worked successfully, thanks a lot

@mengyanshou
Copy link

ruqo 6vee9sl2njcjb pa9
I have no idea about this,it doesn't contained any issues,I am chinese

@linusyang
Copy link

@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

@mengyanshou
Copy link

@linusyang This is a big headache, and I want to write it in batch

Later, I also found out his problem after this,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants