fix: URL decode path to JAR containing spaces to get JAR manifest (#3079)

This commit is contained in:
oSumAtrIX 2024-04-23 19:56:58 +02:00 committed by GitHub
parent 3c46709ead
commit e1bbcb338d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -12,6 +12,8 @@ import app.revanced.util.resultOrThrow
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(
@ -74,7 +76,7 @@ abstract class BaseIntegrationsPatch(
if (urlString.startsWith("jar:file:")) {
val end = urlString.indexOf('!')
return urlString.substring("jar:file:".length, end)
return URLDecoder.decode(urlString.substring("jar:file:".length, end), StandardCharsets.UTF_8)
}
}
throw IllegalStateException("Not running from inside a JAR file.")