Properly set abiList with config.prop for APK

This commit is contained in:
topjohnwu
2025-12-16 02:38:27 -08:00
parent 01cb75eaef
commit 0bbc736051
2 changed files with 19 additions and 4 deletions
+18 -4
View File
@@ -46,11 +46,25 @@ class MagiskPlugin : Plugin<Project> {
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
+1
View File
@@ -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,
)