Skip to content

Commit 5d18490

Browse files
authored
fix: Handle patching XAPK files (#93)
1 parent 38298c5 commit 5d18490

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/main/kotlin/app/morphe/cli/command/PatchCommand.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -431,9 +431,11 @@ internal object PatchCommand : Callable<Int> {
431431

432432
val patcherTemporaryFilesPath = temporaryFilesPath.resolve("patcher")
433433

434-
// Checking if the file is in apkm format (like reddit)
435-
val inputApk = if (apk.extension.equals("apkm", ignoreCase = true)) {
436-
logger.info("Merging APKM bundle")
434+
// We need to check for apkm (like reddit), xapk and apks formats here
435+
436+
val inputApk = if (apk.extension.lowercase() in setOf("apkm", "xapk", "apks")) {
437+
438+
logger.info("Merging split APK bundle")
437439

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

755-
// Clean up merged APK if we created one from APKM
757+
// Clean up merged apk if we created one from apkm, xapk or apks
756758
mergedApkToCleanup?.let {
757759
if (!it.delete()) {
758760
logger.warning("Could not clean up merged APK: ${it.path}")

0 commit comments

Comments
 (0)