1
mirror of https://github.com/revanced/revanced-cli synced 2025-11-21 20:36:43 +01:00

Compare commits

..

7 Commits

Author SHA1 Message Date
semantic-release-bot
f90205b243 chore(release): 1.1.0-dev.3 [skip ci]
# [1.1.0-dev.3](https://github.com/revanced/revanced-cli/compare/v1.1.0-dev.2...v1.1.0-dev.3) (2022-05-15)

### Bug Fixes

* wrong use of variable substitution / typo ([81d53b5](81d53b5518)), closes [revanced/revanced-cli#12](https://github.com/revanced/revanced-cli/issues/12)
2022-05-15 20:11:14 +00:00
oSumAtrIX
159a169c16 Merge pull request #13 from AzimsTech/dev
fix: wrong use of variable substitution / typo
2022-05-15 22:09:27 +02:00
Wan Muhammad Azims
81d53b5518 fix: wrong use of variable substitution / typo
[revanced/revanced-cli#12](https://github.com/revanced/revanced-cli/issues/12)
2022-05-16 03:45:20 +08:00
semantic-release-bot
aba7965df8 chore(release): 1.1.0-dev.2 [skip ci]
# [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

* wrong use of dependency to `revanced-patches` ([351de6c](351de6cb90))
2022-05-07 21:16:55 +00:00
oSumAtrIX
351de6cb90 fix: wrong use of dependency to revanced-patches
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-05-07 23:15:31 +02:00
oSumAtrIX
52dacc16a0 chore: bump project JDK to JDK 17
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-05-07 21:37:24 +02:00
oSumAtrIX
4fe620e84b chore: bump java-version for action setup-java
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-05-07 21:21:44 +02:00
8 changed files with 29 additions and 31 deletions

View File

@@ -20,7 +20,7 @@ jobs:
- name: Setup JDK
uses: actions/setup-java@v2
with:
java-version: '8'
java-version: '17'
distribution: 'adopt'
cache: gradle
- name: Setup Node.js

2
.idea/misc.xml generated
View File

@@ -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>

View File

@@ -1,3 +1,17 @@
# [1.1.0-dev.3](https://github.com/revanced/revanced-cli/compare/v1.1.0-dev.2...v1.1.0-dev.3) (2022-05-15)
### Bug Fixes
* wrong use of variable substitution / typo ([81d53b5](https://github.com/revanced/revanced-cli/commit/81d53b5518454e479b7a8f2e9be934bee30702af)), closes [revanced/revanced-cli#12](https://github.com/revanced/revanced-cli/issues/12)
# [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
* 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)

View File

@@ -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)

View File

@@ -1,2 +1,2 @@
kotlin.code.style = official
version = 1.1.0-dev.1
version = 1.1.0-dev.3

View File

@@ -1,10 +0,0 @@
package app.revanced.patch
import java.io.File
import java.net.URLClassLoader
internal class PatchLoader {
internal companion object {
}
}

View File

@@ -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
}

View File

@@ -42,7 +42,7 @@ internal object Constants {
"""
#!/system/bin/sh
stock_path=${'$'}{ pm path $PLACEHOLDER | grep base | sed 's/package://g' }
stock_path=${'$'}( pm path $PLACEHOLDER | grep base | sed 's/package://g' )
umount -l ${'$'}stock_path
""".trimIndent()
@@ -53,7 +53,7 @@ internal object Constants {
while [ "${'$'}(getprop sys.boot_completed | tr -d '\r')" != "1" ]; do sleep 1; done
base_path="$PATH_REVANCED_APP"
stock_path=${'$'}{ pm path $PLACEHOLDER | grep base | sed 's/package://g' }
stock_path=${'$'}( pm path $PLACEHOLDER | grep base | sed 's/package://g' )
mount -o bind ${'$'}base_path ${'$'}stock_path
""".trimIndent()
}