mirror of
https://github.com/JustArchiNET/ArchiSteamFarm
synced 2024-11-10 07:04:27 +00:00
Make deviceIdentifier-less deviceIDs work with ASF 2FA
This commit is contained in:
parent
1d8edde943
commit
bda4f2c822
1 changed files with 11 additions and 6 deletions
|
@ -287,16 +287,21 @@ namespace ArchiSteamFarm {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// To the best of my knowledge, Steam uses android identifier even on iOS and other devices right now
|
// This one is optional
|
||||||
// If we ever need to correct this, we also need to clean up other places
|
int deviceIdentifierIndex = deviceID.IndexOf(':');
|
||||||
const string deviceIdentifier = "android:";
|
|
||||||
|
|
||||||
if (!deviceID.StartsWith(deviceIdentifier, StringComparison.Ordinal) || (deviceID.Length <= deviceIdentifier.Length)) {
|
if (deviceIdentifierIndex >= 0) {
|
||||||
return false;
|
deviceIdentifierIndex++;
|
||||||
|
|
||||||
|
if (deviceID.Length <= deviceIdentifierIndex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
deviceID = deviceID.Substring(deviceIdentifierIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dashes are optional in the ID, strip them off for comparison
|
// Dashes are optional in the ID, strip them off for comparison
|
||||||
string hash = deviceID.Substring(deviceIdentifier.Length).Replace("-", "");
|
string hash = deviceID.Replace("-", "");
|
||||||
|
|
||||||
return (hash.Length > 0) && Utilities.IsValidHexadecimalString(hash);
|
return (hash.Length > 0) && Utilities.IsValidHexadecimalString(hash);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue