替换友盟为本地aar

调整小游戏为繁体中文
This commit is contained in:
2024-05-08 09:52:35 +08:00
parent 2093306d36
commit 599e88acc6
9 changed files with 60 additions and 26 deletions

View File

@@ -10,6 +10,26 @@ android {
project.tasks.getByName("tasks").doFirst {
}
/* flavorDimensions "packageApk"
productFlavors {
LinkTest {
dimension "packageApk"
manifestPlaceholders = [serverHost: "https://ceshi.yaoulive.com",isGooglePlay:0,isPluginModel:true]
}
LinkOfficial {
dimension "packageApk"
manifestPlaceholders = [serverHost: "https://napi.yaoulive.com",isGooglePlay:0,isPluginModel:true]
}
GoogleTest {
dimension "packageApk"
manifestPlaceholders = [serverHost: "https://ceshi.yaoulive.com",isGooglePlay:1,isPluginModel:false]
}
GoogleOfficial{
dimension "packageApk"
manifestPlaceholders = [serverHost: "https://napi.yaoulive.com",isGooglePlay:1,isPluginModel:false]
}
}*/
/* applicationVariants.all { variant ->
variant.mergeAssetsProvider.configure {
doLast {
@@ -119,14 +139,27 @@ android {
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) {
println "谷歌版本:" + isGooglePlay
println "文件存在" + file(manifestPath).exists()
println "" + (isGooglePlay != 0)
println "" + (file(manifestPath).exists() && isGooglePlay != 0)
if (file(manifestPath).exists() && isGooglePlay != 0) {
def manifestContent = file(manifestPath).getText()
println "移除权限"
manifestContent = manifestContent.replace('<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />', '')
manifestContent = manifestContent.replace('android.permission.REQUEST_INSTALL_PACKAGES', '')
file(manifestPath).write(manifestContent)
} else {
print "not Exists = " + manifestPath
}
manifestPath = "build/intermediates/merged_manifests/release/processReleaseManifest/AndroidManifest.xml"
if (file(manifestPath).exists() && isGooglePlay != 0) {
def manifestContent = file(manifestPath).getText()
println "移除权限2"
manifestContent = manifestContent.replace('<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />', '')
manifestContent = manifestContent.replace('android.permission.REQUEST_INSTALL_PACKAGES', '')
file(manifestPath).write(manifestContent)
}
}
variant.mergeAssetsProvider.configure {
doLast {
@@ -171,7 +204,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 = "完整"
@@ -183,7 +216,6 @@ android {
isTest = "正式服"
}
outputFileName = "[${new Date().format("yyyy-MM-dd", TimeZone.getTimeZone("GMT+8"))}]PDLive-${defaultConfig.versionName}-${isGoogle}-${isPlugin}-${variant.buildType.name}-${isTest}.apk"
}
}
signingConfigs {