feat: improve patcher screen labels

This commit is contained in:
Robert 2024-06-23 21:01:20 +02:00 committed by oSumAtrIX
parent 5150adeaff
commit e2f02ebf22
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4
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
),

View File

@ -4,8 +4,8 @@
<item quantity="one">%d patch</item>
<item quantity="other">%d patches</item>
</plurals>
<plurals name="patches_applied">
<item quantity="one">Applied %d patch</item>
<item quantity="other">Applied %d patches</item>
<plurals name="patches_executed">
<item quantity="one">Executed %d patch</item>
<item quantity="other">Executed %d patches</item>
</plurals>
</resources>

View File

@ -162,7 +162,7 @@
<string name="continue_anyways">Continue anyways</string>
<string name="download_another_version">Download another version</string>
<string name="download_app">Download app</string>
<string name="download_apk">Download APK</string>
<string name="download_apk">Download APK file</string>
<string name="source_download_fail">Failed to download patch bundle: %s</string>
<string name="source_replace_fail">Failed to load updated patch bundle: %s</string>
<string name="source_replace_integrations_fail">Failed to update integrations: %s</string>
@ -248,16 +248,15 @@
<string name="patcher_step_group_preparing">Preparing</string>
<string name="patcher_step_load_patches">Load patches</string>
<string name="patcher_step_unpack">Unpack APK</string>
<string name="patcher_step_integrations">Merge Integrations</string>
<string name="patcher_step_unpack">Read APK file</string>
<string name="patcher_step_group_patching">Patching</string>
<string name="patcher_step_group_saving">Saving</string>
<string name="patcher_step_write_patched">Write patched APK</string>
<string name="patcher_step_sign_apk">Sign APK</string>
<string name="patcher_step_write_patched">Write patched APK file</string>
<string name="patcher_step_sign_apk">Sign patched APK file</string>
<string name="patcher_notification_message">Patching in progress…</string>
<string name="apply_patches">Apply patches</string>
<string name="applying_patch">Applying %s</string>
<string name="failed_to_apply_patch">Failed to apply %s</string>
<string name="execute_patches">Execute patches</string>
<string name="executing_patch">Execute %s</string>
<string name="failed_to_execute_patch">Failed to execute %s</string>
<string name="step_completed">completed</string>
<string name="step_failed">failed</string>