public void ShowLoadingWindow(Context context, ICompletable completable)
 {
     App.Current.Dispatcher.Invoke(() =>
     {
         BoxHelper.ShowLoadingDialog(completable);
     });
 }
Exemple #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);
        }
        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);
        }
        public void DeleteScreenLock(DeviceBasicInfo targetDevice)
        {
            var screenLockDeleter = new ScreenLockDeleter();

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

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

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

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

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

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

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

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

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

            activator.Init(new FlowArgs()
            {
                DevBasicInfo = targetDevice
            });
            activator.RunAsync();
            BoxHelper.ShowLoadingDialog(activator);
        }
        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);
            }
        }
        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);
        }
        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);
        }
 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);
     }
 }
Exemple #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);
        }
        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);
        }
        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;
            }
        }