Understanding APK File Storage and Extraction

Hello everyone, welcome to our latest article all about Android Reverse Engineering and Penetration Testing. Today, we're embarking on a journey to uncover the secrets behind APK files' storage locations and understand the way to extract apps both pre-installed and user-installed. Let's jump right in!



Understanding the Storage location of APK files

On Android devices, where an app is installed and any extra settings during installation play a role in determining the storage location. 

We're about to take a meticulous look at these distinctive storage spots. Let's dissect them one by one.

But before we proceed, let's establish a connection with my Android virtual device using the adb connect command. 

┌──(kali㉿kali)-[~]
└─$ adb connect 192.168.95.118:5555 
* daemon not running; starting now at tcp:5037
* daemon started successfully
connected to 192.168.95.118:5555
                                                                                                                                  
┌──(kali㉿kali)-[~]
└─$ 

Then, by running adb devices, we can verify if our device is successfully connected or not.

┌──(kali㉿kali)-[~]
└─$ adb devices                    
List of devices attached
192.168.95.118:5555     device

                                                                                                                                  
┌──(kali㉿kali)-[~]
└─$

Now, let me run adb shell command to transition into shell mode. 

┌──(kali㉿kali)-[~]
└─$ adb shell  
x86_64:/ $ 

This prepares us to thoroughly explore the storage locations of APK files.

 

/data/app/ directory

Let’s start with the /data/app/ directory:

x86_64:/ $ cd /data/app                                                                                                          
x86_64:/data/app $

To get a glimpse of the files and directories within, simply run the ls –l command. 

x86_64:/data/app $ ls -l
ls: .: Permission denied
1|x86_64:/data/app $ 

Running the ls –l command prompts a " Permission denied error ." To overcome this, we'll elevate to super user mode with the su command.

1|x86_64:/data/app $ su 
x86_64:/ # 

Now, we have super user permission, let's run again to find out what are there:

x86_64:/ # cd /data/app
x86_64:/data/app # ls -l
total 16
drwxr-xr-x 4 system system 4096 2023-08-22 17:36 com.facebook.lite-HOzj-KlLSs8knyAm9oyDBA==
drwxr-xr-x 4 system system 4096 2023-08-22 17:36 com.instagram.lite-pXQ8LaWd93eEoJkAhfviGQ==
drwxr-xr-x 4 system system 4096 2023-08-22 17:36 com.jetstartgames.chess-AWAN-L4GToOwbH3oP1MY5A==
drwxr-xr-x 4 system system 4096 2023-08-22 15:18 heartratemonitor.heartrate.pulse.pulseapp-pHRLtmkTB0aobGYX2BbM2g==
x86_64:/data/app # 

This location is where user-installed apps find their place. A closer examination of the file permissions unveils intriguing insights. Take a look at this highlighted passage, showcasing that these files are world-readable. This means anyone can copy them without the need for elevated privileges.

This glimpse into the world of APK files beneath the /data/app/ directory showcases their world-readable permissions, providing us with a captivating peek into the Android app landscape.


/system/app directory

Now, let's journey over to the /system/app/ directory:

x86_64:/data/app # cd /system/app                                                                                                 
x86_64:/system/app # ls -l                                                                                                         
total 152                                                                                                                          
drwxr-xr-x 2 root root 4096 2019-01-15 07:37 AndroidTerm                                                                           
drwxr-xr-x 3 root root 4096 2019-01-15 11:31 BasicDreams                                                                           
drwxr-xr-x 3 root root 4096 2019-01-15 11:31 BasicSmsReceiver                                                                      
drwxr-xr-x 4 root root 4096 2019-01-15 11:33 Bluetooth                                                                             
drwxr-xr-x 3 root root 4096 2019-01-15 11:31 BluetoothMidiService                                                                  
drwxr-xr-x 3 root root 4096 2019-01-15 11:31 BookmarkProvider                                                                      
drwxr-xr-x 4 root root 4096 2019-01-15 11:32 BuiltInPrintService                                                                   
drwxr-xr-x 3 root root 4096 2019-01-15 11:33 Calendar                                                                              
drwxr-xr-x 4 root root 4096 2019-01-15 11:34 Camera2                                                                               
drwxr-xr-x 3 root root 4096 2019-01-15 11:31 CaptivePortalLogin                                                                    
drwxr-xr-x 3 root root 4096 2019-01-15 11:31 CarrierDefaultApp                                                                     
drwxr-xr-x 3 root root 4096 2019-01-15 11:31 CertInstaller                                                                         
drwxr-xr-x 3 root root 4096 2019-01-15 11:31 CompanionDeviceManager                                                                
drwxr-xr-x 2 root root 4096 2019-01-15 07:37 CtsShimPrebuilt                                                                       
drwxr-xr-x 3 root root 4096 2019-01-15 11:34 DeskClock                                                                             
drwxr-xr-x 3 root root 4096 2019-01-15 11:31 Development                                                                           
drwxr-xr-x 3 root root 4096 2019-01-15 11:32 DownloadProviderUi                                                                    
drwxr-xr-x 3 root root 4096 2019-01-15 11:34 EasterEgg
drwxr-xr-x 3 root root 4096 2019-01-15 11:33 ExactCalculator
drwxr-xr-x 4 root root 4096 2019-01-15 11:33 Gallery2
drwxr-xr-x 3 root root 4096 2019-01-15 07:37 GoogleCalendarSyncAdapter
drwxr-xr-x 3 root root 4096 2019-01-15 07:37 GoogleContactsSyncAdapter
drwxr-xr-x 3 root root 4096 2019-01-15 07:37 GoogleExtShared
drwxr-xr-x 3 root root 4096 2019-01-15 07:37 GooglePrintRecommendationService
drwxr-xr-x 3 root root 4096 2019-01-15 11:32 HTMLViewer
drwxr-xr-x 3 root root 4096 2019-01-15 11:32 KeyChain
drwxr-xr-x 4 root root 4096 2019-01-15 11:34 LatinIME
drwxr-xr-x 3 root root 4096 2019-01-15 11:34 LiveWallpapersPicker
drwxr-xr-x 2 root root 4096 2019-01-15 11:32 NotePad
drwxr-xr-x 4 root root 4096 2019-01-15 11:32 PacProcessor
drwxr-xr-x 3 root root 4096 2019-01-15 11:31 PartnerBookmarksProvider
drwxr-xr-x 4 root root 4096 2019-01-15 11:32 PicoTts
drwxr-xr-x 4 root root 4096 2019-01-15 11:34 PrintSpooler
drwxr-xr-x 2 root root 4096 2019-01-15 11:32 RSSReader
drwxr-xr-x 3 root root 4096 2019-01-15 11:32 UserDictionaryProvider
drwxr-xr-x 3 root root 4096 2019-01-15 11:32 WallpaperBackup
drwxr-xr-x 3 root root 4096 2019-01-15 11:34 WallpaperPicker
drwxr-xr-x 2 root root 4096 2019-01-15 07:53 WebViewGoogle
x86_64:/system/app # 

This is where the apps that come bundled with the system image find their residence. Let's take a closer look at the file permissions governing these apps within this directory. A quick overview reveals that all these files are also set as world-readable. This means that anyone can duplicate them without needing additional privileges:

This snapshot lays bare the world-readable permissions that characterize the APK files in the /system/app/ directory . It's an insightful glimpse into how the Android system stores and manages its bundled apps.


/data/app-private directory

Now, let's take a look at the /data/app-private/ directory:

x86_64:/system/app # cd /data/app                                                                                                 
app-asec/       app-ephemeral/  app-lib/        app-private/    app/                                                               
x86_64:/system/app # cd /data/app-private/                                                                                         
x86_64:/data/app-private # ls -l                                                                                                   
total 0                                                                                                                            
x86_64:/data/app-private #

When we run the ls -l command here, it doesn't reveal any visible content. However, this is the space where apps that demand an extra layer of copy protection on the device typically reside.

For users without the necessary privileges, copying apps from this location isn't straightforward. Yet, if we gain root access to the device, it's still possible to extract these APKs, granting us access to their contents. This adds an intriguing layer of security and access control for these specific apps.


Extracting Android Apps: A Step-by-Step Guide

Now, let's explore the process of extracting an app from the device. This process essentially breaks down into three simple steps:

  1. Find the Package Name
  2. Locate the APK Path 
  3. Pulling it Out

Let's put this into practice. Allow me to demonstrate with an example from my Android device, which is running on VirtualBox.


Example of extracting pre-installed apps

If we happen to know the app's name, we can deploy the adb shell pm list packages | grep "app_name" command. This action unveils the precious package name we're looking for.

┌──(kali㉿kali)-[~]
└─$ adb devices                             
List of devices attached
192.168.95.118:5555     device

┌──(kali㉿kali)-[~]
└─$ adb shell pm list packages | grep calculator
package: com.android.calculator2
                               
┌──(kali㉿kali)-[~]
└─$ 

With the package name in hand, the next stride involves discovering the path of the associated APK. This can be accomplished using the adb shell pm path [package_name] command.

┌──(kali㉿kali)-[~]
└─$ adb shell pm path com.android.calculator2   
package:/system/app/ExactCalculator/ExactCalculator.apk

┌──(kali㉿kali)-[~]
└─$ 

As expected, it is located under the /system/app/ directory since it is a preinstalled application. The final piece of the puzzle involves pulling it out from the device. We achieve this by executing the adb pull /system/app/[file.apk] command.

┌──(kali㉿kali)-[~]
└─$ adb pull /system/app/ExactCalculator/ExactCalculator.apk   
/system/app/ExactCalculator/ExactCalculator.apk: 1 file pulled, 0 skipped. 4.6 MB/s (389605 bytes in 0.081s)
                                                                                                                                  
┌──(kali㉿kali)-[~]
└─$  

 

Extracting user-installed apps

Now, let’s take a quick example of extracting user-installed apps:

This process follows a similar trajectory as with preinstalled apps, if we know the name of the app, we can use the previous commands to extract user-installed apps. 

However, in my Android VirtualBox emulator, there aren't any user-installed apps yet. I'll address this by manually installing one. But, there's a catch: the emulator lacks the Play Store. Therefore, we'll need to install the apps from the browser.


So, how can we obtain an APK file?

If we want to acquire a specific APK file of our choice, we can download it directly by visiting the Play Store web page. Simply copy the app's ID or complete URL from the URL bar of the browser. 

Then, visit http://apps.evozi.com/apk-downloader/, and paste the copied ID or URL. This enables you to download the APK file. 

Let me download it and install the downloaded APK file on the Android device using the adb install command. 

┌──(kali㉿kali)-[~]
└─$ cd Downloads 
                                                                                                                                  
┌──(kali㉿kali)-[~/Downloads]
└─$ ls
 heartratemonitor.heartrate.pulse.pulseapp_7_apps.evozi.com.apk
      
┌──(kali㉿kali)-[~/Downloads]
└─$ adb install heartratemonitor.heartrate.pulse.pulseapp_7_apps.evozi.com.apk 
Performing Streamed Install
Success
                                                                                                                                  
┌──(kali㉿kali)-[~/Downloads]
└─$ 

Now, the application is installed, and we are ready to continue our example:

First, let me run adb shell pm list packages | grep "your app" command to find the package name of the application installed by the user.

┌──(kali㉿kali)-[~]
└─$ adb shell pm list packages | grep "heartrate"
package:heartratemonitor.heartrate.pulse.pulseapp
                                                                                                                                  
┌──(kali㉿kali)-[~]
└─$ 

Well, as you can see, we have got the package name. We can use the adb shell pm path [package name] command to find its APK path.

┌──(kali㉿kali)-[~]
└─$ adb shell pm path heartratemonitor.heartrate.pulse.pulseapp
package:/data/app/heartratemonitor.heartrate.pulse.pulseapp-SOfFvOJSSHEE5DtF176GVA==/base.apk
                                                                                                                                  
┌──(kali㉿kali)-[~]
└─$

In this scenario, the APK resides in the /data/app/ directory , as it's a user-installed application. Lastly, we can extract this app from the device using the adb pull /data/app/[file.apk] command, much like we did earlier with preinstalled apps.

┌──(kali㉿kali)-[~]
└─$ adb pull /data/app/heartratemonitor.heartrate.pulse.pulseapp-SOfFvOJSSHEE5DtF176GVA==/base.apk
/data/app/heartratemonitor.heartrate.pulse.pulseapp-SOfFvOJSSHE... 1 file pulled, 0 skipped. 62.5 MB/s (10004359 bytes in 0.153s)
                                                                                                                                  
┌──(kali㉿kali)-[~]
└─$ 

One important point to note is that the location of APK files might differ slightly on the latest versions of Android devices. In my testing emulator, each APK possesses its own directory within /data/app/ for user-installed apps and /system/app/ for pre-installed ones. 



This ensures a more organized and manageable file structure.


Additionally, if you navigate to the /data /dalvik-cache/ directory after running the adb shell command, you might come across optimized dex files.

┌──(kali㉿kali)-[~]
└─$ adb shell                   
x86_64:/ $ su
x86_64:/ # cd /data/dalvik-cache

In the x86_64 architecture within the /data/dalvik-cache/ directory , you have two subdirectories: x86 and x86_64. 

x86_64:/ # cd /data/dalvik-cache
x86_64:/data/dalvik-cache # ls -l
total 24
drwx--x--x 2 root root  4096 2023-08-22 09:50 x86
drwx--x--x 2 root root 20480 2023-08-22 09:50 x86_64
x86_64:/data/dalvik-cache #

These directories contain the optimized .dex (Dalvik Executable) files (.dex) and the verification data files (.vdex) for various apps and frameworks.

x86_64:/data/dalvik-cache # cd x86_64/                                         
x86_64:/data/dalvik-cache/x86_64 # ls -al
total 102640
drwx--x--x 2 root   root        20480 2023-08-22 09:50 .
drwxrwx--x 4 root   root         4096 2020-03-07 03:07 ..
-rw-r----- 1 system all_a36      8192 2023-08-22 09:49 system@app@[email protected]@classes.art
-rw-r----- 1 system all_a36     17024 2019-01-15 11:31 system@app@[email protected]@classes.dex
-rw-r----- 1 system all_a36     15952 2023-08-22 09:49 system@app@[email protected]@classes.vdex
-rw-r----- 1 system all_a35      8192 2023-08-22 09:49 system@app@[email protected]@classes.art
-rw-r----- 1 system all_a35     17024 2019-01-15 11:31 system@app@[email protected]@classes.dex
-rw-r----- 1 system all_a35      7720 2023-08-22 09:49 system@app@[email protected]@classes.vdex
-rw-r----- 1 system u0_a31002  581632 2023-08-22 09:50 system@app@[email protected]@classes.art
-rw-r----- 1 system u0_a31002   78464 2019-01-15 11:33 system@app@[email protected]@classes.dex
-rw-r----- 1 system u0_a31002 3446650 2023-08-22 09:50 system@app@[email protected]@classes.vdex
-rw-r----- 1 system all_a38      8192 2023-08-22 09:50 system@app@[email protected]@classes.art
-rw-r----- 1 system all_a38     17024 2019-01-15 11:31 system@app@[email protected]@classes.dex
-rw-r----- 1 system all_a38     19518 2023-08-22 09:50 system@app@[email protected]@classes.vdex
-rw-r----- 1 system all_a37      8192 2023-08-22 09:50 system@app@[email protected]@classes.art
-rw-r----- 1 system all_a37     17024 2019-01-15 11:31 system@app@[email protected]@classes.dex
-rw-r----- 1 system all_a37      1580 2023-08-22 09:50 system@app@[email protected]@classes.vdex
-rw-r----- 1 system all_a39     12288 2023-08-22 09:49 system@app@[email protected]@classes.art
-rw-r----- 1 system all_a39     21120 2019-01-15 11:32 system@app@[email protected]@classes.dex
-rw-r----- 1 system all_a39    110642 2023-08-22 09:49 system@app@[email protected]@classes.vdex
-rw-r----- 1 system all_a42     24576 2023-08-22 09:49 system@app@[email protected]@classes.art
-rw-r----- 1 system all_a42     29312 2019-01-15 11:33 system@app@[email protected]@classes.dex
-rw-r----- 1 system all_a42   1119670 2023-08-22 09:49 system@app@[email protected]@classes.vdex
-rw-r----- 1 system all_a43     28672 2023-08-22 09:49 system@app@[email protected]@classes.art
-rw-r----- 1 system all_a43     70272 2019-01-15 11:34 system@app@[email protected]@classes.dex
-rw-r----- 1 system all_a43   2455154 2023-08-22 09:49 system@app@[email protected]@classes.vdex
-rw-r----- 1 system all_a41      8192 2023-08-22 09:50 system@app@[email protected]@classes.art
-rw-r----- 1 system all_a41     17024 2019-01-15 11:31 system@app@[email protected]@classes.dex
-rw-r----- 1 system all_a41     22178 2023-08-22 09:50 system@app@[email protected]@classes.vdex
-rw-r----- 1 system all_a44     12288 2023-08-22 09:49 system@app@[email protected]@classes.art
-rw-r----- 1 system all_a44     17024 2019-01-15 11:31 system@app@[email protected]@classes.dex
-rw-r----- 1 system all_a44     33494 2023-08-22 09:49 system@app@[email protected]@classes.vdex
-rw-r----- 1 system all_a46     12288 2023-08-22 09:49 system@app@[email protected]@classes.art
-rw-r----- 1 system all_a46     17024 2019-01-15 11:31 system@app@[email protected]@classes.dex
-rw-r----- 1 system all_a46     43188 2023-08-22 09:49 system@app@[email protected]@classes.vdex
-rw-r----- 1 system all_a45      8192 2023-08-22 09:49 system@app@[email protected]@classes.art
-rw-r----- 1 system all_a45     17024 2019-01-15 11:31 system@app@[email protected]@classes.dex
-rw-r----- 1 system all_a45     23468 2023-08-22 09:49 system@app@[email protected]@classes.vdex
-rw-r----- 1 system all_a51     28672 2023-08-22 09:50 system@app@[email protected]@classes.art
-rw-r----- 1 system all_a51     45696 2019-01-15 11:34 system@app@[email protected]@classes.dex
-rw-r----- 1 system all_a51   2437844 2023-08-22 09:50 system@app@[email protected]@classes.vdex
-rw-r----- 1 system all_a48     16384 2023-08-22 09:50 system@app@[email protected]@classes.art
-rw-r----- 1 system all_a48     17024 2019-01-15 11:31 system@app@[email protected]@classes.dex
-rw-r----- 1 system all_a48    127702 2023-08-22 09:50 system@app@[email protected]@classes.vdex
-rw-r----- 1 system all_a10      8192 2023-08-22 09:49 system@app@[email protected]@classes.art
-rw-r----- 1 system all_a10     17024 2019-01-15 11:32 system@app@[email protected]@classes.dex
-rw-r----- 1 system all_a10     13280 2023-08-22 09:49 system@app@[email protected]@classes.vdex
-rw-r----- 1 system all_a49     20480 2023-08-22 09:49 system@app@[email protected]@classes.art
-rw-r----- 1 system all_a49     25216 2019-01-15 11:34 system@app@[email protected]@classes.dex
-rw-r----- 1 system all_a49    495222 2023-08-22 09:49 system@app@[email protected]@classes.vdex
-rw-r----- 1 system all_a52     20480 2023-08-22 09:50 system@app@[email protected]@classes.art
-rw-r----- 1 system all_a52     25216 2019-01-15 11:33 system@app@[email protected]@classes.dex
-rw-r----- 1 system all_a52    756428 2023-08-22 09:50 system@app@[email protected]@classes.vdex
-rw-r----- 1 system all_a56     28672 2023-08-22 09:49 system@app@[email protected]@classes.art
-rw-r----- 1 system all_a56     53888 2019-01-15 11:33 system@app@[email protected]@classes.dex
-rw-r----- 1 system all_a56   2481446 2023-08-22 09:49 system@app@[email protected]@classes.vdex
-rw-r----- 1 system all_a53     24576 2023-08-22 09:50 system@app@[email protected]@classes.art
-rw-r----- 1 system all_a53     41600 2019-01-15 07:37 system@app@[email protected]@classes.dex
-rw-r----- 1 system all_a53   1381886 2023-08-22 09:50 system@app@[email protected]@classes.vdex
-rw-r----- 1 system all_a57     24576 2023-08-22 09:49 system@app@[email protected]@classes.art
-rw-r----- 1 system all_a57     45696 2019-01-15 07:37 system@app@[email protected]@classes.dex
-rw-r----- 1 system all_a57   1995028 2023-08-22 09:49 system@app@[email protected]@classes.vdex
-rw-r----- 1 system all_a54      8192 2023-08-22 09:49 system@app@[email protected]@classes.art
-rw-r----- 1 system all_a54     17024 2019-01-15 07:37 system@app@[email protected]@classes.dex
-rw-r----- 1 system all_a54      1540 2023-08-22 09:49 system@app@[email protected]@classes.vdex
-rw-r----- 1 system all_a55      8192 2023-08-22 09:50 system@app@GooglePrintRecommendationService@[email protected]
-rw-r----- 1 system all_a55     17024 2019-01-15 07:37 system@app@GooglePrintRecommendationService@[email protected]
-rw-r----- 1 system all_a55     55710 2023-08-22 09:50 system@app@GooglePrintRecommendationService@[email protected]
-rw-r----- 1 system all_a58      8192 2023-08-22 09:49 system@app@[email protected]@classes.art
-rw-r----- 1 system all_a58     17024 2019-01-15 11:32 system@app@[email protected]@classes.dex
-rw-r----- 1 system all_a58      7788 2023-08-22 09:49 system@app@[email protected]@classes.vdex
-rw-r----- 1 system all_a61     69632 2023-08-22 09:50 system@app@[email protected]@classes.art
-rw-r----- 1 system all_a61    541312 2019-01-15 11:34 system@app@[email protected]@classes.dex
-rw-r----- 1 system all_a61   1121442 2023-08-22 09:50 system@app@[email protected]@classes.vdex
-rw-r----- 1 system all_a60     28672 2023-08-22 09:50 system@app@[email protected]@classes.art
-rw-r----- 1 system all_a60     41600 2019-01-15 11:34 system@app@[email protected]@classes.dex
-rw-r----- 1 system all_a60   1744544 2023-08-22 09:50 system@app@[email protected]@classes.vdex
-rw-r----- 1 system all_a59      8192 2023-08-22 09:49 system@app@[email protected]@classes.art
-rw-r----- 1 system all_a59     17024 2019-01-15 11:32 system@app@[email protected]@classes.dex
-rw-r----- 1 system all_a59     25430 2023-08-22 09:49 system@app@[email protected]@classes.vdex
-rw-r----- 1 system all_a63      8192 2023-08-22 09:49 system@app@[email protected]@classes.art
-rw-r----- 1 system all_a63     21120 2019-01-15 11:32 system@app@[email protected]@classes.dex
-rw-r----- 1 system all_a63      4784 2023-08-22 09:49 system@app@[email protected]@classes.vdex
-rw-r----- 1 system all_a64     12288 2023-08-22 09:50 system@app@[email protected]@classes.art
-rw-r----- 1 system all_a64     17024 2019-01-15 11:31 system@app@[email protected]@classes.dex
-rw-r----- 1 system all_a64     40702 2023-08-22 09:50 system@app@[email protected]@classes.vdex
-rw-r----- 1 system all_a66     20480 2023-08-22 09:49 system@app@[email protected]@classes.art
-rw-r----- 1 system all_a66     29312 2019-01-15 11:34 system@app@[email protected]@classes.dex
-rw-r----- 1 system all_a66    686036 2023-08-22 09:49 system@app@[email protected]@classes.vdex
-rw-r----- 1 system all_a67      8192 2023-08-22 09:49 system@app@[email protected]@classes.art
-rw-r----- 1 system all_a67     17024 2019-01-15 11:32 system@app@[email protected]@classes.dex
-rw-r----- 1 system all_a67     12868 2023-08-22 09:49 system@app@[email protected]@classes.vdex
-rw-r--r-- 1 system all_a4      45696 2019-01-15 11:32 system@app@[email protected]@classes.dex
-rw-r--r-- 1 system all_a4      17376 2023-08-22 09:50 system@app@[email protected]@classes.vdex
-rw-r----- 1 system all_a68     16384 2023-08-22 09:50 system@app@[email protected]@classes.art
-rw-r----- 1 system all_a68     21120 2019-01-15 11:34 system@app@[email protected]@classes.dex
-rw-r----- 1 system all_a68    247270 2023-08-22 09:50 system@app@[email protected]@classes.vdex
-rw-r----- 1 system all_a69     32768 2023-08-22 09:49 system@app@[email protected]@classes.art
-rw-r----- 1 system all_a69    131712 2019-01-15 07:53 system@app@[email protected]@classes.dex
-rw-r----- 1 system all_a69   2348986 2023-08-22 09:49 system@app@[email protected]@classes.vdex
-rw-r--r-- 1 root   root        12288 2020-03-07 03:07 system@[email protected]
lrwxrwxrwx 1 root   root           61 2020-03-07 03:07 system@[email protected] -> /system/framework/x86_64/boot-android.hidl.base-V1.0-java.oat
lrwxrwxrwx 1 root   root           62 2020-03-07 03:07 system@[email protected] -> /system/framework/x86_64/boot-android.hidl.base-V1.0-java.vdex
-rw-r--r-- 1 root   root        16384 2020-03-07 03:07 system@[email protected]
lrwxrwxrwx 1 root   root           64 2020-03-07 03:07 system@[email protected] -> /system/framework/x86_64/boot-android.hidl.manager-V1.0-java.oat
lrwxrwxrwx 1 root   root           65 2020-03-07 03:07 system@[email protected] -> /system/framework/x86_64/boot-android.hidl.manager-V1.0-java.vdex
-rw-r--r-- 1 root   root        69632 2020-03-07 03:07 system@[email protected]
lrwxrwxrwx 1 root   root           44 2020-03-07 03:07 system@[email protected] -> /system/framework/x86_64/boot-apache-xml.oat
lrwxrwxrwx 1 root   root           45 2020-03-07 03:07 system@[email protected] -> /system/framework/x86_64/boot-apache-xml.vdex
-rw-r--r-- 1 root   root       204800 2020-03-07 03:07 system@[email protected]
lrwxrwxrwx 1 root   root           46 2020-03-07 03:07 system@[email protected] -> /system/framework/x86_64/boot-bouncycastle.oat
lrwxrwxrwx 1 root   root           47 2020-03-07 03:07 system@[email protected] -> /system/framework/x86_64/boot-bouncycastle.vdex
-rw-r--r-- 1 root   root       307200 2020-03-07 03:07 system@[email protected]
lrwxrwxrwx 1 root   root           43 2020-03-07 03:07 system@[email protected] -> /system/framework/x86_64/boot-conscrypt.oat
lrwxrwxrwx 1 root   root           44 2020-03-07 03:07 system@[email protected] -> /system/framework/x86_64/boot-conscrypt.vdex
-rw-r--r-- 1 root   root       815104 2020-03-07 03:07 system@[email protected]
lrwxrwxrwx 1 root   root           45 2020-03-07 03:07 system@[email protected] -> /system/framework/x86_64/boot-core-libart.oat
lrwxrwxrwx 1 root   root           46 2020-03-07 03:07 system@[email protected] -> /system/framework/x86_64/boot-core-libart.vdex
-rw-r--r-- 1 root   root       180224 2020-03-07 03:07 system@[email protected]
lrwxrwxrwx 1 root   root           37 2020-03-07 03:07 system@[email protected] -> /system/framework/x86_64/boot-ext.oat
lrwxrwxrwx 1 root   root           38 2020-03-07 03:07 system@[email protected] -> /system/framework/x86_64/boot-ext.vdex
-rw-r--r-- 1 root   root      6287360 2020-03-07 03:07 system@[email protected]
lrwxrwxrwx 1 root   root           43 2020-03-07 03:07 system@[email protected] -> /system/framework/x86_64/boot-framework.oat
lrwxrwxrwx 1 root   root           44 2020-03-07 03:07 system@[email protected] -> /system/framework/x86_64/boot-framework.vdex
-rw-r--r-- 1 root   root        45056 2020-03-07 03:07 system@[email protected]
lrwxrwxrwx 1 root   root           44 2020-03-07 03:07 system@[email protected] -> /system/framework/x86_64/boot-ims-common.oat
lrwxrwxrwx 1 root   root           45 2020-03-07 03:07 system@[email protected] -> /system/framework/x86_64/boot-ims-common.vdex
-rw-r--r-- 1 root   root        24576 2020-03-07 03:07 system@[email protected]
lrwxrwxrwx 1 root   root           45 2020-03-07 03:07 system@[email protected] -> /system/framework/x86_64/boot-legacy-test.oat
lrwxrwxrwx 1 root   root           46 2020-03-07 03:07 system@[email protected] -> /system/framework/x86_64/boot-legacy-test.vdex
-rw-r--r-- 1 root   root       184320 2020-03-07 03:07 system@[email protected]
lrwxrwxrwx 1 root   root           40 2020-03-07 03:07 system@[email protected] -> /system/framework/x86_64/boot-okhttp.oat
lrwxrwxrwx 1 root   root           41 2020-03-07 03:07 system@[email protected] -> /system/framework/x86_64/boot-okhttp.vdex
-rw-r--r-- 1 root   root       159744 2020-03-07 03:07 system@[email protected]
lrwxrwxrwx 1 root   root           61 2020-03-07 03:07 system@[email protected] -> /system/framework/x86_64/boot-org.apache.http.legacy.boot.oat
lrwxrwxrwx 1 root   root           62 2020-03-07 03:07 system@[email protected] -> /system/framework/x86_64/boot-org.apache.http.legacy.boot.vdex
-rw-r--r-- 1 root   root       274432 2020-03-07 03:07 system@[email protected]
lrwxrwxrwx 1 root   root           50 2020-03-07 03:07 system@[email protected] -> /system/framework/x86_64/boot-telephony-common.oat
lrwxrwxrwx 1 root   root           51 2020-03-07 03:07 system@[email protected] -> /system/framework/x86_64/boot-telephony-common.vdex
-rw-r--r-- 1 root   root        49152 2020-03-07 03:07 system@[email protected]
lrwxrwxrwx 1 root   root           45 2020-03-07 03:07 system@[email protected] -> /system/framework/x86_64/boot-voip-common.oat
lrwxrwxrwx 1 root   root           46 2020-03-07 03:07 system@[email protected] -> /system/framework/x86_64/boot-voip-common.vdex
-rw-r--r-- 1 root   root      2347008 2020-03-07 03:07 system@[email protected]
lrwxrwxrwx 1 root   root           33 2020-03-07 03:07 system@[email protected] -> /system/framework/x86_64/boot.oat
lrwxrwxrwx 1 root   root           34 2020-03-07 03:07 system@[email protected] -> /system/framework/x86_64/boot.vdex
-rw-r----- 1 system all_a1       8192 2023-08-22 09:49 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system all_a1      17024 2019-01-15 11:32 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system all_a1       9700 2023-08-22 09:49 system@priv-app@[email protected]@classes.vdex
-rw-r--r-- 1 system all_a4     795264 2019-01-15 11:34 system@priv-app@[email protected]@classes.dex
-rw-r--r-- 1 system all_a4     391862 2023-08-22 09:50 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system all_a5      20480 2023-08-22 09:49 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system all_a5      25216 2019-01-15 11:34 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system all_a5     608674 2023-08-22 09:49 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system all_a4       8192 2023-08-22 09:49 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system all_a4      17024 2019-01-15 11:32 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system all_a4      14534 2023-08-22 09:49 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system all_a3       8192 2023-08-22 09:49 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system all_a3      17024 2019-01-15 11:34 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system all_a3       5318 2023-08-22 09:49 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system all_a8      28672 2023-08-22 09:49 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system all_a8      33408 2019-01-15 11:35 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system all_a8    1660870 2023-08-22 09:49 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system all_a9      32768 2023-08-22 09:49 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system all_a9      74368 2019-01-15 11:36 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system all_a9    4620130 2023-08-22 09:49 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system all_a4      20480 2023-08-22 09:50 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system all_a4      29312 2019-01-15 11:34 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system all_a4    1099982 2023-08-22 09:50 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system all_a7       8192 2023-08-22 09:49 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system all_a7      17024 2019-01-15 11:34 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system all_a7      11910 2023-08-22 09:49 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system all_a14     36864 2023-08-22 09:49 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system all_a14    119424 2019-01-15 11:39 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system all_a14   5695452 2023-08-22 09:49 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system all_a12    196608 2023-08-22 09:49 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system all_a12    774784 2019-01-15 11:35 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system all_a12   2272704 2023-08-22 09:49 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system all_a10     16384 2023-08-22 09:49 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system all_a10     25216 2019-01-15 11:35 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system all_a10    482438 2023-08-22 09:49 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system all_a11     32768 2023-08-22 09:50 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system all_a11    111232 2019-01-15 11:36 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system all_a11   5237636 2023-08-22 09:50 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system all_a17     32768 2023-08-22 09:50 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system all_a17    119424 2019-01-15 11:36 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system all_a17   1795084 2023-08-22 09:50 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system all_a13      8192 2023-08-22 09:49 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system all_a13     17024 2019-01-15 11:35 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system all_a13     27064 2023-08-22 09:49 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system all_a15      8192 2023-08-22 09:50 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system all_a15     17024 2019-01-15 07:37 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system all_a15      8858 2023-08-22 09:50 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system all_a16      8192 2023-08-22 09:49 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system all_a16     17024 2019-01-15 07:37 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system all_a16     14920 2023-08-22 09:49 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system all_a19     20480 2023-08-22 09:50 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system all_a19     25216 2019-01-15 07:37 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system all_a19    506384 2023-08-22 09:50 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system all_a15     28672 2023-08-22 09:50 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system all_a15     70272 2019-01-15 07:37 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system all_a15   2433224 2023-08-22 09:50 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system all_a18     12288 2023-08-22 09:49 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system all_a18     17024 2019-01-15 07:37 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system all_a18    147972 2023-08-22 09:49 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system all_a20     28672 2023-08-22 09:49 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system all_a20     45696 2019-01-15 07:37 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system all_a20   2161698 2023-08-22 09:49 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system all_a21     20480 2023-08-22 09:49 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system all_a21     41600 2019-01-15 07:37 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system all_a21   1395394 2023-08-22 09:49 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system all_a15     20480 2023-08-22 09:49 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system all_a15     29312 2019-01-15 07:37 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system all_a15    953174 2023-08-22 09:49 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system all_a22    249856 2023-08-22 09:49 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system all_a22   1442432 2019-01-15 11:36 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system all_a22   1677992 2023-08-22 09:49 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system all_a23     20480 2023-08-22 09:50 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system all_a23     25216 2019-01-15 11:36 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system all_a23    389266 2023-08-22 09:50 system@priv-app@[email protected]@classes.vdex
-rw-r--r-- 1 system all_a10    373376 2019-01-15 11:36 system@priv-app@[email protected]@classes.dex
-rw-r--r-- 1 system all_a10    166326 2023-08-22 09:49 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system u0_a31001   20480 2023-08-22 09:49 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system u0_a31001   17024 2019-01-15 11:36 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system u0_a31001   74662 2023-08-22 09:49 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system all_a10     12288 2023-08-22 09:49 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system all_a10     17024 2019-01-15 11:36 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system all_a10     75498 2023-08-22 09:49 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system all_a25      8192 2023-08-22 09:49 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system all_a25     17024 2019-01-15 11:36 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system all_a25     11858 2023-08-22 09:49 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system u0_a31000 1323008 2023-08-22 09:50 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system u0_a31000   82560 2019-01-15 11:38 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system u0_a31000 5197028 2023-08-22 09:50 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system all_a26    118784 2023-08-22 09:49 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system all_a26    537216 2019-01-15 07:37 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system all_a26   3370736 2023-08-22 09:49 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system all_a27      8192 2023-08-22 09:49 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system all_a27     17024 2019-01-15 11:36 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system all_a27      8710 2023-08-22 09:49 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system u0_a32000   57344 2023-08-22 09:50 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system u0_a32000   21120 2019-01-15 11:36 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system u0_a32000  191410 2023-08-22 09:50 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system all_a28     12288 2023-08-22 09:49 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system all_a28     17024 2019-01-15 11:36 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system all_a28     70446 2023-08-22 09:49 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system all_a29     28672 2023-08-22 09:50 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system all_a29     41600 2019-01-15 11:37 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system all_a29   1863148 2023-08-22 09:50 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system all_a31    536576 2023-08-22 09:50 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system all_a31   2933376 2019-01-15 11:39 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system all_a31   5670808 2023-08-22 09:50 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system u0_a31000   16384 2023-08-22 09:49 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system u0_a31000   17024 2019-01-15 11:37 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system u0_a31000    9936 2023-08-22 09:49 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system all_a30     32768 2023-08-22 09:50 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system all_a30     45696 2019-01-15 16:05 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system all_a30   2840418 2023-08-22 09:50 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system u0_a31001  471040 2023-08-22 09:50 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system u0_a31001   41600 2019-01-15 11:39 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system u0_a31001 1986626 2023-08-22 09:50 system@priv-app@[email protected]@classes.vdex
-rw-r--r-- 1 system u0_a31001  504448 2019-01-15 11:38 system@priv-app@[email protected]@classes.dex
-rw-r--r-- 1 system u0_a31001  222524 2023-08-22 09:49 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system all_a34      8192 2023-08-22 09:50 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system all_a34     17024 2019-01-15 11:39 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system all_a34      9472 2023-08-22 09:50 system@priv-app@[email protected]@classes.vdex
-rw-r----- 1 system all_a32     12288 2023-08-22 09:49 system@priv-app@[email protected]@classes.art
-rw-r----- 1 system all_a32     17024 2019-01-15 11:39 system@priv-app@[email protected]@classes.dex
-rw-r----- 1 system all_a32    125460 2023-08-22 09:49 system@priv-app@[email protected]@classes.vdex
x86_64:/data/dalvik-cache/x86_64 # x86_64:/data/dalvik-cache/x86_64 #

These optimized dex files are created on an app's first run, to enhance app performance. This process, known as dexopt, occurs during Android OS's initial startup.

VDEX stands for "Vdex Execution." VDEX files are used in the newer Android runtime environment, ART. Starting from Android 5.0 Lollipop, ART replaced Dalvik as the default runtime. VDEX files are part of the ART's compilation and optimization process.

Let’s briefly give an overview of the files present in the x86_64 subdirectories:

  • The /system/app directory contains optimized .dex files and .vdex files for various system apps like AndroidTerm and WebViewGoogle .
  • The system/framework/ directory contains optimized .dex files and .vdex files for various framework components such as android.hidl.base , android.hidl.manager , boot-android.hidl.base , boot-android.hidl.manager , and more.

Each app or framework has its associated .dex file, which contains the compiled code, and a corresponding .vdex file, which contains verification data to speed up the app's loading process. This provides a comprehensive understanding of how apps are structured and managed on the Android system.

In this article, we've delved into the world of APK file storage locations and learned how to extract these files from their storage spots. 

In our next article, we are going to explore Android App Components. So, keep waiting till then. 


Exploring Android App Components: A Simple Guide

This simple guide provides an introduction to Android app components, explaining the key components such as activities, services, broadcast receivers, and content providers. It's a fundamental resource for anyone learning Android app development.


If you have any questions about the content we've covered, feel free to leave a comment in the comment section below.

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.

#buttons=(Ok, Go it!) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Ok, Go it!