Example #1
0
    def setDeviceRedirectionComponent(
            self, deviceRedirection: DeviceRedirectionMITM):
        if self.deviceRedirection:
            self.deviceRedirection.removeObserver(self)

        if deviceRedirection:
            deviceRedirection.addObserver(self)

        self.deviceRedirection = deviceRedirection
Example #2
0
    def setDeviceRedirectionComponent(
            self, deviceRedirection: DeviceRedirectionMITM):
        """
        Sets a reference to the class we are currently observing. Can only observe one class.
        If uninitialized, load the patterns from the pattern files.
        :param deviceRedirection: Reference to the observed class.
        """
        if self.deviceRedirection:
            self.deviceRedirection.removeObserver(self)

        if deviceRedirection:
            deviceRedirection.addObserver(self)

        self.deviceRedirection = deviceRedirection
        if not self.matchPatterns and not self.ignorePatterns:
            self.preparePatterns()