Skip to content

Commit

Permalink
fix: Use UrlDecoder API available in older Android versions
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed May 21, 2024
1 parent e5967ad commit d42fbb1
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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.")
Expand Down

0 comments on commit d42fbb1

Please sign in to comment.