Beispiel #1
0
        public void DoActivate()
        {
            this.Invoke((MethodInvoker)(() => button1.Enabled = false));
            //metroCheckBox1.Enabled = false;
            this.Invoke((MethodInvoker)(() => SkipSetupBox.Enabled = false));
            this.Invoke((MethodInvoker)(() => DisableBBBox.Enabled = false));
            this.Invoke((MethodInvoker)(() => NoOTABox.Enabled = false));
            this.Invoke((MethodInvoker)(() => RebootBox.Enabled = false));
            this.Invoke((MethodInvoker)(() => SubstrateBox.Enabled = false));
            this.Invoke((MethodInvoker)(() => RFSCheckBox.Enabled = false));

            if (RFSCheckBox.Checked == false)
            {
                try
                {
                    if (currentiOSDevice.SIMStatus == "kCTSIMSupportSIMStatusReady" ^ currentiOSDevice.SIMStatus == "kCTSIMSupportSIMStatusPINLocked")
                    {
                        BoxShow("Sim Card detected, its recommended to eject it", "Sim Card on the phone", 7000);
                    }
                }
                catch { }
                this.Invoke((MethodInvoker)(() => button1.Text = "Activating"));
                this.Invoke((MethodInvoker)(() => button1.Enabled = false));
                ActivationWorker.RunWorkerAsync();
            }
            else
            {
                this.Invoke((MethodInvoker)(() => button1.Text = "Deactivating"));
                Activation Deactivate = new Activation();
                Deactivate.RootFSRestore();
                this.Invoke((MethodInvoker)(() => progressBar1.Value = 0));
            }
        }
Beispiel #2
0
        public static async Task <HttpResponseMessage> Run([HttpTrigger(AuthorizationLevel.Function, "post", Route = null)] HttpRequestMessage req, ILogger log)
        {
            log.LogInformation("Start - Activate account Request ");
            HttpResponseMessage response = null;
            ActivationWorker    worker   = null;
            var message = "";

            try
            {
                var userID = await req.Content.ReadAsAsync <int>();

                if (userID > 0)
                {
                    log.LogInformation("Processing Activate account Request for User: "******"1")
                    {
                        message = "Account activated successfully for user ID: " + userID;
                        log.LogInformation(message);
                        response = req.CreateResponse(HttpStatusCode.OK, message);
                    }
                    else if (message == "-1")
                    {
                        message = "User does not exist with User ID: " + userID;
                        log.LogInformation(message);
                        response = req.CreateResponse(HttpStatusCode.NotFound, message);
                    }
                    else
                    {
                        message = "Failed to execute the request!!";
                        log.LogInformation(message);
                        response = req.CreateResponse(HttpStatusCode.ExpectationFailed, message);
                    }
                }
                else
                {
                    message = "Failed to parse user";
                    log.LogError(message);
                    response = req.CreateResponse(System.Net.HttpStatusCode.InternalServerError);
                }

                log.LogInformation("End - Activate account Request ");
            }
            catch (Exception ex)
            {
                log.LogError(ex.Message, ex);
                response = req.CreateErrorResponse(HttpStatusCode.InternalServerError, ex);
            }
            return(response);
        }