From 06ec45504f169323cedf60207406660df170ad0f Mon Sep 17 00:00:00 2001 From: Aryan Date: Tue, 10 Mar 2026 22:16:43 +0530 Subject: [PATCH] Fdroid fix (#57) * fix: reproducible build paths for native libs and strip unused brotli sos * build: improve build reproducibility in CMake * build: disable dependencies information in APK and Bundle --- app/build.gradle.kts | 4 ++++ app/src/main/cpp/CMakeLists.txt | 17 +++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 5cf773f..8f040f9 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -112,6 +112,10 @@ android { compose = true buildConfig = true } + dependenciesInfo { + includeInApk = false + includeInBundle = false + } publishing { singleVariant("release") { } diff --git a/app/src/main/cpp/CMakeLists.txt b/app/src/main/cpp/CMakeLists.txt index 08bb499..e2ba56c 100644 --- a/app/src/main/cpp/CMakeLists.txt +++ b/app/src/main/cpp/CMakeLists.txt @@ -6,8 +6,21 @@ cmake_minimum_required(VERSION 3.22.1) project("reader-native") add_compile_options( - -ffile-prefix-map=${CMAKE_SOURCE_DIR}=. - -ffile-prefix-map=${CMAKE_BINARY_DIR}=. + "-ffile-prefix-map=${CMAKE_SOURCE_DIR}=." + "-ffile-prefix-map=${CMAKE_BINARY_DIR}=." +) + +if(DEFINED CMAKE_ANDROID_NDK) + add_compile_options("-ffile-prefix-map=${CMAKE_ANDROID_NDK}=/ndk") +endif() +if(DEFINED CMAKE_SYSROOT) + add_compile_options("-ffile-prefix-map=${CMAKE_SYSROOT}=/sysroot") +endif() + +add_compile_options( + -Wno-builtin-macro-redefined + -D__DATE__="\"1970-01-01\"" + -D__TIME__="\"00:00:00\"" ) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,max-page-size=16384")