mirror of
https://github.com/ReVanced/revanced-cli.git
synced 2026-01-11 22:06:20 +00:00
Compare commits
3 Commits
v1.1.0
...
v1.1.0-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aba7965df8 | ||
|
|
351de6cb90 | ||
|
|
52dacc16a0 |
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -4,7 +4,7 @@
|
||||
<component name="FrameworkDetectionExcludesConfiguration">
|
||||
<file type="web" url="file://$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="azul-1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="azul-17" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
10
CHANGELOG.md
10
CHANGELOG.md
@@ -1,15 +1,9 @@
|
||||
# [1.1.0](https://github.com/revanced/revanced-cli/compare/v1.0.1...v1.1.0) (2022-05-07)
|
||||
# [1.1.0-dev.2](https://github.com/revanced/revanced-cli/compare/v1.1.0-dev.1...v1.1.0-dev.2) (2022-05-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* ClassLoader not working with Java 9+ ([3a11e11](https://github.com/revanced/revanced-cli/commit/3a11e1135bd1e8958dd21247622d549440725ead))
|
||||
* leftover TODOs ([5b1139c](https://github.com/revanced/revanced-cli/commit/5b1139ce43df1f5c2c848a8209a9e618857031ce))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* run `release.yml` workflow on branch `dev` ([9a64730](https://github.com/revanced/revanced-cli/commit/9a6473056b940c6df4860dd09c09d7ac61545f7d))
|
||||
* wrong use of dependency to `revanced-patches` ([351de6c](https://github.com/revanced/revanced-cli/commit/351de6cb90aa0f2ec93e8b8f6c10d7d312082079))
|
||||
|
||||
# [1.1.0-dev.1](https://github.com/revanced/revanced-cli/compare/v1.0.1...v1.1.0-dev.1) (2022-05-07)
|
||||
|
||||
|
||||
@@ -22,12 +22,9 @@ repositories {
|
||||
}
|
||||
}
|
||||
|
||||
val patchesDependency = "app.revanced:revanced-patches:1.+"
|
||||
|
||||
dependencies {
|
||||
implementation(kotlin("stdlib"))
|
||||
implementation("app.revanced:revanced-patcher:+")
|
||||
implementation(patchesDependency)
|
||||
implementation("info.picocli:picocli:+")
|
||||
|
||||
implementation("me.tongfei:progressbar:+")
|
||||
@@ -45,9 +42,6 @@ tasks {
|
||||
dependsOn(shadowJar)
|
||||
}
|
||||
shadowJar {
|
||||
dependencies {
|
||||
exclude(dependency(patchesDependency))
|
||||
}
|
||||
manifest {
|
||||
attributes("Main-Class" to "app.revanced.cli.MainKt")
|
||||
attributes("Implementation-Title" to project.name)
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
kotlin.code.style = official
|
||||
version = 1.1.0
|
||||
version = 1.1.0-dev.2
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
package app.revanced.patch
|
||||
|
||||
import java.io.File
|
||||
import java.net.URLClassLoader
|
||||
|
||||
internal class PatchLoader {
|
||||
internal companion object {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -2,25 +2,25 @@ package app.revanced.patch
|
||||
|
||||
import app.revanced.patcher.data.base.Data
|
||||
import app.revanced.patcher.patch.base.Patch
|
||||
import app.revanced.patches.Index
|
||||
import java.io.File
|
||||
import java.net.URLClassLoader
|
||||
|
||||
internal object Patches {
|
||||
|
||||
|
||||
/**
|
||||
* This method loads patches from a given patch file
|
||||
* @return the loaded patches represented as a list of functions returning instances of [Patch]
|
||||
*/
|
||||
internal fun load(patchFile: File): List<() -> Patch<Data>> {
|
||||
val url = patchFile.toURI().toURL()
|
||||
internal fun load(patchesJar: File): List<() -> Patch<Data>> {
|
||||
val url = patchesJar.toURI().toURL()
|
||||
val classLoader = URLClassLoader(arrayOf(url))
|
||||
return loadIndex(classLoader).patches
|
||||
|
||||
val indexClass = classLoader.loadClass("app.revanced.patches.Index")
|
||||
|
||||
val index = indexClass.declaredFields.last()
|
||||
index.isAccessible = true
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
return index.get(null) as List<() -> Patch<Data>>
|
||||
}
|
||||
private fun loadIndex(classLoader: ClassLoader) = classLoader
|
||||
.loadClass(Index::class.java.canonicalName)
|
||||
.fields
|
||||
.first()
|
||||
.get(null) as Index
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user