Skip to content

Commit

Permalink
fix name (#16805)
Browse files Browse the repository at this point in the history
fix key name
  • Loading branch information
AwkwardPeak7 authored Jun 21, 2023
1 parent 06da29a commit 047a047
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/en/reaperscans/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ext {
extName = 'Reaper Scans'
pkgNameSuffix = 'en.reaperscans'
extClass = '.ReaperScans'
extVersionCode = 44
extVersionCode = 45
}

apply from: "$rootDir/common.gradle"
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import kotlinx.serialization.json.add
import kotlinx.serialization.json.addJsonObject
import kotlinx.serialization.json.buildJsonObject
import kotlinx.serialization.json.contentOrNull
import kotlinx.serialization.json.jsonObject
import kotlinx.serialization.json.jsonPrimitive
import kotlinx.serialization.json.put
import kotlinx.serialization.json.putJsonArray
Expand Down Expand Up @@ -289,6 +290,9 @@ class ReaperScans : ParsedHttpSource() {
val routeName = livewareData.fingerprint["name"]?.jsonPrimitive?.contentOrNull
?: error("Couldn't find routeName")

val tunstileName = livewareData.serverMemo["data"]?.jsonObject?.keys?.firstOrNull { it != "chapter" }
?: error("Couldn't fine Tunstile Name")

// Javascript: (Math.random() + 1).toString(36).substring(8)
val generateId = { "1.${Random.nextLong().toString(36)}".substring(10) } // Not exactly the same, but results in a 3-5 character string
val payload = buildJsonObject {
Expand All @@ -301,7 +305,7 @@ class ReaperScans : ParsedHttpSource() {
put("id", generateId())
put("method", "${"$"}set")
putJsonArray("params") {
add("turnstile")
add(tunstileName)
add(randomString())
}
}
Expand Down

0 comments on commit 047a047

Please sign in to comment.