예제 #1
0
 public void ShowLoadingWindow(Context context, ICompletable completable)
 {
     App.Current.Dispatcher.Invoke(() =>
     {
         BoxHelper.ShowLoadingDialog(completable);
     });
 }
예제 #2
0
        public override bool Check(DeviceBasicInfo targetDevice)
        {
            Logger.Debug(this, "android version checking");
            Version result = new Version(1, 0);

            Task.Run(() =>
            {
                Thread.Sleep(1000);
                result = new DeviceBuildPropGetter(targetDevice.Serial).GetAndroidVersion();
                BoxHelper.CloseLoadingDialog();
            });
            BoxHelper.ShowLoadingDialog();
            Logger.Debug(this, $"Min{version} Device{result}");
            if (result == null)
            {
                var fmt = App.Current.Resources["msgAndroidVersionCheckFailedFormat"].ToString();
                return(BoxHelper.ShowChoiceDialog(
                           "Warning", String.Format(fmt, version.ToString(3)),
                           "btnCancel", "btnContinue").ToBool());
            }
            if (result < version)
            {
                string tooLowFmt = App.Current.Resources["msgAndroidVersionTooLowFmt"].ToString();
                string msg       = String.Format(tooLowFmt, version.ToString(3));
                BoxHelper.ShowMessageDialog("Warning", msg);
                return(false);
            }
            return(true);
        }
예제 #3
0
        public void ActivateShizukuManager(DeviceBasicInfo targetDevice)
        {
            bool fixAndroidO = false;

            if (new DeviceBuildPropGetter(targetDevice.Serial).GetAndroidVersion() >= new Version("8.0.0"))
            {
                var result = BoxHelper.ShowChoiceDialog("msgNotice", "msgFixAndroidO", "btnDoNotOpen", "btnOpen");
                switch (result)
                {
                case ChoiceResult.BtnCancel:
                    return;

                case ChoiceResult.BtnLeft:
                    fixAndroidO = false;
                    break;

                case ChoiceResult.BtnRight:
                    fixAndroidO = true;
                    break;
                }
            }
            var args = new ShScriptExecuterArgs()
            {
                DevBasicInfo = targetDevice, FixAndroidOAdb = fixAndroidO
            };
            /*开始操作*/
            ShizukuManagerActivator activator = new ShizukuManagerActivator();

            activator.Init(args);
            activator.RunAsync();
            BoxHelper.ShowLoadingDialog(activator);
        }
예제 #4
0
        public void DeleteScreenLock(DeviceBasicInfo targetDevice)
        {
            var screenLockDeleter = new ScreenLockDeleter();

            screenLockDeleter.Init(new FlowArgs()
            {
                DevBasicInfo = targetDevice,
            });
            screenLockDeleter.RunAsync();
            BoxHelper.ShowLoadingDialog(screenLockDeleter);
        }
예제 #5
0
        public void ActivateUsersir(DeviceBasicInfo targetDevice)
        {
            var activator = new UsersirActivator();

            activator.Init(new FlowArgs()
            {
                DevBasicInfo = targetDevice
            });
            activator.RunAsync();
            BoxHelper.ShowLoadingDialog(activator);
        }
예제 #6
0
        public void ActivateGreenifyAggressiveDoze(DeviceBasicInfo targetDevice)
        {
            var activator = new GreenifyAggressiveDozeActivator();

            activator.Init(new FlowArgs()
            {
                DevBasicInfo = targetDevice
            });
            activator.RunAsync();
            BoxHelper.ShowLoadingDialog(activator);
        }
예제 #7
0
        public void ActivateFreezeYou(DeviceBasicInfo targetDevice)
        {
            FreezeYouActivator activator = new FreezeYouActivator();

            activator.Init(new FlowArgs()
            {
                DevBasicInfo = targetDevice
            });
            activator.RunAsync();
            BoxHelper.ShowLoadingDialog(activator);
        }
예제 #8
0
        public void UnlockSystemParation(DeviceBasicInfo targetDevice)
        {
            var unlocker = new SystemPartitionUnlocker();

            unlocker.Init(new FlowArgs()
            {
                DevBasicInfo = targetDevice
            });
            unlocker.RunAsync();
            BoxHelper.ShowLoadingDialog(unlocker);
        }
예제 #9
0
        public void ActivateBlackHole(DeviceBasicInfo targetDevice)
        {
            BlackHoleActivator activator = new BlackHoleActivator();

            activator.Init(new FlowArgs()
            {
                DevBasicInfo = targetDevice
            });
            activator.RunAsync();
            BoxHelper.ShowLoadingDialog(activator);
        }
예제 #10
0
        public void ActivateAirForzen(DeviceBasicInfo targetDevice)
        {
            AirForzenActivator airForzenActivator = new AirForzenActivator();

            airForzenActivator.Init(new FlowArgs()
            {
                DevBasicInfo = targetDevice
            });
            airForzenActivator.RunAsync();
            BoxHelper.ShowLoadingDialog(airForzenActivator);
        }
예제 #11
0
        public void ActivateIceBox(DeviceBasicInfo targetDevice)
        {
            IceBoxActivator iceBoxActivator = new IceBoxActivator();

            iceBoxActivator.Init(new FlowArgs()
            {
                DevBasicInfo = targetDevice
            });
            iceBoxActivator.RunAsync();
            BoxHelper.ShowLoadingDialog(iceBoxActivator);
        }
예제 #12
0
        public void ActivateAnzenbokusuFake(DeviceBasicInfo targetDevice)
        {
            AnzenbokusuFakeActivator activator = new AnzenbokusuFakeActivator();

            activator.Init(new FlowArgs()
            {
                DevBasicInfo = targetDevice
            });
            activator.RunAsync();
            BoxHelper.ShowLoadingDialog(activator);
        }
예제 #13
0
        public void ActivateStopapp(DeviceBasicInfo targetDevice)
        {
            StopAppActivator activator = new StopAppActivator();

            activator.Init(new FlowArgs()
            {
                DevBasicInfo = targetDevice
            });
            activator.RunAsync();
            BoxHelper.ShowLoadingDialog(activator);
        }
예제 #14
0
        public void ScreenShot(DeviceBasicInfo targetDevice)
        {
            FolderBrowserDialog fbd = new FolderBrowserDialog();

            if (fbd.ShowDialog() == DialogResult.OK)
            {
                var shoter = new ScreenShoter();
                shoter.Init(new ScreenShoterArgs()
                {
                    DevBasicInfo = targetDevice,
                    SavePath     = fbd.SelectedPath
                });
                shoter.RunAsync();
                BoxHelper.ShowLoadingDialog(shoter);
            }
        }
예제 #15
0
        public override bool Check(DeviceBasicInfo tragetDevice)
        {
            Logger.Info(this, "install checking");
            bool isInstall = false;

            Task.Run(() =>
            {
                Thread.Sleep(500);
                isInstall = PackageManager.IsInstall(tragetDevice, PkgName) == true;
                BoxHelper.CloseLoadingDialog();
            });
            BoxHelper.ShowLoadingDialog();
            if (!isInstall)
            {
                BoxHelper.ShowMessageDialog("Warning", ErrorMsgKey);
            }
            return(isInstall);
        }
예제 #16
0
        private void ButtonRelockMi_Click(object sender, RoutedEventArgs e)
        {
            if (!BoxHelper.ShowChoiceDialog("Warning", "msgRelockWarning").ToBool())
            {
                return;
            }
            if (!BoxHelper.ShowChoiceDialog("Warning", "msgRelockWarningAgain").ToBool())
            {
                return;
            }
            var oemRelocker = new OemRelocker();

            oemRelocker.Init(new Basic.FlowFramework.FlowArgs()
            {
                DevBasicInfo = _currentDeviceInfo
            });
            oemRelocker.RunAsync();
            BoxHelper.ShowLoadingDialog(oemRelocker);
        }
예제 #17
0
 public void FlashBoot(DeviceBasicInfo targetDevice)
 {
     Microsoft.Win32.OpenFileDialog fileDialog = new Microsoft.Win32.OpenFileDialog();
     fileDialog.Reset();
     fileDialog.Title       = App.Current.Resources["SelecteAFile"].ToString();
     fileDialog.Filter      = "镜像文件(*.img)|*.img";
     fileDialog.Multiselect = false;
     if (fileDialog.ShowDialog() == true)
     {
         var flasherArgs = new DeviceImageFlasherArgs()
         {
             DevBasicInfo = targetDevice,
             ImageType    = DeviceImage.Boot,
             SourceFile   = fileDialog.FileName,
         };
         DeviceImageFlasher flasher = new DeviceImageFlasher();
         flasher.Init(flasherArgs);
         flasher.RunAsync();
         BoxHelper.ShowLoadingDialog(flasher);
     }
 }
예제 #18
0
        private void ButtonVirtualBtnHide_Click(object sender, RoutedEventArgs e)
        {
            var choiceResult = BoxHelper.ShowChoiceDialog("PleaseSelected",
                                                          "msgVirtualButtonHider",
                                                          "btnHide",
                                                          "btnUnhide");

            if (choiceResult == ChoiceResult.BtnCancel)
            {
                return;
            }
            var args = new VirtualButtonHiderArgs()
            {
                DevBasicInfo = _currentDevInfo,
                IsHide       = (choiceResult == ChoiceResult.BtnRight),
            };
            VirtualButtonHider hider = new VirtualButtonHider();

            hider.Init(args);
            hider.RunAsync();
            BoxHelper.ShowLoadingDialog(hider);
        }
예제 #19
0
        public void ExtractBoot(DeviceBasicInfo targetDevice)
        {
            FolderBrowserDialog fbd = new FolderBrowserDialog
            {
                Description = "请选择保存路径"
            };

            if (fbd.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            var args = new DeviceImageExtractorArgs()
            {
                DevBasicInfo = targetDevice,
                SavePath     = fbd.SelectedPath,
                ImageType    = DeviceImage.Boot,
            };
            var extrator = new DeviceImageExtractor();

            extrator.Init(args);
            extrator.RunAsync();
            BoxHelper.ShowLoadingDialog(extrator);
        }
예제 #20
0
        private void ButtonFlashCustomRecovery_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog fileDialog = new OpenFileDialog();

            fileDialog.Reset();
            fileDialog.Title       = "选择一个文件";
            fileDialog.Filter      = "镜像文件(*.img)|*.img|全部文件(*.*)|*.*";
            fileDialog.Multiselect = false;
            if (fileDialog.ShowDialog() == true)
            {
                var flasher = new RecoveryFlasher();
                flasher.Init(new RecoveryFlasherArgs()
                {
                    DevBasicInfo     = _currentDeviceInfo,
                    RecoveryFilePath = fileDialog.FileName,
                });
                flasher.RunAsync();
                BoxHelper.ShowLoadingDialog(flasher);
            }
            else
            {
                return;
            }
        }