Skip to content

Commit 1dc7cfe

Browse files
prateek-whoAzyrRuthless
authored andcommitted
fix: Handle patching XAPK files (MorpheApp#93)
1 parent d18f957 commit 1dc7cfe

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
@@ -445,9 +445,11 @@ internal object PatchCommand : Callable<Int> {
445445

446446
val patcherTemporaryFilesPath = temporaryFilesPath.resolve("patcher")
447447

448-
// Checking if the file is in apkm format (like reddit)
449-
val inputApk = if (apk.extension.equals("apkm", ignoreCase = true)) {
450-
logger.info("Merging APKM bundle")
448+
// We need to check for apkm (like reddit), xapk and apks formats here
449+
450+
val inputApk = if (apk.extension.lowercase() in setOf("apkm", "xapk", "apks")) {
451+
452+
logger.info("Merging split APK bundle")
451453

452454
// Save merged APK to output directory (will be cleaned up after patching)
453455
val outputApk = outputFilePath.parentFile.resolve("${apk.nameWithoutExtension}-merged.apk")
@@ -784,7 +786,7 @@ internal object PatchCommand : Callable<Int> {
784786
purge(temporaryFilesPath)
785787
}
786788

787-
// Clean up merged APK if we created one from APKM
789+
// Clean up merged apk if we created one from apkm, xapk or apks
788790
mergedApkToCleanup?.let {
789791
if (!it.delete()) {
790792
logger.warning("Could not clean up merged APK: ${it.path}")

0 commit comments

Comments
 (0)