Skip to content

Commit

Permalink
fix: allow setting DexClassLoader.optimizedDirectory
Browse files Browse the repository at this point in the history
This is required for API level below 26, otherwise an NPE is thrown
  • Loading branch information
oSumAtrIX committed Aug 29, 2023
1 parent 1bb05f2 commit 11a3378
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/kotlin/app/revanced/patcher/PatchBundleLoader.kt
Expand Up @@ -16,6 +16,7 @@ import java.util.jar.JarFile
/**
* A patch bundle.
*
*
* @param fromClasses The classes to get [Patch]es from.
*/
sealed class PatchBundleLoader private constructor(
Expand Down Expand Up @@ -74,5 +75,8 @@ sealed class PatchBundleLoader private constructor(
}
.map { classDef -> classDef.type.substring(1, classDef.length - 1) }
.map { loadClass(it) }
})
}) {
@Deprecated("This constructor is deprecated. Use the constructor with the second parameter instead.")
constructor(vararg patchBundles: File) : this(*patchBundles, optimizedDexDirectory = null)
}
}

0 comments on commit 11a3378

Please sign in to comment.