diff --git a/common/src/main/kotlin/me/eternal/purrfectsnap/common/config/impl/UserInterfaceTweaks.kt b/common/src/main/kotlin/me/eternal/purrfectsnap/common/config/impl/UserInterfaceTweaks.kt index f04362e6..c1ebc510 100644 --- a/common/src/main/kotlin/me/eternal/purrfectsnap/common/config/impl/UserInterfaceTweaks.kt +++ b/common/src/main/kotlin/me/eternal/purrfectsnap/common/config/impl/UserInterfaceTweaks.kt @@ -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() } } } diff --git a/core/src/main/kotlin/me/eternal/purrfectsnap/core/features/impl/ui/FakeSnapScore.kt b/core/src/main/kotlin/me/eternal/purrfectsnap/core/features/impl/ui/FakeSnapScore.kt index 83400897..c679ec21 100644 --- a/core/src/main/kotlin/me/eternal/purrfectsnap/core/features/impl/ui/FakeSnapScore.kt +++ b/core/src/main/kotlin/me/eternal/purrfectsnap/core/features/impl/ui/FakeSnapScore.kt @@ -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) } } }