Skip to content

Commit 113e06d

Browse files
committed
fix: use an Android <8 API for writing lines to file
1 parent 3dfc16a commit 113e06d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/src/main/kotlin/com/aliucord/manager/patcher/steps/patch/SmaliPatchStep.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ import com.github.difflib.patch.Patch
2121
import org.koin.core.component.KoinComponent
2222
import org.koin.core.component.inject
2323
import java.io.FileNotFoundException
24-
import kotlin.io.path.Path
25-
import kotlin.io.path.writeLines
2624

2725
class SmaliPatchStep : Step(), IDexProvider, KoinComponent {
2826
private val paths: PathManager by inject()
@@ -106,7 +104,9 @@ class SmaliPatchStep : Step(), IDexProvider, KoinComponent {
106104
throw Error("Failed to smali patch $fullClassName", t)
107105
}
108106

109-
Path(smaliFile.absolutePath).writeLines(patched)
107+
smaliFile.bufferedWriter().use { writer ->
108+
patched.forEach(writer::appendLine)
109+
}
110110
}
111111

112112
// Assemble the patched classes back into a single dex

0 commit comments

Comments
 (0)