Пример #1
0
        private void checkAppStore(string bundleId)
        {
            updateProcessLog("Checking appstore...");

            this.cmdResult.activeurlapp = "";
            DateTime now9 = DateTime.Now;

            while (this.cmdResult.activeurlapp == "")
            {
                this.cmd.getactiveurl();
                Thread.Sleep(1000);
                if ((DateTime.Now - now9).TotalSeconds > 20.0)
                {
                    throw new TimeoutException("Get active Url timeouted");
                }
            }

            appInfo currAppInfo = Utils.getBundleIdentityByURL(this.cmdResult.activeurlapp);

            if (currAppInfo.bundleId == "")
            {
                ipData ipdata = NetworkHelper.getIPData(NetworkHelper.currentFakeIP);
                currAppInfo = Utils.getBundleIdentityByURL(this.cmdResult.activeurlapp, ipdata.countryCode);
            }

            if (currAppInfo.bundleId != bundleId && currAppInfo.bundleId != "")
            {
                base.Invoke(new MethodInvoker(delegate
                {
                    MessageBox.Show("Invalid application, please check offer link");
                    throw new Exception("Invalid application");
                }));
            }
        }
Пример #2
0
        public void setCountryByIP(string IP)
        {
            ipData ipData = this.getIPData(IP);

            if (ipData == null)
            {
                return;
            }
            this.timezone = ipData.timezone;
            countrycodeiOS infoByCountryCode = this.getCountryInfoByCountryCode(ipData.countryCode);

            this.country     = infoByCountryCode.countryname;
            this.countryCode = infoByCountryCode.countrycode;
            this.currency    = infoByCountryCode.currency;
            this.language    = infoByCountryCode.languageCode;
            double num1 = (double)iDevice.GetRandomNumber(-10000, 10000) / 100000.0;
            double num2 = (double)iDevice.GetRandomNumber(-10000, 10000) / 100000.0;

            this.latude   = ipData.lat + num1;
            this.longtude = ipData.lon + num2;
        }