Exemplo n.º 1
0
        public static bool TryParse(string combo, out ProxyEx result)
        {
            result = new ProxyEx();

            string[] parts = combo.Split(':');

            if (parts.Length != 2 && parts.Length != 4)
            {
                //throw new ArgumentException("proxyCombo must be in the format IP:PORT or IP:PORT:USERNAME:PASSWORD");

                return(false);
            }

            int port = 0;

            if (!Int32.TryParse(parts[1], out port))
            {
                //throw new ArgumentException(String.Format("Invalid port value \"{0}\"", parts[1]));

                return(false);
            }

            result.Address = parts[0];
            result.Port    = port;

            if (parts.Length == 4)
            {
                result.Username = parts[2];
                result.Password = parts[3];
            }

            return(true);
        }
Exemplo n.º 2
0
        public override bool Equals(object obj)
        {
            ProxyEx proxyEx = obj as ProxyEx;

            if (proxyEx == null)
            {
                return(base.Equals(obj));
            }

            return(proxyEx.Address == this.Address && proxyEx.Port == this.Port);
        }
Exemplo n.º 3
0
        public void SetSettings(Manager manager)
        {
            Settings      = manager.UserSettings;
            ClientManager = manager;

            int osId = OsVersions[Settings.FirmwareType.Length].Length;
            var firmwareUserAgentPart = OsUserAgentParts[osId];
            var firmwareType          = OsVersions[osId];

            Proxy = new ProxyEx
            {
                Address  = Settings.ProxyIP,
                Port     = Settings.ProxyPort,
                Username = Settings.ProxyUsername,
                Password = Settings.ProxyPassword
            };

            ClientDeviceWrapper = new DeviceWrapper
            {
                UserAgent  = $"pokemongo/1 {firmwareUserAgentPart}",
                DeviceInfo = new DeviceInfo
                {
                    DeviceId              = Settings.DeviceId,
                    DeviceBrand           = Settings.DeviceBrand,
                    DeviceModelBoot       = Settings.DeviceModelBoot,
                    HardwareModel         = Settings.HardwareModel,
                    HardwareManufacturer  = Settings.HardwareManufacturer,
                    FirmwareBrand         = Settings.FirmwareBrand,
                    FirmwareType          = Settings.FirmwareType,
                    AndroidBoardName      = Settings.AndroidBoardName,
                    AndroidBootloader     = Settings.AndroidBootloader,
                    DeviceModel           = Settings.DeviceModel,
                    DeviceModelIdentifier = Settings.DeviceModelIdentifier,
                    FirmwareFingerprint   = Settings.FirmwareFingerprint,
                    FirmwareTags          = Settings.FirmwareTags
                },
                Proxy = Proxy.AsWebProxy()
            };

            PlayerLocale = new GetPlayerMessage.Types.PlayerLocale
            {
                Country  = Settings.Country,
                Language = Settings.Language,
                Timezone = Settings.TimeZone
            };
        }
Exemplo n.º 4
0
        public void SetSettings(Manager manager)
        {
            ClientManager = manager;

            Proxy = new ProxyEx
            {
                Address  = ClientManager.UserSettings.ProxyIP,
                Port     = ClientManager.UserSettings.ProxyPort,
                Username = ClientManager.UserSettings.ProxyUsername,
                Password = ClientManager.UserSettings.ProxyPassword
            };

            Dictionary <string, string> Header = new Dictionary <string, string>()
            {
                { "11.1.0", "CFNetwork/889.3 Darwin/17.2.0" },
                { "11.2.0", "CFNetwork/893.10 Darwin/17.3.0" },
                { "11.2.5", "CFNetwork/893.14.2 Darwin/17.4.0" }
            };

            ClientDeviceWrapper = new DeviceWrapper
            {
                UserAgent  = $"pokemongo/1 {Header[ClientManager.UserSettings.FirmwareType]}",
                DeviceInfo = new DeviceInfo
                {
                    DeviceId             = ClientManager.UserSettings.DeviceId,
                    DeviceBrand          = ClientManager.UserSettings.DeviceBrand,
                    DeviceModel          = ClientManager.UserSettings.DeviceModel,
                    DeviceModelBoot      = ClientManager.UserSettings.DeviceModelBoot,
                    HardwareManufacturer = ClientManager.UserSettings.HardwareManufacturer,
                    HardwareModel        = ClientManager.UserSettings.HardwareModel,
                    FirmwareBrand        = ClientManager.UserSettings.FirmwareBrand,
                    FirmwareType         = ClientManager.UserSettings.FirmwareType
                },
                Proxy = Proxy.AsWebProxy()
            };

            PlayerLocale = new GetPlayerMessage.Types.PlayerLocale
            {
                Country  = ClientManager.UserSettings.Country,
                Language = ClientManager.UserSettings.Language,
                Timezone = ClientManager.UserSettings.TimeZone
            };
        }
Exemplo n.º 5
0
        public void SetSettings(ISettings settings)
        {
            Settings = settings;

            int osId = OsVersions[Settings.FirmwareType.Length].Length;
            var firmwareUserAgentPart = OsUserAgentParts[osId];
            var firmwareType          = OsVersions[osId];

            ClientDeviceWrapper = new DeviceWrapper
            {
                UserAgent  = $"pokemongo/1 {firmwareUserAgentPart}",
                DeviceInfo = new DeviceInfo
                {
                    DeviceId              = Settings.DeviceId,
                    DeviceBrand           = Settings.DeviceBrand,
                    DeviceModelBoot       = Settings.DeviceModelBoot,
                    HardwareModel         = Settings.HardwareModel,
                    HardwareManufacturer  = Settings.HardwareManufacturer,
                    FirmwareBrand         = Settings.FirmwareBrand,
                    FirmwareType          = Settings.FirmwareType,
                    AndroidBoardName      = Settings.AndroidBoardName,
                    AndroidBootloader     = Settings.AndroidBootloader,
                    DeviceModel           = Settings.DeviceModel,
                    DeviceModelIdentifier = Settings.DeviceModelIdentifier,
                    FirmwareFingerprint   = Settings.FirmwareFingerprint,
                    FirmwareTags          = Settings.FirmwareTags
                }
            };

            Proxy = new ProxyEx
            {
                Address  = Settings.ProxyIP,
                Port     = Settings.ProxyPort,
                Username = Settings.ProxyUsername,
                Password = Settings.ProxyPassword
            };

            LocaleInfo = new ILocaleInfo();
            LocaleInfo.SetValues(Settings.Country, Settings.Language, Settings.TimeZone);
            Configuration.LocaleInfo = LocaleInfo;
        }
Exemplo n.º 6
0
        public void SetSettings(Manager manager)
        {
            ClientManager = manager;

            int osId = OsVersions[ClientManager.UserSettings.DeviceInfo.FirmwareType.Length].Length;
            var firmwareUserAgentPart = OsUserAgentParts[osId];
            var firmwareType          = OsVersions[osId];

            Proxy = new ProxyEx
            {
                Address  = ClientManager.UserSettings.ProxyIP,
                Port     = ClientManager.UserSettings.ProxyPort,
                Username = ClientManager.UserSettings.ProxyUsername,
                Password = ClientManager.UserSettings.ProxyPassword
            };

            ClientDeviceWrapper = new DeviceWrapper
            {
                UserAgent  = $"pokemongo/1 {firmwareUserAgentPart}",
                DeviceInfo = new DeviceInfo
                {
                    DeviceId             = ClientManager.UserSettings.DeviceInfo.DeviceId,
                    DeviceBrand          = ClientManager.UserSettings.DeviceInfo.DeviceBrand,
                    DeviceModel          = ClientManager.UserSettings.DeviceInfo.DeviceModel,
                    DeviceModelBoot      = ClientManager.UserSettings.DeviceInfo.DeviceModelBoot,
                    HardwareManufacturer = ClientManager.UserSettings.DeviceInfo.HardwareManufacturer,
                    HardwareModel        = ClientManager.UserSettings.DeviceInfo.HardwareModel,
                    FirmwareBrand        = ClientManager.UserSettings.DeviceInfo.FirmwareBrand,
                    FirmwareType         = ClientManager.UserSettings.DeviceInfo.FirmwareType
                },
                Proxy = Proxy.AsWebProxy()
            };

            PlayerLocale = new GetPlayerMessage.Types.PlayerLocale
            {
                Country  = ClientManager.UserSettings.PlayerLocale.Country,
                Language = ClientManager.UserSettings.PlayerLocale.Language,
                Timezone = ClientManager.UserSettings.PlayerLocale.Timezone
            };
        }
Exemplo n.º 7
0
        private void importProxiesToolStripMenuItem_Click_1(object sender, EventArgs e)
        {
            int    count            = fastObjectListViewMain.SelectedObjects.Count;
            string fileName         = String.Empty;
            int    accountsPerProxy = 0;

            string pPerAccount = Prompt.ShowDialog("Accounts per proxy", "Accounts per proxy", "1");

            if (!Int32.TryParse(pPerAccount, out accountsPerProxy) || accountsPerProxy <= 0)
            {
                MessageBox.Show("Invalid input");

                return;
            }


            if (count == 0)
            {
                return;
            }

            using (OpenFileDialog ofd = new OpenFileDialog())
            {
                ofd.Title  = "Open proxy file";
                ofd.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*";

                if (ofd.ShowDialog() == DialogResult.OK)
                {
                    fileName = ofd.FileName;
                }
            }

            if (String.IsNullOrEmpty(fileName))
            {
                return;
            }

            List <ProxyEx> proxies = new List <ProxyEx>();

            try
            {
                string[] tempProxies = File.ReadAllLines(fileName);
                ProxyEx  tempProxyEx = null;

                foreach (string proxyEx in tempProxies)
                {
                    if (ProxyEx.TryParse(proxyEx, out tempProxyEx))
                    {
                        proxies.Add(tempProxyEx);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(String.Format("Failed to import proxy file. Ex: {0}", ex.Message));
                return;
            }

            if (proxies.Count == 0)
            {
                MessageBox.Show("No proxies found");
                return;
            }

            int proxyIndex = 0;
            int proxyUsage = 0;

            foreach (Manager manager in fastObjectListViewMain.SelectedObjects)
            {
                ++proxyUsage;

                if (proxyUsage > accountsPerProxy)
                {
                    ++proxyIndex;
                    proxyUsage = 1;

                    if (proxyIndex >= proxies.Count)
                    {
                        MessageBox.Show("Out of proxies");
                        return;
                    }
                }

                ProxyEx proxy = proxies[proxyIndex];

                manager.UserSettings.ProxyIP       = proxy.Address;
                manager.UserSettings.ProxyPort     = proxy.Port;
                manager.UserSettings.ProxyUsername = proxy.Username;
                manager.UserSettings.ProxyPassword = proxy.Password;
            }
        }