feat(app): апдейтер только в sideload; API/BASE_URL на https

This commit is contained in:
nk
2026-06-08 14:03:21 +03:00
parent 34bd6ab02e
commit 8dc0d46c40
3 changed files with 4 additions and 2 deletions

View File

@@ -117,6 +117,8 @@ class MainActivity : ComponentActivity() {
var downloadedApk by remember { mutableStateOf<java.io.File?>(null) } var downloadedApk by remember { mutableStateOf<java.io.File?>(null) }
val updateScope = rememberCoroutineScope() val updateScope = rememberCoroutineScope()
LaunchedEffect(Unit) { LaunchedEffect(Unit) {
// Авто-обновление только в sideload-сборке (в store обновляет RuStore).
if (!BuildConfig.ENABLE_SELF_UPDATE) return@LaunchedEffect
val info = com.radiola.update.UpdateManager.checkUpdate() ?: return@LaunchedEffect val info = com.radiola.update.UpdateManager.checkUpdate() ?: return@LaunchedEffect
if (info.versionCode > BuildConfig.VERSION_CODE) pendingUpdate = info if (info.versionCode > BuildConfig.VERSION_CODE) pendingUpdate = info
} }

View File

@@ -123,7 +123,7 @@ object AppModule {
@Named("radiolaClient") okHttpClient: OkHttpClient, @Named("radiolaClient") okHttpClient: OkHttpClient,
json: Json json: Json
): Retrofit = Retrofit.Builder() ): Retrofit = Retrofit.Builder()
.baseUrl("http://121.127.37.212:3000/") .baseUrl("https://api.radiola.nexaweb.su/")
.client(okHttpClient) .client(okHttpClient)
.addConverterFactory(json.asConverterFactory("application/json".toMediaType())) .addConverterFactory(json.asConverterFactory("application/json".toMediaType()))
.build() .build()

View File

@@ -32,7 +32,7 @@ data class VersionInfo(
*/ */
object UpdateManager { object UpdateManager {
private const val TAG = "radiOLA/Update" private const val TAG = "radiOLA/Update"
private const val BASE_URL = "http://121.127.37.212:3000" private const val BASE_URL = "https://api.radiola.nexaweb.su"
private val client = OkHttpClient.Builder() private val client = OkHttpClient.Builder()
.connectTimeout(10, TimeUnit.SECONDS) .connectTimeout(10, TimeUnit.SECONDS)