When opening the apk file with winrar(s/w to open compressed files). I got a bunch of files packed inside the apk. Among them classes.dex is one. My question is what is the role of this file and if we modify/delete the same file will it effect the apk?
To make an APK file, a program for Android is first compiled, and then all of its parts are packaged into one file. This holds all of that program's code (These are the .dex files
), resources, assets, certificates, and manifest file.
Programs are commonly written in Java
and compiled to bytecode
. They are then converted from Java Virtual Machine-compatible .class files
to Dalvik-compatible .dex
(Dalvik Executable) files before installation on a device. The compact Dalvik Executable format is designed to be suitable for systems that are constrained in terms of memory and processor speed.
As the .dex files holds the APK resources, any edit on these files will directly effect the APK.