Skip to content

Commit

Permalink
perf(Patcher): don't compress zip entries that will be aligned later
Browse files Browse the repository at this point in the history
  • Loading branch information
rushiiMachine committed Jan 23, 2025
1 parent 543360e commit 0fc8a5d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import com.aliucord.manager.patcher.steps.base.IDexProvider
import com.aliucord.manager.patcher.steps.base.Step
import com.aliucord.manager.patcher.steps.download.CopyDependenciesStep
import com.aliucord.manager.patcher.steps.download.DownloadAliuhookStep
import com.github.diamondminer88.zip.ZipCompression
import com.github.diamondminer88.zip.ZipReader
import com.github.diamondminer88.zip.ZipWriter
import org.koin.core.component.KoinComponent
Expand All @@ -31,7 +32,7 @@ class AddAliuhookLibsStep : Step(), KoinComponent {
val bytes = aliuhook.openEntry("jni/$currentDeviceArch/$libFile")?.read()
?: throw IllegalStateException("Failed to read $libFile from aliuhook aar")

patchedApk.writeEntry("lib/$currentDeviceArch/$libFile", bytes)
patchedApk.writeEntry("lib/$currentDeviceArch/$libFile", bytes, ZipCompression.NONE)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.aliucord.manager.patcher.steps.StepGroup
import com.aliucord.manager.patcher.steps.base.IDexProvider
import com.aliucord.manager.patcher.steps.base.Step
import com.aliucord.manager.patcher.steps.download.CopyDependenciesStep
import com.github.diamondminer88.zip.ZipCompression
import com.github.diamondminer88.zip.ZipReader
import com.github.diamondminer88.zip.ZipWriter
import org.koin.core.component.KoinComponent
Expand Down Expand Up @@ -59,7 +60,7 @@ class ReorganizeDexStep : Step(), KoinComponent {
if (dexProvider.dexPriority <= 0) continue

for (dexBytes in dexProvider.getDexFiles()) {
zip.writeEntry(getDexName(idx++), dexBytes)
zip.writeEntry(getDexName(idx++), dexBytes, ZipCompression.NONE)
}
}

Expand All @@ -70,7 +71,7 @@ class ReorganizeDexStep : Step(), KoinComponent {

val file = paths.patchingWorkingDir().resolve(getDexName(idx))
val bytes = file.readBytes()
zip.writeEntry(getDexName(dexCount + idx), bytes)
zip.writeEntry(getDexName(dexCount + idx), bytes, ZipCompression.NONE)
}

dexCount += idx
Expand All @@ -80,7 +81,7 @@ class ReorganizeDexStep : Step(), KoinComponent {
if (dexProvider.dexPriority > 0) continue

for (dexBytes in dexProvider.getDexFiles()) {
zip.writeEntry(getDexName(dexCount++), dexBytes)
zip.writeEntry(getDexName(dexCount++), dexBytes, ZipCompression.NONE)
}
}
}
Expand Down

0 comments on commit 0fc8a5d

Please sign in to comment.