diff --git a/app/build.gradle b/app/build.gradle index b95eba43d..33feb71bd 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -54,6 +54,21 @@ android { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } + applicationVariants.all { variant -> + 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" + def isGooglePlay=rootProject.ext.manifestPlaceholders.isGooglePlay + if(file(manifestPath).exists()&&isGooglePlay) { + def manifestContent = file(manifestPath).getText() + manifestContent = manifestContent.replace('android.permission.REQUEST_INSTALL_PACKAGES', '') + file(manifestPath).write(manifestContent) + }else{ + print "not Exists = "+manifestPath + } + } + } signingConfigs { release { keyAlias 'phonelive' @@ -141,6 +156,7 @@ dependencies { } // 链接包需要注释掉 否正无法更新 谷歌包需要打开 +/* project.afterEvaluate { android.applicationVariants.all { variant -> variant.outputs.each { output -> @@ -152,4 +168,4 @@ project.afterEvaluate { } } } -} \ No newline at end of file +}*/