fix: allow setting DexClassLoader.optimizedDirectory

This is required for API level below 26, otherwise an NPE is thrown
This commit is contained in:
oSumAtrIX 2023-08-29 04:09:04 +02:00
parent 1bb05f22d3
commit 11a3378659
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4

View File

@ -16,6 +16,7 @@ import java.util.jar.JarFile
/** /**
* A patch bundle. * A patch bundle.
* *
*
* @param fromClasses The classes to get [Patch]es from. * @param fromClasses The classes to get [Patch]es from.
*/ */
sealed class PatchBundleLoader private constructor( sealed class PatchBundleLoader private constructor(
@ -74,5 +75,8 @@ sealed class PatchBundleLoader private constructor(
} }
.map { classDef -> classDef.type.substring(1, classDef.length - 1) } .map { classDef -> classDef.type.substring(1, classDef.length - 1) }
.map { loadClass(it) } .map { loadClass(it) }
}) }) {
@Deprecated("This constructor is deprecated. Use the constructor with the second parameter instead.")
constructor(vararg patchBundles: File) : this(*patchBundles, optimizedDexDirectory = null)
}
} }