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

Remove Java dependencies #22

Open
Razican opened this Issue Sep 15, 2016 · 6 comments

Comments

Projects
None yet
2 participants
@Razican
Member

Razican commented Sep 15, 2016

We should not require Java dependencies for our software, here is the current status of Java dependencies:

@Razican Razican added the Enhancement label Sep 15, 2016

@Razican

This comment has been minimized.

Show comment
Hide comment
@Razican

Razican Sep 15, 2016

Member

@zerjioang maybe you could help with some of these by puting some light in some of them? Maybe dex2jar is near your FDP?

Member

Razican commented Sep 15, 2016

@zerjioang maybe you could help with some of these by puting some light in some of them? Maybe dex2jar is near your FDP?

@zerjioang

This comment has been minimized.

Show comment
Hide comment
@zerjioang

zerjioang Sep 21, 2016

@Razican yep, it might help you since I do not decompile android bytecode to java. I just read it as a decompiler does but without generating final code.
So you can check, how I parse bytecode array into structured code for later, gather information such as class names, methods, fields and so on.
I can even follow inner and outter class method so, it can be interesing

zerjioang commented Sep 21, 2016

@Razican yep, it might help you since I do not decompile android bytecode to java. I just read it as a decompiler does but without generating final code.
So you can check, how I parse bytecode array into structured code for later, gather information such as class names, methods, fields and so on.
I can even follow inner and outter class method so, it can be interesing

@zerjioang

This comment has been minimized.

Show comment
Hide comment
@zerjioang

zerjioang Sep 21, 2016

And btw, if you guys @Razican @Br1oP @Chuky9 @SergioD0l agree, we can collaborate and improve one each others projects and create something big!

zerjioang commented Sep 21, 2016

And btw, if you guys @Razican @Br1oP @Chuky9 @SergioD0l agree, we can collaborate and improve one each others projects and create something big!

@Razican

This comment has been minimized.

Show comment
Hide comment
@Razican

Razican Sep 21, 2016

Member

@zerjioang It is of course my desire. Since version 0.2.0 we are planning big changes to the project (until then, first of October, we are only looking forward to a release).

But one of our biggest problems is the fact that we are using a ton of external Java dependencies we would like to avoid, and two of them are the ones that extract the .dex file and convert it to .jar (Java bytecode) which we only use to convert it to original Java code wirh another dependency.

That takes us a lot of analysis time, and could probably be solved by using a Rust dex to Java decompiler. I'll check out your code once we release this first version and I'll try to port it to Rust.

We still have some issues parsing XML files though (we are using APKtool for that). Do you have any information in that area?

Member

Razican commented Sep 21, 2016

@zerjioang It is of course my desire. Since version 0.2.0 we are planning big changes to the project (until then, first of October, we are only looking forward to a release).

But one of our biggest problems is the fact that we are using a ton of external Java dependencies we would like to avoid, and two of them are the ones that extract the .dex file and convert it to .jar (Java bytecode) which we only use to convert it to original Java code wirh another dependency.

That takes us a lot of analysis time, and could probably be solved by using a Rust dex to Java decompiler. I'll check out your code once we release this first version and I'll try to port it to Rust.

We still have some issues parsing XML files though (we are using APKtool for that). Do you have any information in that area?

@zerjioang

This comment has been minimized.

Show comment
Hide comment
@zerjioang

zerjioang Sep 21, 2016

@Razican I know Java dependencies can be slow, and indeed, the latest version of apktool is much more slower than the previous one.

Extracting .dex is simple cause you use a zip algorithm and its done. Reading the bytecode is a bit difficult since you have to create the model based on .dex architecture and parse the byte array into that. Even with this, I recommend you to take a look to 'dx' utility source code. You have it there all you want to parse the code into readable format with classes, methods, arguments and so on.

Regardint to XML, I have a class that you can port to rust that converts binary xml to readable xml. It was taken from axml project so maybe this can put some light into your problem.

Did you think about using 'dx' output result (json/xml I guess) instead of dex2jar outcome?

Anyway, Im thinking on how viable is to port all my project to rust too.
I know, you convince me! :P

zerjioang commented Sep 21, 2016

@Razican I know Java dependencies can be slow, and indeed, the latest version of apktool is much more slower than the previous one.

Extracting .dex is simple cause you use a zip algorithm and its done. Reading the bytecode is a bit difficult since you have to create the model based on .dex architecture and parse the byte array into that. Even with this, I recommend you to take a look to 'dx' utility source code. You have it there all you want to parse the code into readable format with classes, methods, arguments and so on.

Regardint to XML, I have a class that you can port to rust that converts binary xml to readable xml. It was taken from axml project so maybe this can put some light into your problem.

Did you think about using 'dx' output result (json/xml I guess) instead of dex2jar outcome?

Anyway, Im thinking on how viable is to port all my project to rust too.
I know, you convince me! :P

@Razican

This comment has been minimized.

Show comment
Hide comment
@Razican

Razican Oct 3, 2016

Member

A dex/Dalvik parser is being worked on in the dalvik repo. Once we have the parser, we will be able to create a dex to Java direct decompiler. Which would solve #23 (jd-cmd) and #24 (dex2jar). About APKTool, we are currently using it only for XML extraction, which I think can be solved with your proposal, @zerjioang.

Member

Razican commented Oct 3, 2016

A dex/Dalvik parser is being worked on in the dalvik repo. Once we have the parser, we will be able to create a dex to Java direct decompiler. Which would solve #23 (jd-cmd) and #24 (dex2jar). About APKTool, we are currently using it only for XML extraction, which I think can be solved with your proposal, @zerjioang.

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