https://kotlinlang.org logo
Title
k

Koneko Toujou

03/12/2023, 1:33 PM
Does kotlin emit different bytecode for both android and desktop? Assuming both compile for the same source and same target, and both compile the exact same class
m

mbonnin

03/12/2023, 1:37 PM
Android will take the .class files and turn them into .dex (the format of the Android JVM)
But the initial .class files shouldn't be that different? (not sure about that last part but I don't see a strong reason why)
k

Koneko Toujou

03/12/2023, 1:41 PM
Hmmm
m

mbonnin

03/12/2023, 1:42 PM
You can open an apk in Android Studio, it'll show the .dex files inside (or you can just unzip it too)
k

Koneko Toujou

03/12/2023, 1:42 PM
Yea
As i have heard that ummm most bytecode analysers need special support for android
Tho such analysers are typically memory heavy :(
a

Andrey

03/12/2023, 3:34 PM
Tell me what exactly you want to do, I can help. The bytecode is a bit more complicated than smali. But both of them are very easy to learn, except that the JVM is a stack machine and ART is a register machine. You can easily convert one to the other.