Skip to content

Commit

Permalink
Merge pull request #233 from taku-nm/patch-1
Browse files Browse the repository at this point in the history
fix: URL decode path to JAR containing spaces by osumatrix
  • Loading branch information
crimera authored May 22, 2024
2 parents e8ee0b0 + d9e6374 commit f7d837e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import com.android.tools.smali.dexlib2.Opcode
import com.android.tools.smali.dexlib2.iface.ClassDef
import com.android.tools.smali.dexlib2.iface.Method
import crimera.patches.twitter.misc.integrations.fingerprints.ReVancedUtilsPatchesVersionFingerprint
import java.net.URLDecoder
import java.util.jar.JarFile

abstract class BaseIntegrationsPatch(
Expand Down Expand Up @@ -69,7 +70,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), "UTF-8")
}
}
throw IllegalStateException("Not running from inside a JAR file.")
Expand Down Expand Up @@ -120,4 +121,4 @@ abstract class BaseIntegrationsPatch(
internal companion object {
internal const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/shared/Utils;"
}
}
}

0 comments on commit f7d837e

Please sign in to comment.