Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/main/kotlin/app/morphe/cli/command/PatchCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -431,9 +431,11 @@ internal object PatchCommand : Callable<Int> {

val patcherTemporaryFilesPath = temporaryFilesPath.resolve("patcher")

// Checking if the file is in apkm format (like reddit)
val inputApk = if (apk.extension.equals("apkm", ignoreCase = true)) {
logger.info("Merging APKM bundle")
// We need to check for apkm (like reddit), xapk and apks formats here

val inputApk = if (apk.extension.lowercase() in setOf("apkm", "xapk", "apks")) {

logger.info("Merging split APK bundle")

// Save merged APK to output directory (will be cleaned up after patching)
val outputApk = outputFilePath.parentFile.resolve("${apk.nameWithoutExtension}-merged.apk")
Expand Down Expand Up @@ -752,7 +754,7 @@ internal object PatchCommand : Callable<Int> {
purge(temporaryFilesPath)
}

// Clean up merged APK if we created one from APKM
// Clean up merged apk if we created one from apkm, xapk or apks
mergedApkToCleanup?.let {
if (!it.delete()) {
logger.warning("Could not clean up merged APK: ${it.path}")
Expand Down
Loading