Android:原始资源是否存储在文件系统本地? [英] Android: Are raw resources stored locally on the filesystem?
问题描述
我正在分析一个APK,并在应用程序的/res/raw/目录中看到了一组.txt资源.在模拟器上安装应用程序后,我希望可以在/data/data/[app]/files目录中看到这些相同的文件,但是它们似乎不存在.原始资源存储在哪里?是否在应用程序运行时在文件系统上的其他位置生成了原始资源?或者在访问它们时,它是从本地.apk文件动态生成的吗?谢谢.
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.
推荐答案
原始资源(实际上是所有资源)都捆绑在APK文件中(这包括放置在assets/
中的文件),这就是为什么您无法进入使用File
句柄. APK文件本身通常位于设备的system/app
目录中.
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.
您提到的内部存储位置(/data/data/[app]/files
)是放置用Context.openFileInput()
,Context.openFileOutput()
或Context.getFilesDir()
创建的文件的位置.
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
这篇关于Android:原始资源是否存储在文件系统本地?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!