This commit is contained in:
RSR/
2026-03-12 02:12:09 +04:00
parent 6948d86efc
commit 50199b052f
2 changed files with 7 additions and 14 deletions

View File

@@ -69,8 +69,7 @@ class UserInterfaceTweaks : ConfigContainer() {
inputCheck = { input ->
if (input.isEmpty()) true
else {
val digits = input.replace(Regex("[^0-9]"), "")
digits.isNotEmpty() && digits.length <= 7 && digits.toLong() <= 9999999L
input.replace(Regex("[^0-9]"), "").isNotEmpty()
}
}
}

View File

@@ -11,17 +11,8 @@ class FakeSnapScore : Feature("Fake Snap Score") {
val customScoreRaw = context.config.userInterface.spoofSnapScore.customSnapScore.getNullable()?.trim()?.takeIf { it.isNotBlank() }
?: return
val customScore = try {
val digitsOnly = customScoreRaw.replace(Regex("[^0-9]"), "")
if (digitsOnly.isNotEmpty()) {
val clampedVal = digitsOnly.toLong().coerceAtMost(9999999L)
java.text.NumberFormat.getNumberInstance(java.util.Locale.US).format(clampedVal)
} else {
null
}
} catch (e: Exception) {
null
} ?: return
val customScore = customScoreRaw.replace(Regex("[^0-9]"), "")
if (customScore.isEmpty()) return
onNextActivityCreate {
android.widget.TextView::class.java.hook("setText", HookStage.BEFORE) { param ->
@@ -31,7 +22,8 @@ class FakeSnapScore : Feature("Fake Snap Score") {
val digits = text.replace(Regex("[^0-9]"), "")
if (digits.length >= 4 || text.contains(",")) {
var parent = (param.thisObject() as android.widget.TextView).parent
val textView = param.thisObject() as android.widget.TextView
var parent = textView.parent
var isProfile = false
while (parent != null) {
@@ -45,6 +37,8 @@ class FakeSnapScore : Feature("Fake Snap Score") {
if (isProfile) {
param.setArg(0, customScore)
textView.ellipsize = null
textView.setSingleLine(false)
}
}
}