android/gradle: Use /usr/bin/ as ANDROID_SDK_ROOT fallback

This commit is contained in:
2025-09-27 20:56:10 +02:00
parent 56cbaa6d16
commit e4aea80f0b

View File

@@ -685,6 +685,11 @@ fun getDebugKeystorePath(): String {
fun getDefaultAndroidSdkPath(): String? {
val os = System.getProperty("os.name").lowercase()
val userHome = System.getProperty("user.home")
val zipAlign = File("/usr/bin/zipalign")
if (zipAlign.exists()) {
return "/usr/bin"
}
return when {
os.contains("win") ->
@@ -740,6 +745,11 @@ fun findToolInSdkPath(toolName: String): String? {
return toolExec.absolutePath
}
}
} else {
val toolExec = File(androidHome, toolName)
if (toolExec.exists()) {
return toolExec.absolutePath
}
}
}
@@ -883,4 +893,4 @@ fun signBundle(input: File, output: File) {
}
println("AAB signed and aligned successfully")
}
}