mirror of
https://github.com/ReVanced/revanced-api.git
synced 2026-01-17 16:33:57 +00:00
Compare commits
6 Commits
v1.1.0-dev
...
v1.2.0-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d7b4e7b7f | ||
|
|
4e8e83db1a | ||
|
|
e113daa089 | ||
|
|
170edd3157 | ||
|
|
d18e09cba3 | ||
|
|
bc919b85f5 |
20
CHANGELOG.md
20
CHANGELOG.md
@@ -1,3 +1,23 @@
|
|||||||
|
# [1.2.0-dev.1](https://github.com/ReVanced/revanced-api/compare/v1.1.0...v1.2.0-dev.1) (2024-08-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Move /latest routes to parent ([4e8e83d](https://github.com/ReVanced/revanced-api/commit/4e8e83db1a20c76a81967af4e7e3a8634649790a))
|
||||||
|
|
||||||
|
# [1.1.0](https://github.com/ReVanced/revanced-api/compare/v1.0.0...v1.1.0) (2024-07-15)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Don't encode public keys & instead send them raw ([435beae](https://github.com/ReVanced/revanced-api/commit/435beae3831fc8ce161aec676ff20f253b1caf66))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Add static file paths to remove env specific files in resources ([39d0b78](https://github.com/ReVanced/revanced-api/commit/39d0b78c7919f684439b6f052ab3f064159c2a70))
|
||||||
|
* Convert static about file to documented route & add key parameter to about route ([dfe6df3](https://github.com/ReVanced/revanced-api/commit/dfe6df3ef6006d06681673bcfaf87c44c40ad446))
|
||||||
|
|
||||||
# [1.1.0-dev.1](https://github.com/ReVanced/revanced-api/compare/v1.0.0...v1.1.0-dev.1) (2024-07-15)
|
# [1.1.0-dev.1](https://github.com/ReVanced/revanced-api/compare/v1.0.0...v1.1.0-dev.1) (2024-07-15)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
org.gradle.parallel = true
|
org.gradle.parallel = true
|
||||||
org.gradle.caching = true
|
org.gradle.caching = true
|
||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
version = 1.1.0-dev.1
|
version = 1.2.0-dev.1
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ ktor = "2.3.7"
|
|||||||
ktoml = "0.5.2"
|
ktoml = "0.5.2"
|
||||||
picocli = "4.7.6"
|
picocli = "4.7.6"
|
||||||
datetime = "0.6.0"
|
datetime = "0.6.0"
|
||||||
revanced-patcher = "19.3.1"
|
revanced-patcher = "20.0.0"
|
||||||
revanced-library = "2.3.0"
|
revanced-library = "3.0.1-dev.1"
|
||||||
caffeine = "3.1.8"
|
caffeine = "3.1.8"
|
||||||
bouncy-castle = "1.78.1"
|
bouncy-castle = "1.78.1"
|
||||||
|
|
||||||
|
|||||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,7 +1,7 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionSha256Sum=a4b4158601f8636cdeeab09bd76afb640030bb5b144aafe261a5e8af027dc612
|
distributionSha256Sum=d725d707bfabd4dfdc958c624003b3c80accc03f7037b5122c4b1d0ef15cecab
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
5
gradlew
vendored
5
gradlew
vendored
@@ -15,6 +15,8 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
@@ -84,7 +86,8 @@ done
|
|||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
||||||
|
' "$PWD" ) || exit
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD=maximum
|
MAX_FD=maximum
|
||||||
|
|||||||
2
gradlew.bat
vendored
2
gradlew.bat
vendored
@@ -13,6 +13,8 @@
|
|||||||
@rem See the License for the specific language governing permissions and
|
@rem See the License for the specific language governing permissions and
|
||||||
@rem limitations under the License.
|
@rem limitations under the License.
|
||||||
@rem
|
@rem
|
||||||
|
@rem SPDX-License-Identifier: Apache-2.0
|
||||||
|
@rem
|
||||||
|
|
||||||
@if "%DEBUG%"=="" @echo off
|
@if "%DEBUG%"=="" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
|
|||||||
@@ -16,31 +16,29 @@ import org.koin.ktor.ext.get as koinGet
|
|||||||
internal fun Route.managerRoute() = route("manager") {
|
internal fun Route.managerRoute() = route("manager") {
|
||||||
val managerService = koinGet<ManagerService>()
|
val managerService = koinGet<ManagerService>()
|
||||||
|
|
||||||
route("latest") {
|
installManagerRouteDocumentation()
|
||||||
installLatestManagerRouteDocumentation()
|
|
||||||
|
rateLimit(RateLimitName("weak")) {
|
||||||
|
get {
|
||||||
|
call.respond(managerService.latestRelease())
|
||||||
|
}
|
||||||
|
|
||||||
|
route("version") {
|
||||||
|
installManagerVersionRouteDocumentation()
|
||||||
|
|
||||||
rateLimit(RateLimitName("weak")) {
|
|
||||||
get {
|
get {
|
||||||
call.respond(managerService.latestRelease())
|
call.respond(managerService.latestVersion())
|
||||||
}
|
|
||||||
|
|
||||||
route("version") {
|
|
||||||
installLatestManagerVersionRouteDocumentation()
|
|
||||||
|
|
||||||
get {
|
|
||||||
call.respond(managerService.latestVersion())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun Route.installLatestManagerRouteDocumentation() = installNotarizedRoute {
|
private fun Route.installManagerRouteDocumentation() = installNotarizedRoute {
|
||||||
tags = setOf("Manager")
|
tags = setOf("Manager")
|
||||||
|
|
||||||
get = GetInfo.builder {
|
get = GetInfo.builder {
|
||||||
description("Get the latest manager release")
|
description("Get the current manager release")
|
||||||
summary("Get latest manager release")
|
summary("Get current manager release")
|
||||||
response {
|
response {
|
||||||
description("The latest manager release")
|
description("The latest manager release")
|
||||||
mediaTypes("application/json")
|
mediaTypes("application/json")
|
||||||
@@ -50,14 +48,14 @@ private fun Route.installLatestManagerRouteDocumentation() = installNotarizedRou
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun Route.installLatestManagerVersionRouteDocumentation() = installNotarizedRoute {
|
private fun Route.installManagerVersionRouteDocumentation() = installNotarizedRoute {
|
||||||
tags = setOf("Manager")
|
tags = setOf("Manager")
|
||||||
|
|
||||||
get = GetInfo.builder {
|
get = GetInfo.builder {
|
||||||
description("Get the latest manager release version")
|
description("Get the current manager release version")
|
||||||
summary("Get latest manager release version")
|
summary("Get current manager release version")
|
||||||
response {
|
response {
|
||||||
description("The latest manager release version")
|
description("The current manager release version")
|
||||||
mediaTypes("application/json")
|
mediaTypes("application/json")
|
||||||
responseCode(HttpStatusCode.OK)
|
responseCode(HttpStatusCode.OK)
|
||||||
responseType<APIReleaseVersion>()
|
responseType<APIReleaseVersion>()
|
||||||
|
|||||||
@@ -19,30 +19,28 @@ import org.koin.ktor.ext.get as koinGet
|
|||||||
internal fun Route.patchesRoute() = route("patches") {
|
internal fun Route.patchesRoute() = route("patches") {
|
||||||
val patchesService = koinGet<PatchesService>()
|
val patchesService = koinGet<PatchesService>()
|
||||||
|
|
||||||
route("latest") {
|
installPatchesRouteDocumentation()
|
||||||
installLatestPatchesRouteDocumentation()
|
|
||||||
|
|
||||||
rateLimit(RateLimitName("weak")) {
|
rateLimit(RateLimitName("weak")) {
|
||||||
get {
|
get {
|
||||||
call.respond(patchesService.latestRelease())
|
call.respond(patchesService.latestRelease())
|
||||||
}
|
|
||||||
|
|
||||||
route("version") {
|
|
||||||
installLatestPatchesVersionRouteDocumentation()
|
|
||||||
|
|
||||||
get {
|
|
||||||
call.respond(patchesService.latestVersion())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rateLimit(RateLimitName("strong")) {
|
route("version") {
|
||||||
route("list") {
|
installPatchesVersionRouteDocumentation()
|
||||||
installLatestPatchesListRouteDocumentation()
|
|
||||||
|
|
||||||
get {
|
get {
|
||||||
call.respondBytes(ContentType.Application.Json) { patchesService.list() }
|
call.respond(patchesService.latestVersion())
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
rateLimit(RateLimitName("strong")) {
|
||||||
|
route("list") {
|
||||||
|
installPatchesListRouteDocumentation()
|
||||||
|
|
||||||
|
get {
|
||||||
|
call.respondBytes(ContentType.Application.Json) { patchesService.list() }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -60,14 +58,14 @@ internal fun Route.patchesRoute() = route("patches") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun Route.installLatestPatchesRouteDocumentation() = installNotarizedRoute {
|
private fun Route.installPatchesRouteDocumentation() = installNotarizedRoute {
|
||||||
tags = setOf("Patches")
|
tags = setOf("Patches")
|
||||||
|
|
||||||
get = GetInfo.builder {
|
get = GetInfo.builder {
|
||||||
description("Get the latest patches release")
|
description("Get the current patches release")
|
||||||
summary("Get latest patches release")
|
summary("Get current patches release")
|
||||||
response {
|
response {
|
||||||
description("The latest patches release")
|
description("The current patches release")
|
||||||
mediaTypes("application/json")
|
mediaTypes("application/json")
|
||||||
responseCode(HttpStatusCode.OK)
|
responseCode(HttpStatusCode.OK)
|
||||||
responseType<APIRelease<APIPatchesAsset>>()
|
responseType<APIRelease<APIPatchesAsset>>()
|
||||||
@@ -75,14 +73,14 @@ private fun Route.installLatestPatchesRouteDocumentation() = installNotarizedRou
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun Route.installLatestPatchesVersionRouteDocumentation() = installNotarizedRoute {
|
private fun Route.installPatchesVersionRouteDocumentation() = installNotarizedRoute {
|
||||||
tags = setOf("Patches")
|
tags = setOf("Patches")
|
||||||
|
|
||||||
get = GetInfo.builder {
|
get = GetInfo.builder {
|
||||||
description("Get the latest patches release version")
|
description("Get the current patches release version")
|
||||||
summary("Get latest patches release version")
|
summary("Get current patches release version")
|
||||||
response {
|
response {
|
||||||
description("The latest patches release version")
|
description("The current patches release version")
|
||||||
mediaTypes("application/json")
|
mediaTypes("application/json")
|
||||||
responseCode(HttpStatusCode.OK)
|
responseCode(HttpStatusCode.OK)
|
||||||
responseType<APIReleaseVersion>()
|
responseType<APIReleaseVersion>()
|
||||||
@@ -90,12 +88,12 @@ private fun Route.installLatestPatchesVersionRouteDocumentation() = installNotar
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun Route.installLatestPatchesListRouteDocumentation() = installNotarizedRoute {
|
private fun Route.installPatchesListRouteDocumentation() = installNotarizedRoute {
|
||||||
tags = setOf("Patches")
|
tags = setOf("Patches")
|
||||||
|
|
||||||
get = GetInfo.builder {
|
get = GetInfo.builder {
|
||||||
description("Get the list of patches from the latest patches release")
|
description("Get the list of patches from the current patches release")
|
||||||
summary("Get list of patches from latest patches release")
|
summary("Get list of patches from current patches release")
|
||||||
response {
|
response {
|
||||||
description("The list of patches")
|
description("The list of patches")
|
||||||
mediaTypes("application/json")
|
mediaTypes("application/json")
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import app.revanced.api.configuration.repository.BackendRepository
|
|||||||
import app.revanced.api.configuration.repository.BackendRepository.BackendOrganization.BackendRepository.BackendRelease.Companion.first
|
import app.revanced.api.configuration.repository.BackendRepository.BackendOrganization.BackendRepository.BackendRelease.Companion.first
|
||||||
import app.revanced.api.configuration.repository.ConfigurationRepository
|
import app.revanced.api.configuration.repository.ConfigurationRepository
|
||||||
import app.revanced.api.configuration.schema.*
|
import app.revanced.api.configuration.schema.*
|
||||||
import app.revanced.library.PatchUtils
|
import app.revanced.library.serializeTo
|
||||||
import app.revanced.patcher.PatchBundleLoader
|
import app.revanced.patcher.patch.loadPatchesFromJar
|
||||||
import com.github.benmanes.caffeine.cache.Caffeine
|
import com.github.benmanes.caffeine.cache.Caffeine
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
@@ -94,7 +94,7 @@ internal class PatchesService(
|
|||||||
configurationRepository.patches.publicKeyId,
|
configurationRepository.patches.publicKeyId,
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
PatchBundleLoader.Jar(patchesFile)
|
loadPatchesFromJar(setOf(patchesFile))
|
||||||
} else {
|
} else {
|
||||||
// Use an empty set of patches if the signature is invalid.
|
// Use an empty set of patches if the signature is invalid.
|
||||||
emptySet()
|
emptySet()
|
||||||
@@ -103,7 +103,7 @@ internal class PatchesService(
|
|||||||
patchesFile.delete()
|
patchesFile.delete()
|
||||||
|
|
||||||
ByteArrayOutputStream().use { stream ->
|
ByteArrayOutputStream().use { stream ->
|
||||||
PatchUtils.Json.serialize(patches, outputStream = stream)
|
patches.serializeTo(outputStream = stream)
|
||||||
|
|
||||||
stream.toByteArray()
|
stream.toByteArray()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user