Damian Sowa
4 min readMar 1, 2024

--

Getting data from Android apps, how do I manage to get assets and JSON files from APK files?

I would like to start with that even if you can get data from the other apps you probably shouldn’t use it, it probably has some copyrights etc. I am sharing my knowledge because this topic is interesting for me and I feel excited that I can get the data I want from mobile apps. What I also would like to add — I am working every day as an FE developer, so my knowledge about mobile development is mediocre, and maybe some methods could be improved.

After you find the app that you want decode, you need to download it, my favourite downloader is — https://apkcombo.com/downloader/ , you need to paste the Google Play link and then you can download apk file.

Why do you want to download the file? First, you need to check how the app is made and how and where files are stored.

  • Non-native app with native shell (ex. Ionic, Flutter) and local assets
  • Non-native app with native shell (ex. Ionic, Flutter) and online assets
  • Native app with local assets
  • Native app with online assets

I would recommend playing a little bit with the app on your phone, and later opening it after downloading it (just change .apk -> .zip) and open it (will work 90%).

How to spot a Non-native app with a native shell?

This is super easy, often you can go to the assets folder and you can find it there (ex. web code) and some other files. If you are really lucky and all assets are bundled locally maybe you can find things you wanted there.

What if I see code, but no assets that are interesting for me?

Then it is worth reading through the code and also looking for the “http” and “https” strings in the whole project. You may easily find the links you wanted and you will be able to get files.

But what if it is a native app?

Because I am a web developer, it is easier for me to check non-native apps, but after some playing, I’ve found a way to decompile an Android native app and get more information from inside.

So after opening the native app, It looks a little bit gibberish you can see some things, and you can maybe find some strings inside and maybe some assets. But everything will look chaotic and not human-friendly.

https://apktool.org/

The good thing is that there is a tool for decompiling Android apps — Apktool and it looks like it works pretty well.

apktool d file.apk

After installation in your OS, run the command from above. The app after decompilation still looks gibberish, but local assets are easier to check and I believe some assets that haven’t been visible before appear there. You can look again for links etc. There is a high chance you will find the assets you need.

Native app with downloadable content

The last time I found another scenario, the app I wanted to decode was downloading almost all assets after running on my phone. I’ve found a URL to Firebase, but I wasn’t able to get what I wanted. From the second side, I was sure that the app needed to store all downloaded assets somewhere locally on my phone. I’ve found that this folder is /data/data/. Unfortunately for a long time, Android doesn’t allow to view this folder (without root). I didn’t want to root my phone, but I thought maybe I would be able to run an Android emulator and root it there. It happened it was much easier than I expected.

How to root Android on the Android emulator in Android Studio?

Android Studio — create a new Virtual Device

You need to create a new Virtual Device, but what is extremely important you need to look for a system image without “(Google Play)”, but “(Google APIs)” are totally fine. Later you need to run it and run the below command in the terminal.

adb root

If there is no error, then you have root access on your virtual device. Then from Android Studio, you can view Android files and you can check /data/data/ and view and copy whatever you like.

The end

I tried to share everything that I learn about decompiling, opening and looking inside apk files for assets that are interesting to me. I believe not everything is covered here but hope so this article was interesting for you.

--

--