mirror of
https://github.com/revanced/revanced-cli.git
synced 2024-06-02 11:26:06 +02:00
12 lines
398 B
Kotlin
12 lines
398 B
Kotlin
package app.revanced.utils.align
|
|
|
|
import app.revanced.utils.align.zip.structures.ZipEntry
|
|
|
|
internal object ZipAligner {
|
|
private const val DEFAULT_ALIGNMENT = 4
|
|
private const val LIBRARY_ALIGNMENT = 4096
|
|
|
|
fun getEntryAlignment(entry: ZipEntry): Int? =
|
|
if (entry.compression.toUInt() != 0u) null else if (entry.fileName.endsWith(".so")) LIBRARY_ALIGNMENT else DEFAULT_ALIGNMENT
|
|
}
|