From 88d22477d50a4aaddd6404d057aa180378ca049b Mon Sep 17 00:00:00 2001 From: zarzet Date: Mon, 13 Apr 2026 02:47:59 +0700 Subject: [PATCH] fix: preserve existing M4A metadata during embed and enable BuildConfig generation --- android/app/build.gradle.kts | 4 ++++ lib/services/ffmpeg_service.dart | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 75293943..d8fefd0e 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -20,6 +20,10 @@ android { compileSdk = flutter.compileSdkVersion ndkVersion = flutter.ndkVersion + buildFeatures { + buildConfig = true + } + compileOptions { isCoreLibraryDesugaringEnabled = true sourceCompatibility = JavaVersion.VERSION_17 diff --git a/lib/services/ffmpeg_service.dart b/lib/services/ffmpeg_service.dart index e34c5174..bcf5bea6 100644 --- a/lib/services/ffmpeg_service.dart +++ b/lib/services/ffmpeg_service.dart @@ -1473,7 +1473,7 @@ class FFmpegService { required String m4aPath, String? coverPath, Map? metadata, - bool preserveMetadata = false, + bool preserveMetadata = true, }) async { final tempDir = await getTemporaryDirectory(); final tempOutput = _nextTempEmbedPath(tempDir.path, '.m4a');