fix: Use UrlDecoder API available in older Android versions

This commit is contained in:
oSumAtrIX 2024-05-21 03:36:32 +02:00
parent e5967ada0f
commit d42fbb1521
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4

View File

@ -14,7 +14,6 @@ import com.android.tools.smali.dexlib2.Opcode
import com.android.tools.smali.dexlib2.iface.ClassDef
import com.android.tools.smali.dexlib2.iface.Method
import java.net.URLDecoder
import java.nio.charset.StandardCharsets
import java.util.jar.JarFile
abstract class BaseIntegrationsPatch(
@ -77,7 +76,8 @@ abstract class BaseIntegrationsPatch(
if (urlString.startsWith("jar:file:")) {
val end = urlString.lastIndexOf('!')
return URLDecoder.decode(urlString.substring("jar:file:".length, end), StandardCharsets.UTF_8)
return URLDecoder.decode(urlString.substring("jar:file:".length, end), "UTF-8")
}
}
throw IllegalStateException("Not running from inside a JAR file.")