问题描述
我正在分析APK,并在应用程序的/RE/RAW/目录中查看一组.txt资源.在仿真器上安装应用程序后,我希望在/data/data/[app]/文件目录中看到相同的文件,但它们似乎并不存在.存储的原始资源在哪里?是在文件系统上的其他位置在应用程序运行时生成的原始资源吗?或访问它们时,它是否动态地从本地.APK文件动态?谢谢.
推荐答案
原始资源(且实际上,所有资源)在APK文件中捆绑在一起(包括放置在assets/中的文件),这就是为什么无法使用File句柄. APK文件本身通常居住在设备的system/app目录中.
您提到的内部存储位置(/data/data/[app]/files)是放置使用Context.openFileInput(),Context.openFileOutput()或Context.getFilesDir()创建的文件.
hth
问题描述
I am analyzing an APK, and see a set of .txt resources in the /res/raw/ directory of the application. After installing the application on an emulator, I would expect to see those same files in the /data/data/[app]/files directory, but they do not seem to exist. Where are the raw resources stored? Are raw resources generated at application runtime somewhere else on the filesystem? Or when they are accessed, is it dynamically from the local .apk file? Thanks.
推荐答案
Raw resources (and really, all resources) are bundled in the APK file (this includes files placed in assets/), which is why you cannot get to the using File handles. The APK files themselves usually live in the system/app directory of the device.
The internal storage location you mentioned (/data/data/[app]/files) is where files created with Context.openFileInput(), Context.openFileOutput(), or Context.getFilesDir() are placed.
HTH