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]
aapt dump resources [path_to_hangouts_apk]
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!