generated from ReVanced/revanced-patches-template
-
-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This reverts commit ed24a20.
- Loading branch information
Showing
496 changed files
with
2,429 additions
and
2,555 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,22 @@ | ||
package app.revanced.meta | ||
|
||
import app.revanced.patcher.data.Context | ||
import app.revanced.patcher.patch.Patch | ||
import app.revanced.patcher.util.patch.PatchBundle | ||
import app.revanced.patcher.PatchBundleLoader | ||
import app.revanced.patcher.patch.PatchClass | ||
import java.io.File | ||
|
||
internal typealias PatchBundlePatches = List<Class<out Patch<Context>>> | ||
internal typealias PatchBundlePatches = List<PatchClass> | ||
|
||
internal interface PatchesFileGenerator { | ||
fun generate(bundle: PatchBundlePatches) | ||
|
||
private companion object { | ||
@JvmStatic | ||
fun main(args: Array<String>) = PatchBundle.Jar( | ||
File("build/libs/").listFiles()!!.first { | ||
it.name.startsWith("revanced-patches-") && it.name.endsWith(".jar") | ||
}.absolutePath | ||
).loadPatches().also { | ||
if (it.isEmpty()) throw IllegalStateException("No patches found") | ||
fun main(args: Array<String>) = PatchBundleLoader.Jar( | ||
File("build/libs/").listFiles { it -> it.name.endsWith(".jar") }!!.first() | ||
).also { loader -> | ||
if (loader.isEmpty()) throw IllegalStateException("No patches found") | ||
}.let { bundle -> | ||
arrayOf(JsonGenerator()).forEach { it.generate(bundle) } | ||
arrayOf(JsonGenerator()).forEach { generator -> generator.generate(bundle) } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.