mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-04 19:10:47 -05:00
app: unify image patching and support USB output
Merge "Select and patch a file" and "Download and patch a file" into a single "Patch firmware / image" flow that lets users choose between an app-provided firmware suggestion, a local file, or an HTTPS URL. On Googlebooks, allow streaming the patched recovery GPT image directly to a connected USB flash drive via Android's USB Host Bulk-Only Transport and SCSI block commands in UsbBlockDevice, avoiding writing the multi-gigabyte image to internal storage or needing another PC. Assisted-by: Gemini 4 Argon
This commit is contained in:
@@ -155,6 +155,7 @@ class MainActivity : ComponentActivity(), SplashScreenHost {
|
||||
if (vm.flashAction.isEmpty()) {
|
||||
vm.flashAction = key.action
|
||||
vm.flashUri = key.additionalData?.toUri()
|
||||
vm.usbDevice = key.usbDevice
|
||||
vm.startFlashing()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ class FlashViewModel : BaseViewModel() {
|
||||
|
||||
var flashAction: String = ""
|
||||
var flashUri: Uri? = null
|
||||
var usbDevice: String? = null
|
||||
|
||||
private var emulator: TerminalEmulator? = null
|
||||
private val emulatorReady = CompletableDeferred<TerminalEmulator>()
|
||||
@@ -73,6 +74,7 @@ class FlashViewModel : BaseViewModel() {
|
||||
fun startFlashing() {
|
||||
val action = flashAction
|
||||
val uri = flashUri
|
||||
val usb = usbDevice
|
||||
|
||||
viewModelScope.launch {
|
||||
val emu = emulatorReady.await()
|
||||
@@ -105,14 +107,7 @@ class FlashViewModel : BaseViewModel() {
|
||||
uri ?: return@launch
|
||||
_showReboot.value = false
|
||||
onResult(withContext(Dispatchers.IO) {
|
||||
MagiskInstaller.Patch(uri, outItems, logItems).exec()
|
||||
})
|
||||
}
|
||||
Const.Value.DOWNLOAD -> {
|
||||
uri ?: return@launch
|
||||
_showReboot.value = false
|
||||
onResult(withContext(Dispatchers.IO) {
|
||||
MagiskInstaller.Download(uri.toString(), outItems, logItems).exec()
|
||||
MagiskInstaller.Patch(uri, usb, outItems, logItems).exec()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
package com.topjohnwu.magisk.ui.install
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.IntentFilter
|
||||
import android.hardware.usb.UsbManager
|
||||
import android.net.Uri
|
||||
import androidx.activity.compose.rememberLauncherForActivityResult
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
@@ -29,6 +34,7 @@ import androidx.compose.material.icons.filled.Close
|
||||
import androidx.compose.material3.Card
|
||||
import androidx.compose.material3.CardDefaults
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.HorizontalDivider
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.IconButton
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
@@ -40,6 +46,7 @@ import androidx.compose.material3.TopAppBar
|
||||
import androidx.compose.material3.TopAppBarDefaults
|
||||
import androidx.compose.material3.adaptive.currentWindowAdaptiveInfo
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.DisposableEffect
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
@@ -49,6 +56,7 @@ import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.semantics.Role
|
||||
import androidx.compose.ui.text.input.ImeAction
|
||||
@@ -56,12 +64,15 @@ import androidx.compose.ui.text.input.KeyboardType
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.window.Dialog
|
||||
import androidx.compose.ui.window.DialogProperties
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.net.toUri
|
||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||
import androidx.window.core.layout.WindowSizeClass
|
||||
import com.topjohnwu.magisk.core.Config
|
||||
import com.topjohnwu.magisk.core.Info
|
||||
import com.topjohnwu.magisk.core.repository.FirmwareCrawler
|
||||
import com.topjohnwu.magisk.core.utils.MediaStoreUtils.displayName
|
||||
import com.topjohnwu.magisk.core.utils.UsbBlockDevice
|
||||
import com.topjohnwu.magisk.ui.component.ConfirmResult
|
||||
import com.topjohnwu.magisk.ui.component.MagiskDialog
|
||||
import com.topjohnwu.magisk.ui.component.MarkdownText
|
||||
@@ -80,22 +91,12 @@ fun InstallDialog(
|
||||
modifier: Modifier = Modifier
|
||||
) {
|
||||
val installUiState by installVm.uiState.collectAsStateWithLifecycle()
|
||||
var showDownloadDialog by rememberSaveable { mutableStateOf(false) }
|
||||
val filePicker = rememberLauncherForActivityResult(ActivityResultContracts.GetContent()) { uri ->
|
||||
uri?.let { installVm.onPatchFileSelected(it) }
|
||||
}
|
||||
var showPatchDialog by rememberSaveable { mutableStateOf(false) }
|
||||
|
||||
val secondSlotDialog = rememberConfirmDialog()
|
||||
val secondSlotTitle = stringResource(android.R.string.dialog_alert_title)
|
||||
val secondSlotMsg = stringResource(CoreR.string.install_inactive_slot_msg)
|
||||
|
||||
LaunchedEffect(installUiState.requestFilePicker) {
|
||||
if (installUiState.requestFilePicker) {
|
||||
filePicker.launch("*/*")
|
||||
installVm.onFilePickerConsumed()
|
||||
}
|
||||
}
|
||||
|
||||
LaunchedEffect(installUiState.showSecondSlotWarning) {
|
||||
if (installUiState.showSecondSlotWarning) {
|
||||
val result = secondSlotDialog.awaitConfirm(title = secondSlotTitle, content = secondSlotMsg)
|
||||
@@ -106,20 +107,21 @@ fun InstallDialog(
|
||||
}
|
||||
}
|
||||
|
||||
LaunchedEffect(installUiState.showDownloadDialog) {
|
||||
if (installUiState.showDownloadDialog) {
|
||||
showDownloadDialog = true
|
||||
installVm.onDownloadDialogConsumed()
|
||||
LaunchedEffect(installUiState.showPatchDialog) {
|
||||
if (installUiState.showPatchDialog) {
|
||||
showPatchDialog = true
|
||||
installVm.onPatchDialogConsumed()
|
||||
}
|
||||
}
|
||||
|
||||
if (showDownloadDialog) {
|
||||
DownloadComposableDialog(
|
||||
if (showPatchDialog) {
|
||||
PatchComposableDialog(
|
||||
candidate = installUiState.candidate,
|
||||
onDismiss = { showDownloadDialog = false },
|
||||
onConfirm = { url ->
|
||||
showDownloadDialog = false
|
||||
installVm.onDownloadUrlSelected(url)
|
||||
showUsbDestination = installVm.isGooglebook,
|
||||
onDismiss = { showPatchDialog = false },
|
||||
onConfirm = { uri, usbDevice ->
|
||||
showPatchDialog = false
|
||||
installVm.onPatchSelected(uri, usbDevice)
|
||||
}
|
||||
)
|
||||
}
|
||||
@@ -189,21 +191,13 @@ fun InstallDialog(
|
||||
),
|
||||
) {
|
||||
SettingsArrow(
|
||||
title = stringResource(CoreR.string.select_patch_file),
|
||||
title = stringResource(CoreR.string.patch_image),
|
||||
onClick = {
|
||||
onDismiss()
|
||||
installVm.selectMethod(InstallViewModel.Method.PATCH)
|
||||
},
|
||||
)
|
||||
|
||||
SettingsArrow(
|
||||
title = stringResource(CoreR.string.download_patch_file),
|
||||
onClick = {
|
||||
onDismiss()
|
||||
installVm.selectMethod(InstallViewModel.Method.DOWNLOAD)
|
||||
},
|
||||
)
|
||||
|
||||
if (installVm.isRooted) {
|
||||
SettingsArrow(
|
||||
title = stringResource(CoreR.string.direct_install),
|
||||
@@ -276,45 +270,112 @@ private fun InstallOptionsSection(
|
||||
}
|
||||
}
|
||||
|
||||
private fun parseHttpsUrl(url: String): Uri? {
|
||||
if (url.isEmpty()) return null
|
||||
val uri = url.toUri()
|
||||
if (!uri.scheme.equals("https", ignoreCase = true)) return null
|
||||
if (uri.host.isNullOrEmpty()) return null
|
||||
if (uri.path.isNullOrEmpty()) return null
|
||||
return uri
|
||||
}
|
||||
|
||||
private enum class PatchSource {
|
||||
CANDIDATE, FILE, URL
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun DownloadComposableDialog(
|
||||
fun PatchComposableDialog(
|
||||
onDismiss: () -> Unit,
|
||||
onConfirm: (Uri) -> Unit,
|
||||
onConfirm: (Uri, String?) -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
candidate: FirmwareCrawler.Candidate? = null,
|
||||
showUsbDestination: Boolean = false,
|
||||
) {
|
||||
var selectedCandidate by rememberSaveable(candidate) { mutableStateOf(candidate != null) }
|
||||
var url by rememberSaveable { mutableStateOf("") }
|
||||
var isError by rememberSaveable { mutableStateOf(false) }
|
||||
|
||||
fun isValidUrl(url: String): Uri? {
|
||||
if (url.isEmpty()) return null
|
||||
val uri = url.toUri()
|
||||
if (!uri.scheme.equals("https", ignoreCase = true)) return null
|
||||
if (uri.host.isNullOrEmpty()) return null
|
||||
if (uri.path.isNullOrEmpty()) return null
|
||||
return uri
|
||||
val context = LocalContext.current
|
||||
var source by rememberSaveable(candidate) {
|
||||
mutableStateOf(if (candidate != null) PatchSource.CANDIDATE else PatchSource.FILE)
|
||||
}
|
||||
var localFileUri by rememberSaveable { mutableStateOf<Uri?>(null) }
|
||||
var pendingSubmitAfterPick by rememberSaveable { mutableStateOf(false) }
|
||||
var url by rememberSaveable { mutableStateOf("") }
|
||||
var isUrlError by rememberSaveable { mutableStateOf(false) }
|
||||
|
||||
val submit = {
|
||||
if (candidate != null && selectedCandidate) {
|
||||
onConfirm(candidate.url.toUri())
|
||||
} else {
|
||||
isValidUrl(url.trim())?.let {
|
||||
onConfirm(it)
|
||||
} ?: run {
|
||||
isError = true
|
||||
var usbDevices by remember {
|
||||
mutableStateOf(
|
||||
if (showUsbDestination) UsbBlockDevice.listDevices(context) else emptyList()
|
||||
)
|
||||
}
|
||||
var selectedUsb by rememberSaveable { mutableStateOf<String?>(null) }
|
||||
var preferFile by rememberSaveable { mutableStateOf(false) }
|
||||
|
||||
if (showUsbDestination) {
|
||||
DisposableEffect(context) {
|
||||
usbDevices = UsbBlockDevice.listDevices(context)
|
||||
val receiver = object : BroadcastReceiver() {
|
||||
override fun onReceive(ctx: Context, intent: Intent) {
|
||||
usbDevices = UsbBlockDevice.listDevices(context)
|
||||
}
|
||||
}
|
||||
val filter = IntentFilter().apply {
|
||||
addAction(UsbManager.ACTION_USB_DEVICE_ATTACHED)
|
||||
addAction(UsbManager.ACTION_USB_DEVICE_DETACHED)
|
||||
}
|
||||
ContextCompat.registerReceiver(context, receiver, filter, ContextCompat.RECEIVER_EXPORTED)
|
||||
onDispose {
|
||||
runCatching { context.unregisterReceiver(receiver) }
|
||||
}
|
||||
}
|
||||
|
||||
LaunchedEffect(usbDevices) {
|
||||
if (selectedUsb != null && usbDevices.none { it.deviceName == selectedUsb }) {
|
||||
selectedUsb = usbDevices.firstOrNull()?.deviceName
|
||||
} else if (selectedUsb == null && !preferFile && usbDevices.isNotEmpty()) {
|
||||
selectedUsb = usbDevices.first().deviceName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val confirmWithUri = { targetUri: Uri ->
|
||||
val usbTarget = if (showUsbDestination) {
|
||||
selectedUsb?.takeIf { name -> usbDevices.any { it.deviceName == name } }
|
||||
} else {
|
||||
null
|
||||
}
|
||||
onConfirm(targetUri, usbTarget)
|
||||
}
|
||||
|
||||
val localFilePicker = rememberLauncherForActivityResult(ActivityResultContracts.GetContent()) { uri ->
|
||||
val shouldSubmit = pendingSubmitAfterPick
|
||||
pendingSubmitAfterPick = false
|
||||
if (uri != null) {
|
||||
localFileUri = uri
|
||||
source = PatchSource.FILE
|
||||
if (shouldSubmit) {
|
||||
confirmWithUri(uri)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val submit = submit@{
|
||||
val targetUri = when (source) {
|
||||
PatchSource.CANDIDATE -> candidate?.url?.toUri() ?: return@submit
|
||||
PatchSource.FILE -> localFileUri ?: run {
|
||||
pendingSubmitAfterPick = true
|
||||
localFilePicker.launch("*/*")
|
||||
return@submit
|
||||
}
|
||||
PatchSource.URL -> parseHttpsUrl(url.trim()) ?: run {
|
||||
isUrlError = true
|
||||
return@submit
|
||||
}
|
||||
}
|
||||
confirmWithUri(targetUri)
|
||||
}
|
||||
|
||||
MagiskDialog(
|
||||
modifier = modifier,
|
||||
onDismissRequest = onDismiss,
|
||||
title = stringResource(
|
||||
if (candidate != null) CoreR.string.download_patch_file
|
||||
else CoreR.string.download_dialog_title
|
||||
),
|
||||
title = stringResource(CoreR.string.patch_image),
|
||||
confirmText = stringResource(android.R.string.ok),
|
||||
onConfirm = submit,
|
||||
dismissText = stringResource(android.R.string.cancel),
|
||||
@@ -324,21 +385,21 @@ fun DownloadComposableDialog(
|
||||
modifier = Modifier.padding(top = 8.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(8.dp)
|
||||
) {
|
||||
if (candidate != null) {
|
||||
Column(modifier = Modifier.selectableGroup()) {
|
||||
Column(modifier = Modifier.selectableGroup()) {
|
||||
if (candidate != null) {
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.selectable(
|
||||
selected = selectedCandidate,
|
||||
onClick = { selectedCandidate = true },
|
||||
selected = source == PatchSource.CANDIDATE,
|
||||
onClick = { source = PatchSource.CANDIDATE },
|
||||
role = Role.RadioButton
|
||||
)
|
||||
.padding(vertical = 4.dp),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
RadioButton(
|
||||
selected = selectedCandidate,
|
||||
selected = source == PatchSource.CANDIDATE,
|
||||
onClick = null
|
||||
)
|
||||
Spacer(Modifier.width(16.dp))
|
||||
@@ -357,42 +418,80 @@ fun DownloadComposableDialog(
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.selectable(
|
||||
selected = !selectedCandidate,
|
||||
onClick = { selectedCandidate = false },
|
||||
role = Role.RadioButton
|
||||
)
|
||||
.padding(vertical = 4.dp),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
RadioButton(
|
||||
selected = !selectedCandidate,
|
||||
onClick = null
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.selectable(
|
||||
selected = source == PatchSource.FILE,
|
||||
onClick = {
|
||||
source = PatchSource.FILE
|
||||
pendingSubmitAfterPick = false
|
||||
localFilePicker.launch("*/*")
|
||||
},
|
||||
role = Role.RadioButton
|
||||
)
|
||||
Spacer(Modifier.width(16.dp))
|
||||
.padding(vertical = 4.dp),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
RadioButton(
|
||||
selected = source == PatchSource.FILE,
|
||||
onClick = null
|
||||
)
|
||||
Spacer(Modifier.width(16.dp))
|
||||
Column {
|
||||
Text(
|
||||
text = stringResource(CoreR.string.download_dialog_title),
|
||||
text = stringResource(CoreR.string.select_from_storage),
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
color = MaterialTheme.colorScheme.onSurface
|
||||
)
|
||||
val fileName = remember(localFileUri) {
|
||||
localFileUri?.let { runCatching { it.displayName }.getOrNull() }
|
||||
}
|
||||
Text(
|
||||
text = if (!fileName.isNullOrEmpty()) fileName
|
||||
else stringResource(CoreR.string.patch_file_msg),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.selectable(
|
||||
selected = source == PatchSource.URL,
|
||||
onClick = { source = PatchSource.URL },
|
||||
role = Role.RadioButton
|
||||
)
|
||||
.padding(vertical = 4.dp),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
RadioButton(
|
||||
selected = source == PatchSource.URL,
|
||||
onClick = null
|
||||
)
|
||||
Spacer(Modifier.width(16.dp))
|
||||
Text(
|
||||
text = stringResource(CoreR.string.download_dialog_title),
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
color = MaterialTheme.colorScheme.onSurface
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (candidate == null || !selectedCandidate) {
|
||||
if (source == PatchSource.URL) {
|
||||
OutlinedTextField(
|
||||
value = url,
|
||||
onValueChange = {
|
||||
url = it
|
||||
isError = false
|
||||
isUrlError = false
|
||||
},
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
label = { Text(stringResource(CoreR.string.download_dialog_msg)) },
|
||||
isError = isError,
|
||||
isError = isUrlError,
|
||||
singleLine = true,
|
||||
keyboardOptions = KeyboardOptions(
|
||||
keyboardType = KeyboardType.Uri,
|
||||
@@ -402,7 +501,7 @@ fun DownloadComposableDialog(
|
||||
onDone = { submit() }
|
||||
)
|
||||
)
|
||||
if (isError) {
|
||||
if (isUrlError) {
|
||||
Text(
|
||||
text = stringResource(CoreR.string.download_dialog_title),
|
||||
color = MaterialTheme.colorScheme.error,
|
||||
@@ -411,6 +510,87 @@ fun DownloadComposableDialog(
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (showUsbDestination) {
|
||||
HorizontalDivider(modifier = Modifier.padding(vertical = 4.dp))
|
||||
|
||||
Text(
|
||||
text = stringResource(CoreR.string.output_destination),
|
||||
style = MaterialTheme.typography.titleSmall,
|
||||
color = MaterialTheme.colorScheme.primary
|
||||
)
|
||||
|
||||
Column(modifier = Modifier.selectableGroup()) {
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.selectable(
|
||||
selected = selectedUsb == null,
|
||||
onClick = {
|
||||
preferFile = true
|
||||
selectedUsb = null
|
||||
},
|
||||
role = Role.RadioButton
|
||||
)
|
||||
.padding(vertical = 4.dp),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
RadioButton(
|
||||
selected = selectedUsb == null,
|
||||
onClick = null
|
||||
)
|
||||
Spacer(Modifier.width(16.dp))
|
||||
Text(
|
||||
text = stringResource(CoreR.string.save_to_file),
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
color = MaterialTheme.colorScheme.onSurface
|
||||
)
|
||||
}
|
||||
|
||||
for (device in usbDevices) {
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.selectable(
|
||||
selected = selectedUsb == device.deviceName,
|
||||
onClick = {
|
||||
preferFile = false
|
||||
selectedUsb = device.deviceName
|
||||
},
|
||||
role = Role.RadioButton
|
||||
)
|
||||
.padding(vertical = 4.dp),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
RadioButton(
|
||||
selected = selectedUsb == device.deviceName,
|
||||
onClick = null
|
||||
)
|
||||
Spacer(Modifier.width(16.dp))
|
||||
Text(
|
||||
text = "USB: ${device.label}",
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
color = MaterialTheme.colorScheme.onSurface
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (usbDevices.isEmpty()) {
|
||||
Text(
|
||||
text = stringResource(CoreR.string.no_usb_drive_found),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
)
|
||||
} else if (selectedUsb != null) {
|
||||
Text(
|
||||
text = stringResource(CoreR.string.usb_overwrite_warning),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = MaterialTheme.colorScheme.error
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
package com.topjohnwu.magisk.ui.install
|
||||
|
||||
import android.net.Uri
|
||||
import android.widget.Toast
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.topjohnwu.magisk.arch.BaseViewModel
|
||||
import com.topjohnwu.magisk.core.AppContext
|
||||
import com.topjohnwu.magisk.core.BuildConfig.APP_VERSION_CODE
|
||||
import com.topjohnwu.magisk.core.Const
|
||||
import com.topjohnwu.magisk.core.Info
|
||||
import com.topjohnwu.magisk.core.ktx.toast
|
||||
import com.topjohnwu.magisk.core.repository.FirmwareCrawler
|
||||
import com.topjohnwu.magisk.core.repository.NetworkService
|
||||
import com.topjohnwu.magisk.core.utils.UsbBlockDevice
|
||||
import com.topjohnwu.magisk.ui.navigation.Route
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.Job
|
||||
@@ -22,26 +21,26 @@ import kotlinx.coroutines.launch
|
||||
import timber.log.Timber
|
||||
import java.io.File
|
||||
import java.io.IOException
|
||||
import com.topjohnwu.magisk.core.R as CoreR
|
||||
|
||||
class InstallViewModel(
|
||||
svc: NetworkService,
|
||||
crawler: FirmwareCrawler,
|
||||
) : BaseViewModel() {
|
||||
|
||||
enum class Method { NONE, PATCH, DIRECT, INACTIVE_SLOT, DOWNLOAD }
|
||||
enum class Method { NONE, PATCH, DIRECT, INACTIVE_SLOT }
|
||||
|
||||
data class UiState(
|
||||
val method: Method = Method.NONE,
|
||||
val notes: String = "",
|
||||
val patchUri: Uri? = null,
|
||||
val requestFilePicker: Boolean = false,
|
||||
val usbDevice: String? = null,
|
||||
val showSecondSlotWarning: Boolean = false,
|
||||
val showDownloadDialog: Boolean = false,
|
||||
val showPatchDialog: Boolean = false,
|
||||
val candidate: FirmwareCrawler.Candidate? = null,
|
||||
)
|
||||
|
||||
val isRooted get() = Info.isRooted
|
||||
val isGooglebook get() = Info.isGooglebook
|
||||
val skipOptions = Info.isEmulator || (Info.isSAR && !Info.isFDE && Info.ramdisk)
|
||||
val noSecondSlot = !isRooted || !Info.isAB || Info.isEmulator
|
||||
|
||||
@@ -78,50 +77,46 @@ class InstallViewModel(
|
||||
_uiState.update { it.copy(method = method) }
|
||||
when (method) {
|
||||
Method.PATCH -> {
|
||||
AppContext.toast(CoreR.string.patch_file_msg, Toast.LENGTH_LONG)
|
||||
_uiState.update { it.copy(requestFilePicker = true) }
|
||||
}
|
||||
Method.INACTIVE_SLOT -> {
|
||||
_uiState.update { it.copy(showSecondSlotWarning = true) }
|
||||
}
|
||||
Method.DOWNLOAD -> {
|
||||
val job = candidateJob
|
||||
if (job != null && job.isActive) {
|
||||
viewModelScope.launch {
|
||||
job.join()
|
||||
_uiState.update { it.copy(showDownloadDialog = true) }
|
||||
_uiState.update { it.copy(showPatchDialog = true) }
|
||||
}
|
||||
} else {
|
||||
_uiState.update { it.copy(showDownloadDialog = true) }
|
||||
_uiState.update { it.copy(showPatchDialog = true) }
|
||||
}
|
||||
}
|
||||
Method.INACTIVE_SLOT -> {
|
||||
_uiState.update { it.copy(showSecondSlotWarning = true) }
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
fun onFilePickerConsumed() {
|
||||
_uiState.update { it.copy(requestFilePicker = false) }
|
||||
}
|
||||
|
||||
fun onSecondSlotWarningConsumed() {
|
||||
_uiState.update { it.copy(showSecondSlotWarning = false) }
|
||||
}
|
||||
|
||||
fun onDownloadDialogConsumed() {
|
||||
_uiState.update { it.copy(showDownloadDialog = false) }
|
||||
fun onPatchDialogConsumed() {
|
||||
_uiState.update { it.copy(showPatchDialog = false) }
|
||||
}
|
||||
|
||||
fun onPatchFileSelected(uri: Uri) {
|
||||
_uiState.update { it.copy(patchUri = uri) }
|
||||
if (_uiState.value.method == Method.PATCH) {
|
||||
install()
|
||||
}
|
||||
}
|
||||
|
||||
fun onDownloadUrlSelected(uri: Uri) {
|
||||
_uiState.update { it.copy(patchUri = uri) }
|
||||
if (_uiState.value.method == Method.DOWNLOAD) {
|
||||
install()
|
||||
fun onPatchSelected(uri: Uri, usbDeviceName: String? = null) {
|
||||
if (usbDeviceName != null) {
|
||||
viewModelScope.launch {
|
||||
if (UsbBlockDevice.requestPermission(AppContext, usbDeviceName)) {
|
||||
_uiState.update { it.copy(patchUri = uri, usbDevice = usbDeviceName) }
|
||||
if (_uiState.value.method == Method.PATCH) {
|
||||
install()
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
_uiState.update { it.copy(patchUri = uri, usbDevice = null) }
|
||||
if (_uiState.value.method == Method.PATCH) {
|
||||
install()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,11 +124,8 @@ class InstallViewModel(
|
||||
when (_uiState.value.method) {
|
||||
Method.PATCH -> navigateTo(Route.Flash(
|
||||
action = Const.Value.PATCH_FILE,
|
||||
additionalData = _uiState.value.patchUri!!.toString()
|
||||
))
|
||||
Method.DOWNLOAD -> navigateTo(Route.Flash(
|
||||
action = Const.Value.DOWNLOAD,
|
||||
additionalData = _uiState.value.patchUri!!.toString()
|
||||
additionalData = _uiState.value.patchUri!!.toString(),
|
||||
usbDevice = _uiState.value.usbDevice
|
||||
))
|
||||
Method.DIRECT -> navigateTo(Route.Flash(
|
||||
action = Const.Value.FLASH_MAGISK
|
||||
|
||||
@@ -19,6 +19,7 @@ sealed interface Route : NavKey, Parcelable {
|
||||
data class Flash(
|
||||
val action: String,
|
||||
val additionalData: String? = null,
|
||||
val usbDevice: String? = null,
|
||||
) : Route
|
||||
|
||||
@Parcelize
|
||||
|
||||
@@ -59,7 +59,6 @@ object Const {
|
||||
object Value {
|
||||
const val FLASH_ZIP = "flash"
|
||||
const val PATCH_FILE = "patch"
|
||||
const val DOWNLOAD = "download"
|
||||
const val FLASH_MAGISK = "magisk"
|
||||
const val FLASH_INACTIVE_SLOT = "slot"
|
||||
const val UNINSTALL = "uninstall"
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.topjohnwu.magisk.core.utils.MediaStoreUtils.openFd
|
||||
import com.topjohnwu.magisk.core.utils.MediaStoreUtils.outputStream
|
||||
import com.topjohnwu.magisk.core.utils.ProgressInputStream
|
||||
import com.topjohnwu.magisk.core.utils.RootUtils
|
||||
import com.topjohnwu.magisk.core.utils.UsbBlockDevice
|
||||
import com.topjohnwu.superuser.Shell
|
||||
import com.topjohnwu.superuser.ShellUtils
|
||||
import com.topjohnwu.superuser.internal.UiThreadHandler
|
||||
@@ -198,26 +199,19 @@ abstract class MagiskInstallImpl protected constructor(
|
||||
private suspend fun InputStream.copyAndCloseOut(out: OutputStream) =
|
||||
out.use { copyAll(it, 1024 * 1024) }
|
||||
|
||||
private suspend fun processFile(uri: Uri): Boolean {
|
||||
private suspend fun processFile(uri: Uri, usbDeviceName: String? = null): Boolean {
|
||||
val input = try {
|
||||
DataChannel.File(ParcelFileDescriptor.AutoCloseInputStream(uri.openFd()).channel)
|
||||
if (uri.scheme.equals("https", ignoreCase = true) || uri.scheme.equals("http", ignoreCase = true)) {
|
||||
DataChannel.Http(ServiceLocator.okhttp, uri.toString())
|
||||
} else {
|
||||
DataChannel.File(ParcelFileDescriptor.AutoCloseInputStream(uri.openFd()).channel)
|
||||
}
|
||||
} catch (e: IOException) {
|
||||
console.add("! Process error")
|
||||
console.add("! Error: " + (e.message ?: "Process error"))
|
||||
Timber.e(e)
|
||||
return false
|
||||
}
|
||||
return processInput(input)
|
||||
}
|
||||
|
||||
private suspend fun processUrl(url: String): Boolean {
|
||||
val input = try {
|
||||
DataChannel.Http(ServiceLocator.okhttp, url)
|
||||
} catch (e: IOException) {
|
||||
console.add("! Error: " + e.message)
|
||||
Timber.e(e)
|
||||
return false
|
||||
}
|
||||
return processInput(input)
|
||||
return processInput(input, usbDeviceName)
|
||||
}
|
||||
|
||||
private fun PatchFileClassifier.openProgressStream(): InputStream {
|
||||
@@ -252,11 +246,15 @@ abstract class MagiskInstallImpl protected constructor(
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun processInput(input: DataChannel): Boolean {
|
||||
private suspend fun processInput(input: DataChannel, usbDeviceName: String? = null): Boolean {
|
||||
try {
|
||||
input.use {
|
||||
PatchFileClassifier(input).use { file ->
|
||||
logs.add("Input type: ${file.type}, payload: ${file.entryPath ?: "<input>"}")
|
||||
if (usbDeviceName != null && file.type != PatchFileClassifier.Type.RecoveryGpt) {
|
||||
console.add("! Selected file is not a recovery disk image")
|
||||
return false
|
||||
}
|
||||
return when (file.type) {
|
||||
PatchFileClassifier.Type.Tar -> {
|
||||
processWholeFile(file.openProgressStream(), "tar") { out ->
|
||||
@@ -265,8 +263,12 @@ abstract class MagiskInstallImpl protected constructor(
|
||||
}
|
||||
PatchFileClassifier.Type.RecoveryGpt -> {
|
||||
file.entryPath?.let { console.add("- Processing $it") }
|
||||
processWholeFile(file.openProgressStream(), "bin") { out ->
|
||||
RecoveryGptProcessor(installDir, out, console, logs)
|
||||
if (usbDeviceName != null) {
|
||||
processUsbRecovery(file, usbDeviceName)
|
||||
} else {
|
||||
processWholeFile(file.openProgressStream(), "bin") { out ->
|
||||
RecoveryGptProcessor(installDir, out, console, logs)
|
||||
}
|
||||
}
|
||||
}
|
||||
PatchFileClassifier.Type.PayloadBin -> extractAndProcessImage { out ->
|
||||
@@ -291,15 +293,12 @@ abstract class MagiskInstallImpl protected constructor(
|
||||
}
|
||||
}
|
||||
|
||||
// Patch the boot image in a whole file (e.g. tar archive), and output a new file
|
||||
// with all the original contents and the patched boot image
|
||||
private suspend fun processWholeFile(
|
||||
private suspend fun runWholeFilePatcher(
|
||||
input: InputStream,
|
||||
ext: String,
|
||||
outStream: OutputStream,
|
||||
outputLabel: String,
|
||||
createPatcher: (OutputStream) -> WholeFilePatcher
|
||||
): Boolean {
|
||||
val outFile = MediaStoreUtils.getFile("$destName.$ext")
|
||||
val outStream = outFile.uri.outputStream().buffered(1024 * 1024)
|
||||
val patcher = createPatcher(outStream)
|
||||
|
||||
// Process input file
|
||||
@@ -308,7 +307,6 @@ abstract class MagiskInstallImpl protected constructor(
|
||||
} catch (e: IOException) {
|
||||
patcher.close()
|
||||
runCatching { outStream.close() }
|
||||
outFile.delete()
|
||||
if (e is TarProcessor.NoBootException)
|
||||
console.add("! No boot image found")
|
||||
console.add("! Process error")
|
||||
@@ -320,7 +318,6 @@ abstract class MagiskInstallImpl protected constructor(
|
||||
if (!patchBoot()) {
|
||||
patcher.close()
|
||||
runCatching { outStream.close() }
|
||||
outFile.delete()
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -331,18 +328,57 @@ abstract class MagiskInstallImpl protected constructor(
|
||||
newBoot.delete()
|
||||
} catch (e: IOException) {
|
||||
patcher.close()
|
||||
console.add("! Failed to output to $outFile")
|
||||
outFile.delete()
|
||||
console.add("! Failed to output to $outputLabel")
|
||||
Timber.e(e)
|
||||
return false
|
||||
} finally {
|
||||
patcher.close()
|
||||
outStream.close()
|
||||
runCatching { outStream.close() }
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
// Patch the boot image in a whole file (e.g. tar archive), and output a new file
|
||||
// with all the original contents and the patched boot image
|
||||
private suspend fun processWholeFile(
|
||||
input: InputStream,
|
||||
ext: String,
|
||||
createPatcher: (OutputStream) -> WholeFilePatcher
|
||||
): Boolean {
|
||||
val outFile = MediaStoreUtils.getFile("$destName.$ext")
|
||||
val outStream = outFile.uri.outputStream().buffered(1024 * 1024)
|
||||
if (!runWholeFilePatcher(input, outStream, outFile.toString(), createPatcher)) {
|
||||
outFile.delete()
|
||||
return false
|
||||
}
|
||||
return onOutputWritten(outFile)
|
||||
}
|
||||
|
||||
private suspend fun processUsbRecovery(file: PatchFileClassifier, usbDeviceName: String): Boolean {
|
||||
val outStream = try {
|
||||
UsbBlockDevice.open(context, usbDeviceName, file.size, console, logs)
|
||||
} catch (e: IOException) {
|
||||
console.add("! " + (e.message ?: "Failed to open USB drive"))
|
||||
Timber.e(e)
|
||||
return false
|
||||
}
|
||||
if (!runWholeFilePatcher(file.openProgressStream(), outStream, usbDeviceName) { out ->
|
||||
RecoveryGptProcessor(installDir, out, console, logs)
|
||||
}) {
|
||||
return false
|
||||
}
|
||||
|
||||
console.add("")
|
||||
console.add("****************************")
|
||||
console.add(" Recovery image flashed to USB ")
|
||||
console.add("****************************")
|
||||
|
||||
targetImage.delete()
|
||||
"cp_readlink $installDir".sh()
|
||||
return true
|
||||
}
|
||||
|
||||
// Extract the boot image from the input, and output the patched boot image
|
||||
private suspend fun extractAndProcessImage(extract: suspend (ExtendedFile) -> Unit): Boolean {
|
||||
// Process input file
|
||||
@@ -430,9 +466,8 @@ abstract class MagiskInstallImpl protected constructor(
|
||||
private fun Array<String>.sh() = shell.newJob().add(*this).to(console, logs).exec()
|
||||
private fun String.fsh() = ShellUtils.fastCmd(shell, this)
|
||||
|
||||
protected suspend fun patchFile(file: Uri) = extractFiles() && processFile(file)
|
||||
|
||||
protected suspend fun patchFile(url: String) = extractFiles() && processUrl(url)
|
||||
protected suspend fun patchFile(file: Uri, usbDeviceName: String? = null) =
|
||||
extractFiles() && processFile(file, usbDeviceName)
|
||||
|
||||
protected suspend fun direct() = findImage() && extractFiles() && patchBoot() && flashBoot()
|
||||
|
||||
@@ -495,18 +530,11 @@ class MagiskInstaller {
|
||||
|
||||
class Patch(
|
||||
private val uri: Uri,
|
||||
private val usbDeviceName: String? = null,
|
||||
console: MutableList<String>,
|
||||
logs: MutableList<String>
|
||||
) : ConsoleInstaller(console, logs) {
|
||||
override suspend fun operations() = patchFile(uri)
|
||||
}
|
||||
|
||||
class Download(
|
||||
private val url: String,
|
||||
console: MutableList<String>,
|
||||
logs: MutableList<String>
|
||||
) : ConsoleInstaller(console, logs) {
|
||||
override suspend fun operations() = patchFile(url)
|
||||
override suspend fun operations() = patchFile(uri, usbDeviceName)
|
||||
}
|
||||
|
||||
class SecondSlot(
|
||||
|
||||
@@ -0,0 +1,540 @@
|
||||
package com.topjohnwu.magisk.core.utils
|
||||
|
||||
import android.app.PendingIntent
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.IntentFilter
|
||||
import android.hardware.usb.UsbConstants
|
||||
import android.hardware.usb.UsbDevice
|
||||
import android.hardware.usb.UsbDeviceConnection
|
||||
import android.hardware.usb.UsbEndpoint
|
||||
import android.hardware.usb.UsbInterface
|
||||
import android.hardware.usb.UsbManager
|
||||
import android.os.Build
|
||||
import androidx.core.content.ContextCompat
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.suspendCancellableCoroutine
|
||||
import java.io.IOException
|
||||
import java.io.OutputStream
|
||||
import java.nio.ByteBuffer
|
||||
import java.nio.ByteOrder
|
||||
import kotlin.coroutines.resume
|
||||
|
||||
object UsbBlockDevice {
|
||||
|
||||
private const val SCSI_SUBCLASS = 0x06
|
||||
private const val BOT_PROTOCOL = 0x50
|
||||
|
||||
data class DeviceInfo(
|
||||
val deviceName: String,
|
||||
val label: String,
|
||||
val vendorId: Int,
|
||||
val productId: Int,
|
||||
)
|
||||
|
||||
private class BotInterface(
|
||||
val usbInterface: UsbInterface,
|
||||
val inEndpoint: UsbEndpoint,
|
||||
val outEndpoint: UsbEndpoint,
|
||||
)
|
||||
|
||||
fun listDevices(context: Context): List<DeviceInfo> {
|
||||
val usbManager = context.getSystemService(UsbManager::class.java) ?: return emptyList()
|
||||
return usbManager.deviceList.values.mapNotNull { device ->
|
||||
findBotInterface(device) ?: return@mapNotNull null
|
||||
val manufacturer = device.manufacturerName?.trim().orEmpty()
|
||||
val product = device.productName?.trim().orEmpty()
|
||||
val label = when {
|
||||
manufacturer.isNotEmpty() && product.isNotEmpty() -> {
|
||||
if (product.startsWith(manufacturer, ignoreCase = true)) product
|
||||
else "$manufacturer $product"
|
||||
}
|
||||
product.isNotEmpty() -> product
|
||||
manufacturer.isNotEmpty() -> manufacturer
|
||||
else -> device.deviceName
|
||||
}
|
||||
DeviceInfo(
|
||||
deviceName = device.deviceName,
|
||||
label = label,
|
||||
vendorId = device.vendorId,
|
||||
productId = device.productId,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun requestPermission(context: Context, deviceName: String): Boolean {
|
||||
val usbManager = context.getSystemService(UsbManager::class.java) ?: return false
|
||||
val device = usbManager.deviceList[deviceName] ?: return false
|
||||
if (usbManager.hasPermission(device)) return true
|
||||
|
||||
val action = "${context.packageName}.USB_PERMISSION"
|
||||
return suspendCancellableCoroutine { cont ->
|
||||
val receiver = object : BroadcastReceiver() {
|
||||
override fun onReceive(ctx: Context, intent: Intent) {
|
||||
if (intent.action != action) return
|
||||
runCatching { context.unregisterReceiver(this) }
|
||||
if (cont.isActive) {
|
||||
cont.resume(usbManager.hasPermission(device))
|
||||
}
|
||||
}
|
||||
}
|
||||
ContextCompat.registerReceiver(
|
||||
context,
|
||||
receiver,
|
||||
IntentFilter(action),
|
||||
ContextCompat.RECEIVER_EXPORTED
|
||||
)
|
||||
cont.invokeOnCancellation {
|
||||
runCatching { context.unregisterReceiver(receiver) }
|
||||
}
|
||||
val flags = PendingIntent.FLAG_UPDATE_CURRENT or
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) PendingIntent.FLAG_MUTABLE else 0
|
||||
val pendingIntent = PendingIntent.getBroadcast(
|
||||
context,
|
||||
0,
|
||||
Intent(action).setPackage(context.packageName),
|
||||
flags
|
||||
)
|
||||
usbManager.requestPermission(device, pendingIntent)
|
||||
}
|
||||
}
|
||||
|
||||
@Throws(IOException::class)
|
||||
suspend fun open(
|
||||
context: Context,
|
||||
deviceName: String,
|
||||
requiredSize: Long,
|
||||
console: MutableList<String>,
|
||||
logs: MutableList<String>,
|
||||
): OutputStream {
|
||||
val usbManager = context.getSystemService(UsbManager::class.java)
|
||||
?: throw IOException("UsbManager unavailable")
|
||||
val device = usbManager.deviceList[deviceName]
|
||||
?: throw IOException("USB device disconnected: $deviceName")
|
||||
if (!usbManager.hasPermission(device)) {
|
||||
throw IOException("Permission denied for USB device: $deviceName")
|
||||
}
|
||||
val bot = findBotInterface(device)
|
||||
?: throw IOException("USB device does not support Mass Storage Bulk-Only Transport")
|
||||
|
||||
val connection = usbManager.openDevice(device)
|
||||
?: throw IOException("Failed to open USB device: $deviceName")
|
||||
var success = false
|
||||
try {
|
||||
if (!connection.claimInterface(bot.usbInterface, true)) {
|
||||
throw IOException("Failed to claim USB Mass Storage interface")
|
||||
}
|
||||
val stream = UsbBotOutputStream(connection, bot.usbInterface, bot.inEndpoint, bot.outEndpoint, logs)
|
||||
stream.initialize(requiredSize, console)
|
||||
success = true
|
||||
return stream
|
||||
} finally {
|
||||
if (!success) {
|
||||
runCatching { connection.releaseInterface(bot.usbInterface) }
|
||||
runCatching { connection.close() }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun findBotInterface(device: UsbDevice): BotInterface? {
|
||||
for (i in 0 until device.interfaceCount) {
|
||||
val intf = device.getInterface(i)
|
||||
if (intf.interfaceClass != UsbConstants.USB_CLASS_MASS_STORAGE ||
|
||||
intf.interfaceSubclass != SCSI_SUBCLASS ||
|
||||
intf.interfaceProtocol != BOT_PROTOCOL
|
||||
) continue
|
||||
|
||||
var inEp: UsbEndpoint? = null
|
||||
var outEp: UsbEndpoint? = null
|
||||
for (j in 0 until intf.endpointCount) {
|
||||
val ep = intf.getEndpoint(j)
|
||||
if (ep.type == UsbConstants.USB_ENDPOINT_XFER_BULK) {
|
||||
if (ep.direction == UsbConstants.USB_DIR_IN) {
|
||||
inEp = ep
|
||||
} else if (ep.direction == UsbConstants.USB_DIR_OUT) {
|
||||
outEp = ep
|
||||
}
|
||||
}
|
||||
}
|
||||
if (inEp != null && outEp != null) {
|
||||
return BotInterface(
|
||||
usbInterface = intf,
|
||||
inEndpoint = inEp,
|
||||
outEndpoint = outEp,
|
||||
)
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
private class UsbBotOutputStream(
|
||||
private val connection: UsbDeviceConnection,
|
||||
private val usbInterface: UsbInterface,
|
||||
private val inEndpoint: UsbEndpoint,
|
||||
private val outEndpoint: UsbEndpoint,
|
||||
private val logs: MutableList<String>,
|
||||
) : OutputStream() {
|
||||
|
||||
private var tag = 1
|
||||
private var blockSize = 512
|
||||
private var blockCount = 0L
|
||||
private var currentLba = 0L
|
||||
private var closed = false
|
||||
private var failed = false
|
||||
private var synced = false
|
||||
|
||||
private val buffer = ByteArray(BUFFER_SIZE)
|
||||
private var bufPos = 0
|
||||
|
||||
private val cbwBytes = ByteArray(CBW_SIZE)
|
||||
private val cbwBuf = ByteBuffer.wrap(cbwBytes).order(ByteOrder.LITTLE_ENDIAN)
|
||||
private val cswBytes = ByteArray(CSW_SIZE)
|
||||
private val cswBuf = ByteBuffer.wrap(cswBytes).order(ByteOrder.LITTLE_ENDIAN)
|
||||
|
||||
@Throws(IOException::class)
|
||||
suspend fun initialize(requiredSize: Long, console: MutableList<String>) {
|
||||
// 1. SCSI INQUIRY (0x12)
|
||||
val inquiry = ByteArray(36)
|
||||
val inquiryStatus = executeScsiIn(
|
||||
cdb = byteArrayOf(0x12, 0, 0, 0, inquiry.size.toByte(), 0),
|
||||
data = inquiry,
|
||||
length = inquiry.size,
|
||||
timeout = CONTROL_TIMEOUT
|
||||
)
|
||||
if (inquiryStatus != 0) {
|
||||
throw IOException("SCSI INQUIRY failed (status=$inquiryStatus)")
|
||||
}
|
||||
val peripheralType = inquiry[0].toInt() and 0x1F
|
||||
if (peripheralType != 0x00) {
|
||||
throw IOException("Unsupported SCSI peripheral type: 0x${peripheralType.toString(16)}")
|
||||
}
|
||||
val vendor = String(inquiry, 8, 8, Charsets.US_ASCII).trim()
|
||||
val product = String(inquiry, 16, 16, Charsets.US_ASCII).trim()
|
||||
|
||||
// 2. SCSI TEST UNIT READY (0x00) + REQUEST SENSE (0x03) retry loop
|
||||
var ready = false
|
||||
for (attempt in 0 until 10) {
|
||||
val turStatus = executeScsiOut(
|
||||
cdb = byteArrayOf(0x00, 0, 0, 0, 0, 0),
|
||||
data = buffer,
|
||||
length = 0,
|
||||
timeout = CONTROL_TIMEOUT
|
||||
)
|
||||
if (turStatus == 0) {
|
||||
ready = true
|
||||
break
|
||||
}
|
||||
requestSense()
|
||||
delay(100)
|
||||
}
|
||||
if (!ready) {
|
||||
throw IOException("USB drive is not ready")
|
||||
}
|
||||
|
||||
// 3. SCSI READ CAPACITY (10) (0x25) / READ CAPACITY (16) (0x9E/0x10)
|
||||
val cap10 = ByteArray(8)
|
||||
val cap10Status = executeScsiIn(
|
||||
cdb = byteArrayOf(0x25, 0, 0, 0, 0, 0, 0, 0, 0, 0),
|
||||
data = cap10,
|
||||
length = cap10.size,
|
||||
timeout = CONTROL_TIMEOUT
|
||||
)
|
||||
if (cap10Status != 0) {
|
||||
requestSense()
|
||||
throw IOException("SCSI READ CAPACITY(10) failed (status=$cap10Status)")
|
||||
}
|
||||
val cap10Buf = ByteBuffer.wrap(cap10).order(ByteOrder.BIG_ENDIAN)
|
||||
val lastLba32 = cap10Buf.int.toLong() and 0xFFFFFFFFL
|
||||
val blkLen10 = cap10Buf.int
|
||||
|
||||
if (lastLba32 == 0xFFFFFFFFL) {
|
||||
val cap16 = ByteArray(32)
|
||||
val cap16Status = executeScsiIn(
|
||||
cdb = byteArrayOf(
|
||||
0x9E.toByte(), 0x10,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, cap16.size.toByte(),
|
||||
0, 0
|
||||
),
|
||||
data = cap16,
|
||||
length = cap16.size,
|
||||
timeout = CONTROL_TIMEOUT
|
||||
)
|
||||
if (cap16Status != 0) {
|
||||
requestSense()
|
||||
throw IOException("SCSI READ CAPACITY(16) failed (status=$cap16Status)")
|
||||
}
|
||||
val cap16Buf = ByteBuffer.wrap(cap16).order(ByteOrder.BIG_ENDIAN)
|
||||
blockCount = cap16Buf.long + 1L
|
||||
blockSize = cap16Buf.int
|
||||
} else {
|
||||
blockCount = lastLba32 + 1L
|
||||
blockSize = blkLen10
|
||||
}
|
||||
|
||||
if (blockSize <= 0 || blockSize % 512 != 0 || BUFFER_SIZE % blockSize != 0) {
|
||||
throw IOException("Unsupported USB logical block size: $blockSize")
|
||||
}
|
||||
|
||||
val capacityBytes = blockCount * blockSize
|
||||
val capacityMb = capacityBytes / (1024 * 1024)
|
||||
console.add("- Target USB: $vendor $product ($capacityMb MB)")
|
||||
logs.add("USB device: $vendor $product, blocks=$blockCount, blockSize=$blockSize, capacity=$capacityBytes")
|
||||
|
||||
if (requiredSize > 0 && capacityBytes < requiredSize) {
|
||||
val reqMb = (requiredSize + 1024 * 1024 - 1) / (1024 * 1024)
|
||||
throw IOException("USB drive is too small (${capacityMb} MB < ${reqMb} MB required)")
|
||||
}
|
||||
}
|
||||
|
||||
override fun write(b: Int) {
|
||||
if (closed) throw IOException("Stream closed")
|
||||
buffer[bufPos++] = b.toByte()
|
||||
if (bufPos == BUFFER_SIZE) {
|
||||
flushBuffer(BUFFER_SIZE)
|
||||
}
|
||||
}
|
||||
|
||||
override fun write(b: ByteArray, off: Int, len: Int) {
|
||||
if (closed) throw IOException("Stream closed")
|
||||
var offset = off
|
||||
var remaining = len
|
||||
while (remaining > 0) {
|
||||
val copyLen = minOf(remaining, BUFFER_SIZE - bufPos)
|
||||
System.arraycopy(b, offset, buffer, bufPos, copyLen)
|
||||
bufPos += copyLen
|
||||
offset += copyLen
|
||||
remaining -= copyLen
|
||||
if (bufPos == BUFFER_SIZE) {
|
||||
flushBuffer(BUFFER_SIZE)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun flush() {
|
||||
if (closed) throw IOException("Stream closed")
|
||||
try {
|
||||
if (bufPos > 0) {
|
||||
val rem = bufPos % blockSize
|
||||
val alignedLen = if (rem == 0) bufPos else {
|
||||
val pad = blockSize - rem
|
||||
buffer.fill(0, bufPos, bufPos + pad)
|
||||
bufPos + pad
|
||||
}
|
||||
flushBuffer(alignedLen)
|
||||
}
|
||||
syncCache()
|
||||
synced = true
|
||||
} catch (e: IOException) {
|
||||
failed = true
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
override fun close() {
|
||||
if (closed) return
|
||||
try {
|
||||
if (!failed && !synced) {
|
||||
flush()
|
||||
}
|
||||
} finally {
|
||||
closed = true
|
||||
runCatching { connection.releaseInterface(usbInterface) }
|
||||
runCatching { connection.close() }
|
||||
}
|
||||
}
|
||||
|
||||
@Throws(IOException::class)
|
||||
private fun flushBuffer(length: Int) {
|
||||
try {
|
||||
val blocks = length / blockSize
|
||||
if (currentLba + blocks > blockCount) {
|
||||
throw IOException("Write exceeds USB drive capacity at LBA $currentLba")
|
||||
}
|
||||
val cdb = if (currentLba + blocks <= 0xFFFFFFFFL && blocks <= 0xFFFF) {
|
||||
val lba = currentLba.toInt()
|
||||
byteArrayOf(
|
||||
0x2A, // WRITE(10)
|
||||
0x00,
|
||||
(lba ushr 24).toByte(),
|
||||
(lba ushr 16).toByte(),
|
||||
(lba ushr 8).toByte(),
|
||||
lba.toByte(),
|
||||
0x00,
|
||||
(blocks ushr 8).toByte(),
|
||||
blocks.toByte(),
|
||||
0x00
|
||||
)
|
||||
} else {
|
||||
val cdb16 = ByteArray(16)
|
||||
val buf = ByteBuffer.wrap(cdb16).order(ByteOrder.BIG_ENDIAN)
|
||||
buf.put(0, 0x8A.toByte()) // WRITE(16)
|
||||
buf.putLong(2, currentLba)
|
||||
buf.putInt(10, blocks)
|
||||
cdb16
|
||||
}
|
||||
|
||||
val status = executeScsiOut(cdb, buffer, length, WRITE_TIMEOUT)
|
||||
if (status != 0) {
|
||||
val sense = requestSense()
|
||||
throw IOException("SCSI WRITE failed at LBA $currentLba (status=$status, sense=$sense)")
|
||||
}
|
||||
currentLba += blocks
|
||||
bufPos = 0
|
||||
synced = false
|
||||
} catch (e: IOException) {
|
||||
failed = true
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
@Throws(IOException::class)
|
||||
private fun syncCache() {
|
||||
val status = executeScsiOut(
|
||||
cdb = byteArrayOf(0x35, 0, 0, 0, 0, 0, 0, 0, 0, 0),
|
||||
data = buffer,
|
||||
length = 0,
|
||||
timeout = WRITE_TIMEOUT
|
||||
)
|
||||
if (status != 0) {
|
||||
val sense = requestSense()
|
||||
// Ignore Illegal Request (senseKey == 0x05) on devices that do not implement SYNCHRONIZE CACHE
|
||||
if (!sense.startsWith("key=0x5")) {
|
||||
logs.add("SCSI SYNCHRONIZE CACHE(10) returned status=$status ($sense)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun requestSense(): String {
|
||||
val sense = ByteArray(18)
|
||||
val status = runCatching {
|
||||
executeScsiIn(
|
||||
cdb = byteArrayOf(0x03, 0, 0, 0, sense.size.toByte(), 0),
|
||||
data = sense,
|
||||
length = sense.size,
|
||||
timeout = CONTROL_TIMEOUT
|
||||
)
|
||||
}.getOrDefault(-1)
|
||||
if (status != 0) return "sense_unavailable(status=$status)"
|
||||
val key = sense[2].toInt() and 0x0F
|
||||
val asc = sense[12].toInt() and 0xFF
|
||||
val ascq = sense[13].toInt() and 0xFF
|
||||
return "key=0x${key.toString(16)}, asc=0x${asc.toString(16)}, ascq=0x${ascq.toString(16)}"
|
||||
}
|
||||
|
||||
@Throws(IOException::class)
|
||||
private fun executeScsiOut(cdb: ByteArray, data: ByteArray, length: Int, timeout: Int): Int {
|
||||
val cmdTag = sendCbw(cdb, length, isDataIn = false)
|
||||
if (length > 0) {
|
||||
val transferred = connection.bulkTransfer(outEndpoint, data, 0, length, timeout)
|
||||
if (transferred != length) {
|
||||
clearHalt(outEndpoint)
|
||||
throw IOException("USB bulk OUT transfer failed ($transferred / $length bytes)")
|
||||
}
|
||||
}
|
||||
return readCsw(cmdTag, timeout)
|
||||
}
|
||||
|
||||
@Throws(IOException::class)
|
||||
private fun executeScsiIn(cdb: ByteArray, data: ByteArray, length: Int, timeout: Int): Int {
|
||||
val cmdTag = sendCbw(cdb, length, isDataIn = true)
|
||||
if (length > 0) {
|
||||
val transferred = connection.bulkTransfer(inEndpoint, data, 0, length, timeout)
|
||||
if (transferred < 0) {
|
||||
clearHalt(inEndpoint)
|
||||
}
|
||||
}
|
||||
return readCsw(cmdTag, timeout)
|
||||
}
|
||||
|
||||
@Throws(IOException::class)
|
||||
private fun sendCbw(cdb: ByteArray, dataLength: Int, isDataIn: Boolean): Int {
|
||||
val cmdTag = tag++
|
||||
cbwBytes.fill(0)
|
||||
cbwBuf.clear()
|
||||
cbwBuf.putInt(CBW_SIGNATURE)
|
||||
cbwBuf.putInt(cmdTag)
|
||||
cbwBuf.putInt(dataLength)
|
||||
cbwBuf.put(if (isDataIn) 0x80.toByte() else 0x00)
|
||||
cbwBuf.put(0) // LUN 0
|
||||
cbwBuf.put(cdb.size.toByte())
|
||||
cbwBuf.put(cdb)
|
||||
|
||||
val sent = connection.bulkTransfer(outEndpoint, cbwBytes, 0, CBW_SIZE, CONTROL_TIMEOUT)
|
||||
if (sent != CBW_SIZE) {
|
||||
throw IOException("Failed to send USB CBW ($sent / $CBW_SIZE bytes)")
|
||||
}
|
||||
return cmdTag
|
||||
}
|
||||
|
||||
@Throws(IOException::class)
|
||||
private fun readCsw(expectedTag: Int, timeout: Int): Int {
|
||||
var received = connection.bulkTransfer(inEndpoint, cswBytes, 0, CSW_SIZE, timeout)
|
||||
if (received < 0) {
|
||||
clearHalt(inEndpoint)
|
||||
received = connection.bulkTransfer(inEndpoint, cswBytes, 0, CSW_SIZE, timeout)
|
||||
}
|
||||
if (received != CSW_SIZE) {
|
||||
resetRecovery()
|
||||
throw IOException("Failed to read USB CSW ($received / $CSW_SIZE bytes)")
|
||||
}
|
||||
cswBuf.clear()
|
||||
val sig = cswBuf.int
|
||||
val rcvTag = cswBuf.int
|
||||
cswBuf.int // dataResidue
|
||||
val status = cswBuf.get().toInt() and 0xFF
|
||||
if (sig != CSW_SIGNATURE || rcvTag != expectedTag) {
|
||||
resetRecovery()
|
||||
throw IOException("Invalid USB CSW (sig=0x${sig.toString(16)}, tag=$rcvTag, expected=$expectedTag)")
|
||||
}
|
||||
if (status == 2) {
|
||||
resetRecovery()
|
||||
throw IOException("USB Mass Storage Phase Error")
|
||||
}
|
||||
return status
|
||||
}
|
||||
|
||||
private fun resetRecovery() {
|
||||
connection.controlTransfer(
|
||||
UsbConstants.USB_DIR_OUT or UsbConstants.USB_TYPE_CLASS or USB_RECIP_INTERFACE,
|
||||
BOT_RESET_REQUEST,
|
||||
0,
|
||||
usbInterface.id,
|
||||
null,
|
||||
0,
|
||||
CONTROL_TIMEOUT
|
||||
)
|
||||
clearHalt(inEndpoint)
|
||||
clearHalt(outEndpoint)
|
||||
}
|
||||
|
||||
private fun clearHalt(endpoint: UsbEndpoint) {
|
||||
connection.controlTransfer(
|
||||
UsbConstants.USB_DIR_OUT or UsbConstants.USB_TYPE_STANDARD or USB_RECIP_ENDPOINT,
|
||||
USB_REQ_CLEAR_FEATURE,
|
||||
ENDPOINT_HALT,
|
||||
endpoint.address,
|
||||
null,
|
||||
0,
|
||||
CONTROL_TIMEOUT
|
||||
)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val BUFFER_SIZE = 128 * 1024
|
||||
private const val CBW_SIZE = 31
|
||||
private const val CSW_SIZE = 13
|
||||
private const val CBW_SIGNATURE = 0x43425355 // "USBC"
|
||||
private const val CSW_SIGNATURE = 0x53425355 // "USBS"
|
||||
private const val CONTROL_TIMEOUT = 5_000
|
||||
private const val WRITE_TIMEOUT = 30_000
|
||||
|
||||
private const val USB_RECIP_INTERFACE = 0x01
|
||||
private const val USB_RECIP_ENDPOINT = 0x02
|
||||
private const val USB_REQ_CLEAR_FEATURE = 0x01
|
||||
private const val ENDPOINT_HALT = 0x00
|
||||
private const val BOT_RESET_REQUEST = 0xFF
|
||||
}
|
||||
}
|
||||
@@ -38,9 +38,7 @@
|
||||
<string name="manager_download_install">اضغط للتنزيل والتثبيت</string>
|
||||
<string name="direct_install">التثبيت المباشر (موصى به)</string> <string name="install_inactive_slot">التثبيت على الفتحة غير النشطة (بعد OTA)</string> <string name="install_inactive_slot_msg">سيُجبَر جهازك على الإقلاع من الفتحة غير النشطة الحالية بعد إعادة التشغيل!\nاستخدم هذا الخيار فقط بعد اكتمال تحديث OTA.\nهل تريد المتابعة؟</string>
|
||||
<string name="setup_title">إعداد إضافي</string>
|
||||
<string name="select_patch_file">تحديد ملف وتصحيحه</string>
|
||||
<string name="patch_file_msg">حدد ملف خام (*.img) أو ملف ODIN tar (*.tar) أو ملف payload.bin (*.bin)</string>
|
||||
<string name="download_patch_file">تنزيل ملف وتعديله</string>
|
||||
<string name="download_dialog_title">أدخل رابط الملف</string>
|
||||
<string name="download_dialog_msg">ملف OTA كاملة أو ملف المصنع</string>
|
||||
<string name="reboot_delay_toast">إعادة التشغيل خلال 5 ثوانٍ…</string>
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
<string name="install_inactive_slot">Instalar na ralura inactiva (darréu del OTA)</string>
|
||||
<string name="install_inactive_slot_msg">¡El preséu va arrincar OBLIGATORIAMENTE na ralura inactiva dempués de reaniciar!\nUsa esta opción namás dempués d\'acabar l\'anovamientu per OTA.\n¿Quies siguir?</string>
|
||||
<string name="setup_title">Configuración adicional</string>
|
||||
<string name="select_patch_file">Seleicionar y parchiar un ficheru</string>
|
||||
<string name="patch_file_msg">Seleiciona una imaxe en bruto (*.img), un archivu d\'ODIN (*.tar) o un ficheru payload.bin (*.bin)</string>
|
||||
<string name="reboot_delay_toast">Reaniciando en 5 segundos…</string>
|
||||
<string name="flash_screen_title">Instalación</string>
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
<string name="install_inactive_slot">Aktiv olmayan Slot\'a quraşdır (OTA\'dan sonra)</string>
|
||||
<string name="install_inactive_slot_msg">Cihazınız yenidən başladıqdan sonra aktiv olmayan slotda başlamağa MƏCBUR ediləcək!\nBu seçimi ancaq OTA bitdikdən sonra tətbiq edin.\nDavam edilsin?</string>
|
||||
<string name="setup_title">Əlavə Sazlamalar</string>
|
||||
<string name="select_patch_file">Fayl seç və yamaqla</string>
|
||||
<string name="patch_file_msg">(*.img) yaxud ODIN (*.tar) seç</string>
|
||||
<string name="reboot_delay_toast">5 saniyəyə yenidən başlayacaq…</string>
|
||||
<string name="flash_screen_title">Quraşdırılma</string>
|
||||
|
||||
@@ -39,9 +39,7 @@
|
||||
<string name="manager_download_install">Pritisni da preuzmeš i instaliraš</string>
|
||||
<string name="direct_install">Direktna instalacija (Preporučeno)</string> <string name="install_inactive_slot">Instalacija na neaktivan slot (Nakon OTA)</string> <string name="install_inactive_slot_msg">Vaš uređaj će biti FORSIRAN da se pokrene na trenutno neaktivnom slotu nakon ponovnog pokretanja!\nKoristite opciju samo kad se OTA završi.\nNastavi?</string>
|
||||
<string name="setup_title">Dodatne postavke</string>
|
||||
<string name="select_patch_file">Izaberi fajl</string>
|
||||
<string name="patch_file_msg">Izaberi sliku (*.img) ili ODIN tarfile (*.tar) ili payload.bin (*.bin)</string>
|
||||
<string name="download_patch_file">Preuzmi i patch-uj fajl</string>
|
||||
<string name="download_dialog_title">Unesi URL slike</string>
|
||||
<string name="download_dialog_msg">Potpuna OTA slika ili fabrička slika</string>
|
||||
<string name="reboot_delay_toast">Ponovo pokretanje za 5 sekundi…</string>
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
<string name="install_inactive_slot">Усталяваць у неактыўны слот (пасля OTA)</string>
|
||||
<string name="install_inactive_slot_msg">Ваша прылада ПРЫМУСОВА перазапусціцца ў неактыўны слот!\nВыкарыстоўвайце гэты параметр толькі пасля завяршэння OTA.\nПрацягнуць?</string>
|
||||
<string name="setup_title">Дадатковая ўсталёўка</string>
|
||||
<string name="select_patch_file">Абраць файл і ўжыць да яго патч</string>
|
||||
<string name="patch_file_msg">Абярыце файл вобраза (*.img) альбо архіў ODIN (*.tar)</string>
|
||||
<string name="reboot_delay_toast">Перазапуск праз 5 секунд…</string>
|
||||
<string name="flash_screen_title">Усталёўка</string>
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
<string name="install_inactive_slot">Инсталиране в неактивен дял (след OTA)</string>
|
||||
<string name="install_inactive_slot_msg">Устройство ЗАДЪЛЖИТЕЛНО ще зареди от текущия неактивен дял при следващия рестарт.\nИзползвайте само при приключила инсталация на OTA.\nПродължаване?</string>
|
||||
<string name="setup_title">Допълнителни настройки</string>
|
||||
<string name="select_patch_file">Избор и закърпване на файл</string>
|
||||
<string name="patch_file_msg">Изберете образ (*.img) или архив на ODIN (*.tar)</string>
|
||||
<string name="reboot_delay_toast">Рестартиране след 5 секунди…</string>
|
||||
<string name="flash_screen_title">Инсталиране</string>
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
<string name="install_inactive_slot">নিষ্ক্রিয় স্লটে ইনস্টল করুন (OTA এর পরে)</string>
|
||||
<string name="install_inactive_slot_msg">রিবুট করার পরে আপনার ডিভাইসটিকে বর্তমান নিষ্ক্রিয় স্লটে বুট করতে বাধ্য করা হবে!\It হয়ে গেলেই এই বিকল্পটি ব্যবহার করুন।\চালিয়ে রাখবেন?</string>
|
||||
<string name="setup_title">অতিরিক্ত সেটআপ</string>
|
||||
<string name="select_patch_file">একটি ফাইল নির্বাচন করুন এবং প্যাচ করুন</string>
|
||||
<string name="patch_file_msg">একটি কাঁচা চিত্র (*.img) বা একটি ODIN টারফাইল (*.tar) নির্বাচন করুন</string>
|
||||
<string name="reboot_delay_toast">৫ সেকেন্ডের মধ্যে রিবুট হচ্ছে...</string>
|
||||
<string name="flash_screen_title">স্থাপন</string>
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
<string name="install_inactive_slot">Instal·la a la ranura inactiva (Després d\'una OTA)</string>
|
||||
<string name="install_inactive_slot_msg">El teu dispositiu serà FORÇAT a arrancar en l\'actual ranura inactiva després del reinici!\nUtilitza aquesta opció NOMÉS quan l\'OTA s\'hagi fet.\nContinuar?</string>
|
||||
<string name="setup_title">Instal·lació addicional</string>
|
||||
<string name="select_patch_file">Selecciona i arranja un arxiu</string>
|
||||
<string name="patch_file_msg">Selecciona una imatge crua (*.img) o un ODIN tarfile (*.tar)</string>
|
||||
<string name="reboot_delay_toast">Reinici en 5 segons…</string>
|
||||
<string name="flash_screen_title">Instal·lació</string>
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
<string name="manager_download_install">Stiskněte pro stažení a instalaci</string>
|
||||
<string name="direct_install">Přímá instalace (doporučeno)</string> <string name="install_inactive_slot">Instalace do druhého slotu (po OTA)</string> <string name="install_inactive_slot_msg">Vaše zařízení bude po restartu VYNUCENĚ spuštěno do aktuálního neaktivního slotu!\nTuto možnost použijte pouze po dokončení OTA.\nChcete pokračovat?</string>
|
||||
<string name="setup_title">Další nastavení</string>
|
||||
<string name="select_patch_file">Vybrat a opravit soubor</string>
|
||||
<string name="patch_file_msg">Vyberte soubor RAW (*.img), soubor TAR pro ODIN (*.tar), nebo payload.bin (*.bin)</string>
|
||||
<string name="reboot_delay_toast">Restartování za 5 sekund…</string>
|
||||
<string name="flash_screen_title">Instalace</string>
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
<string name="install_inactive_slot">In inaktiven Slot installieren (nach OTA)</string>
|
||||
<string name="install_inactive_slot_msg">Dein Gerät wird gezwungen, nach einem Neustart in den inaktiven Slot zu booten! Diese Option nur verwenden, wenn OTA abgeschlossen ist.\nWeiter?</string>
|
||||
<string name="setup_title">Zusätzliche Einstellungen</string>
|
||||
<string name="select_patch_file">Eine Datei auswählen und patchen</string>
|
||||
<string name="patch_file_msg">Ein Raw Image (*.img), eine ODIN Tar-Datei (*.tar) oder eine Payload.bin (*.bin) auswählen</string>
|
||||
<string name="reboot_delay_toast">Neustart in 5 Sekunden …</string>
|
||||
<string name="flash_screen_title">Installieren</string>
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
<string name="install_inactive_slot">Εγκατάσταση στο ανενεργό Slot (Μετά από OTA)</string>
|
||||
<string name="install_inactive_slot_msg">Η συσκευή σας θα αναγκαστεί να εκκινήσει στο τρέχον ανενεργό Slot μετά από επανεκκίνηση!\nΧρησιμοποιήστε αυτήν την επιλογή μόνο αφού ολοκληρωθεί το OTA.\nΣυνέχεια;</string>
|
||||
<string name="setup_title">Πρόσθετη εγκατάσταση</string>
|
||||
<string name="select_patch_file">Επέλεξε και κάνε Patch ένα αρχείο</string>
|
||||
<string name="patch_file_msg">Επέλεξε μία raw εικόνα (*.img) ή ένα ODIN tarfile (*.tar)</string>
|
||||
<string name="reboot_delay_toast">Επανεκκίνηση σε 5 δευτερόλεπτα…</string>
|
||||
<string name="flash_screen_title">Εγκατάσταση</string>
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
<string name="install_inactive_slot">Instalar en el slot inactivo (tras una OTA)</string>
|
||||
<string name="install_inactive_slot_msg">Tu dispositivo será forzado a bootear en el slot inactivo actual después de un reinicio\nUsa esta opción solo después de que la actualización OTA se complete.\n¿Quieres continuar?</string>
|
||||
<string name="setup_title">Configuración adicional</string>
|
||||
<string name="select_patch_file">Seleccionar y parchar un archivo</string>
|
||||
<string name="patch_file_msg">Selecciona una imagen raw (.img) o un archivo comprimido que la contenga (.tar), en caso de que quieras usar Odin (Samsung)</string>
|
||||
<string name="reboot_delay_toast">Reiniciando en 5 segundos…</string>
|
||||
<string name="flash_screen_title">Instalación</string>
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
<string name="install_inactive_slot">Installi ebaaktiivsesse lahtrisse (pärast üle-õhu uuendust)</string>
|
||||
<string name="install_inactive_slot_msg">Pärast taaskäivitust SUNNITAKSE sinu seade käivituma praegusesse ebaaktiivsesse lahtrisse!\nKasuta seda valikut vaid peale üle-õhu uuenduse teostamist.\nJätkad?</string>
|
||||
<string name="setup_title">Lisaseadistus</string>
|
||||
<string name="select_patch_file">Vali ja paika fail</string>
|
||||
<string name="patch_file_msg">Vali toortõmmis (*.img) või ODIN tar-fail (*.tar)</string>
|
||||
<string name="reboot_delay_toast">Taaskäivitamine 5 sekundi pärast…</string>
|
||||
<string name="flash_screen_title">Installimine</string>
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
<string name="install_inactive_slot">نصب در حافظه غیر فعال (بعد OTA)</string>
|
||||
<string name="install_inactive_slot_msg">بعد از راه اندازی مجدد دستگاه شما مجبور به راه اندازی در حافظه غیرفعال فعلی می شود! \nفقط پس از انجام OTA از این گزینه استفاده کنید. \nادامه می دهید؟</string>
|
||||
<string name="setup_title">تنظیمات اضافی</string>
|
||||
<string name="select_patch_file">یک فایل را انتخاب و پچ کنید</string>
|
||||
<string name="patch_file_msg">یک تصویر خام (*.img) یا یک فایل (ODIN (*.tar انتخاب کنید</string>
|
||||
<string name="reboot_delay_toast">راه اندازی مجدد در 5 ثانیه…</string>
|
||||
<string name="flash_screen_title">نصب و راه اندازی</string>
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
<string name="install_inactive_slot">Installer dans l’espace inactif (après mise à jour OTA)</string>
|
||||
<string name="install_inactive_slot_msg">Votre appareil sera obligatoirement réamorcé à partir de l’espace (slot) actuellement inactif après son redémarrage !\nN’utilisez uniquement cette option qu’après que la mise à jour OTA a été effectuée.\nVoulez‑vous continuer ?</string>
|
||||
<string name="setup_title">Configuration supplémentaire</string>
|
||||
<string name="select_patch_file">Sélectionnez le fichier cible du correctif</string>
|
||||
<string name="patch_file_msg">Sélectionnez une image brute (*.img) ou une archive TAR ODIN (*.tar) ou un fichier payload.bin (*.bin)</string>
|
||||
<string name="reboot_delay_toast">Redémarrage dans 5 secondes…</string>
|
||||
<string name="flash_screen_title">Installation</string>
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
<string name="install_inactive_slot">निष्क्रिय स्लॉट में इंस्टॉल करें (OTA के बाद)</string>
|
||||
<string name="install_inactive_slot_msg">आपका डिवाइस रीबूट होने के बाद वर्तमान निष्क्रिय स्लॉट में बूट करने के लिए मजबूर किया जाएगा!\n इस विकल्प का उपयोग सिर्फ OTA हो जाने के बाद करें।\n जारी रखें?</string>
|
||||
<string name="setup_title">अतिरिक्त सेटअप</string>
|
||||
<string name="select_patch_file">एक फ़ाइल का चयन और पैच करें</string>
|
||||
<string name="patch_file_msg">एक रॉ छवि (* .img) या एक ODIN tarfile (* .tar) का चयन करें</string>
|
||||
<string name="reboot_delay_toast">5 सेकंड में रिबूट हो रहा है...</string>
|
||||
<string name="flash_screen_title">इंस्टॉलेशन</string>
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
<string name="install_inactive_slot">Inactive slot par install karo (OTA ke baad)</string>
|
||||
<string name="install_inactive_slot_msg">Reboot ke baad device ko inactive slot se boot karna padega!\nSirf tab use karo jab OTA complete ho chuka ho.\nAage badhna hai?</string>
|
||||
<string name="setup_title">Extra setup</string>
|
||||
<string name="select_patch_file">File select karke patch karo</string>
|
||||
<string name="patch_file_msg">Raw image (*.img), ODIN tar file (*.tar), ya payload.bin (*.bin) select karo</string>
|
||||
<string name="reboot_delay_toast">Phone 5 second mein reboot hoga…</string>
|
||||
<string name="flash_screen_title">Installation ho rahi hai</string>
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
<string name="install_inactive_slot">Instaliraj u neaktivni utor (Nakon OTA)</string>
|
||||
<string name="install_inactive_slot_msg">Vaš će se uređaj prisiliti pokrenuti s trenutnog neaktivnog mjesta nakon ponovnog pokretanja!\nKoristite tu opciju samo nakon što je OTA dovršena.\nContinue?</string>
|
||||
<string name="setup_title">Dodatno postavljanje</string>
|
||||
<string name="select_patch_file">Odaberite patch datoteku</string>
|
||||
<string name="patch_file_msg">Odaberite raw (*.img) ili ODIN tarfile (*.tar)</string>
|
||||
<string name="reboot_delay_toast">Ponovno pokretanje za 5 sekundi…</string>
|
||||
<string name="flash_screen_title">Instalacija</string>
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
<string name="install_inactive_slot">Telepítés inaktív slot-ba (OTA után)</string>
|
||||
<string name="install_inactive_slot_msg">Eszközöd újraindítás után KÉNYSZERÍTVE az aktuális inaktív slot-ból indulásra!\nEzt az opciót csak az OTA befejezése után használd.\nFolytatod?</string>
|
||||
<string name="setup_title">További beállítások</string>
|
||||
<string name="select_patch_file">Fájl kiválasztás és módosítása</string>
|
||||
<string name="patch_file_msg">Válassz ki egy raw image-et (*.img) vagy egy ODIN tar fájlt (*.tar)</string>
|
||||
<string name="reboot_delay_toast">Újraindítás 5 másodpercen belül…</string>
|
||||
<string name="flash_screen_title">Telepítés</string>
|
||||
|
||||
@@ -45,9 +45,7 @@
|
||||
<string name="install_inactive_slot">Pasang ke slot tidak aktif (Setelah OTA)</string>
|
||||
<string name="install_inactive_slot_msg">Perangkat Anda akan DIPAKSA untuk boot ke slot tidak aktif saat ini setelah dimulai ulang!\nGunakan opsi ini hanya setelah OTA selesai.\nLanjutkan?</string>
|
||||
<string name="setup_title">Penyiapan tambahan</string>
|
||||
<string name="select_patch_file">Pilih dan tambal berkas</string>
|
||||
<string name="patch_file_msg">Pilih berkas image mentah (*.img) atau tar ODIN (*.tar) atau payload.bin (*.bin)</string>
|
||||
<string name="download_patch_file">Unduh dan tambal berkas</string>
|
||||
<string name="download_dialog_title">Masukkan URL image</string>
|
||||
<string name="download_dialog_msg">Image OTA lengkap atau image pabrik</string>
|
||||
<string name="reboot_delay_toast">Memulai ulang dalam 5 detik…</string>
|
||||
|
||||
@@ -38,9 +38,7 @@
|
||||
<string name="manager_download_install">Apri questa notifica per scaricare e installare</string>
|
||||
<string name="direct_install">Installazione diretta (raccomandata)</string> <string name="install_inactive_slot">Installa nello slot inattivo (dopo un aggiornamento OTA)</string> <string name="install_inactive_slot_msg">Questo dispositivo verrà FORZATO ad avviarsi usando lo slot inattivo!\nUsa questo metodo solo dopo che un aggiornamento OTA è stato installato.\nVuoi continuare?</string>
|
||||
<string name="setup_title">Configurazione aggiuntiva</string>
|
||||
<string name="select_patch_file">Seleziona e aggiorna un file</string>
|
||||
<string name="patch_file_msg">Seleziona un\'immagine in formato .img, un file .tar di ODIN o un file payload.bin</string>
|
||||
<string name="download_patch_file">Scarica e applica una patch a un file</string>
|
||||
<string name="download_dialog_title">Inserisci l\'URL dell\'immagine</string>
|
||||
<string name="download_dialog_msg">Immagine OTA completa o immagine di fabbrica</string>
|
||||
<string name="reboot_delay_toast">Riavvio fra 5 secondi…</string>
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
<string name="install_inactive_slot">התקנה לסלוט לא פעיל (לאחר OTA)</string>
|
||||
<string name="install_inactive_slot_msg">ההתקן שלך ייאלץ אתחול לסלוט הלא פעיל הנוכחי שלך לאחר הפעלה מחדש!\nיש להשתמש באפשרות זו רק לאחר ביצוע OTA בלבד.\nלהמשיך?</string>
|
||||
<string name="setup_title">התקנה נוספת</string>
|
||||
<string name="select_patch_file">בחירה והתקנת קובץ</string>
|
||||
<string name="patch_file_msg">בחירת קובץ גולמי (*.img) או ODIN tarfile (*.tar) או payload.bin (*.bin)</string>
|
||||
<string name="reboot_delay_toast">מאתחל בעוד 5 שניות…</string>
|
||||
<string name="flash_screen_title">התקנה</string>
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
<string name="install_inactive_slot">別のスロットにインストール (OTA 後)</string>
|
||||
<string name="install_inactive_slot_msg">お使いのデバイスは再起動後に現在とは別のスロットで強制的に起動されます!\nこのオプションは OTA の完了後にのみ使用してください。\n続行しますか?</string>
|
||||
<string name="setup_title">追加セットアップ</string>
|
||||
<string name="select_patch_file">パッチするファイルの選択</string>
|
||||
<string name="patch_file_msg">イメージファイル (*.img) または ODIN tar ファイル (*.tar) を選択してください</string>
|
||||
<string name="reboot_delay_toast">5秒後に再起動します…</string>
|
||||
<string name="flash_screen_title">インストール</string>
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
<string name="install_inactive_slot">არააქტიურ სლოტში დაყენება (სისტემის განახლების შემდეგ)</string>
|
||||
<string name="install_inactive_slot_msg">თქვენი მოწყობილობა გადაიტვირთება არააქატიურ სლოტში!\nგამოიყენეთ ეს ოფცია მხოლოდ სისტემის განახლების დროს.\nგავაგრძელოთ?</string>
|
||||
<string name="setup_title">დამატებითი ინსტალაცია</string>
|
||||
<string name="select_patch_file">ფაილის დაპატჩვა</string>
|
||||
<string name="patch_file_msg">აირჩიეთ (*.img) ფაილი ან ODIN tarfile-ი (*.tar)</string>
|
||||
<string name="reboot_delay_toast">გადატვირთვა 5 წამში…</string>
|
||||
<string name="flash_screen_title">ინსტალაცია</string>
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
<string name="install_inactive_slot">Белсенді емес слотқа орнату (OTA-дан кейін)</string>
|
||||
<string name="install_inactive_slot_msg">Құрылғыңыз белсенді емес слотқа МӘЖБҮРЛІ ТҮРДЕ қайта жүктеледі!\nБұл тәсілді тек OTA жаңартуынан кейін қолданыңыз.\nЖалғастырасыз ба?</string>
|
||||
<string name="setup_title">Қосымша баптау</string>
|
||||
<string name="select_patch_file">Файл таңдап, патчтау</string>
|
||||
<string name="patch_file_msg">Жад бөлімінің бейнесін (*.img), ODIN мұрағатын (*.tar) немесе payload.bin (*.bin) файлын таңдаңыз</string>
|
||||
<string name="reboot_delay_toast">5 секундтан кейін қайта жүктеледі…</string>
|
||||
<string name="flash_screen_title">Орнату</string>
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
<string name="install_inactive_slot">비활성 슬롯에 설치 (OTA 이후)</string>
|
||||
<string name="install_inactive_slot_msg">기기를 다시 시작한 후에는 현재 비활성 상태인 슬롯으로 강제로 부팅됩니다!\nOTA 업데이트 후에만 이 옵션을 사용하십시오.\n계속하시겠습니까?</string>
|
||||
<string name="setup_title">추가 설정</string>
|
||||
<string name="select_patch_file">파일 선택 및 패치</string>
|
||||
<string name="patch_file_msg">raw 이미지 (*.img) 또는 ODIN tar 파일 (*.tar) 선택</string>
|
||||
<string name="reboot_delay_toast">5초 후 다시 시작합니다…</string>
|
||||
<string name="flash_screen_title">설치과정</string>
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
<string name="install_inactive_slot">دایبگرە بۆ خانەی ناچالاک(پاش OTA)</string>
|
||||
<string name="install_inactive_slot_msg">ئێستا ئامێرەکەت دەچێتە خانە ناچالاکەکە، ئەمە بەکاربهێنە تەنها دوای ئەپدەیت کردن لە ڕێگەی OTA، بەردەوام دەبیت؟</string>
|
||||
<string name="setup_title">ڕێکخستنی زیاتر</string>
|
||||
<string name="select_patch_file">فایلێک هەڵبژێرە و پینەی بکە</string>
|
||||
<string name="patch_file_msg">تکایە فایلێکی Tar یان img یان payload.bin هەڵبژێرە</string>
|
||||
<string name="reboot_delay_toast">ڕێستارت کردنەوە لە ماوەی ٥ چرکە…</string>
|
||||
<string name="flash_screen_title">ڕێکخستن</string>
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
<string name="install_inactive_slot">Įdiegti į antrąją vietą (po OTA naujinimo)</string>
|
||||
<string name="install_inactive_slot_msg">Jūsų įremginys bus PRIVERSTAS pasileisti į dabartinę neaktyvią vietą po paleidimo iš naujo!\nNaudokite šią parinktį, kai OTA naujinimas yra baigtas.\nTęsti?</string>
|
||||
<string name="setup_title">Išplėstinė sąranka</string>
|
||||
<string name="select_patch_file">Pasirinkite ir taisykite failą</string>
|
||||
<string name="patch_file_msg">Pasirinkite vaizdo failą (*.img) arba ODIN archyvą (*.tar)</string>
|
||||
<string name="reboot_delay_toast">Paleidžiama iš naujo po 5 sekundžių…</string>
|
||||
<string name="flash_screen_title">Įdiegimas</string>
|
||||
|
||||
@@ -47,7 +47,6 @@
|
||||
<string name="install_inactive_slot">Инсталирај во неактивен слот (по ОТА)</string>
|
||||
<string name="install_inactive_slot_msg">Вашиот уред ќе биде ПРИНУДЕН да се подигне на тековниот неактивен слот по рестартирањето!\nОваа опција користете ја само откако OTA ажурирање е направено.\nПродолжи?</string>
|
||||
<string name="setup_title">Дополнителни подесувања</string>
|
||||
<string name="select_patch_file">Избери и обнови ја датотеката</string>
|
||||
<string name="patch_file_msg">Избери само image датотека (*.img) или ODIN tar датотека (*.tar)</string>
|
||||
<string name="reboot_delay_toast">Рестартирање за 5 секунди…</string>
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
<string name="install_inactive_slot">നിഷ്ക്രിയ സ്ലോട്ടിലേക്ക് ഇൻസ്റ്റാൾ ചെയ്യുക (OTA-ന് ശേഷം)</string>
|
||||
<string name="install_inactive_slot_msg">റീബൂട്ടിന് ശേഷം നിങ്ങളുടെ ഉപകരണം നിലവിലെ നിഷ്ക്രിയ സ്ലോട്ടിലേക്ക് ബൂട്ട് ചെയ്യാൻ നിർബന്ധിതരാകും!\nOTA പൂർത്തിയാക്കിയതിന് ശേഷം മാത്രം ഈ ഓപ്ഷൻ ഉപയോഗിക്കുക.\nതുടരണോ?</string>
|
||||
<string name="setup_title">അധിക സജ്ജീകരണം</string>
|
||||
<string name="select_patch_file">ഒരു ഫയൽ തിരഞ്ഞെടുത്ത് പാച്ച് ചെയ്യുക</string>
|
||||
<string name="patch_file_msg">ഒരു റോ ഇമേജ് (*.img) അല്ലെങ്കിൽ ഒരു ODIN ടാർ ഫയൽ (*.tar) തിരഞ്ഞെടുക്കുക</string>
|
||||
<string name="reboot_delay_toast">5 സെക്കൻഡിൽ റീബൂട്ട് ചെയ്യുന്നു…</string>
|
||||
<string name="flash_screen_title">ഇൻസ്റ്റലേഷൻ</string>
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
<string name="install_inactive_slot">Installer til inaktiv plass (etter OTA)</string>
|
||||
<string name="install_inactive_slot_msg">Din enhet vil bli tvunget til å starte opp i inaktiv plass etter omstart!\nKun bruk dette etter at OTA er ferdig.\Fortsett?</string>
|
||||
<string name="setup_title">Ytterligere oppsett</string>
|
||||
<string name="select_patch_file">Velg og utfør programfiks av en fil</string>
|
||||
<string name="patch_file_msg">Velg et rå-avtrykk (*.img) eller en ODIN-tjæreballfil (*.tar)</string>
|
||||
<string name="reboot_delay_toast">Starter på ny om 5 sek …</string>
|
||||
<string name="flash_screen_title">Installasjon</string>
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
<string name="install_inactive_slot">Installeren in inactieve sleuf (na OTA)</string>
|
||||
<string name="install_inactive_slot_msg">Je apparaat wordt GEDWONGEN opgestart in de huidige inactieve sleuf na het herstarten!\nGebruik deze optie alleen NA het installeren van een OTA-update.\nWil je doorgaan?</string>
|
||||
<string name="setup_title">Installatie afronden</string>
|
||||
<string name="select_patch_file">Kies en patch een bestand</string>
|
||||
<string name="patch_file_msg">Kies een schijfkopie (*.img) of ODIN-tarbestand (*.tar)</string>
|
||||
<string name="reboot_delay_toast">Je apparaat wordt over 5 seconden herstart…</string>
|
||||
<string name="flash_screen_title">Installatie</string>
|
||||
|
||||
@@ -40,7 +40,6 @@
|
||||
<string name="install_inactive_slot">ਨਾ-ਸਰਗਰਮ ਸਲਾਟ ਵਿੱਚ ਇੰਸਟਾਲ ਕਰੋ (OTA ਤੋਂ ਬਾਅਦ)</string>
|
||||
<string name="install_inactive_slot_msg">ਤੁਹਾਡੀ ਡਿਵਾਈਸ ਨੂੰ ਮੁੜ ਚਾਲੂ ਹੋਣ ਤੋਂ ਬਾਅਦ ਮੌਜੂਦਾ ਨਿਸ਼ਕਿਰਿਆ ਨੰਬਰ ਤੇ ਬੂਟ ਕਰਨ ਲਈ ਮਜਬੂਰ ਕੀਤਾ ਜਾਏਗਾ!\n OTA ਪੂਰਾ ਹੋਣ ਤੋਂ ਬਾਅਦ ਹੀ ਇਸ ਵਿਕਲਪ ਦੀ ਵਰਤੋਂ ਕਰੋ।\n ਜਾਰੀ ਰੱਖਣਾ ਹੈ?</string>
|
||||
<string name="setup_title">ਅਤਿਰਿਕਤ ਸੈਟਅਪ</string>
|
||||
<string name="select_patch_file">ਇੱਕ ਫਾਈਲ ਚੁਣੋ ਅਤੇ ਪੈਚ ਕਰੋ</string>
|
||||
<string name="patch_file_msg">ਇੱਕ ਰੋ ਛੱਞੀ ਨੂੰ (* .img) ਜਾਂ ਇੱਕ Odin tarfile (* .tar) ਦੀ ਚੋਣ ਕਰੋ</string>
|
||||
<string name="reboot_delay_toast">5 ਸਕਿੰਟਾਂ ਵਿੱਚ ਰੀਬੂਟ ਹੋ ਰਿਹਾ ਹੈ …</string>
|
||||
<string name="flash_screen_title">ਇੰਸਟਾਲੇਸ਼ਨ</string>
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
<string name="install_inactive_slot">Zainstaluj w nieaktywnym slocie (po OTA)</string>
|
||||
<string name="install_inactive_slot_msg">Po ponownym uruchomieniu twoje urządzenie zostanie ZMUSZONE do rozruchu z aktualnie nieaktywnego slotu!\nUżywaj tej opcji tylko po ukończeniu aktualizacji OTA.\nKontynuować?</string>
|
||||
<string name="setup_title">Dodatkowa konfiguracja</string>
|
||||
<string name="select_patch_file">Wybierz i załataj plik</string>
|
||||
<string name="patch_file_msg">Wybierz obraz raw (*.img) lub plik tar ODIN (*.tar) lub payload.bin (*.bin)</string>
|
||||
<string name="reboot_delay_toast">Ponowne uruchomienie za 5 sekund…</string>
|
||||
<string name="flash_screen_title">Instalacja</string>
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
<string name="install_inactive_slot">Instalar no slot inativo (após o OTA)</string>
|
||||
<string name="install_inactive_slot_msg">Seu dispositivo será FORÇADO a inicializar no slot inativo atual após uma reinicialização!\nSó use esta opção após a conclusão do OTA.\nDeseja continuar?</string>
|
||||
<string name="setup_title">Configuração adicional</string>
|
||||
<string name="select_patch_file">Selecione e corrija um arquivo</string>
|
||||
<string name="patch_file_msg">Selecione um arquivo imagem (*.img) ou um arquivo tar (*.tar) ou um arquivo payload.bin (*.bin)</string>
|
||||
<string name="reboot_delay_toast">Reiniciando em 5 segundos…</string>
|
||||
<string name="flash_screen_title">Instalação</string>
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
<string name="install_inactive_slot">Instalar no slot inativo (após o OTA)</string>
|
||||
<string name="install_inactive_slot_msg">O seu dispositivo será FORÇADO a inicializar no slot inativo atual após um reinício!\nSó use esta opção após a conclusão do OTA.\nDeseja continuar?</string>
|
||||
<string name="setup_title">Configuração adicional</string>
|
||||
<string name="select_patch_file">Selecione e corrija um ficheiro</string>
|
||||
<string name="patch_file_msg">Selecione um ficheiro de imagem (*.img) ou um ficheiro tar (*.tar) ou um ficheiro payload.bin (*.bin)</string>
|
||||
<string name="reboot_delay_toast">A reiniciar em 5 segundos…</string>
|
||||
<string name="flash_screen_title">Instalação</string>
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
<string name="install_inactive_slot">Instalează în slotul inactiv (După OTA)</string>
|
||||
<string name="install_inactive_slot_msg">Dispozitivul va fi FORȚAT să booteze în slotul actual inactiv după repornire!\nFolosește această opțiune numai după terminarea OTA.\nContinui?</string>
|
||||
<string name="setup_title">Configurare suplimentară</string>
|
||||
<string name="select_patch_file">Selectează și patchuiește un fișier</string>
|
||||
<string name="patch_file_msg">Selectează o imagine brută (*.img) sau un fișier tar ODIN (*.tar)</string>
|
||||
<string name="reboot_delay_toast">Repornire în 5 secunde…</string>
|
||||
<string name="flash_screen_title">Instalare</string>
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
<string name="install_inactive_slot">Установка во второй слот (после OTA-обновления)</string>
|
||||
<string name="install_inactive_slot_msg">Ваше устройство будет принудительно перезагружено в неактивный (противоположный) слот!\nИспользуйте эту опцию только при интеграции Magisk после OTA-обновления!\nПродолжить?</string>
|
||||
<string name="setup_title">Расширенная установка</string>
|
||||
<string name="select_patch_file">Пропатчить boot-образ</string>
|
||||
<string name="patch_file_msg">Выберите файл образа (*.img) или архив ODIN (*.tar)</string>
|
||||
<string name="reboot_delay_toast">Перезагрузка через 5 секунд…</string>
|
||||
<string name="flash_screen_title">Установка</string>
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
<string name="install_inactive_slot">Inštalovať na neaktívny slot (Po OTA)</string>
|
||||
<string name="install_inactive_slot_msg">Vaše zariadenie bude po reštarte PRINÚTENÉ nabootovať do aktuálne neaktívneho slotu!\nTúto voľbu použite iba po skončení OTA.\nPokračovať?</string>
|
||||
<string name="setup_title">Ďalšie nastavenia</string>
|
||||
<string name="select_patch_file">Vybrať a zaplátať súbor</string>
|
||||
<string name="patch_file_msg">Vyberte raw súbor (*.img) alebo tar súbor ODIN (*.tar) alebo payload.bin (*.bin)</string>
|
||||
<string name="reboot_delay_toast">Reštart o 5 sekúnd…</string>
|
||||
<string name="flash_screen_title">Inštalácia</string>
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
<string name="manager_download_install">Shtypni për të shkarkuar dhe instaluar</string>
|
||||
<string name="direct_install">Instalim direkt (I rekomanduar)</string> <string name="install_inactive_slot">Instalo në slotin joaktiv (Pas OTA)</string> <string name="install_inactive_slot_msg">Pajisja juaj do të DETYROHET të ndizet në slotin aktual joaktiv pas rinisjes!\nPërdoreni këtë opsion vetëm pasi të ketë përfunduar OTA.\nVazhdoni?</string>
|
||||
<string name="setup_title">Konfigurim shtesë</string>
|
||||
<string name="select_patch_file">Zgjidhni dhe arnoni një skedar</string>
|
||||
<string name="patch_file_msg">Zgjidhni një imazh raw (*.img), një ODIN tarfile (*.tar) ose një payload.bin (*.bin)</string>
|
||||
<string name="reboot_delay_toast">Duke u rinisur pas 5 sekondave…</string>
|
||||
<string name="flash_screen_title">Instalimi</string>
|
||||
|
||||
@@ -39,9 +39,7 @@
|
||||
<string name="manager_download_install">Притисни да преузмеш и инсталираш</string>
|
||||
<string name="direct_install">Директна инсталација (Препоручено)</string> <string name="install_inactive_slot">Инсталација на неактиван слот (Након OTA)</string> <string name="install_inactive_slot_msg">Ваш уређај ће бити ФОРСИРАН да се покрене на тренутно неактивном слоту након поновног покретања!\nКористите опцију само кад се OTA заврши.\nНастави?</string>
|
||||
<string name="setup_title">Додатне поставке</string>
|
||||
<string name="select_patch_file">Изабери фајл</string>
|
||||
<string name="patch_file_msg">Изабери слику (*.img) или ODIN tarfile (*.tar) или payload.bin (*.bin)</string>
|
||||
<string name="download_patch_file">Преузми и patch-уј фајл</string>
|
||||
<string name="download_dialog_title">Унеси URL слике</string>
|
||||
<string name="download_dialog_msg">Потпуна OTA слика или фабричка слика</string>
|
||||
<string name="reboot_delay_toast">Поново покретање за 5 секунди…</string>
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
<string name="install_inactive_slot">Installera till inaktiv Slot (Efter OTA)</string>
|
||||
<string name="install_inactive_slot_msg">Din enhet kommer att bli TVINGAD att starta till den nuvarande inaktiva slot efter omstart!\nAnvänd endast detta alternativ efter att en OTA uppdatering är utförd.\nFortsätt??</string>
|
||||
<string name="setup_title">Ytterligare installation</string>
|
||||
<string name="select_patch_file">Välj och patcha en fil</string>
|
||||
<string name="patch_file_msg">Välj en rå avbildningsfil (*.img) eller en ODIN tar-fil (*.tar)</string>
|
||||
<string name="reboot_delay_toast">Omstart om 5 sekunder…</string>
|
||||
<string name="flash_screen_title">Installation</string>
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
<string name="install_inactive_slot">Install to Inactive Slot (After OTA)</string>
|
||||
<string name="install_inactive_slot_msg">Your device will be FORCED to boot to the current inactive slot after a reboot!\nOnly use this option after OTA is done.\nContinue?</string>
|
||||
<string name="setup_title">Additional Setup</string>
|
||||
<string name="select_patch_file">Select and Patch a File</string>
|
||||
<string name="patch_file_msg">Select a raw image (*.img) or an ODIN tarfile (*.tar)</string>
|
||||
<string name="reboot_delay_toast">Rebooting in 5 seconds…</string>
|
||||
<string name="flash_screen_title">Installation</string>
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
<string name="install_inactive_slot">செயலற்ற ஸ்லாட்டுக்கு நிறுவவும் (OTA க்குப் பிறகு)</string>
|
||||
<string name="install_inactive_slot_msg">மறுதொடக்கம் செய்தபின் தற்போதைய செயலற்ற ஸ்லாட்டுக்கு துவக்க உங்கள் சாதனம் கட்டாயப்படுத்தப்படும்!\nOTA முடிந்தபின் மட்டுமே இந்த விருப்பத்தைப் பயன்படுத்தவும்.\nதொடரவா?</string>
|
||||
<string name="setup_title">கூடுதல் அமைப்பு</string>
|
||||
<string name="select_patch_file">ஒரு கோப்பைத் தேர்ந்தெடுத்து ஒட்டவும்</string>
|
||||
<string name="patch_file_msg">மூல படம் (* .img) அல்லது ODIN டார்ஃபைல் (* .tar) ஐத் தேர்ந்தெடுக்கவும்</string>
|
||||
<string name="reboot_delay_toast">5 வினாடிகளில் மீண்டும் துவக்குகிறது…</string>
|
||||
<string name="flash_screen_title">நிறுவல்</string>
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
<string name="manager_download_install">İndirmek ve yüklemek için dokunun</string>
|
||||
<string name="direct_install">Doğrudan kurulum (Önerilen)</string> <string name="install_inactive_slot">Etkin olmayan slota kur (OTA\'dan sonra)</string> <string name="install_inactive_slot_msg">Cihazınız yeniden başlatıldıktan sonra mevcut etkin olmayan slottan başlatılmaya ZORLANACAK!\nBu seçeneği yalnızca OTA işlemi bittikten sonra kullanın.\nDevam edilsin mi?</string>
|
||||
<string name="setup_title">Ek kurulum</string>
|
||||
<string name="select_patch_file">Bir dosya seçin ve yamalayın</string>
|
||||
<string name="patch_file_msg">Bir ham imaj (*.img), ODIN tar dosyası (*.tar) veya payload.bin (*.bin) seçin</string>
|
||||
<string name="reboot_delay_toast">5 saniye içinde yeniden başlatılıyor…</string>
|
||||
<string name="flash_screen_title">Kurulum</string>
|
||||
|
||||
@@ -38,9 +38,7 @@
|
||||
<string name="manager_download_install">Натисніть, щоб завантажити і встановити</string>
|
||||
<string name="direct_install">Пряме встановлення (рекомендовано)</string> <string name="install_inactive_slot">Встановити в неактивний слот (після OTA)</string> <string name="install_inactive_slot_msg">Ваш пристрій буде примусово перезавантажено в неактивний слот!\nВикористовуйте цю опцію тільки для встановлення OTA.\nПродовжити?</string>
|
||||
<string name="setup_title">Додаткове налаштування</string>
|
||||
<string name="select_patch_file">Вибрати і пропатчити файл</string>
|
||||
<string name="patch_file_msg">Виберіть необроблений образ (*.img) або стиснутий файл ODIN (*.tar)</string>
|
||||
<string name="download_patch_file">Завантажити і пропатчити файл</string>
|
||||
<string name="download_dialog_title">Введіть URL образу</string>
|
||||
<string name="download_dialog_msg">Повний OTA-образ або заводський образ</string>
|
||||
<string name="reboot_delay_toast">Перезавантаження через 5 секунд…</string>
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
<string name="install_inactive_slot">غیر فعال سلاٹ میں انسٹال کریں (OTA کے بعد)</string>
|
||||
<string name="install_inactive_slot_msg">ریبوٹ کے بعد آپ کا آلہ زبردستی موجودہ غیر فعال سلاٹ میں بوٹ ہو جائے گا!\nیہ آپشن صرف OTA مکمل ہونے کے بعد استعمال کریں۔\nجاری رکھیں؟</string>
|
||||
<string name="setup_title">اضافی سیٹ اپ</string>
|
||||
<string name="select_patch_file">پیچ فائل منتخب اور پیچ کریں</string>
|
||||
<string name="patch_file_msg">ایک خام امیج (*.img) یا ایک ODIN ٹار فائل (*.tar) یا ایک payload.bin (*.bin) منتخب کریں</string>
|
||||
<string name="reboot_delay_toast">5 سیکنڈ میں ریبوٹ ہو رہا ہے…</string>
|
||||
<string name="flash_screen_title">انسٹالیشن</string>
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
<string name="install_inactive_slot">Cài đặt vào vùng không hoạt động (Sau OTA)</string>
|
||||
<string name="install_inactive_slot_msg">Thiết bị của bạn sẽ bị BUỘC khởi động vào vị trí không hoạt động hiện tại sau khi khởi động lại!\nChỉ sử dụng tùy chọn này sau khi hoàn tất OTA.\nTiếp tục chứ?</string>
|
||||
<string name="setup_title">Thiết lập bổ sung</string>
|
||||
<string name="select_patch_file">Chọn và vá tệp</string>
|
||||
<string name="patch_file_msg">Chọn đĩa ảnh (*.img) hoặc tệp tarfile ODIN (*.tar)</string>
|
||||
<string name="reboot_delay_toast">Khởi động lại sau 5 giây…</string>
|
||||
<string name="flash_screen_title">Cài đặt</string>
|
||||
|
||||
@@ -45,9 +45,7 @@
|
||||
<string name="install_inactive_slot">安装到未使用的槽位(OTA 后)</string>
|
||||
<string name="install_inactive_slot_msg">将在重启后强制切换到另一个槽位!注意只能在 OTA 更新完成后的重启之前使用。</string>
|
||||
<string name="setup_title">修复安装</string>
|
||||
<string name="select_patch_file">选择并修补文件</string>
|
||||
<string name="patch_file_msg">选择一个原始映像文件(*.img)、Odin 包(*.tar)或 payload.bin(*.bin)</string>
|
||||
<string name="download_patch_file">下载并修补映像</string>
|
||||
<string name="download_dialog_title">输入映像链接</string>
|
||||
<string name="download_dialog_msg">完整 OTA 映像或者出厂映像</string>
|
||||
<string name="reboot_delay_toast">设备将在 5 秒后重启</string>
|
||||
|
||||
@@ -46,9 +46,7 @@
|
||||
<string name="install_inactive_slot">安裝到非使用中的槽位(在 OTA 更新後)</string>
|
||||
<string name="install_inactive_slot_msg">您的裝置將在下次重新啟動後強制切換到非使用中的槽位!\n這個選項僅在 OTA 更新完畢後使用。\n請問是否繼續?</string>
|
||||
<string name="setup_title">修復安裝</string>
|
||||
<string name="select_patch_file">選擇並修補檔案</string>
|
||||
<string name="patch_file_msg">請選取未修改過的映像檔 (*.img) 或 Odin 的 TAR 檔案 (*.tar) 或 payload.bin (*.bin)</string>
|
||||
<string name="download_patch_file">下載並修補映像檔</string>
|
||||
<string name="download_dialog_title">輸入映像檔連結</string>
|
||||
<string name="download_dialog_msg">完整 OTA 映像檔或原廠映像檔</string>
|
||||
<string name="reboot_delay_toast">將在 5 秒後重新啟動……</string>
|
||||
|
||||
@@ -45,13 +45,17 @@
|
||||
<string name="install_inactive_slot">Install to inactive slot (After OTA)</string>
|
||||
<string name="install_inactive_slot_msg">Your device will be FORCED to boot to the current inactive slot after a reboot!\nOnly use this option after OTA is done.\nContinue?</string>
|
||||
<string name="setup_title">Additional setup</string>
|
||||
<string name="select_patch_file">Select and patch a file</string>
|
||||
<string name="patch_image">Patch firmware / image</string>
|
||||
<string name="select_from_storage">Select from storage</string>
|
||||
<string name="patch_file_msg">Select a raw image (*.img) or an ODIN tarfile (*.tar) or a payload.bin (*.bin)</string>
|
||||
<string name="download_patch_file">Download and patch a file</string>
|
||||
<string name="download_dialog_title">Enter image URL</string>
|
||||
<string name="download_dialog_msg">Full OTA image or factory image</string>
|
||||
<string name="download_googlebook_recovery_image">Download latest Googlebook recovery image</string>
|
||||
<string name="download_pixel_factory_image">Download latest Pixel factory image</string>
|
||||
<string name="output_destination">Output destination</string>
|
||||
<string name="save_to_file">Save to file</string>
|
||||
<string name="no_usb_drive_found">No USB drive detected. Insert a USB flash drive.</string>
|
||||
<string name="usb_overwrite_warning">All data on the selected USB drive will be permanently erased.</string>
|
||||
<string name="reboot_delay_toast">Rebooting in 5 seconds…</string>
|
||||
<string name="flash_screen_title">Installation</string>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user