Fix incorrect device info generation
Gh0st [2016-08-12 16:27:55]
Fix incorrect device info generation
diff --git a/src/RocketBotGUI/SettingsForm.Designer.cs b/src/RocketBotGUI/SettingsForm.Designer.cs
index 3836a68..23b41f3 100644
--- a/src/RocketBotGUI/SettingsForm.Designer.cs
+++ b/src/RocketBotGUI/SettingsForm.Designer.cs
@@ -75,6 +75,9 @@ namespace PokemonGo.RocketAPI.Window
this.cbSelectAllTransfer = new System.Windows.Forms.CheckBox();
this.clbTransfer = new System.Windows.Forms.CheckedListBox();
this.tabPage3 = new System.Windows.Forms.TabPage();
+ this.label22 = new System.Windows.Forms.Label();
+ this.label20 = new System.Windows.Forms.Label();
+ this.label21 = new System.Windows.Forms.Label();
this.RandomIDBtn = new System.Windows.Forms.Button();
this.deviceTypeCb = new System.Windows.Forms.ComboBox();
this.RandomDeviceBtn = new System.Windows.Forms.Button();
@@ -105,9 +108,6 @@ namespace PokemonGo.RocketAPI.Window
this.DeviceIdTb = new System.Windows.Forms.TextBox();
this.deviceIdlb = new System.Windows.Forms.Label();
this.label18 = new System.Windows.Forms.Label();
- this.label20 = new System.Windows.Forms.Label();
- this.label21 = new System.Windows.Forms.Label();
- this.label22 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.trackBar)).BeginInit();
this.panel1.SuspendLayout();
this.panel2.SuspendLayout();
@@ -685,6 +685,40 @@ namespace PokemonGo.RocketAPI.Window
this.tabPage3.Size = new System.Drawing.Size(589, 430);
this.tabPage3.TabIndex = 0;
this.tabPage3.Text = "Device";
+ //
+ // label22
+ //
+ this.label22.AutoSize = true;
+ this.label22.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F);
+ this.label22.Location = new System.Drawing.Point(416, 92);
+ this.label22.Name = "label22";
+ this.label22.Size = new System.Drawing.Size(168, 90);
+ this.label22.TabIndex = 69;
+ this.label22.Text = "This setting change what the \r\nserver think you are using to \r\nplay Pokémon GO. I" +
+ "ts a good \r\nidea to change your device to \r\nwhat phone you are using to \r\npreven" +
+ "t ip ban.";
+ //
+ // label20
+ //
+ this.label20.AutoSize = true;
+ this.label20.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F);
+ this.label20.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
+ this.label20.Location = new System.Drawing.Point(416, 13);
+ this.label20.Name = "label20";
+ this.label20.Size = new System.Drawing.Size(74, 18);
+ this.label20.TabIndex = 67;
+ this.label20.Text = "Important:";
+ //
+ // label21
+ //
+ this.label21.AutoSize = true;
+ this.label21.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F);
+ this.label21.Location = new System.Drawing.Point(416, 32);
+ this.label21.Name = "label21";
+ this.label21.Size = new System.Drawing.Size(164, 45);
+ this.label21.TabIndex = 66;
+ this.label21.Text = "For your account safety.\r\nPlease do not change your \r\naccount infomation too ofte" +
+ "n.\r\n";
//
// RandomIDBtn
//
@@ -709,7 +743,7 @@ namespace PokemonGo.RocketAPI.Window
this.deviceTypeCb.Name = "deviceTypeCb";
this.deviceTypeCb.Size = new System.Drawing.Size(150, 23);
this.deviceTypeCb.TabIndex = 37;
- this.deviceTypeCb.SelectedIndexChanged += new System.EventHandler(this.deviceTypeCb_SelectedIndexChanged);
+ this.deviceTypeCb.SelectionChangeCommitted += new System.EventHandler(this.deviceTypeCb_SelectedIndexChanged);
//
// RandomDeviceBtn
//
@@ -965,40 +999,6 @@ namespace PokemonGo.RocketAPI.Window
this.label18.Size = new System.Drawing.Size(76, 15);
this.label18.TabIndex = 36;
this.label18.Text = "Device Type:";
- //
- // label20
- //
- this.label20.AutoSize = true;
- this.label20.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F);
- this.label20.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
- this.label20.Location = new System.Drawing.Point(416, 13);
- this.label20.Name = "label20";
- this.label20.Size = new System.Drawing.Size(74, 18);
- this.label20.TabIndex = 67;
- this.label20.Text = "Important:";
- //
- // label21
- //
- this.label21.AutoSize = true;
- this.label21.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F);
- this.label21.Location = new System.Drawing.Point(416, 32);
- this.label21.Name = "label21";
- this.label21.Size = new System.Drawing.Size(164, 45);
- this.label21.TabIndex = 66;
- this.label21.Text = "For your account safety.\r\nPlease do not change your \r\naccount infomation too ofte" +
- "n.\r\n";
- //
- // label22
- //
- this.label22.AutoSize = true;
- this.label22.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F);
- this.label22.Location = new System.Drawing.Point(416, 92);
- this.label22.Name = "label22";
- this.label22.Size = new System.Drawing.Size(168, 90);
- this.label22.TabIndex = 69;
- this.label22.Text = "This setting change what the \r\nserver think you are using to \r\nplay Pokémon GO. I" +
- "ts a good \r\nidea to change your device to \r\nwhat phone you are using to \r\npreven" +
- "t ip ban.";
//
// SettingsForm
//
diff --git a/src/RocketBotGUI/SettingsForm.cs b/src/RocketBotGUI/SettingsForm.cs
index 0fd7ab9..e123405 100644
--- a/src/RocketBotGUI/SettingsForm.cs
+++ b/src/RocketBotGUI/SettingsForm.cs
@@ -92,7 +92,7 @@ namespace PokemonGo.RocketAPI.Window
{
for (var i = 0; i < clbCatch.Items.Count; i++)
{
- var pokemonId = (PokemonId) clbCatch.Items[i];
+ var pokemonId = (PokemonId)clbCatch.Items[i];
if (pokemonIdSetting == pokemonId)
{
clbCatch.SetItemChecked(i, true);
@@ -104,7 +104,7 @@ namespace PokemonGo.RocketAPI.Window
{
for (var i = 0; i < clbTransfer.Items.Count; i++)
{
- var pokemonId = (PokemonId) clbTransfer.Items[i];
+ var pokemonId = (PokemonId)clbTransfer.Items[i];
if (pokemonIdSetting == pokemonId)
{
clbTransfer.SetItemChecked(i, true);
@@ -116,7 +116,7 @@ namespace PokemonGo.RocketAPI.Window
{
for (var i = 0; i < clbEvolve.Items.Count; i++)
{
- var pokemonId = (PokemonId) clbEvolve.Items[i];
+ var pokemonId = (PokemonId)clbEvolve.Items[i];
if (pokemonIdSetting == pokemonId)
{
clbEvolve.SetItemChecked(i, true);
@@ -147,9 +147,7 @@ namespace PokemonGo.RocketAPI.Window
FirmwareTagsTb.Text = Settings.Instance.FirmwareTags;
FirmwareTypeTb.Text = Settings.Instance.FirmwareType;
FirmwareFingerprintTb.Text = Settings.Instance.FirmwareFingerprint;
- _doNotPopulate = true;
deviceTypeCb.SelectedIndex = Settings.Instance.DeviceBrand.ToLower() == "apple" ? 0 : 1;
- _doNotPopulate = false;
}
}
@@ -369,30 +367,27 @@ namespace PokemonGo.RocketAPI.Window
private void PopulateDevice()
{
- if (_doNotPopulate)
- {
- return;
- }
+ deviceTypeCb.SelectedIndex = _deviceHelper.GetRandomIndex(2);
var candidateDevices = deviceTypeCb.SelectedIndex == 0
? _deviceInfos.Where(d => d.DeviceBrand.ToLower() == "apple").ToList()
: _deviceInfos.Where(d => d.DeviceBrand.ToLower() != "apple").ToList();
var selectIndex = _deviceHelper.GetRandomIndex(candidateDevices.Count);
- DeviceIdTb.Text = _deviceInfos[selectIndex].DeviceId == "8525f6d8251f71b7"
+ DeviceIdTb.Text = candidateDevices[selectIndex].DeviceId == "8525f6d8251f71b7"
? _deviceHelper.RandomString(16, "0123456789abcdef")
- : _deviceInfos[selectIndex].DeviceId;
- AndroidBoardNameTb.Text = _deviceInfos[selectIndex].AndroidBoardName;
- AndroidBootloaderTb.Text = _deviceInfos[selectIndex].AndroidBootloader;
- DeviceBrandTb.Text = _deviceInfos[selectIndex].DeviceBrand;
- DeviceModelTb.Text = _deviceInfos[selectIndex].DeviceModel;
- DeviceModelIdentifierTb.Text = _deviceInfos[selectIndex].DeviceModelIdentifier;
- DeviceModelBootTb.Text = _deviceInfos[selectIndex].DeviceModelBoot;
- HardwareManufacturerTb.Text = _deviceInfos[selectIndex].HardwareManufacturer;
- HardwareModelTb.Text = _deviceInfos[selectIndex].HardwareModel;
- FirmwareBrandTb.Text = _deviceInfos[selectIndex].FirmwareBrand;
- FirmwareTagsTb.Text = _deviceInfos[selectIndex].FirmwareTags;
- FirmwareTypeTb.Text = _deviceInfos[selectIndex].FirmwareType;
- FirmwareFingerprintTb.Text = _deviceInfos[selectIndex].FirmwareFingerprint;
+ : candidateDevices[selectIndex].DeviceId;
+ AndroidBoardNameTb.Text = candidateDevices[selectIndex].AndroidBoardName;
+ AndroidBootloaderTb.Text = candidateDevices[selectIndex].AndroidBootloader;
+ DeviceBrandTb.Text = candidateDevices[selectIndex].DeviceBrand;
+ DeviceModelTb.Text = candidateDevices[selectIndex].DeviceModel;
+ DeviceModelIdentifierTb.Text = candidateDevices[selectIndex].DeviceModelIdentifier;
+ DeviceModelBootTb.Text = candidateDevices[selectIndex].DeviceModelBoot;
+ HardwareManufacturerTb.Text = candidateDevices[selectIndex].HardwareManufacturer;
+ HardwareModelTb.Text = candidateDevices[selectIndex].HardwareModel;
+ FirmwareBrandTb.Text = candidateDevices[selectIndex].FirmwareBrand;
+ FirmwareTagsTb.Text = candidateDevices[selectIndex].FirmwareTags;
+ FirmwareTypeTb.Text = candidateDevices[selectIndex].FirmwareType;
+ FirmwareFingerprintTb.Text = candidateDevices[selectIndex].FirmwareFingerprint;
}
}
}
\ No newline at end of file
You may download the files in Public Git.