From e1bbcb338dd7fce895b606440bd6f040d5486a64 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Tue, 23 Apr 2024 19:56:58 +0200 Subject: [PATCH] fix: URL decode path to JAR containing spaces to get JAR manifest (#3079) --- .../patches/shared/misc/integrations/BaseIntegrationsPatch.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/app/revanced/patches/shared/misc/integrations/BaseIntegrationsPatch.kt b/src/main/kotlin/app/revanced/patches/shared/misc/integrations/BaseIntegrationsPatch.kt index 7c461f6ee9..226b46e4d0 100644 --- a/src/main/kotlin/app/revanced/patches/shared/misc/integrations/BaseIntegrationsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/shared/misc/integrations/BaseIntegrationsPatch.kt @@ -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.")