From 0bbc7360519726f7e3b5004542c0131fa0c0c86f Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Tue, 16 Dec 2025 02:38:27 -0800 Subject: [PATCH] Properly set abiList with config.prop for APK --- app/buildSrc/src/main/java/Plugin.kt | 22 ++++++++++++++++++---- build.py | 1 + 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/app/buildSrc/src/main/java/Plugin.kt b/app/buildSrc/src/main/java/Plugin.kt index a1d99255e..1d3f06d75 100644 --- a/app/buildSrc/src/main/java/Plugin.kt +++ b/app/buildSrc/src/main/java/Plugin.kt @@ -46,11 +46,25 @@ class MagiskPlugin : Plugin { private fun Project.applyPlugin() { initRandom(rootProject.file("dict.txt")) props.clear() - rootProject.file("gradle.properties").inputStream().use { props.load(it) } + + // Get gradle properties relevant to Magisk + props.putAll(properties.filter { (key, _) -> key.startsWith("magisk.") }) + + // Load config.prop val configPath: String? by this - val config = rootFile(configPath ?: "config.prop") - if (config.exists()) - config.inputStream().use { props.load(it) } + val configFile = rootFile(configPath ?: "config.prop") + if (configFile.exists()) { + configFile.inputStream().use { + val config = Properties() + config.load(it) + // Remove properties that should be passed by commandline + config.remove("abiList") + props.putAll(config) + } + } + + // Commandline override + findProperty("abiList")?.let { props.put("abiList", it) } val repo = FileRepository(rootFile(".git")) val refId = repo.refDatabase.exactRef("HEAD").objectId diff --git a/build.py b/build.py index e4015f465..bb93ddeb5 100755 --- a/build.py +++ b/build.py @@ -406,6 +406,7 @@ def build_apk(module: str): gradlew, f"{module}:assemble{build_type}", f"-PconfigPath={props}", + f"-PabiList={','.join(build_abis.keys())}", ], env=env, )