Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Mirai
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Mirai
Commits
f0fd0b51
Commit
f0fd0b51
authored
Dec 30, 2019
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change ipAddress from ByteArray to String
parent
4fd579a7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
19 deletions
+19
-19
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/QQAndroidClient.kt
...tlin/net/mamoe/mirai/qqandroid/network/QQAndroidClient.kt
+3
-3
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/Tlv.kt
.../net/mamoe/mirai/qqandroid/network/protocol/packet/Tlv.kt
+13
-13
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/login/LoginPacket.kt
...ai/qqandroid/network/protocol/packet/login/LoginPacket.kt
+2
-2
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/utils/DeviceInfo.kt
...Main/kotlin/net/mamoe/mirai/qqandroid/utils/DeviceInfo.kt
+1
-1
No files found.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/QQAndroidClient.kt
View file @
f0fd0b51
...
...
@@ -35,11 +35,11 @@ internal open class QQAndroidClient(
var
ssoSequenceId
:
Int
=
0
var
openAppId
:
Long
=
715019303L
var
ipv6NetType
:
Int
=
TODO
()
val
apkVersionName
:
ByteArray
=
"8.2.0"
.
toByteArray
()
val
appClientVersion
:
Int
=
TODO
()
val
appClientVersion
:
Int
=
0
var
networkType
:
NetworkType
=
NetworkType
.
WIFI
val
apkSignatureMd5
:
ByteArray
=
TODO
()
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/Tlv.kt
View file @
f0fd0b51
...
...
@@ -4,6 +4,7 @@ import kotlinx.io.core.BytePacketBuilder
import
kotlinx.io.core.ByteReadPacket
import
kotlinx.io.core.toByteArray
import
kotlinx.io.core.writeFully
import
net.mamoe.mirai.qqandroid.utils.NetworkType
import
net.mamoe.mirai.utils.currentTime
import
net.mamoe.mirai.utils.io.*
import
net.mamoe.mirai.utils.md5
...
...
@@ -29,15 +30,14 @@ inline class LoginType(
}
@Suppress
(
"MemberVisibilityCanBePrivate"
)
fun
BytePacketBuilder
.
t1
(
uin
:
Long
,
ip
:
ByteArray
)
{
require
(
ip
.
size
==
4
)
fun
BytePacketBuilder
.
t1
(
uin
:
Long
,
ip
:
String
)
{
writeShort
(
0
x1
)
writeShortLVPacket
{
writeShort
(
1
)
// _ip_ver
writeInt
(
Random
.
nextInt
())
writeInt
(
uin
.
toInt
())
writeTime
()
write
Fully
(
ip
)
write
IP
(
ip
)
writeShort
(
0
)
}
shouldEqualsTo
20
}
...
...
@@ -83,9 +83,9 @@ fun BytePacketBuilder.t18(
fun
BytePacketBuilder
.
t106
(
appId
:
Long
,
subAppId
:
Long
,
appClientVersion
:
Int
,
appClientVersion
:
Int
=
0
,
uin
:
Long
,
ipAddress
:
ByteArray
,
ipAddress
:
String
,
n5_always_1
:
Int
=
1
,
passwordMd5
:
ByteArray
,
salt
:
Long
,
...
...
@@ -112,7 +112,7 @@ fun BytePacketBuilder.t106(
}
writeTime
()
write
Fully
(
ipAddress
)
write
IP
(
ipAddress
)
writeByte
(
n5_always_1
.
toByte
())
writeFully
(
passwordMd5
)
writeFully
(
tgtgtKey
)
...
...
@@ -130,7 +130,7 @@ fun BytePacketBuilder.t106(
}
writeInt
(
subAppId
.
toInt
())
writeInt
(
loginType
.
value
)
writeShortLVByteArray
(
uinAccount
)
writeShortLVByteArray
(
uinAccount
)
// TODO check if should be empty byte[]
}
}
shouldEqualsTo
98
}
...
...
@@ -234,7 +234,7 @@ fun BytePacketBuilder.t144(
// t124
osType
:
ByteArray
=
"android"
.
toByteArray
(),
osVersion
:
ByteArray
,
ipv6NetType
:
Int
,
networkType
:
NetworkType
,
simInfo
:
ByteArray
,
unknown
:
ByteArray
,
apn
:
ByteArray
=
"wifi"
.
toByteArray
(),
...
...
@@ -256,7 +256,7 @@ fun BytePacketBuilder.t144(
encryptAndWrite
(
tgtgtKey
)
{
t109
(
androidId
)
t52d
(
androidDevInfo
)
t124
(
osType
,
osVersion
,
ipv6Net
Type
,
simInfo
,
unknown
,
apn
)
t124
(
osType
,
osVersion
,
network
Type
,
simInfo
,
unknown
,
apn
)
t128
(
isGuidFromFileNull
,
isGuidAvailable
,
isGuidChanged
,
guidFlag
,
buildModel
,
guid
,
buildBrand
)
t16e
(
buildModel
)
}
...
...
@@ -284,7 +284,7 @@ fun BytePacketBuilder.t52d(
fun
BytePacketBuilder
.
t124
(
osType
:
ByteArray
=
"android"
.
toByteArray
(),
osVersion
:
ByteArray
,
// Build.VERSION.RELEASE.toByteArray()
ipv6NetType
:
Int
,
//oicq.wlogin_sdk.tools.util#get_network_type
networkType
:
NetworkType
,
//oicq.wlogin_sdk.tools.util#get_network_type
simInfo
:
ByteArray
,
// oicq.wlogin_sdk.tools.util#get_sim_operator_name
unknown
:
ByteArray
,
apn
:
ByteArray
=
"wifi"
.
toByteArray
()
// oicq.wlogin_sdk.tools.util#get_apn_string
...
...
@@ -293,7 +293,7 @@ fun BytePacketBuilder.t124(
writeShortLVPacket
{
writeShortLVByteArrayLimitedLength
(
osType
,
16
)
writeShortLVByteArrayLimitedLength
(
osVersion
,
16
)
writeShort
(
ipv6NetTyp
e
.
toShort
())
writeShort
(
networkType
.
valu
e
.
toShort
())
writeShortLVByteArrayLimitedLength
(
simInfo
,
16
)
writeShortLVByteArrayLimitedLength
(
unknown
,
32
)
writeShortLVByteArrayLimitedLength
(
apn
,
16
)
...
...
@@ -414,14 +414,14 @@ fun BytePacketBuilder.t154(
fun
BytePacketBuilder
.
t141
(
simInfo
:
ByteArray
,
ipv6NetType
:
Int
,
networkType
:
NetworkType
,
apn
:
ByteArray
)
{
writeShort
(
0
x141
)
writeShortLVPacket
{
writeShort
(
1
)
// version
writeShortLVByteArray
(
simInfo
)
writeShort
(
ipv6NetTyp
e
.
toShort
())
writeShort
(
networkType
.
valu
e
.
toShort
())
writeShortLVByteArray
(
apn
)
}
}
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/login/LoginPacket.kt
View file @
f0fd0b51
...
...
@@ -74,7 +74,7 @@ internal object LoginPacket : PacketFactory<LoginPacket.LoginPacketResponse, Log
androidDevInfo
=
client
.
device
.
generateDeviceInfoData
(),
osType
=
client
.
device
.
osType
,
osVersion
=
client
.
device
.
version
.
release
,
ipv6NetType
=
client
.
ipv6Net
Type
,
networkType
=
client
.
network
Type
,
simInfo
=
client
.
device
.
simInfo
,
unknown
=
byteArrayOf
(),
apn
=
client
.
device
.
apn
,
isGuidFromFileNull
=
false
,
...
...
@@ -97,7 +97,7 @@ internal object LoginPacket : PacketFactory<LoginPacket.LoginPacketResponse, Log
// ignored t16a because array5 is null
t154
(
client
.
ssoSequenceId
)
t141
(
client
.
device
.
simInfo
,
client
.
ipv6Net
Type
,
client
.
device
.
apn
)
t141
(
client
.
device
.
simInfo
,
client
.
network
Type
,
client
.
device
.
apn
)
t8
(
2052
)
// ignored t511 because domain is null
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/utils/DeviceInfo.kt
View file @
f0fd0b51
...
...
@@ -34,7 +34,7 @@ abstract class DeviceInfo(
abstract
val
imsiMd5
:
ByteArray
abstract
val
ipAddress
:
ByteArray
abstract
val
ipAddress
:
String
abstract
val
androidId
:
ByteArray
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment