SlimeReadTheme: remove use of incompatible API (#6919)

Call requires API level 26 (current min is 21):
`java.util.regex.Matcher#start` (called from kotlin. text.
`MatchGroupCollection#get(String)`)
This commit is contained in:
Vetle Ledaal 2025-01-03 08:41:23 +01:00 committed by Draff
parent 0615bf338a
commit 61c8073679
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
1 changed files with 2 additions and 2 deletions

View File

@ -56,8 +56,8 @@ abstract class SlimeReadTheme(
if (!scriptResponse.isSuccessful) throw Exception("HTTP error ${scriptResponse.code}")
val script = scriptResponse.body.string()
val apiUrl = FUNCTION_REGEX.find(script)?.let { result ->
val varBlock = result.groups["script"]?.value ?: return@let null
val varUrlInfix = result.groups["infix"]?.value ?: return@let null
val varBlock = result.groupValues[1]
val varUrlInfix = result.groupValues[2]
val block = """${varBlock.replace(varUrlInfix, "\"$urlInfix\"")}.toString()"""