Commit 9140fb89 authored by Him188's avatar Him188

Convert `.run` calls to member accesses

parent 74b5b29d
...@@ -29,26 +29,24 @@ internal object LoginPacket : PacketFactory<LoginPacket.LoginPacketResponse, Log ...@@ -29,26 +29,24 @@ internal object LoginPacket : PacketFactory<LoginPacket.LoginPacketResponse, Log
writeShort(9) // subCommand writeShort(9) // subCommand
writeShort(LoginType.PASSWORD.value.toShort()) writeShort(LoginType.PASSWORD.value.toShort())
client.run {
client.device.run {
val appId = 16L val appId = 16L
val subAppId = 2L val subAppId = 2L
t18(appId, appClientVersion, account.id) t18(appId, client.appClientVersion, client.account.id)
t1(account.id, ipAddress) t1(client.account.id, client.device.ipAddress)
t106( t106(
appId, appId,
subAppId /* maybe 1*/, subAppId /* maybe 1*/,
appClientVersion, client.appClientVersion,
account.id, client.account.id,
ipAddress, client.device.ipAddress,
1, 1,
account.passwordMd5, client.account.passwordMd5,
0, 0,
account.id.toByteArray(), client.account.id.toByteArray(),
tgtgtKey, client.tgtgtKey,
true, true,
guid, client.device.guid,
LoginType.PASSWORD LoginType.PASSWORD
) )
...@@ -62,44 +60,44 @@ internal object LoginPacket : PacketFactory<LoginPacket.LoginPacketResponse, Log ...@@ -62,44 +60,44 @@ internal object LoginPacket : PacketFactory<LoginPacket.LoginPacketResponse, Log
// defaults true // defaults true
if (ConfigManager.get_loginWithPicSt()) appIdList = longArrayOf(1600000226L) if (ConfigManager.get_loginWithPicSt()) appIdList = longArrayOf(1600000226L)
*/ */
t116(miscBitMap, subSigMap, longArrayOf(1600000226L)) t116(client.miscBitMap, client.subSigMap, longArrayOf(1600000226L))
t100(appId, subAppId, appClientVersion, mainSigMap or 0xC0) t100(appId, subAppId, client.appClientVersion, client.mainSigMap or 0xC0)
t107(0) t107(0)
t108(byteArrayOf()) t108(byteArrayOf())
// ignored: t104() // ignored: t104()
t142(apkId) t142(client.apkId)
// if login with non-number uin // if login with non-number uin
// t112() // t112()
t144( t144(
androidId = androidId, androidId = client.device.androidId,
androidDevInfo = generateDeviceInfoData(), androidDevInfo = client.device.generateDeviceInfoData(),
osType = osType, osType = client.device.osType,
osVersion = version.release, osVersion = client.device.version.release,
ipv6NetType = ipv6NetType, ipv6NetType = client.ipv6NetType,
simInfo = simInfo, simInfo = client.device.simInfo,
unknown = byteArrayOf(), apn = apn, unknown = byteArrayOf(), apn = client.device.apn,
isGuidFromFileNull = false, isGuidFromFileNull = false,
isGuidAvailable = true, isGuidAvailable = true,
isGuidChanged = false, isGuidChanged = false,
guidFlag = guidFlag(GuidSource.FROM_STORAGE, MacOrAndroidIdChangeFlag.NoChange), guidFlag = guidFlag(GuidSource.FROM_STORAGE, MacOrAndroidIdChangeFlag.NoChange),
buildModel = model, buildModel = client.device.model,
guid = guid, guid = client.device.guid,
buildBrand = brand, buildBrand = client.device.brand,
tgtgtKey = tgtgtKey tgtgtKey = client.tgtgtKey
) )
t145(guid) t145(client.device.guid)
t147(appId, apkVersionName, apkSignatureMd5) t147(appId, client.apkVersionName, client.apkSignatureMd5)
if (miscBitMap and 0x80 != 0) { if (client.miscBitMap and 0x80 != 0) {
t166(1) t166(1)
} }
// ignored t16a because array5 is null // ignored t16a because array5 is null
t154(ssoSequenceId) t154(client.ssoSequenceId)
t141(simInfo, ipv6NetType, apn) t141(client.device.simInfo, client.ipv6NetType, client.device.apn)
t8(2052) t8(2052)
// ignored t511 because domain is null // ignored t511 because domain is null
...@@ -107,16 +105,16 @@ internal object LoginPacket : PacketFactory<LoginPacket.LoginPacketResponse, Log ...@@ -107,16 +105,16 @@ internal object LoginPacket : PacketFactory<LoginPacket.LoginPacketResponse, Log
// ignored t185 because loginType is not SMS // ignored t185 because loginType is not SMS
// ignored t400 because of first login // ignored t400 because of first login
t187(macAddress) t187(client.device.macAddress)
t188(androidId) t188(client.device.androidId)
if (imsiMd5.isNotEmpty()) { if (client.device.imsiMd5.isNotEmpty()) {
t194(imsiMd5) t194(client.device.imsiMd5)
} }
t191() t191()
t201(N = byteArrayOf()) t201(N = byteArrayOf())
val bssid = wifiBSSID val bssid = client.device.wifiBSSID
val ssid = wifiSSID val ssid = client.device.wifiSSID
if (bssid != null && ssid != null) { if (bssid != null && ssid != null) {
t202(bssid, ssid) t202(bssid, ssid)
} }
...@@ -136,9 +134,6 @@ internal object LoginPacket : PacketFactory<LoginPacket.LoginPacketResponse, Log ...@@ -136,9 +134,6 @@ internal object LoginPacket : PacketFactory<LoginPacket.LoginPacketResponse, Log
// ignored t318 because not logging in by QR // ignored t318 because not logging in by QR
} }
} }
}
}
class LoginPacketResponse : Packet class LoginPacketResponse : Packet
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment