rovo89 / XposedBridge

The Java part of the Xposed framework.
3.91k stars 1.1k forks source link

param.thisObject and param.args null and/or switched #97

Closed Frazew closed 8 years ago

Frazew commented 8 years ago

This has given me headaches while trying to build my module. The issue is that on some methods (I haven't found any pattern), the param.thisObjects is actually a Object[] containing the arguments of the method and param.args is null. That means there is no way to access the this of the method. If this is of any help, I'm hooking methods in android.hardware.SystemSensorManager. The ones that gave me issues were the constructor of this class, and android.hardware.SystemSensorManager.SensorEventQueue.dispatchSensorEvent, however for example, android.hardware.SystemSensorManager.getFullSensorList can be called without any issue.

If that matters, I'm running Xposed 80 with the latest XposedBridge-v84 on Android Studio with a device on Marshmallow and building for and with sdk23.

rovo89 commented 8 years ago

Could you upload the APK, and if possible also the source code? My assumption is that you compile the Xposed API classes into the APK instead if just referencing them. There should be a warning in the Xposed log starting with v84 if this is the case.

Frazew commented 8 years ago

That was indeed the issue, after replacing the library with the referenced one, it works just fine. Thank you for your help.

rovo89 commented 8 years ago

OK, thanks for the confirmation. I have just sent emails to all developers of modules which have the same issue. In one of the next Xposed versions, I plan to turn the warning into an error and refuse to load such modules. It's bad for modules which work fine despite being compiled incorrectly, but it's even worse to experience random misbehaviors.