From cab490fd57fb6c64e2cbdc18983f4c8f8a907244 Mon Sep 17 00:00:00 2001 From: qingyu Date: Fri, 27 Oct 2023 15:43:30 +0800 Subject: [PATCH] fix: copy unsigned file to output if signer config not provided --- .../apkaabconverter/convert/ApkToAABConverter.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/shapun/apkaabconverter/convert/ApkToAABConverter.java b/app/src/main/java/com/shapun/apkaabconverter/convert/ApkToAABConverter.java index a788521..acb96b7 100644 --- a/app/src/main/java/com/shapun/apkaabconverter/convert/ApkToAABConverter.java +++ b/app/src/main/java/com/shapun/apkaabconverter/convert/ApkToAABConverter.java @@ -26,6 +26,8 @@ import java.util.zip.ZipInputStream; import java.util.zip.ZipOutputStream; +import kotlin.io.FilesKt; + public class ApkToAABConverter extends FileConverter { private static final int BUFFER_SIZE = 1024 * 2; @@ -166,6 +168,12 @@ public void sign() { ); } else { addLog("No signer config provided, skipping signing"); + FilesKt.copyTo( + mNonSignedAAB.toFile(), + getOutputPath().toFile(), + true, + 8 * 1024 + ); } } @@ -186,7 +194,7 @@ public Builder setBundleConfig(Path configPath) { return this; } - public Builder setBundleConfig(Config.BundleConfig bundleConfig){ + public Builder setBundleConfig(Config.BundleConfig bundleConfig) { bundleConfigPath = null; this.bundleConfig = bundleConfig; return this;