diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 9f5fe783..6c93f4c8 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -27,7 +27,12 @@ val hiltVersion = "2.52" val glideVersion = "4.16.0" val ktorVersion = "3.0.0-beta-2" val media3Version = "1.5.0" -val livekitVersion = "2.14.1" + +object LivekitVersion { + val core = "2.14.1" + val componentsCompose = "1.3.1" +} + val material3Version = "1.4.0-alpha10" val androidXTestVersion = "1.6.1" @@ -132,6 +137,12 @@ android { "FLAVOUR_ID", "\"${buildproperty("build.flavour_id", "RVX_BUILD_FLAVOUR_ID")}\"" ) + + buildConfigField( + "boolean", + "USE_ALPHA_API", + "${buildproperty("dev.use_alpha_api", "RVX_DEV_USE_ALPHA_API")}" + ) } } compileOptions { @@ -288,7 +299,8 @@ dependencies { implementation("dev.snipme:highlights:1.0.0") // Livekit - implementation("io.livekit:livekit-android:$livekitVersion") + implementation("io.livekit:livekit-android:${LivekitVersion.core}") + implementation("io.livekit:livekit-android-compose-components:${LivekitVersion.componentsCompose}") // Firebase - Cloud Messaging implementation(platform("com.google.firebase:firebase-bom:33.9.0")) diff --git a/app/src/main/java/chat/revolt/api/RevoltAPI.kt b/app/src/main/java/chat/revolt/api/RevoltAPI.kt index 0e5b66ee..c3937bd5 100644 --- a/app/src/main/java/chat/revolt/api/RevoltAPI.kt +++ b/app/src/main/java/chat/revolt/api/RevoltAPI.kt @@ -53,14 +53,18 @@ import kotlinx.serialization.json.Json import java.net.SocketException import chat.revolt.api.schemas.Channel as ChannelSchema -const val REVOLT_BASE = "https://api.revolt.chat/0.8" +val REVOLT_BASE = + if (BuildConfig.USE_ALPHA_API) "https://alpha.revolt.chat/api" else "https://api.revolt.chat/0.8" const val REVOLT_SUPPORT = "https://support.revolt.chat" const val REVOLT_MARKETING = "https://revolt.chat" -const val REVOLT_FILES = "https://cdn.revoltusercontent.com" -const val REVOLT_JANUARY = "https://jan.revolt.chat" +val REVOLT_FILES = + if (BuildConfig.USE_ALPHA_API) "https://alpha.revolt.chat/autumn" else "https://cdn.revoltusercontent.com" +val REVOLT_JANUARY = + if (BuildConfig.USE_ALPHA_API) "https://alpha.revolt.chat/january" else "https://jan.revolt.chat" const val REVOLT_APP = "https://app.revolt.chat" const val REVOLT_INVITES = "https://rvlt.gg" -const val REVOLT_WEBSOCKET = "wss://ws.revolt.chat" +val REVOLT_WEBSOCKET = + if (BuildConfig.USE_ALPHA_API) "wss://alpha.revolt.chat/ws" else "wss://ws.revolt.chat" const val REVOLT_KJBOOK = "https://revoltchat.github.io/android" fun String.api(): String { diff --git a/revoltbuild.properties.example b/revoltbuild.properties.example index ea6a101c..1ab8b495 100644 --- a/revoltbuild.properties.example +++ b/revoltbuild.properties.example @@ -1,4 +1,5 @@ sentry.dsn= sentry.upload_mappings=true build.debug.app_name= -build.flavour_id=ZZUU \ No newline at end of file +build.flavour_id=ZZUU +dev.use_alpha_api=false \ No newline at end of file