From 113e06dceed2db6b6a70a3c142e2f6e692e67a2f Mon Sep 17 00:00:00 2001 From: rushiiMachine <33725716+rushiiMachine@users.noreply.github.com> Date: Tue, 4 Mar 2025 16:30:49 -0800 Subject: [PATCH] fix: use an Android <8 API for writing lines to file --- .../aliucord/manager/patcher/steps/patch/SmaliPatchStep.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/aliucord/manager/patcher/steps/patch/SmaliPatchStep.kt b/app/src/main/kotlin/com/aliucord/manager/patcher/steps/patch/SmaliPatchStep.kt index 2ed6b08..4fdc637 100644 --- a/app/src/main/kotlin/com/aliucord/manager/patcher/steps/patch/SmaliPatchStep.kt +++ b/app/src/main/kotlin/com/aliucord/manager/patcher/steps/patch/SmaliPatchStep.kt @@ -21,8 +21,6 @@ import com.github.difflib.patch.Patch import org.koin.core.component.KoinComponent import org.koin.core.component.inject import java.io.FileNotFoundException -import kotlin.io.path.Path -import kotlin.io.path.writeLines class SmaliPatchStep : Step(), IDexProvider, KoinComponent { private val paths: PathManager by inject() @@ -106,7 +104,9 @@ class SmaliPatchStep : Step(), IDexProvider, KoinComponent { throw Error("Failed to smali patch $fullClassName", t) } - Path(smaliFile.absolutePath).writeLines(patched) + smaliFile.bufferedWriter().use { writer -> + patched.forEach(writer::appendLine) + } } // Assemble the patched classes back into a single dex