fix: Use UrlDecoder API available in older Android versions
This commit is contained in:
parent
e5967ada0f
commit
d42fbb1521
|
@ -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.ClassDef
|
||||||
import com.android.tools.smali.dexlib2.iface.Method
|
import com.android.tools.smali.dexlib2.iface.Method
|
||||||
import java.net.URLDecoder
|
import java.net.URLDecoder
|
||||||
import java.nio.charset.StandardCharsets
|
|
||||||
import java.util.jar.JarFile
|
import java.util.jar.JarFile
|
||||||
|
|
||||||
abstract class BaseIntegrationsPatch(
|
abstract class BaseIntegrationsPatch(
|
||||||
|
@ -77,7 +76,8 @@ abstract class BaseIntegrationsPatch(
|
||||||
|
|
||||||
if (urlString.startsWith("jar:file:")) {
|
if (urlString.startsWith("jar:file:")) {
|
||||||
val end = urlString.lastIndexOf('!')
|
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.")
|
throw IllegalStateException("Not running from inside a JAR file.")
|
||||||
|
|
Loading…
Reference in a new issue