In my module, I need to replace the method (onReceive) of an inner class (Receiver). Inside that method, I'm using XposedHelpers.getSurroundingThis to reference the instance object of the outer class (SeekBarVolumizer). In short, the method getSurroundingThis always returns the instance object of the class SeekBarVolumizer. The situation is similar to figure 1.
It all works fine except for some Xperia devices on Android 5.1 that the class SeekBarVolumizer is also used in another class SomcExpandedVolumeSliders as in figure 2. This time, I found that the method getSurroundingThis returns the instance object of the class VolumeSliderInfo instead. In this case, the replaced method will never be able to reference the correct object and its variable and method.
Is this an Xposed issue or just that I program incorrectly?
Figure 1:
Figure 2:
It all works fine except for some Xperia devices on Android 5.1 that the class SeekBarVolumizer is also used in another class SomcExpandedVolumeSliders as in figure 2. This time, I found that the method getSurroundingThis returns the instance object of the class VolumeSliderInfo instead. In this case, the replaced method will never be able to reference the correct object and its variable and method.
Is this an Xposed issue or just that I program incorrectly?
Figure 1:
Quote:
public class SeekBarVolumizer { ... private final class Receiver { public void onReceive(Context context, Intent intent) { /* codes here to be replaced */ } } } |
Figure 2:
Quote:
public class SomcExpandedVolumeSliders { ... private static class VolumeSliderInfo { private SeekBarVolumizer mSeekBarVolumizer; ... } } |
Aucun commentaire:
Enregistrer un commentaire