Skip to content

Commit

Permalink
SlimeReadTheme: remove use of incompatible API (#6919)
Browse files Browse the repository at this point in the history
Call requires API level 26 (current min is 21):
`java.util.regex.Matcher#start` (called from kotlin. text.
`MatchGroupCollection#get(String)`)
  • Loading branch information
vetleledaal authored Jan 3, 2025
1 parent 7a1853a commit 15da3f5
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()"""

Expand Down

0 comments on commit 15da3f5

Please sign in to comment.