Reputation: 42379
For instance, we have phone.apk
and phone.odex
under /system/app
. According to some unofficial documentation, phone.odex
is used to expedite the process of loading an app. However, why do we not just put phone.odex
under /data/dalvik
?
What's more weird is: There exists a file named system@app@[email protected]
under /data/dalvik
, when the app is loading, which one takes priority to load, /system/app/phone.odex
or /data/dalvik/system@app@[email protected]
?
Is it totally redundant to put phone.odex
under /system/app
?
Upvotes: 3
Views: 7319
Reputation: 52343
The /system/app
directory is read-only on normal (non-developer) devices, and only updated when the system receives an update. The point of /system/app/*.odex
is that the .odex file can be delivered as part of a system update, so it doesn't have to be generated on the first post-update boot, and doesn't eat up space on the /data partition.
If the .apk and .odex files are out of sync, the system is not able to overwrite the .odex in /system/app
, and will try to generate a correct version in /data/dalvik-cache
. Normally this will fail, because when .apk and .odex are delivered in pairs, the .apk does not contain a .dex file (it would be redundant to do so).
The .odex in /system/app
is scanned first, so it essentially takes priority.
Finding a redundant .odex is not expected, and suggests that at some point the device had a phone.apk
that included a .dex and that did not match the .odex.
Upvotes: 6