Hi Dave,
Thanks a lot for your informative reply! It is really helpful and makes a lot of sense.
I used zipinfo to look into the apk file and got a basic understanding of the apk content.
(1) I found the resources.arsc is deflated as well. in the zipinfo result, there is a "defN" mark for the resources.arsc. So it exists in a compressed format in the apk file.
However, I agree the way you described. I think this arsc file should be decompressed and extracted out like the lib and dex files, since it will be visited frequently. But I don't know why it is remained compressed in the package. And when an App is launched, the system seems needs to look up for this file first before it can load the assets/res files.
(2) So the resources.arsc works as a "mapping table" for this apk file, which provides a kind of "random read" feature for this semi-compressed file. When a resource/assets file is requested, we can locate its offset within this apk file. If we don't have such kind of lookup mapping table file, we have to uncompressed this whole package and keep all the uncompressed data in the memory, or we need to decompress this large file again.
(3) We already know that the dex file and lib files are extracted. I managed to remove the dex files and lib files from the apk file, and replace the original one. I found the App can be launched and running very well. So why does Android still keeps these file in the apk file? I guess it could be possible to add some code to the "android App installer" to save some storage space by removing the lib and dex files within apk.
Seems that I have too many questions... :-)
Thanks a lot for your patience to read it and I am appreciated very much..
Xuebin