Check APK files in Android Studio

Rasoul Miri
3 min readSep 19, 2017

--

Checking out the APK is one of the great features of Android Studio, so you can easily view files within the APK for analysis.

The APK file is a compressed file, such as ZIP and RAR files, and can be viewed with compression software (such as WINRAR). Perhaps this is a question in your mind. What is the difference between an APK and compression software with Android Studio? You will find the answer to this question in more detail.

The benefits of this option can be used to accurately check the ProGuard operation and APK volume differences from the previous version. You can also see the number of methods and outputs of res files.

To do this, go to File > Open and select the desired APK file.

APK Open on Android Studio

The difference between this method and the open method with compression software is to open class.dex and resources.arsc files.

Open class.dex

By choosing classes.dex, you should see the image below.

The classes.dex file opens an APK file by Android Studio

As you can see, you can see all the packages in the dex file.

The number of methods for an APK is very important to us, as each .dex file can not be more than 65,536 (the reason for this limitation you can see from this link ).

As you can see, you can easily see the number of methods (in this case, the number of methods is 21,204).

You can also view the level of the classes by viewing the classes subcategories.

Check the file size of the class.dex file opened by an Android studio APK file

As you can see, the names of the packages and classes are changed in the image above and the ProGuard has worked correctly.

Open resources.arsc

By choosing the resources.arsc file, you should see the image below.

The resources.arsc file opens an APK file by Android Studio

As you can see, it’s easy to view project file files as well as configuration levels for different sizes or languages.

You can use the resConfigs in the build.gradle file to delete the folders you do not want from res in the APK.

For example, when you use resConfigs "en" in the build.gradle file, Android Studio can help you:

Before using resConfigs “en” in the build.gradle file
After using resConfigs “en” in the build.gradle file

Compare two APK files

And finally, you can use the Compare with APK to compare two files.

Option to compare two APK Android Studios
Compare two APK files in Android Studio

--

--