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

Issue with apps written on Kotlin. #529

Closed
redmi111 opened this issue Mar 28, 2019 · 9 comments
Closed

Issue with apps written on Kotlin. #529

redmi111 opened this issue Mar 28, 2019 · 9 comments

Comments

@redmi111
Copy link

redmi111 commented Mar 28, 2019

image
As on the image above decompiled java bytecode of apps written on kotlin doesn't look so good. Hope there'll be a solution for this.

https://brompwnie.github.io/reversing/2018/02/12/Kotlin-and-Java-How-Hackers-See-Your-Code.html In this link I got some information that the obfuscated kotlin apps doesn't give many junks (like @metadata before class starts) as compared to non obfuscated apk. Take a look at it, Thanks.

@jpstotz
Copy link
Collaborator

jpstotz commented Mar 28, 2019

I assume you are referring to the way the String fields are initialized:

String server1 = new String(new byte[]{(byte)66, (byte) 111, ...});

@redmi111
Copy link
Author

Classes not inlined and things like @metadata' above the class name.

@jpstotz
Copy link
Collaborator

jpstotz commented Mar 28, 2019

The @metadata structure is by design not readable for humans, ist is generated by the Kotlin compiler and is used for reflection:
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-metadata/index.html

@redmi111
Copy link
Author

redmi111 commented Mar 28, 2019

This is the link can you please refer this link. obfuscation eliminated that. so there might be some workaround to achieve this in jadx decompiler Right?

@skylot
Copy link
Owner

skylot commented Mar 28, 2019

@redmi111 in issues please write what you expect jadx will do.
As I understand you expect:

  • @Metadata annotation is removed
  • All "anonymous" classes are inlined

Anything else?

P.S. Please learn how to insert a link on Github (see docs), because your links not working (I already fixed them for you)

@redmi111
Copy link
Author

@skylot thanks for your advice. Yes, you got the point of what I want.

@skylot
Copy link
Owner

skylot commented Mar 28, 2019

@redmi111 ok. But I don't think it will be implemented soon because for general class inlining jadx need to collect usage information for such classes by scanning all code before decompilation. This is not implemented now and it will highly increase decompilation time or memory usage. For remove metadata annotation jadx need check that there is no reflection usage, this is also hard.

@redmi111
Copy link
Author

Thank you for your reply. No problem.

@skylot
Copy link
Owner

skylot commented Mar 19, 2022

Anonymous class inlining implemented. @metadata annotation still not removed and don't it is really needed.

@skylot skylot closed this as completed Mar 19, 2022
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

3 participants