Skip to content

Commit

Permalink
fix: URL decode path to JAR containing spaces to get JAR manifest (#3079
Browse files Browse the repository at this point in the history
)
  • Loading branch information
oSumAtrIX authored Apr 23, 2024
1 parent 3c46709 commit e1bbcb3
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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.")
Expand Down

0 comments on commit e1bbcb3

Please sign in to comment.