E/MessageQueue-JNI(3648): Exception in MessageQueue callback: handleReceiveCallback
E/MessageQueue-JNI(3648): android.content.res.Resources$NotFoundException: File res/raw/voice_note_start.wav from drawable resource ID #0x7f0f000c
E/MessageQueue-JNI(3648): at android.content.res.Resources.openRawResourceFd(Resources.java:1315)
E/MessageQueue-JNI(3648): at android.media.SoundPool.load(SoundPool.java:245)
apktool d (with apktool 2.4.0)apktool b (with apktool 2.4.0)_Notes_:
Apktool default.
If this APK can be freely shared, please upload/attach a link to it.
https://www.apkmirror.com/apk/whatsapp-inc/whatsapp/whatsapp-2-19-34-release/whatsapp-messenger-2-19-34-2-android-apk-download/
apktool d, apktool b without changing anything? YesThis looks like an AAPT/AAPT2 similar to the https://github.com/iBotPeaches/Apktool/issues/2032 issue reported...
~Ibuprophen
@ibuprophen1 I've seen issue #2032 (which is related to the ids.xml). Mine is not similar.
I agree it might be AAPT related, because the APK is trying to load a .wav (raw) file using the drawable identifier!
Well git blaming myself all the way back to 2.3.1 will be impossible, so guess we have to treat this as a bug vs regression.
@iBotPeaches First of all, thank you for your time and efforts on apktool.
I'm just raising this issue as it's really strange and confused by how aapt can classify .wav file as a drawable.
IMO, I'm not sure if this is a bug vs regression; as this may affect many future apks with large /res folders.
So it might be worth looking at now before growing.
@B88B I can confirm this issue, it affects me too!
@iBotPeaches I spent hours looking into this issue and I found the cause:
It is this Androlib.java (line 698)
In commit a8bdad628a58e65313521b809d8df60f3f86d40e, you started using _zipPackage()_ to build the apk instead of _aaptPackage()_. And zipPackage() is somehow tampering with the resources in final APK
(perhaps it explains the smaller APK size?).
I did some tests by building Apktool 2.3.2 (from source code) by changing back to aaptPackage() instead of zipPackage(), and was able to fix the crash issue.
Proof-of-concept test (Try the following using 2.3.1 and 2.3.2+):
apktool d file.apkapktool b file.apkResults:
I am looking into this matter, and will update you with my progress :)
100% confirmed, the crash is caused by this commit a8bdad628a58e65313521b809d8df60f3f86d40e.
I have built 2.4.1 (snapshot) with reverting the above commit, and the app APK no longer crashes!
You can do the tests yourself. (@B88B can you confirm the fix?)
apktool-cli-all-issue2036.zip
@iBotPeaches Any thoughts on why zipPackage() is causing this issue?
@YoBasha I can confirm, it is fixed and everything working fine.
THANK YOU VERY MUCH, you're the man! I hope you can help provide a permanent solution for future apktool versions.
@YoBasha Reverting that commit returns aapt1 to the process during the build of applications, which if you are using an aapt2 build is not feasible. We cannot revert that, so need to identify why Apktool is not moving files to correct location.
After spending countless hours testing, I think there is no problem in Apktool.
Important notes:
My Theory:
So @B88B , I guess there is no bug in Apktool 2.4.0. Next time just use 2.4.0 for the whole process (decode and build).
@iBotPeaches I think you can close this issue now, as it is just a inproper use of Apktool.
@iBotPeaches I think you can close this issue now, as it is just a inproper use of Apktool.
Sorry for delay. Thanks for triage. Closing.
Most helpful comment
UPDATE 1
100% confirmed, the crash is caused by this commit a8bdad628a58e65313521b809d8df60f3f86d40e.
I have built 2.4.1 (snapshot) with reverting the above commit, and the app APK no longer crashes!
You can do the tests yourself. (@B88B can you confirm the fix?)
apktool-cli-all-issue2036.zip
@iBotPeaches Any thoughts on why zipPackage() is causing this issue?