Skip to content

Commit f4b65f5

Browse files
committed
fix: Use PathClassLoader to fix not being able to load patches on Android 8 or below
1 parent c6cc64d commit f4b65f5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

patcher/src/androidMain/kotlin/app/revanced/patcher/patch/Patch.android.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package app.revanced.patcher.patch
22

3-
import dalvik.system.DexClassLoader
3+
import dalvik.system.PathClassLoader
44
import lanchon.multidexlib2.BasicDexFileNamer
55
import lanchon.multidexlib2.MultiDexIO
66
import java.io.File
@@ -32,10 +32,8 @@ actual fun loadPatches(
3232
classDef.type.substring(1, classDef.length - 1)
3333
}
3434
},
35-
DexClassLoader(
35+
PathClassLoader(
3636
patchesFiles.joinToString(File.pathSeparator) { it.absolutePath },
37-
null,
38-
null,
3937
currentClassLoader,
4038
),
4139
onFailedToLoad,

0 commit comments

Comments
 (0)