Extracting .apk file from mobile devices

11/21/2023

During the penetration testing, we absolutely must perform static analysis by decompiling, disassembling an apk file. For a usual situation we can request the apk file from dev team. But what if the target application comes from Google Store, How we can get the apk file. Let’s talk about it in this blog.

Extracting .APK File

1. Download and install the application on a mobile device from Google Play Store.


2. Finding the application package name

# Option #1 : Guessing a KEYWORD from application's name
adb shell pm list packages | grep [KEYWORD]

# Option #2 : Latest installed application (Root Required)
adb shell ls -laht /data/data

# Option #3 : Using Frida
frida-ps -Uai

3. Extracting the apk file path

adb shell pm path com.example.app

4. Download the apk file

adb pull /path/to/apk/file.apk