public override void Execute(Mirror mirror, IAsyncProgress asyn)
        {
            var device = mirror.Source as Device;

            DeviceManager = device.DeviceManager as IOSDeviceManager;

            //数据缓存路径
            var tempSavePath = FileHelper.ConnectPath(mirror.Target, "temp");

            FileHelper.CreateExitsDirectorySafe(tempSavePath);

            //数据备份
            var resPath = DeviceManager.CopyUserData(device, tempSavePath, asyn);

            if (!FileHelper.IsValidDictory(resPath))
            {//数据拷贝失败!
            }

            //打包
            mirror.Local = FileHelper.ConnectPath(mirror.Target, mirror.TargetFile);
            ZipFile.CreateFromDirectory(resPath, mirror.Local);

            if (!FileHelper.IsValid(mirror.Local))
            {//打包失败!
            }

            //删除缓存文件
            FileHelper.DeleteDirectorySafe(tempSavePath);
        }
Exemplo n.º 2
0
        private Boolean Init(DataPumpControllableExecutionContext context)
        {
            Device device = context.PumpDescriptor.Source as Device;

            if (device == null)
            {
                return(false);
            }
            IOSDeviceManager dm = device.DeviceManager as IOSDeviceManager;

            if (dm == null)
            {
                return(false);
            }
            String savePath = dm.CopyUserData(device, context.TargetDirectory, context.Reporter);

            if (FileHelper.IsValidDictory(savePath))
            {
                RenameUnofficialApp(savePath);
            }
            SetContextData(context, "savePath", savePath);
            return(true);
        }
Exemplo n.º 3
0
        protected override Boolean InitAtFirstTime()
        {
            Pump   metadata = Metadata;
            Device device   = metadata.Source as Device;

            if (device == null)
            {
                return(false);
            }
            IOSDeviceManager dm = device.DeviceManager as IOSDeviceManager;

            if (dm == null)
            {
                return(false);
            }
            String savePath = dm.CopyUserData(device, metadata.SourceStorePath, null);

            _savePath = savePath;
            if (FileHelper.IsValidDictory(savePath))
            {
                RenameUnofficialApp(savePath);
            }
            return(true);
        }
 public override void Stop(IAsyncProgress asyn)
 {
     DeviceManager?.StopCopyUserData();
     DeviceManager = null;
 }