2023-08-07 05:00:41 +03:00

880 B

💉 Introduction to ReVanced Patcher

Familiarize yourself with ReVanced Patcher.

📙 How it works

// Prepare patches to apply and files to merge

val patches = PatchBundle.Jar("revanced-patches.jar").loadPatches()
val mergeList = listOf("integrations.apk")

// Create the options for the patcher

val options = PatcherOptions(
     inputFile = File("some.apk"),
     resourceCacheDirectory = File("cache"),
)

// Create the patcher and add the prepared patches and files

val patcher = Patcher(options)
    .also { it.addPatches(patches) }
    .also { it.addFiles(mergeList) }

// Execute and save the patched files

patcher.executePatches().forEach { (patch, result) ->
    val log = if (!result.isSuccess)
        "failed"
    else
        "succeeded"
    println("$patch $log")
}

val result = patcher.save()