fix: фикс бинарника
This commit is contained in:
1 parent
6a84cb8ca3
commit
39d095ade2
3 files changed
+12
-3
No files matched your search
@@ -181,11 +181,17 @@ class ProxyService : Service() {
|
|||||||
if (!startupEmitted) {
|
if (!startupEmitted) {
|
||||||
ProxyServiceState.setStartupResult(StartupResult.Failed(
|
ProxyServiceState.setStartupResult(StartupResult.Failed(
|
||||||
"Процесс завершился без вывода (код: $exitCode)"))
|
"Процесс завершился без вывода (код: $exitCode)"))
|
||||||
startupFailed = true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (e: Exception) {
|
} 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 {
|
} finally {
|
||||||
process.set(null)
|
process.set(null)
|
||||||
when {
|
when {
|
||||||
|
|||||||
@@ -140,7 +140,10 @@ class LocalProxyManager(private val context: Context) {
|
|||||||
return@withContext "Файл слишком большой (максимум 100 МБ)"
|
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 }
|
withContext(Dispatchers.Main) { _customKernelExists.value = true }
|
||||||
ProxyServiceState.addLog("Кастомное ядро установлено: ${dest.length() / 1024} КБ")
|
ProxyServiceState.addLog("Кастомное ядро установлено: ${dest.length() / 1024} КБ")
|
||||||
null
|
null
|
||||||
|
|||||||
Binary file not shown.
Reference in new issue
Block a user