Resource package name is not necessarily the same as app package name
I'd like to report a possible bug. I searched the forums and it doesn't seem like anyone else has reported this yet but I apologize in advance if this is a repost.
When the handleInitPackageResources(InitPackageResourcesPar am)
method is called, I assume that resparam.res.getPackageName()
should return the package name of the resources being loaded. However, this does not seem to work as expected. Let's take for example the Googe Hangouts app.
The Hangouts app has the application package name "com.google.android.talk". However, the package name of the resources is "com.google.android.apps.babel" and not "com.google.android.talk". This can be verified by doing the following:
aapt dump badging [path_to_hangouts_apk]
At the head of the output, you should notice package: name='com.google.android.talk'
. This is the application package name. Now try:
aapt dump resources [path_to_hangouts_apk]
Now, at the head of the output, you should notice Package 0 id=127 name=com.google.android.apps.babel
. This is the package name of the resources. It would be great if resparam.res.getPackageName()
returns "com.google.android.apps.babel" instead of "com.google.android.talk".
If I try to access resource IDs of Google Hangouts using the resparam.res.getIdentifier
method, and by passing "com.google.android.talk" as the argument to defPackage
, I do not get any valid IDs. However, If I pass "com.google.android.apps.babel" as the argument, I get the resource IDs correctly.
Let me know if I can provide more information to help fix this bug. Thanks!