Does Android Studio amplify classes.dex file?

It seems that classes.dexthe apk file in the output folder is different from the installed application.

I use the classes.dex file for some security issues, so usually I unzipped the latest apk file and got the information from the file classes.dex. But when I read the classes.dex file at runtime, the file size is so different. (8 MB vs 46 KB)

The application works fine. Someone said that Proguard makes the classes.dex file easier, but I disabled Proguard. (useProguard false, minifyEnabled false in build.gradle)

Is there anything I can try? Thank you in advance.

Short description of the sentence: the classes.dexfile app/build/outputs/apk/app.apkcreated by Android Studio is different from classes.dexthat which I could find from the actual installed application of the Android device.

+4
source share
1 answer

In fact, the android studio does the conversion , and the term you used "compress" happens by default when you create it.

The compilation process for Android applications is very different from other Java applications. But it starts the same way: Java source code files are compiled into files .classusing the command javac:conversion_to_class_file

.class - Java JVM Java. Android- . Android , Dalvik. - Dalvik, - Oracle JVM, .

.class .jar classes.dex, - Dalvik. dx: classes.dex .

conversion_to_dex_file

classes.dex , , zip , Android .apk. Android aapt:

conversion_to_apk_file

proguard

  • Shrink - , , .
  • - - .
  • Obfuscate - , .

, .
, Android, .

.

+1

Source: https://habr.com/ru/post/1680411/


All Articles