mirror of
https://github.com/ReVanced/revanced-patcher.git
synced 2026-01-27 21:21:03 +00:00
chore: assert instead of printing in tests
This commit is contained in:
@@ -39,8 +39,10 @@ sealed class PatchBundleLoader private constructor(
|
||||
*
|
||||
* @param patchBundles The path to patch bundles of JAR format.
|
||||
*/
|
||||
class Jar(vararg patchBundles: File) :
|
||||
PatchBundleLoader(with(URLClassLoader(patchBundles.map { it.toURI().toURL() }.toTypedArray())) {
|
||||
class Jar(vararg patchBundles: File) : PatchBundleLoader(
|
||||
with(
|
||||
URLClassLoader(patchBundles.map { it.toURI().toURL() }.toTypedArray())
|
||||
) {
|
||||
patchBundles.flatMap { patchBundle ->
|
||||
// Get the names of all classes in the DEX file.
|
||||
|
||||
@@ -55,15 +57,17 @@ sealed class PatchBundleLoader private constructor(
|
||||
* A [PatchBundleLoader] for [Dex] files.
|
||||
*
|
||||
* @param patchBundles The path to patch bundles of DEX format.
|
||||
* @param optimizedDexDirectory The directory to store optimized DEX files in.
|
||||
* This parameter is deprecated and has no effect since API level 26.
|
||||
*/
|
||||
class Dex(vararg patchBundles: File) : PatchBundleLoader(with(
|
||||
DexClassLoader(
|
||||
patchBundles.joinToString(File.pathSeparator) { it.absolutePath },
|
||||
null,
|
||||
class Dex(vararg patchBundles: File, optimizedDexDirectory: File? = null) : PatchBundleLoader(
|
||||
with(
|
||||
DexClassLoader(
|
||||
patchBundles.joinToString(File.pathSeparator) { it.absolutePath }, optimizedDexDirectory?.absolutePath,
|
||||
null,
|
||||
PatchBundleLoader::class.java.classLoader
|
||||
)
|
||||
) {
|
||||
)
|
||||
) {
|
||||
patchBundles
|
||||
.flatMap {
|
||||
MultiDexIO.readDexFile(true, it, BasicDexFileNamer(), null, null).classes
|
||||
|
||||
Reference in New Issue
Block a user