Exemple #1
0
    def getIOSPlatforms(self, tempdir):
        platforms = []
        if self.args.device:
            device_str = self.args.device
            assert device_str[0] == '{', "device must be a json string"
            device = json.loads(device_str)
            idb = IDB(device["hash"], tempdir)
            platform = IOSPlatform(tempdir, idb, self.args)
            platform.setPlatform(device["kind"])
            platforms.append(platform)
            return platforms

        if self.devices is None:
            self.devices = self.getDevices()
        if self.args.excluded_devices:
            excluded_devices = \
                set(self.args.excluded_devices.strip().split(','))
            self.devices = self.devices.difference(excluded_devices)

        if self.args.devices:
            supported_devices = set(self.args.devices.strip().split(','))
            if supported_devices.issubset(self.devices):
                self.devices = supported_devices

        for device in self.devices:
            model = self.devices[device]
            idb = IDB(device, tempdir)
            platform = IOSPlatform(tempdir, idb, self.args)
            platform.setPlatform(model)
            platforms.append(platform)

        return platforms
Exemple #2
0
    def getIOSPlatforms(self, tempdir, usb_controller):
        platforms = []
        if self.args.device:
            device_str = self.args.device
            assert device_str[0] == "{", "device must be a json string"
            device = json.loads(device_str)
            hash = device["hash"]
            idb = IDB(hash, tempdir)
            platform_meta = {
                "os_version": self.devices[hash]["os_version"],
                "model": self.devices[hash]["model"],
                "abi": self.devices[hash]["abi"],
            }
            platform = IOSPlatform(
                tempdir, idb, self.args, platform_meta, usb_controller
            )
            platform.setPlatform(self.devices[hash]["model"])
            platforms.append(platform)
            return platforms

        if self.args.excluded_devices:
            self.devices = {
                d: self.devices[d]
                for d in self.devices
                if d not in self.args.excluded_devices
            }

        if self.args.devices:
            self.devices = {
                d: self.devices[d] for d in self.devices if d in self.args.devices
            }

        for device in self.devices:
            idb = IDB(device, tempdir)
            platform_meta = {
                "os_version": self.devices[device]["os_version"],
                "model": self.devices[device]["model"],
                "abi": self.devices[device]["abi"],
            }
            platform = IOSPlatform(tempdir, idb, self.args, platform_meta)
            platform.setPlatform(self.devices[device]["model"])
            platforms.append(platform)

        return platforms
Exemple #3
0
    def getIOSPlatforms(self, tempdir):
        platforms = []
        if self.args.device:
            device_str = self.args.device
            assert device_str[0] == '{', "device must be a json string"
            device = json.loads(device_str)
            hash = device["hash"]
            idb = IDB(hash, tempdir)
            platform_meta = {
                "os_version": self.devices[hash]["os_version"],
                "model": self.devices[hash]["model"],
                "abi": self.devices[hash]["abi"]
            }
            platform = IOSPlatform(tempdir, idb, self.args, platform_meta)
            platform.setPlatform(self.devices[hash]["model"])
            platforms.append(platform)
            return platforms

        if self.args.excluded_devices:
            excluded_devices = \
                set(self.args.excluded_devices.strip().split(','))
            self.devices = self.devices.difference(excluded_devices)

        if self.args.devices:
            supported_devices = set(self.args.devices.strip().split(','))
            if supported_devices.issubset(self.devices):
                self.devices = supported_devices

        for device in self.devices:
            idb = IDB(device, tempdir)
            platform_meta = {
                "os_version": self.devices[device]["os_version"],
                "model": self.devices[device]["model"],
                "abi": self.devices[device]["abi"]
            }
            platform = IOSPlatform(tempdir, idb, self.args, platform_meta)
            platform.setPlatform(self.devices[device]["model"])
            platforms.append(platform)

        return platforms