Originally Posted by rovo89
Have you made sure that the enque() method is actually called? You can easily test this with the Xposed Installer, just download any module. It also uses this method. Make sure you place the hook in initZygote(), otherwise it won't be active in the installer process.
, yes I did put this call in initZygote. I took the clue from XposedBridge code which hooks up android.app package methods in there. Also, I found this issue when I installed my app on Xperia Z Kitkat ROM and found it not working when the various ways to invoke enqueue did not call the hooks. I typically use Chrome/AOSP browsers to download an image to SD card to test this. In Jellybean (on my earlier Xperia J), the hooks get invoked as expected. Its just that in Kitkat, even though the "hookMethod" returns a Unhook reference, the hooks are never called.
Interestingly, this is only affecting the DownloadManager class method hooks. I have also hooked methods in downloadprovider class and it gets called alright. This is really a very confusing situation
Is it possible for you to give this a try please? The code snippet I pasted should be good enough, otherwise I can rig up a sample. Thanks!