bugfix: fixing regex special chars break it

Special chars breaks regex
Regex is differently between jvm and android
Credit for bugfix @Lag bug found @int3debug
This commit is contained in:
int3debug 2024-04-17 18:26:47 +02:00
parent 6df3ef14f6
commit 0c9df7602a

View file

@ -1,6 +1,6 @@
package com.lagradost.cloudstream3.utils
import com.lagradost.cloudstream3.mvvm.logError
import com.lagradost.safefile.logError
import java.util.regex.Pattern
import kotlin.math.pow
@ -50,7 +50,7 @@ class JsUnpacker(packedJS: String?) {
throw Exception("Unknown p.a.c.k.e.r. encoding")
}
val unbase = Unbase(radix)
p = Pattern.compile("\\b\\w+\\b")
p = Pattern.compile("""\b[a-zA-Z0-9_]+\b""")
m = p.matcher(payload)
val decoded = StringBuilder(payload)
var replaceOffset = 0