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
b062c580
Commit
b062c580
authored
Jan 05, 2020
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Android stuff
parent
67903e67
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
386 additions
and
236 deletions
+386
-236
mirai-core-qqandroid/src/androidMain/kotlin/net/mamoe/mirai/qqandroid/utils/SystemDeviceInfo.kt
...otlin/net/mamoe/mirai/qqandroid/utils/SystemDeviceInfo.kt
+2
-0
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/QQAndroidClient.kt
...tlin/net/mamoe/mirai/qqandroid/network/QQAndroidClient.kt
+8
-1
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/OutgoingPacketAndroid.kt
...qandroid/network/protocol/packet/OutgoingPacketAndroid.kt
+238
-103
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/PacketFactory.kt
.../mirai/qqandroid/network/protocol/packet/PacketFactory.kt
+1
-1
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/login/LoginPacket.kt
...ai/qqandroid/network/protocol/packet/login/LoginPacket.kt
+133
-131
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/utils/DeviceInfo.kt
...Main/kotlin/net/mamoe/mirai/qqandroid/utils/DeviceInfo.kt
+2
-0
mirai-core-qqandroid/src/jvmMain/kotlin/net/mamoe/mirai/qqandroid/utils/SystemDeviceInfo.kt
...otlin/net/mamoe/mirai/qqandroid/utils/SystemDeviceInfo.kt
+2
-0
No files found.
mirai-core-qqandroid/src/androidMain/kotlin/net/mamoe/mirai/qqandroid/utils/SystemDeviceInfo.kt
View file @
b062c580
...
@@ -66,6 +66,8 @@ actual class SystemDeviceInfo actual constructor(context: Context) : DeviceInfo(
...
@@ -66,6 +66,8 @@ actual class SystemDeviceInfo actual constructor(context: Context) : DeviceInfo(
get
()
=
md5
(
kotlin
.
runCatching
{
get
()
=
md5
(
kotlin
.
runCatching
{
(
context
.
applicationContext
.
getSystemService
(
Context
.
TELEPHONY_SERVICE
)
as
TelephonyManager
).
subscriberId
.
toByteArray
()
(
context
.
applicationContext
.
getSystemService
(
Context
.
TELEPHONY_SERVICE
)
as
TelephonyManager
).
subscriberId
.
toByteArray
()
}.
getOrElse
{
byteArrayOf
()
})
}.
getOrElse
{
byteArrayOf
()
})
override
val
imei
:
String
get
()
=
"858414369211993"
// TODO: 2020/1/5 get actual imei and ksid
override
val
ksid
:
String
get
()
=
"|454001228437590|A8.2.0.27f6ea96"
override
val
ipAddress
:
String
get
()
=
localIpAddress
()
override
val
ipAddress
:
String
get
()
=
localIpAddress
()
override
val
androidId
:
ByteArray
get
()
=
Build
.
ID
.
toByteArray
()
override
val
androidId
:
ByteArray
get
()
=
Build
.
ID
.
toByteArray
()
override
val
apn
:
ByteArray
get
()
=
"wifi"
.
toByteArray
()
override
val
apn
:
ByteArray
get
()
=
"wifi"
.
toByteArray
()
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/QQAndroidClient.kt
View file @
b062c580
package
net.mamoe.mirai.qqandroid.network
package
net.mamoe.mirai.qqandroid.network
import
kotlinx.atomicfu.AtomicInt
import
kotlinx.atomicfu.atomic
import
kotlinx.io.core.toByteArray
import
kotlinx.io.core.toByteArray
import
net.mamoe.mirai.BotAccount
import
net.mamoe.mirai.BotAccount
import
net.mamoe.mirai.qqandroid.utils.*
import
net.mamoe.mirai.qqandroid.utils.*
import
net.mamoe.mirai.utils.MiraiInternalAPI
import
net.mamoe.mirai.utils.io.hexToBytes
import
net.mamoe.mirai.utils.io.hexToBytes
/*
/*
...
@@ -33,7 +36,11 @@ internal open class QQAndroidClient(
...
@@ -33,7 +36,11 @@ internal open class QQAndroidClient(
var
mainSigMap
:
Int
=
16724722
var
mainSigMap
:
Int
=
16724722
var
subSigMap
:
Int
=
0
x10400
//=66,560
var
subSigMap
:
Int
=
0
x10400
//=66,560
var
ssoSequenceId
:
Int
=
85602
private
val
_ssoSequenceId
:
AtomicInt
=
atomic
(
85600
)
@MiraiInternalAPI
(
"Do not use directly. Get from the lambda param of buildSsoPacket"
)
internal
fun
nextSsoSequenceId
()
=
_ssoSequenceId
.
addAndGet
(
2
)
var
openAppId
:
Long
=
715019303L
var
openAppId
:
Long
=
715019303L
val
apkVersionName
:
ByteArray
=
"8.2.0"
.
toByteArray
()
val
apkVersionName
:
ByteArray
=
"8.2.0"
.
toByteArray
()
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/OutgoingPacketAndroid.kt
View file @
b062c580
This diff is collapsed.
Click to expand it.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/PacketFactory.kt
View file @
b062c580
...
@@ -18,7 +18,7 @@ import net.mamoe.mirai.utils.cryptor.DecrypterType
...
@@ -18,7 +18,7 @@ import net.mamoe.mirai.utils.cryptor.DecrypterType
* @param TDecrypter 服务器回复包解密器
* @param TDecrypter 服务器回复包解密器
*/
*/
@UseExperimental
(
ExperimentalUnsignedTypes
::
class
)
@UseExperimental
(
ExperimentalUnsignedTypes
::
class
)
abstract
class
PacketFactory
<
out
TPacket
:
Packet
,
TDecrypter
:
Decrypter
>(
val
decrypterType
:
DecrypterType
<
TDecrypter
>)
{
internal
abstract
class
PacketFactory
<
out
TPacket
:
Packet
,
TDecrypter
:
Decrypter
>(
val
decrypterType
:
DecrypterType
<
TDecrypter
>)
{
@Suppress
(
"PropertyName"
)
@Suppress
(
"PropertyName"
)
internal
var
_id
:
PacketId
=
NullPacketId
internal
var
_id
:
PacketId
=
NullPacketId
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/login/LoginPacket.kt
View file @
b062c580
This diff is collapsed.
Click to expand it.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/utils/DeviceInfo.kt
View file @
b062c580
...
@@ -33,6 +33,8 @@ abstract class DeviceInfo(
...
@@ -33,6 +33,8 @@ abstract class DeviceInfo(
abstract
val
wifiSSID
:
ByteArray
?
abstract
val
wifiSSID
:
ByteArray
?
abstract
val
imsiMd5
:
ByteArray
abstract
val
imsiMd5
:
ByteArray
abstract
val
imei
:
String
abstract
val
ksid
:
String
abstract
val
ipAddress
:
String
abstract
val
ipAddress
:
String
...
...
mirai-core-qqandroid/src/jvmMain/kotlin/net/mamoe/mirai/qqandroid/utils/SystemDeviceInfo.kt
View file @
b062c580
...
@@ -26,6 +26,8 @@ actual class SystemDeviceInfo actual constructor(context: Context) : DeviceInfo(
...
@@ -26,6 +26,8 @@ actual class SystemDeviceInfo actual constructor(context: Context) : DeviceInfo(
@UseExperimental
(
ExperimentalUnsignedTypes
::
class
)
@UseExperimental
(
ExperimentalUnsignedTypes
::
class
)
override
val
imsiMd5
:
ByteArray
override
val
imsiMd5
:
ByteArray
get
()
=
ubyteArrayOf
(
0
xD4u
,
0
x1Du
,
0
x8Cu
,
0
xD9u
,
0
x8Fu
,
0
x00u
,
0
xB2u
,
0
x04u
,
0
xE9u
,
0
x80u
,
0
x09u
,
0
x98u
,
0
xECu
,
0
xF8u
,
0
x42u
,
0
x7Eu
).
toByteArray
()
get
()
=
ubyteArrayOf
(
0
xD4u
,
0
x1Du
,
0
x8Cu
,
0
xD9u
,
0
x8Fu
,
0
x00u
,
0
xB2u
,
0
x04u
,
0
xE9u
,
0
x80u
,
0
x09u
,
0
x98u
,
0
xECu
,
0
xF8u
,
0
x42u
,
0
x7Eu
).
toByteArray
()
override
val
imei
:
String
get
()
=
"858414369211993"
override
val
ksid
:
String
get
()
=
"|454001228437590|A8.2.0.27f6ea96"
override
val
ipAddress
:
String
get
()
=
localIpAddress
()
override
val
ipAddress
:
String
get
()
=
localIpAddress
()
override
val
androidId
:
ByteArray
get
()
=
"QSR1.190920.001"
.
toByteArray
()
override
val
androidId
:
ByteArray
get
()
=
"QSR1.190920.001"
.
toByteArray
()
override
val
apn
:
ByteArray
get
()
=
"wifi"
.
toByteArray
()
override
val
apn
:
ByteArray
get
()
=
"wifi"
.
toByteArray
()
...
...
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