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

Request for Dex compilation enhancement #28

Open
developer-krushna opened this issue Jan 15, 2024 · 14 comments
Open

Request for Dex compilation enhancement #28

developer-krushna opened this issue Jan 15, 2024 · 14 comments

Comments

@developer-krushna
Copy link

Why this modified library is so speed in compilation, parsing while the original one is too slow to parse and compile ????

https://github.com/L-JINBIN/ApkSignatureKiller/tree/3a3e49157068887dcd8efabf2fcc5ad6cbbd88a2/dexlib2

@sgjesse
Copy link
Collaborator

sgjesse commented Jan 22, 2024

Can you please explain the difference you are seeing?

If the input you are reading has been processed by R8, then #6 might cause a difference. This will be version 3.0.0 vs 3.0.1. Otherwise the library move from https://github.com/JesusFreke/smali to here did not introduce any functional changes, basically just a namespace change.

@developer-krushna
Copy link
Author

Can you please explain the difference you are seeing?

If the input you are reading has been processed by R8, then #6 might cause a difference. This will be version 3.0.0 vs 3.0.1. Otherwise the library move from https://github.com/JesusFreke/smali to here did not introduce any functional changes, basically just a namespace change.

.. i am asking you to enhance how a developer did it which is not currently possible on new smali lib.. so please enhance the Dex reading process, compilation process

@sgjesse
Copy link
Collaborator

sgjesse commented Jan 22, 2024

I am still not sure I understand the exact issue. The reference to https://github.com/L-JINBIN/ApkSignatureKiller/tree/3a3e49157068887dcd8efabf2fcc5ad6cbbd88a2/dexlib2 is a 7-year old version (copy?) of dexlib2 are you using this, and was it patched to be faster?

Or are you seeing that using dexlib2 has gotten slower? In that case could you supply some benchmark to demonstrate the difference?

@developer-krushna
Copy link
Author

developer-krushna commented Jan 24, 2024

I am still not sure I understand the exact issue. The reference to https://github.com/L-JINBIN/ApkSignatureKiller/tree/3a3e49157068887dcd8efabf2fcc5ad6cbbd88a2/dexlib2 is a 7-year old version (copy?) of dexlib2 are you using this, and was it patched to be faster?

Or are you seeing that using dexlib2 has gotten slower? In that case could you supply some benchmark to demonstrate the difference?

Until now i not able to make like that Enhancement by analysing each codes of that modified dexlib2 for latest dexlib2 that was really very time consuming + iam not properly familiar with such codes as you are.. and later i close the project and ask you.. if you understand.
As of my research i have seen DexBuilder class have some extra codes that directly Insert classDef just like DexPool class . making it more enhancement while internClass

dexPool.internClass(classDef); this is too slow while interning classDef

I too not understand how can i explain you..
If you know MT Manager app which is really very powerful Dex editor app developed by him (modified dexlib2 creator) .. You can feel it's speed of Dex compilation (mean classDef intern) while Dex saving..That kind of enhancement i want for my project sir.. And it would be really nice to see your project with same compilation Speed..

Thank you.. you are really great ❤️

@developer-krushna
Copy link
Author

I am still not sure I understand the exact issue. The reference to https://github.com/L-JINBIN/ApkSignatureKiller/tree/3a3e49157068887dcd8efabf2fcc5ad6cbbd88a2/dexlib2 is a 7-year old version (copy?) of dexlib2 are you using this, and was it patched to be faster?

Or are you seeing that using dexlib2 has gotten slower? In that case could you supply some benchmark to demonstrate the difference?

Hi sir..You got some ideas???

@sgjesse
Copy link
Collaborator

sgjesse commented Mar 19, 2024

We have no current plans for working on the performance of dexlib2 for building DEX. In most cases it is best to generate DEX from java byte code (from Java or Kotlin code) using the D8 or R8 compiler.

@developer-krushna
Copy link
Author

Sir i think you misunderstanding my question.. And i think you forgot the difference of D8 and dexlib2 library..these are too much different in there work.. Because we are Reverser we know dexlib2 is the the best project that can help us to decode dalvik Dex file .. It can help us to edit Smali code and building back to Dex file and much more things like my private project Dex strings Decryption etc.. But my problem is with compilation of Dex and speed in decoding of Dex ..Which is too slow not only on PC but also for android.. but the old modified dexlib2 that I shared you having some extra codes that helps in Dex decode and Dex compilation enhancement..

Sorry if you are not working on these plans..

@developer-krushna
Copy link
Author

developer-krushna commented Jun 13, 2024

@UltraSina
Copy link

does it speeded up and also support dex version 40 and 41?

@developer-krushna
Copy link
Author

does it speeded up and also support dex version 40 and 41?

Check my modified library

@developer-krushna
Copy link
Author

could you say details of changes you did? you just added internClass in dexBuilder?

Check usage and dig other modified classes..I made several changes..and also for quick access you should check instruction folder for instruction classes

And a new class added UpdateReference you can check where it is used

@UltraSina
Copy link

thanks , 🌞✨

@Lohita9
Copy link

Lohita9 commented Oct 24, 2024

@developer-krushna MT Manager compiles smali code faster than the latest dexlib2 library because it uses an optimized project structure to improve Dex file compilation. The directory structure is as follows:

_dex: Stores compiled Dex files.

build: Contains files generated during compilation, which help speed up future compilations.

config: Holds project configuration files.

data: Stores the original Dex file and a code cache, which accelerates code searching.

smali: Contains folders corresponding to different Dex files, where each folder holds edited and newly added classes.

@developer-krushna
Copy link
Author

developer-krushna commented Oct 24, 2024

@Lohita9
The same Speed (but a little slower) you can get in my modified Smali library..

I know the method which MT manager uses but the fact is .. for improving the speed, smali library enhancement also plays a major key role ... Basically I did this in my project.. how ever I will try to implement the same feature in my project very soon

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

No branches or pull requests

4 participants