3

I know that accessing the /data/app folder in Android where APKs are stored requires root. However, I am curious to know whether an Android application requires root to access its own APK as well.

Thanks in advance.

Heshan Perera
  • 4,592
  • 8
  • 44
  • 57
  • Why would you need to? You have an uncompressed apk during development and all the tools(SDK/NDK) for internal access... – MattMatt Apr 05 '14 at 03:42
  • Not sure why would want to... In theory you may be able to access it but the odds are rare. If you did, it would be considered a vulnerability because i could embed malicious code in an image and recursively run it from within my app....as an example. Also, your app should store everything in the proper storage locations per developer best practice. – Grady D Apr 05 '14 at 04:30
  • This would be very useful eg. when you want make other devices able to download the app via WiFi Direct with no Internet connection. – m93a Aug 31 '16 at 14:15

1 Answers1

1

yes you can
i'm already tried this. i have an application that required me to access the source package that has sql files ( not java file, so it still exist after building it ). so to solve that, i need to open my apk file inside data/app and open it as zip stream then read my sql file. anyway my device is not rooted.
P.S : i cannot put my sql file in asset because of some reasons

Randyka Yudhistira
  • 3,612
  • 1
  • 26
  • 41