fix: фикс бинарника

This commit is contained in:
samosvalishe committed 2026-04-06 18:07:40 +03:00
1 parent 6a84cb8ca3
commit 39d095ade2
3 files changed
+12 -3

No files matched your search

@@ -181,11 +181,17 @@ class ProxyService : Service() {
if (!startupEmitted) {
ProxyServiceState.setStartupResult(StartupResult.Failed(
"Процесс завершился без вывода (код: $exitCode)"))
startupFailed = true
}
} catch (e: Exception) {
ProxyServiceState.addLog("КРИТИЧЕСКАЯ ОШИБКА: ${e.message}")
val msg = e.message ?: ""
if (msg.contains("error=13") || msg.contains("Permission denied")) {
ProxyServiceState.addLog("КРИТИЧЕСКАЯ ОШИБКА: Отказано в запуске ядра — ваше устройство блокирует выполнение файлов из внутреннего хранилища (SELinux/noexec). Используйте встроенное ядро.")
ProxyServiceState.setStartupResult(StartupResult.Failed(msg))
startupFailed = true
} else {
ProxyServiceState.addLog("КРИТИЧЕСКАЯ ОШИБКА: ${e.message}")
}
} finally {
process.set(null)
when {
@@ -140,7 +140,10 @@ class LocalProxyManager(private val context: Context) {
return@withContext "Файл слишком большой (максимум 100 МБ)"
}
dest.setExecutable(true)
dest.setExecutable(true, false)
try {
Runtime.getRuntime().exec(arrayOf("chmod", "755", dest.absolutePath)).waitFor()
} catch (_: Exception) {}
withContext(Dispatchers.Main) { _customKernelExists.value = true }
ProxyServiceState.addLog("Кастомное ядро установлено: ${dest.length() / 1024} КБ")
null
Binary file not shown.