feat: improve patcher screen labels

This commit is contained in:
Robert
2024-06-23 21:01:20 +02:00
committed by oSumAtrIX
parent 154f036fe9
commit f4d6c60b9e
5 changed files with 17 additions and 23 deletions

View File

@@ -47,7 +47,7 @@ class Session(
var nextPatchIndex = 0
updateProgress(
name = androidContext.getString(R.string.applying_patch, selectedPatches[nextPatchIndex]),
name = androidContext.getString(R.string.executing_patch, selectedPatches[nextPatchIndex]),
state = State.RUNNING
)
@@ -56,7 +56,7 @@ class Session(
if (exception != null) {
updateProgress(
name = androidContext.getString(R.string.failed_to_apply_patch, patch.name),
name = androidContext.getString(R.string.failed_to_execute_patch, patch.name),
state = State.FAILED,
message = exception.stackTraceToString()
)
@@ -72,7 +72,7 @@ class Session(
selectedPatches.getOrNull(nextPatchIndex)?.let { nextPatch ->
updateProgress(
name = androidContext.getString(R.string.applying_patch, nextPatch.name)
name = androidContext.getString(R.string.executing_patch, nextPatch.name)
)
}
@@ -82,7 +82,7 @@ class Session(
updateProgress(
state = State.COMPLETED,
name = androidContext.resources.getQuantityString(
R.plurals.patches_applied,
R.plurals.patches_executed,
selectedPatches.size,
selectedPatches.size
)
@@ -105,7 +105,6 @@ class Session(
logger.info("Merging integrations")
acceptIntegrations(integrations.toSet())
acceptPatches(selectedPatches.toSet())
updateProgress(state = State.COMPLETED) // Merging
logger.info("Applying patches...")
applyPatchesVerbose(selectedPatches.sortedBy { it.name })

View File

@@ -184,11 +184,11 @@ class PatcherWorker(
Log.i(tag, "Patching succeeded".logFmt())
Result.success()
} catch (e: ProcessRuntime.RemoteFailureException) {
Log.e(tag, "An exception occured in the remote process while patching. ${e.originalStackTrace}".logFmt())
Log.e(tag, "An exception occurred in the remote process while patching. ${e.originalStackTrace}".logFmt())
updateProgress(state = State.FAILED, message = e.originalStackTrace)
Result.failure()
} catch (e: Exception) {
Log.e(tag, "An exception occured while patching".logFmt(), e)
Log.e(tag, "An exception occurred while patching".logFmt(), e)
updateProgress(state = State.FAILED, message = e.stackTraceToString())
Result.failure()
} finally {

View File

@@ -316,13 +316,9 @@ class PatcherViewModel(
context.getString(R.string.patcher_step_unpack),
StepCategory.PREPARING
),
Step(
context.getString(R.string.patcher_step_integrations),
StepCategory.PREPARING
),
Step(
context.getString(R.string.apply_patches),
context.getString(R.string.execute_patches),
StepCategory.PATCHING
),