|
|
|
@ -43,11 +43,6 @@ android {
|
|
|
|
versionName = flutter.versionName
|
|
|
|
versionName = flutter.versionName
|
|
|
|
multiDexEnabled = true
|
|
|
|
multiDexEnabled = true
|
|
|
|
|
|
|
|
|
|
|
|
// Force application label to override plugin labels
|
|
|
|
|
|
|
|
manifestPlaceholders["appLabel"] = "Dr. Alhabib"
|
|
|
|
|
|
|
|
resValue("string", "app_name", "Dr. Alhabib")
|
|
|
|
|
|
|
|
resValue("string", "application_name", "Dr. Alhabib")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Filter to arm64-v8a for better native library compatibility
|
|
|
|
// Filter to arm64-v8a for better native library compatibility
|
|
|
|
ndk {
|
|
|
|
ndk {
|
|
|
|
abiFilters += listOf("arm64-v8a", "armeabi-v7a")
|
|
|
|
abiFilters += listOf("arm64-v8a", "armeabi-v7a")
|
|
|
|
@ -246,102 +241,6 @@ tasks.whenTaskAdded {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// DISABLED: This was causing packaging conflicts
|
|
|
|
|
|
|
|
// Instead relying on manifest merger rules and resource priorities
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
// CRITICAL: Fix CallKit plugin conflict at compile time
|
|
|
|
|
|
|
|
tasks.register("fixCallKitPluginConflict") {
|
|
|
|
|
|
|
|
doLast {
|
|
|
|
|
|
|
|
println("🔧 Fixing CallKit plugin conflicts with payment services...")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Fix merged manifests
|
|
|
|
|
|
|
|
val manifestFiles = listOf(
|
|
|
|
|
|
|
|
File(project.layout.buildDirectory.asFile.get(), "intermediates/merged_manifests"),
|
|
|
|
|
|
|
|
File(project.layout.buildDirectory.asFile.get(), "intermediates/packaged_manifests")
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
manifestFiles.forEach { manifestDir ->
|
|
|
|
|
|
|
|
if (manifestDir.exists()) {
|
|
|
|
|
|
|
|
manifestDir.walkTopDown().forEach { file ->
|
|
|
|
|
|
|
|
if (file.isFile && file.name == "AndroidManifest.xml") {
|
|
|
|
|
|
|
|
var content = file.readText()
|
|
|
|
|
|
|
|
var modified = false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Remove any CallKit application labels
|
|
|
|
|
|
|
|
if (content.contains("android:label=\"CallKit\"")) {
|
|
|
|
|
|
|
|
content = content.replace("android:label=\"CallKit\"", "android:label=\"@string/app_name\"")
|
|
|
|
|
|
|
|
modified = true
|
|
|
|
|
|
|
|
println(" ✓ Removed CallKit label from: ${file.path}")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Ensure tools namespace is declared if we need to use it
|
|
|
|
|
|
|
|
if (content.contains("<manifest") && !content.contains("xmlns:tools")) {
|
|
|
|
|
|
|
|
content = content.replace(
|
|
|
|
|
|
|
|
"<manifest",
|
|
|
|
|
|
|
|
"<manifest xmlns:tools=\"http://schemas.android.com/tools\""
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
modified = true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Ensure our app label takes precedence - only if tools namespace exists
|
|
|
|
|
|
|
|
if (content.contains("<application") && content.contains("xmlns:tools") && !content.contains("tools:replace=\"android:label\"")) {
|
|
|
|
|
|
|
|
content = content.replace(
|
|
|
|
|
|
|
|
"<application",
|
|
|
|
|
|
|
|
"<application tools:replace=\"android:label\""
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
modified = true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (modified) {
|
|
|
|
|
|
|
|
file.writeText(content)
|
|
|
|
|
|
|
|
println(" ✓ Patched manifest: ${file.path}")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Fix merged resources (strings.xml)
|
|
|
|
|
|
|
|
val resFiles = listOf(
|
|
|
|
|
|
|
|
File(project.layout.buildDirectory.asFile.get(), "intermediates/merged_res"),
|
|
|
|
|
|
|
|
File(project.layout.buildDirectory.asFile.get(), "intermediates/incremental/mergeDebugResources/merged.dir"),
|
|
|
|
|
|
|
|
File(project.layout.buildDirectory.asFile.get(), "intermediates/incremental/mergeReleaseResources/merged.dir")
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
resFiles.forEach { resDir ->
|
|
|
|
|
|
|
|
if (resDir.exists()) {
|
|
|
|
|
|
|
|
resDir.walkTopDown().forEach { file ->
|
|
|
|
|
|
|
|
if (file.isFile && file.name == "strings.xml") {
|
|
|
|
|
|
|
|
var content = file.readText()
|
|
|
|
|
|
|
|
var modified = false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Replace any "CallKit" string resources
|
|
|
|
|
|
|
|
if (content.contains(">CallKit<")) {
|
|
|
|
|
|
|
|
content = content.replace(">CallKit<", ">Dr. Alhabib<")
|
|
|
|
|
|
|
|
modified = true
|
|
|
|
|
|
|
|
println(" ✓ Replaced CallKit string in: ${file.path}")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (modified) {
|
|
|
|
|
|
|
|
file.writeText(content)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
println("✅ CallKit plugin conflict fix completed!")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Run the fix after manifest and resource merging
|
|
|
|
|
|
|
|
tasks.whenTaskAdded {
|
|
|
|
|
|
|
|
if (name.contains("merge") && (name.contains("Manifest") || name.contains("Resources"))) {
|
|
|
|
|
|
|
|
finalizedBy("fixCallKitPluginConflict")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//tasks.whenTaskAdded {
|
|
|
|
//tasks.whenTaskAdded {
|
|
|
|
// if (name.contains("merge") && name.contains("NativeLibs")) {
|
|
|
|
// if (name.contains("merge") && name.contains("NativeLibs")) {
|
|
|
|
// doLast {
|
|
|
|
// doLast {
|
|
|
|
|