From 4695e040a1c5cf2456cb253b63c81cfdb7b663f5 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Mon, 6 May 2024 14:42:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4gradle=E6=89=93=E5=8C=85?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 915d7940e..b9255e4bd 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -116,11 +116,15 @@ android { String variantName = variant.name.capitalize() def processManifestTask = project.tasks.getByName("process${variantName}Manifest") processManifestTask.doLast { pm -> - String manifestPath = "build/intermediates/bundle_manifest/release/bundle-manifest/AndroidManifest.xml" + String manifestPath = "build/intermediates/merged_manifests/release/processReleaseManifest/AndroidManifest.xml" def isGooglePlay = rootProject.ext.manifestPlaceholders.isGooglePlay - if (file(manifestPath).exists() && isGooglePlay==1) { + println "谷歌版本:" + isGooglePlay + println "文件存在" + file(manifestPath).exists() + println "" + (isGooglePlay ==1) + println "" + (file(manifestPath).exists() && isGooglePlay == 1) + if (file(manifestPath).exists() && isGooglePlay == 1) { def manifestContent = file(manifestPath).getText() - + println "移除权限" manifestContent = manifestContent.replace('', '') file(manifestPath).write(manifestContent) } else { @@ -170,7 +174,7 @@ android { isGoogle = "谷歌" } else if (rootProject.ext.manifestPlaceholders.isGooglePlay == 2) { isGoogle = "Huawei" - }else if (rootProject.ext.manifestPlaceholders.isGooglePlay == 3) { + } else if (rootProject.ext.manifestPlaceholders.isGooglePlay == 3) { isGoogle = "Samsung" } def isPlugin = "完整"