Esempio n. 1
0
        public static Dictionary <string, object> get()
        {
label_1:
            while (true)
            {
                try
                {
                    FakeInfoCore.buildversion  = (string)null;
                    FakeInfoCore.regioncode    = "en_US";
                    FakeInfoCore.langcode      = "en";
                    FakeInfoCore.countryISO    = (string)null;
                    FakeInfoCore.countryCode   = (string)null;
                    FakeInfoCore.timezone      = (string)null;
                    FakeInfoCore.location      = PointF.Empty;
                    FakeInfoCore.carrier       = (string)null;
                    FakeInfoCore.locale        = (string)null;
                    FakeInfoCore.model         = (string)null;
                    FakeInfoCore.modemVersion  = (string)null;
                    FakeInfoCore.systemVersion = (string)null;
                    FakeInfoCore.name          = (string)null;
                    if (FakeInfoCore._timezones == null)
                    {
                        FakeInfoCore._modemlee        = Split.tachchuoi(ResourceList.Modembylee, "\r\n");
                        FakeInfoCore._IMEbylee        = System.IO.File.ReadAllLines(GlobalConfig.executableDirectory() + "\\IMEbylee.list");
                        FakeInfoCore._modelbylee      = Split.tachchuoi(ResourceList.modelbylee, "\r\n");
                        FakeInfoCore._timezones       = Split.tachchuoi(ResourceList.Timezones, "\r\n");
                        FakeInfoCore._carriers        = Split.tachchuoi(ResourceList.Operators, "\r\n");
                        FakeInfoCore._regions         = Split.tachchuoi(ResourceList.Regions, "\r\n");
                        FakeInfoCore._langs           = FakeInfoCore._regions;
                        FakeInfoCore._ua              = Split.tachchuoi(ResourceList.UA, "\r\n");
                        FakeInfoCore._names           = System.IO.File.ReadAllLines(GlobalConfig.executableDirectory() + "\\Names.list");
                        FakeInfoCore._codes           = Split.tachchuoi(ResourceList.Countries, "\r\n");
                        FakeInfoCore._ccodes          = Split.tachchuoi(ResourceList.Codes, "\r\n");
                        FakeInfoCore._LocaleLanguages = Split.tachchuoi(ResourceList.LocaleLanguages, "\r\n");
                    }
                    string[] strArray1 = Split.tachchuoi(ResourceList.IOSLanguageCode, "\r\n");
                    Dictionary <string, object> dictionary1 = new Dictionary <string, object>();
                    if (LocalConfig.getCurrentConfig().getBooleanForKey("FakeLocationFromIP"))
                    {
                        string requestUriString = "http://pro.ip-api.com/json/" + GlobalConfig.currentPublicIP + "?key=kISXZimHUJwHgV7";
                        string input            = (string)null;
                        using (HttpWebResponse response = (HttpWebResponse)WebRequest.Create(requestUriString).GetResponse())
                        {
                            using (Stream responseStream = response.GetResponseStream())
                            {
                                using (StreamReader streamReader = new StreamReader(responseStream))
                                    input = streamReader.ReadToEnd();
                            }
                        }
                        if (input != null)
                        {
                            Dictionary <string, object> dictionary2 = FakeInfoCore.jss.Deserialize <Dictionary <string, object> >(input);
                            FakeInfoCore.country = dictionary2["country"].ToString();
                            string str1 = dictionary2["countryCode"].ToString();
                            dictionary2["region"].ToString();
                            string str2 = dictionary2["timezone"].ToString();
                            double num1 = Convert.ToDouble(dictionary2["lat"].ToString());
                            double num2 = Convert.ToDouble(dictionary2["lon"].ToString());
                            double num3 = (double)FakeInfoCore.GetRandomNumber(-10000, 10000) / 100000.0;
                            double num4 = (double)FakeInfoCore.GetRandomNumber(-10000, 10000) / 100000.0;
                            FakeInfoCore.location = new PointF((float)(num1 + num3), (float)(num2 + num4));
                            FakeInfoCore.timezone = !((IEnumerable <string>)FakeInfoCore._timezones).Contains <string>(str2) ? GlobalConfig.randItem(FakeInfoCore._timezones) : str2;
                            for (int index = 0; index < ((IEnumerable <string>)strArray1).Count <string>(); ++index)
                            {
                                if (strArray1[index].IndexOf(FakeInfoCore.country) >= 0)
                                {
                                    FakeInfoCore.langcode = Split.tachchuoi(strArray1[index], "|")[0];
                                    break;
                                }
                            }
                            List <region> source1 = new List <region>();
                            foreach (string region in FakeInfoCore._regions)
                            {
                                string str3 = Split.tachchuoi(region, "_")[1];
                                if (str1.ToLower() == str3.ToLower())
                                {
                                    source1.Add(new region()
                                    {
                                        code = region
                                    });
                                }
                                try
                                {
                                    string str4 = Split.tachchuoi(region, "_")[2];
                                    if (str1.ToLower() == str4.ToLower())
                                    {
                                        source1.Add(new region()
                                        {
                                            code = region
                                        });
                                    }
                                }
                                catch
                                {
                                }
                            }
                            try
                            {
                                string langcode = FakeInfoCore.langcode;
                                if (langcode.IndexOf("_") >= 0)
                                {
                                    langcode = Split.tachchuoi(langcode, "_")[0];
                                }
                                for (int index = 0; index < source1.Count <region>(); ++index)
                                {
                                    if (source1[index].code.IndexOf(langcode) >= 0)
                                    {
                                        FakeInfoCore.regioncode = source1[index].code;
                                        break;
                                    }
                                }
                            }
                            catch
                            {
                            }
                            FakeInfoCore.countryISO = str1.ToLower();
                            string upper = dictionary2["country"].ToString().ToUpper();
                            foreach (string code in FakeInfoCore._codes)
                            {
                                if (code.Contains(upper))
                                {
                                    FakeInfoCore.countryCode = GlobalConfig.stringSplit(code)[1];
                                    break;
                                }
                            }
                            if (FakeInfoCore.countryCode == null || FakeInfoCore.countryCode == "")
                            {
                                int num5 = (int)MessageBox.Show("set countryCode", upper);
                            }
                            List <Carrier> source2 = new List <Carrier>();
                            foreach (string carrier in FakeInfoCore._carriers)
                            {
                                if (carrier.ToUpper().Contains(upper))
                                {
                                    string str3 = GlobalConfig.stringSplit(carrier)[1];
                                    string str4 = GlobalConfig.stringSplit(carrier)[2];
                                    string str5 = GlobalConfig.stringSplit(carrier)[3];
                                    string str6 = GlobalConfig.stringSplit(carrier)[4];
                                    if (str3 != null && str3 != "")
                                    {
                                        source2.Add(new Carrier()
                                        {
                                            namecarrier = str3,
                                            mcc         = str4,
                                            mnc         = str5,
                                            iso         = str6
                                        });
                                    }
                                }
                            }
                            if (source2.Count == 0)
                            {
                                int index = new Random().Next(0, ((IEnumerable <string>)FakeInfoCore._carriers).Count <string>());
                                FakeInfoCore.carrier = GlobalConfig.stringSplit(FakeInfoCore._carriers[index])[1];
                                FakeInfoCore.mcc     = GlobalConfig.stringSplit(FakeInfoCore._carriers[index])[2];
                                FakeInfoCore.mnc     = GlobalConfig.stringSplit(FakeInfoCore._carriers[index])[3];
                                FakeInfoCore.iso     = GlobalConfig.stringSplit(FakeInfoCore._carriers[index])[4];
                            }
                            else
                            {
                                int index = new Random().Next(0, source2.Count <Carrier>());
                                FakeInfoCore.carrier = source2[index].namecarrier;
                                FakeInfoCore.mcc     = source2[index].mcc;
                                FakeInfoCore.mnc     = source2[index].mnc;
                                FakeInfoCore.iso     = source2[index].iso;
                            }
                        }
                        else
                        {
                            int num = (int)MessageBox.Show("Lol");
                        }
                    }
                    else
                    {
                        int int32ForKey1 = LocalConfig.getCurrentConfig().getInt32ForKey("fakeRegion");
                        FakeInfoCore.regioncode = FakeInfoCore._e("fakeRegionEnable") ? FakeInfoCore._regions[int32ForKey1] : (string)null;
                        int int32ForKey2 = LocalConfig.getCurrentConfig().getInt32ForKey("fakeLang");
                        FakeInfoCore.langcode = FakeInfoCore._e("fakelangEnable") ? FakeInfoCore._langs[int32ForKey2] : (string)null;
                        int int32ForKey3 = LocalConfig.getCurrentConfig().getInt32ForKey("fakeTz");
                        FakeInfoCore.timezone = FakeInfoCore._e("fakeTzEnable") ? FakeInfoCore._timezones[int32ForKey3] : (string)null;
                        int int32ForKey4 = LocalConfig.getCurrentConfig().getInt32ForKey("fakeCa");
                        FakeInfoCore.carrier  = FakeInfoCore._e("fakeCaEnable") ? FakeInfoCore._carriers[int32ForKey4] : (string)null;
                        FakeInfoCore.location = FakeInfoCore._e("fakeLocationEnable") ? new PointF((float)Convert.ToDouble(LocalConfig.getCurrentConfig().getStringForKey("fakeLocationLat")), (float)Convert.ToDouble(LocalConfig.getCurrentConfig().getStringForKey("fakeLocationLong"))) : PointF.Empty;
                        string[] strArray2 = GlobalConfig.stringSplit(FakeInfoCore.carrier);
                        if (strArray2.Length >= 2)
                        {
                            FakeInfoCore.carrier = strArray2[1];
                            foreach (string ccode in FakeInfoCore._ccodes)
                            {
                                if (ccode.StartsWith(strArray2[0].ToUpper()))
                                {
                                    FakeInfoCore.countryISO = GlobalConfig.stringSplit(ccode, ";")[1].ToLower();
                                    break;
                                }
                            }
                            foreach (string code in FakeInfoCore._codes)
                            {
                                if (code.StartsWith(strArray2[0].ToUpper()))
                                {
                                    FakeInfoCore.countryCode = GlobalConfig.stringSplit(code, " | ")[1].ToLower();
                                    break;
                                }
                            }
                        }
                    }
                    while (true)
                    {
                        if (LocalConfig.getCurrentConfig().getBooleanForKey("FakeDeviceFromFile"))
                        {
                            do
                            {
                                List <string> source = new List <string>();
                                for (int index = 0; index < ((IEnumerable <string>)FakeInfoCore._models_).Count <string>(); ++index)
                                {
                                    if (frmMain.bool_iphone7 && FakeInfoCore._models_[index].IndexOf("iPhone 7") >= 0)
                                    {
                                        source.Add(FakeInfoCore._models_[index]);
                                    }
                                }
                                FakeInfoCore.model = source.Count <string>() <= 0 ? GlobalConfig.randItem(((IEnumerable <string>)FakeInfoCore._models_).ToArray <string>()) : GlobalConfig.randItem(source.ToArray());
                                string        str1       = Split.tachchuoi(FakeInfoCore.model, " | ")[1];
                                List <string> stringList = new List <string>();
                                for (int index = 0; index < ((IEnumerable <string>)FakeInfoCore._modemlee).Count <string>(); ++index)
                                {
                                    string str2 = Split.tachchuoi(FakeInfoCore._modemlee[index], "|")[1];
                                    if (FakeInfoCore._modemlee[index].IndexOf(str1) >= 0 && str2.IndexOf(FakeInfoCore.iosVersion) >= 0)
                                    {
                                        stringList.Add(FakeInfoCore._modemlee[index]);
                                    }
                                }
                                FakeInfoCore.systemVersion = Split.tachchuoi(GlobalConfig.randItem(stringList.ToArray()), "|")[1];
                            }while (frmMain.bool_chkonly10_3_1 && FakeInfoCore.systemVersion != "10.3.1");
                            FakeInfoCore.name = GlobalConfig.randItem(FakeInfoCore._names);
                        }
                        else
                        {
                            FakeInfoCore.systemVersion = GlobalConfig.randItem(FakeInfoCore._versions_);
                            FakeInfoCore.model         = GlobalConfig.randItem(FakeInfoCore._models_);
                            if (FakeInfoCore._e("FRandName"))
                            {
                                FakeInfoCore.name = GlobalConfig.randItem(FakeInfoCore._names);
                                if (FakeInfoCore.model.StartsWith("iPad") || FakeInfoCore.model.StartsWith("iPhone") || !FakeInfoCore.model.StartsWith("iPod"))
                                {
                                    ;
                                }
                            }
                            else
                            {
                                FakeInfoCore.name = LocalConfig.getCurrentConfig().getStringForKey("fakeName");
                                if (FakeInfoCore.name == null)
                                {
                                    FakeInfoCore.name = "";
                                }
                            }
                        }
                        if (FakeInfoCore.timezone != null)
                        {
                            dictionary1["tz"] = (object)FakeInfoCore.timezone;
                        }
                        if (FakeInfoCore.regioncode != null)
                        {
                            dictionary1["locale"] = (object)FakeInfoCore.regioncode;
                        }
                        if (FakeInfoCore.langcode != null)
                        {
                            dictionary1["lang"] = (object)FakeInfoCore.langcode;
                        }
                        if (FakeInfoCore.carrier != null)
                        {
                            dictionary1["carrier"] = (object)FakeInfoCore.carrier;
                            dictionary1["mcc"]     = (object)FakeInfoCore.mcc;
                            dictionary1["mnc"]     = (object)FakeInfoCore.mnc;
                            dictionary1["iso"]     = (object)FakeInfoCore.iso;
                        }
                        if (FakeInfoCore.location != PointF.Empty)
                        {
                            Dictionary <string, object> dictionary2 = dictionary1;
                            string index1 = "location_x";
                            float  num    = FakeInfoCore.location.X;
                            string str1   = num.ToString();
                            dictionary2[index1] = (object)str1;
                            Dictionary <string, object> dictionary3 = dictionary1;
                            string index2 = "location_y";
                            num = FakeInfoCore.location.Y;
                            string str2 = num.ToString();
                            dictionary3[index2] = (object)str2;
                        }
                        if (FakeInfoCore.name != null)
                        {
                            dictionary1["name"] = (object)FakeInfoCore.name;
                        }
                        if (FakeInfoCore.systemVersion != null)
                        {
                            string   ios       = ResourceList.IOS;
                            string[] strArray2 = Split.tachchuoi(ios, "\r\n");
                            for (int index = 0; index < ios.Count <char>(); ++index)
                            {
                                if (strArray2[index].ToString().Contains(FakeInfoCore.systemVersion))
                                {
                                    dictionary1["systemVersion"] = (object)Split.tachchuoi(strArray2[index], "-")[0];
                                    dictionary1["buildversion"]  = (object)Split.tachchuoi(strArray2[index], "-")[1];
                                    break;
                                }
                            }
                        }
                        if (FakeInfoCore.model != null)
                        {
                            if (FakeInfoCore.model.StartsWith("iPhone"))
                            {
                                dictionary1["model"] = (object)"iPhone";
                            }
                            if (FakeInfoCore.model.StartsWith("iPad"))
                            {
                                dictionary1["model"] = (object)"iPad";
                            }
                            if (FakeInfoCore.model.StartsWith("iPod"))
                            {
                                dictionary1["model"] = (object)"iPod";
                            }
                            string[] strArray2 = GlobalConfig.stringSplit(FakeInfoCore.model);
                            if (strArray2.Length == 2)
                            {
                                dictionary1["machine"] = (object)strArray2[1].Trim();
                            }
                        }
                        if (FakeInfoCore.systemVersion != null && FakeInfoCore.model != null)
                        {
                            string str1 = dictionary1["model"].ToString() + ";";
                            if (dictionary1["model"].ToString().StartsWith("iPod"))
                            {
                                str1 = dictionary1["model"].ToString() + " touch;";
                            }
                            string        str2       = FakeInfoCore.systemVersion.Replace(".", "_");
                            List <string> stringList = new List <string>();
                            foreach (string str3 in FakeInfoCore._ua)
                            {
                                if (str3.Contains(str2 + " ") && str3.Contains(str1))
                                {
                                    stringList.Add(str3);
                                }
                            }
                            if (stringList.Count > 0)
                            {
                                dictionary1["ua"] = (object)GlobalConfig.randItem(stringList.ToArray());
                            }
                            else if (stringList.Count == 0)
                            {
                                foreach (string str3 in FakeInfoCore._ua)
                                {
                                    if (str3.Contains(str2 + " "))
                                    {
                                        stringList.Add(str3);
                                    }
                                }
                                if (stringList.Count > 0)
                                {
                                    dictionary1["ua"] = (object)GlobalConfig.randItem(stringList.ToArray());
                                }
                            }
                        }
                        Random random = new Random();
                        dictionary1["serial"] = (object)GlobalConfig.RandomString((string)null, 12);
                        dictionary1["imei"]   = (object)FakeInfoCore.CreateImeibylee();
                        List <modelVersion> source1 = new List <modelVersion>();
                        foreach (string chuoi in FakeInfoCore._modelbylee)
                        {
                            string str = dictionary1["machine"].ToString();
                            if (chuoi.Contains(str))
                            {
                                source1.Add(new modelVersion()
                                {
                                    name = Split.tachchuoi(chuoi, "|")[0]
                                });
                            }
                        }
                        if (source1.Count <modelVersion>() != 0)
                        {
                            int index = random.Next(0, source1.Count <modelVersion>());
                            dictionary1["modelVersion"] = (object)(source1[index].name + "J/A");
                            string str = dictionary1["machine"].ToString() + "|" + dictionary1["systemVersion"] + "|" + dictionary1["buildversion"];
                            foreach (string chuoi in FakeInfoCore._modemlee)
                            {
                                if (chuoi.Contains(str))
                                {
                                    dictionary1["ModemVersion"] = (object)Split.tachchuoi(chuoi, "|")[3];
                                    dictionary1["yearcpr"]      = (object)Split.tachchuoi(chuoi, "|")[4];
                                    break;
                                }
                            }
                            try
                            {
                                if (!(dictionary1["ModemVersion"].ToString() == "") || dictionary1["ModemVersion"].ToString() != null)
                                {
                                    break;
                                }
                            }
                            catch
                            {
                            }
                        }
                        else
                        {
                            goto label_1;
                        }
                    }
                    for (int index = 0; index < ((IEnumerable <string>)FakeInfoCore._LocaleLanguages).Count <string>(); ++index)
                    {
                        if (FakeInfoCore._LocaleLanguages[index].IndexOf(FakeInfoCore.country) >= 0)
                        {
                            dictionary1["locale"] = dictionary1["AppleLocale"] = (object)Split.tachchuoi(FakeInfoCore._LocaleLanguages[index], "|")[1];
                            dictionary1["lang"]   = dictionary1["AppleLanguages"] = (object)Split.tachchuoi(FakeInfoCore._LocaleLanguages[index], "|")[2];
                            break;
                        }
                    }
                    try
                    {
                        if (dictionary1["AppleLocale"].ToString() == "" || dictionary1["AppleLocale"].ToString() == null || dictionary1["AppleLanguages"].ToString() == "" || dictionary1["AppleLanguages"].ToString() == null)
                        {
                            int num = (int)MessageBox.Show("Chua add GEO nay");
                        }
                    }
                    catch
                    {
                        int num = (int)MessageBox.Show("Chua add GEO nay");
                        continue;
                    }
                    dictionary1["BSSID"]   = (object)FakeInfoCore.CreateBSSIDbylee();
                    dictionary1["aliMac"]  = (object)dictionary1["BSSID"].ToString();
                    dictionary1["aliImei"] = (object)FakeInfoCore.TOSHA1(dictionary1["aliMac"].ToString());
                    return(dictionary1);
                }
                catch (Exception ex)
                {
                }
            }
        }
Esempio n. 2
0
        public void execute(out bool end, int countrun, bool setRRS)
        {
            if (this.type == Operation.OperationType.Script2Operation)
            {
                if (File.Exists(LocalConfig.getCurrentConfig().configDirectory() + "/Scripts/" + this.appScriptOperationAppName.Replace(Operation.CurrentAppName, Operation.__g_var_appName)))
                {
                    string str = File.ReadAllText(LocalConfig.getCurrentConfig().configDirectory() + "/Scripts/" + this.appScriptOperationAppName.Replace(Operation.CurrentAppName, Operation.__g_var_appName));
                    if (str != null)
                    {
                        this.scripts = GlobalConfig.splitToLines(str);
                    }
                }
                else
                {
                    Operation.__g_var_appId   = frmMain.Appid;
                    Operation.__g_var_appName = frmMain.AppnameDefault;
                    if (File.Exists(LocalConfig.getCurrentConfig().configDirectory() + "/Scripts/" + this.appScriptOperationAppName.Replace(Operation.CurrentAppName, Operation.__g_var_appName)))
                    {
                        string str = File.ReadAllText(LocalConfig.getCurrentConfig().configDirectory() + "/Scripts/" + this.appScriptOperationAppName.Replace(Operation.CurrentAppName, Operation.__g_var_appName));
                        if (str != null)
                        {
                            this.scripts = GlobalConfig.splitToLines(str);
                        }
                    }
                }
                bool result1 = false;
                end = false;
                frmMain.BoolstartTimer1 = true;
                for (int index = 0; index < this.scripts.Length; ++index)
                {
                    this.CheckConnectDevice();
                    if (AutoLeadClient.send(Operation.jss.Serialize((object)new Dictionary <string, object>()
                    {
                        ["cmd"] = (object)"topmostappsystem"
                    })) && AutoLeadClient.receive().IndexOf(Operation.idapp_open) < 0)
                    {
                        string script1Line = "open_app(" + Operation.idapp_open + ")";
                        try
                        {
                            bool result2;
                            ScriptsCore.executeScript(script1Line, out result2);
                        }
                        catch
                        {
                        }
                    }
                    string script1Line1 = this.scripts[index].Replace(Operation.CurrentAppName, Operation.__g_var_appName).Replace(Operation.CurrentAppId, Operation.__g_var_appId);
                    if (script1Line1 != null && script1Line1 != "")
                    {
                        frmMain.sttScript2 = script1Line1;
                        if (script1Line1 == "capcharAli")
                        {
                            frmMain.FindAli();
                            script1Line1 = "text(\"" + Capchar.Getcapchar() + "\")";
                        }
                        if (script1Line1 == "downChMavrochain")
                        {
                            frmMain.FindMavrochain();
                            script1Line1 = "";
                        }
                        if (script1Line1 == "capcharMavrochain")
                        {
                            script1Line1 = "rd(\"" + Capchar.Getcapchar() + "\")";
                        }
                        this.CheckConnectDevice();
                        ScriptsCore.executeScript(script1Line1, out result1, this);
                    }
                }
                frmMain.BoolstartTimer1 = false;
            }
            else if (this.type == Operation.OperationType.ScriptOperation && this._description.IndexOf("Script RRS") >= 0)
            {
                bool result1 = false;
                end = false;
                frmMain.BoolstartTimer1 = true;
                for (int index = 0; index < this.scripts.Length; ++index)
                {
                    this.CheckConnectDevice();
                    if (AutoLeadClient.send(Operation.jss.Serialize((object)new Dictionary <string, object>()
                    {
                        ["cmd"] = (object)"topmostappsystem"
                    })) && AutoLeadClient.receive().IndexOf(frmMain.idappRRS) < 0)
                    {
                        string script1Line = "open_app(" + frmMain.idappRRS + ")";
                        try
                        {
                            bool result2;
                            ScriptsCore.executeScript(script1Line, out result2);
                        }
                        catch
                        {
                        }
                    }
                    string script1Line1 = this.scripts[index].Replace(Operation.CurrentAppName, Operation.__g_var_appName).Replace(Operation.CurrentAppId, Operation.__g_var_appId);
                    if (script1Line1 != null && script1Line1 != "")
                    {
                        frmMain.sttScript2 = script1Line1;
                        this.CheckConnectDevice();
                        ScriptsCore.executeScript(script1Line1, out result1, this);
                    }
                }
                frmMain.BoolstartTimer1 = false;
            }
            else if (this.type == Operation.OperationType.WaitForAppStoreOperation)
            {
                try
                {
                    end = false;
                    this.checkASFlag = true;
                    this.checkAS     = new Thread(new ThreadStart(this._check_appstore));
                    this.checkAS.Start();
                    while (this.timeout > 0)
                    {
                        if (!frmMain.sttconnect)
                        {
                            end = true;
                            break;
                        }
                        Thread.Sleep(1000);
                        if (this.checkASResult != null)
                        {
                            break;
                        }
                    }
                    this.checkASFlag = false;
                    while (this.checkAS.IsAlive)
                    {
                        if (!frmMain.sttconnect)
                        {
                            end = true;
                            break;
                        }
                        Thread.Sleep(1000);
                    }
                    if (this.checkASResult == null)
                    {
                        end = true;
                    }
                    this.checkAS = (Thread)null;
                }
                catch (Exception ex)
                {
                    if (this.checkAS != null && this.checkAS.IsAlive)
                    {
                        this.checkAS.Abort();
                    }
                    throw ex;
                }
            }
            else if (this.type == Operation.OperationType.OpenDetectedAppOperation)
            {
                end = false;
                if (frmMain.bool_detectapp)
                {
                    Dictionary <string, object> dictionary = new Dictionary <string, object>();
                    dictionary["cmd"] = (object)"topmostappsystem";
                    string url = (string)null;
                    if (AutoLeadClient.send(Operation.jss.Serialize((object)dictionary)))
                    {
                        string input = AutoLeadClient.receive();
                        this.checkASResult = Operation.jss.Deserialize <Dictionary <string, object> >(input);
                        url = this.checkASResult["url"].ToString();
                        if (url.Length > 0)
                        {
                            Operation.__g_var_detectedAppId = AppURLToAppID.AppIDFromURL(url);
                            if (Operation.__g_var_detectedAppId.Length <= 0)
                            {
                                Operation.__g_var_detectedAppId = AppURLToAppID.AppIDFromSiteLee(url);
                            }
                        }
                    }
                    if (Operation.__g_var_detectedAppId.Length > 0)
                    {
                        List <Listapp> list = frmMain.ListappInstall.Where <Listapp>((Func <Listapp, bool>)(c => c.app_id == Operation.__g_var_detectedAppId)).ToList <Listapp>();
                        if (list.Count <Listapp>() > 0)
                        {
                            Operation.nameapp_open = list[0].app_name;
                            if (!frmMain.bool_sml)
                            {
                                if (frmMain.Appid != Operation.__g_var_detectedAppId)
                                {
                                    end = true;
                                }
                                else
                                {
                                    string script1Line = "open_app(" + Operation.__g_var_detectedAppId + ")";
                                    Operation.idapp_open = Operation.__g_var_detectedAppId;
                                    try
                                    {
                                        bool result;
                                        ScriptsCore.executeScript(script1Line, out result);
                                    }
                                    catch
                                    {
                                    }
                                }
                            }
                            else
                            {
                                string script1Line = "open_app(" + Operation.__g_var_detectedAppId + ")";
                                Operation.idapp_open = Operation.__g_var_detectedAppId;
                                try
                                {
                                    bool result;
                                    ScriptsCore.executeScript(script1Line, out result);
                                }
                                catch
                                {
                                }
                            }
                        }
                        else
                        {
                            end = true;
                        }
                    }
                    else
                    {
                        int num1 = (int)MessageBox.Show(url + " \r\n Nhấn OK để copy link app");
                        if (!frmMain.bool_sml)
                        {
                            int num2 = (int)MessageBox.Show("App này không nhận dạng được, bỏ chọn phần 'Nhận dạng app'");
                        }
                        end = true;
                    }
                }
                else
                {
                    Operation.__g_var_detectedAppId = frmMain.Appid;
                    string script1Line = "open_app(" + Operation.__g_var_detectedAppId + ")";
                    Operation.idapp_open   = Operation.__g_var_detectedAppId;
                    Operation.nameapp_open = frmMain.AppnameDefault;
                    try
                    {
                        bool result;
                        ScriptsCore.executeScript(script1Line, out result);
                    }
                    catch
                    {
                    }
                }
            }
            else if (this.type == Operation.OperationType.GetRunningAppOperation)
            {
                Operation.__g_var_appId   = Operation.idapp_open;
                Operation.__g_var_appName = Operation.nameapp_open;
                end = false;
            }
            else if (this.type == Operation.OperationType.FakeInfoOperation)
            {
                Dictionary <string, object> dictionary;
                while (true)
                {
                    end                      = false;
                    dictionary               = new Dictionary <string, object>();
                    dictionary["cmd"]        = (object)"fake_info";
                    dictionary["listapp_id"] = (object)this.fakeAppId;
                    if (this.fakeSet)
                    {
                        if (Operation.dict.Count <= 0)
                        {
                            Operation.dict = FakeInfoCore.get();
                        }
                        if (Operation.dict.Count > 0)
                        {
                            if (!Operation.CheckinfoFake(Operation.dict))
                            {
                                Operation.dict.Clear();
                            }
                            else
                            {
                                break;
                            }
                        }
                        else
                        {
                            goto label_101;
                        }
                    }
                    else
                    {
                        goto label_101;
                    }
                }
                if (frmMain.bool_fakelangnoIP)
                {
                    Operation.dict["lang"] = (object)Split.tachchuoi(frmMain.langnoIP, "|")[0];
                }
                Operation.dict["setfakegeo"]    = !frmMain.bool_fakegeo ? (object)"0" : (object)"1";
                Operation.dict["setfakeUa"]     = !frmMain.bool_fakeUA ? (object)"0" : (object)"1";
                Operation.dict["setfakescreen"] = !frmMain.bool_fakescreen ? (object)"0" : (object)"1";
                dictionary["info"] = (object)Operation.dict;
label_101:
                if (!AutoLeadClient.send(Operation.jss.Serialize((object)dictionary)))
                {
                    return;
                }
                string input = AutoLeadClient.receive();
                if (Convert.ToInt32(Operation.jss.Deserialize <Dictionary <string, object> >(input)["result"]) != 1)
                {
                    throw new Exception("ERROR. [" + this.description() + "] return [False]");
                }
                Thread.Sleep(1000);
            }
            else if (this.type == Operation.OperationType.SetupProxyOperation)
            {
                end = false;
                try
                {
                    string[] strArray = GlobalConfig.stringSplit(this.ipWithLocation, ",");
                    if (strArray.Length >= 3)
                    {
                        string country = strArray[1].Trim();
                        strArray[2].Trim();
                        if (country.Equals("TAIWAN"))
                        {
                            country = "TAIWAN, PROVINCE OF CHINA";
                        }
                        if (country.Equals("BOLIVIA"))
                        {
                            country = "BOLIVIA, PLURINATIONAL STATE OF";
                        }
                        if (country.Equals("IRAN"))
                        {
                            country = "IRAN, ISLAMIC REPUBLIC OF";
                        }
                        if (country.Equals("IRAN"))
                        {
                            country = "IRAN, ISLAMIC REPUBLIC OF";
                        }
                        if (country.Equals("KOREA"))
                        {
                            country = "KOREA, REPUBLIC OF";
                        }
                        if (country.Equals("KOREA"))
                        {
                            country = "KOREA, REPUBLIC OF";
                        }
                        if (country.Equals("MACEDONIA"))
                        {
                            country = "MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF";
                        }
                        if (country.Equals("MOLDOVA"))
                        {
                            country = "MOLDOVA, REPUBLIC OF";
                        }
                        if (country.Equals("PALESTINE"))
                        {
                            country = "PALESTINE, STATE OF";
                        }
                        string str1   = strArray[0].Trim();
                        string str2   = this.ipWithLocation.Replace(str1, "").Replace(", " + country, "").Trim();
                        string region = str2.Length != 0 ? str2.Remove(0, 1).Trim() : (string)null;
                        this.frm.setupProxy(this.tool, str1, country, region, this.previousSshInfo);
                    }
                }
                catch (Exception ex)
                {
                }
                if (GlobalConfig.currentPublicIP == null)
                {
                    throw new Exception("ERROR. Could not execute [" + this.description() + "]");
                }
            }
            else if (this.type == Operation.OperationType.ChangeIPOperation)
            {
                if (!setRRS)
                {
                    Operation.dict.Clear();
                }
                end = false;
                try
                {
                    this.frm.changeIP();
                }
                catch (Exception ex)
                {
                }
                if (GlobalConfig.currentPublicIP == null)
                {
                    throw new Exception("ERROR. Could not execute [" + this.description() + "]");
                }
            }
            else if (this.type == Operation.OperationType.AppScriptOperation)
            {
                end = false;
                new Dictionary <string, object>()["cmd"] = (object)"topmostappsystem";
                if (!this._isAppRunning(this.appScriptOperationAppName))
                {
                    return;
                }
                bool result = false;
                end = false;
                for (int index = 0; index < this.scripts.Length; ++index)
                {
                    this.CheckConnectDevice();
                    string script1Line = this.scripts[index].Replace(Operation.CurrentAppName, Operation.__g_var_appName).Replace(Operation.CurrentAppId, Operation.__g_var_appId);
                    if (this._isAppRunning(this.appScriptOperationAppName))
                    {
                        if (!ScriptsCore.executeScript(script1Line, out result, this))
                        {
                            if (!result)
                            {
                                throw new Exception("ERROR. Could not execute [" + this.description() + "]");
                            }
                            end = true;
                            break;
                        }
                        if (!result)
                        {
                            throw new Exception("ERROR. [" + this.description() + "] return [False]");
                        }
                    }
                    else
                    {
                        break;
                    }
                }
            }
            else if (this.type == Operation.OperationType.ScriptOperation && this._description.IndexOf("Restore") >= 0)
            {
                bool result = false;
                end = false;
                for (int index = 0; index < this.scripts.Length; ++index)
                {
                    string script1Line = this.scripts[index].Replace(Operation.CurrentAppName, Operation.__g_var_appName).Replace(Operation.CurrentAppId, Operation.__g_var_appId).Replace(" ", "");
                    if (script1Line != null && script1Line != "")
                    {
                        ScriptsCore.executeScript(script1Line, out result, this);
                        frmMain.RestoreRRS(Split.tachchuoi(this.scripts[index].Replace("restore(", "").Replace(",<current_appid>)", ""), ",")[0]);
                        Thread.Sleep(3000);
                        result = true;
                        end    = false;
                    }
                }
            }
            else
            {
                bool result = false;
                end = false;
                for (int index1 = 0; index1 < this.scripts.Length; ++index1)
                {
                    string script1Line = this.scripts[index1].Replace(Operation.CurrentAppName, Operation.__g_var_appName).Replace(Operation.CurrentAppId, Operation.__g_var_appId);
                    if (script1Line == "exit()")
                    {
                        script1Line = "";
                        Operation.__g_var_appName = "";
                        Operation.__g_var_appId   = "";
                    }
                    if (script1Line == "downChMavrochain")
                    {
                        frmMain.FindMavrochain();
                        script1Line = "";
                    }
                    if (script1Line == "capcharMavrochain")
                    {
                        script1Line = "rd(\"" + Capchar.Getcapchar() + "\")";
                    }
                    if (script1Line != null && script1Line != "")
                    {
                        if (script1Line.IndexOf("backup") >= 0)
                        {
                            if (script1Line.IndexOf("backuprrs") >= 0)
                            {
                                string str1 = script1Line.Replace("backuprrs", "backup").Replace(" ", "");
                                string str2 = Split.tachchuoi(str1, ",")[0].Replace("backup(", "");
                                frmMain.WipeOlRRSlee(str2);
                                ScriptsCore.executeScript(str1, out result, this);
                                frmMain.BKRRS(str2, true);
                                result = true;
                                end    = false;
                                break;
                            }
                            for (int index2 = 0; index2 < frmMain.ListVitriBk.Count; ++index2)
                            {
                                if (frmMain.ListVitriBk[index2].vitri == countrun)
                                {
                                    string str = script1Line.Replace(" ", "");
                                    ScriptsCore.executeScript(str, out result, this);
                                    frmMain.BKRRS(Split.tachchuoi(str, ",")[0].Replace("backup(", ""), false);
                                    frmMain.UpRRSFtp();
                                    result = true;
                                    end    = false;
                                    break;
                                }
                            }
                            result = true;
                            end    = false;
                        }
                        else if (!ScriptsCore.executeScript(script1Line, out result, this))
                        {
                            if (!result)
                            {
                                throw new Exception("ERROR. Could not execute [" + this.description() + "]");
                            }
                            end = true;
                            break;
                        }
                        if (!result)
                        {
                            throw new Exception("ERROR. [" + this.description() + "] return [False]");
                        }
                    }
                }
            }
        }