From 71fab34c98fbc85700ee41f3d41b7d915db7d404 Mon Sep 17 00:00:00 2001 From: kmmiio99o <164557248+kmmiio99o@users.noreply.github.com> Date: Tue, 9 Jun 2026 11:22:11 +0000 Subject: [PATCH] fix: use locale-independent formatting for LSPatch output filename (#4) Fixes installation failures on non-Latin locales by ensuring the LSPatch output filename lookup uses Latin numerals regardless of device locale. LSPatch uses String.format(Locale.getDefault(), ...) which produces locale-specific numerals (e.g., Arabic numerals on Arabic locales), but the filename lookup was using hardcoded Latin numerals, causing a mismatch that resulted in "Invalid package" errors. Fixes #XXXX --- .../patcher/steps/install/InjectShiggyXposedStep.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/aliucord/manager/patcher/steps/install/InjectShiggyXposedStep.kt b/app/src/main/kotlin/com/aliucord/manager/patcher/steps/install/InjectShiggyXposedStep.kt index 478b09b..f4c2b03 100644 --- a/app/src/main/kotlin/com/aliucord/manager/patcher/steps/install/InjectShiggyXposedStep.kt +++ b/app/src/main/kotlin/com/aliucord/manager/patcher/steps/install/InjectShiggyXposedStep.kt @@ -13,6 +13,7 @@ import org.lsposed.lspatch.share.LSPConfig import org.lsposed.patch.LSPatch import org.lsposed.patch.util.Logger import java.io.File +import java.util.* class InjectShiggyXposedStep : Step() { override val group: StepGroup = StepGroup.Install @@ -82,7 +83,15 @@ class InjectShiggyXposedStep : Step() { // FilenameUtils.getBaseName(apkFileName), // LSPConfig.instance.VERSION_CODE) // ) - val patchedApkName = "${baseName}-${LSPConfig.instance.VERSION_CODE}-lspatched.apk" + // Note: LSPatch uses Locale.getDefault() which can produce locale-specific numerals + // (e.g., Arabic numerals on Arabic locales). We must use Locale.US to ensure + // consistent filename matching regardless of device locale. + val patchedApkName = String.format( + Locale.US, + "%s-%d-lspatched.apk", + baseName, + LSPConfig.instance.VERSION_CODE + ) val patchedApk = File(tempDir, patchedApkName) if (patchedApk.exists()) {