is it possible to unzip a .apk file(or generally any zipped file) into memory instead of writing it to fs

14,087

Hope you are using Linux:

$ cd /dev/shm
$ unzip /path/to/my.apk

that's it. Unzipped APK in memory.

Share:
14,087
Daniel
Author by

Daniel

on the way to a better programmer

Updated on August 09, 2022

Comments

  • Daniel
    Daniel almost 2 years

    I am doing research with mobile apps and need to analyze their code after unzipping the .apk file. However, the process of unzipping naturally involves lots of IO, which doesn't make it scalable, I am thinking if it's possible to hold the unzipped data in memory, with several variables representing it, thus saving the trouble of writing to FS. I am loaded with thousands of apps to analyze, so being able to do something like this would significantly speed up my process. Is there anyone who can suggest a way out for me. I am using python. Thanks in advance

  • Daniel
    Daniel almost 11 years
    that seems to be a quick way to work around this issue. Thanks! I did a quick google and find that, /dev/shm, /tmp, /var/tmp /run can all serve as temporary memory storage. But I am not quite sure how they differ from each other, and in my case which one should I use. specifically /tmp and /var/tmp is mounted on filesystem /dev/sda6, /run is on tmpfs, and /dev/shm is on none. what's the different among them, and how are they related to memory when they are literally mounted on a device in the case of /tmp and /var/tmp
  • Diego Torres Milano
    Diego Torres Milano almost 11 years
    Check the filesystem type, if tmpfs it is in memory
  • Daniel
    Daniel almost 11 years
    how about /tmp and /var/tmp, on my computer it's /dev/sda6
  • Daniel
    Daniel almost 11 years
    df /tmp Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda6 191425164 50784288 130910368 28% / xushunyi@xushunyi-Lenovo-G450:/dev$ df /var/tmp