同步PD修复内容:
[修复首页English分类下,下拉刷新没有数据问题] 同步PD打包脚本
This commit is contained in:
105
app/build.gradle
105
app/build.gradle
@@ -3,6 +3,7 @@ apply plugin: 'img-optimizer'
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
apply plugin: 'com.google.firebase.crashlytics'
|
||||
apply plugin: 'com.alibaba.arouter'
|
||||
apply from: "../package_config.gradle"
|
||||
android {
|
||||
namespace "com.pandoralive.shayu"
|
||||
dexOptions {
|
||||
@@ -107,22 +108,26 @@ android {
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
|
||||
|
||||
applicationVariants.all { variant ->
|
||||
println "清空build文件夹";
|
||||
for (final def project in rootProject.getAllprojects()) {
|
||||
def name = variant.name.replace('Debug', '').replace('Release', '').toLowerCase()
|
||||
delete project.buildDir
|
||||
delete 'app' + File.separator + name
|
||||
println project.buildDir
|
||||
}
|
||||
String variantName = variant.name.capitalize()
|
||||
def processManifestTask = project.tasks.getByName("process${variantName}Manifest")
|
||||
processManifestTask.doLast { pm ->
|
||||
String manifestPath = "build/intermediates/merged_manifests/release/processReleaseManifest/AndroidManifest.xml"
|
||||
def isGooglePlay = rootProject.ext.manifestPlaceholders.isGooglePlay
|
||||
String manifestPath = "build/intermediates/merged_manifests/google_onlineRelease/processGoogle_onlineReleaseManifest/AndroidManifest.xml"
|
||||
def isGooglePlay = variant.name.contains("google")
|
||||
println "谷歌版本:" + isGooglePlay
|
||||
println "文件存在" + file(manifestPath).exists()
|
||||
println "" + (isGooglePlay == 1)
|
||||
println "" + (file(manifestPath).exists() && isGooglePlay == 1)
|
||||
if (file(manifestPath).exists() && isGooglePlay == 1) {
|
||||
println "" + (file(manifestPath).exists() && isGooglePlay)
|
||||
if (file(manifestPath).exists() && isGooglePlay) {
|
||||
def manifestContent = file(manifestPath).getText()
|
||||
println "移除权限"
|
||||
manifestContent = manifestContent.replace('<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />', '')
|
||||
@@ -130,6 +135,13 @@ android {
|
||||
} else {
|
||||
print "not Exists = " + manifestPath
|
||||
}
|
||||
if (file(manifestPath).exists() && isGooglePlay) {
|
||||
def manifestContent = file(manifestPath).getText()
|
||||
println "移除权限2"
|
||||
manifestContent = manifestContent.replace('<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />', '')
|
||||
file(manifestPath).write(manifestContent)
|
||||
|
||||
}
|
||||
}
|
||||
variant.mergeAssetsProvider.configure {
|
||||
doLast {
|
||||
@@ -171,26 +183,77 @@ android {
|
||||
}
|
||||
}
|
||||
}
|
||||
variant.outputs.all {
|
||||
def isGoogle = "链接"
|
||||
if (rootProject.ext.manifestPlaceholders.isGooglePlay == 1) {
|
||||
isGoogle = "谷歌"
|
||||
} else if (rootProject.ext.manifestPlaceholders.isGooglePlay == 2) {
|
||||
isGoogle = "Huawei"
|
||||
} else if (rootProject.ext.manifestPlaceholders.isGooglePlay == 3) {
|
||||
isGoogle = "Samsung"
|
||||
variant.outputs.all { vt ->
|
||||
println("输出文件名:${vt}")
|
||||
def channel = ''
|
||||
def server=''
|
||||
if (variant.name.startsWith('huawei')) {
|
||||
channel = "华为"
|
||||
} else if (variant.name.startsWith('samsung')) {
|
||||
channel = "三星"
|
||||
} else if (variant.name.startsWith('google')) {
|
||||
channel = "谷歌"
|
||||
} else {
|
||||
channel = "链接"
|
||||
}
|
||||
def isPlugin = "完整"
|
||||
if (rootProject.ext.manifestPlaceholders.isPluginModel) {
|
||||
isPlugin = "插件"
|
||||
if(variant.name.contains('online')){
|
||||
server='正式服'
|
||||
}else{
|
||||
server='测试服'
|
||||
}
|
||||
def isTest = "测试服"
|
||||
if (rootProject.ext.manifestPlaceholders.serverHost == "https://napi.yaoulive.com") {
|
||||
isTest = "正式服"
|
||||
}
|
||||
outputFileName = "[${new Date().format("yyyy-MM-dd", TimeZone.getTimeZone("GMT+8"))}]潘多拉-${defaultConfig.versionName}-${isGoogle}-${isPlugin}-${variant.buildType.name}-${isTest}.apk"
|
||||
|
||||
outputFileName = "[${new Date().format("yyyy-MM-dd HHmmss", TimeZone.getTimeZone("GMT+8"))}]PDLive-${defaultConfig.versionName}-${channel}-${server}-${variant.buildType.name}.apk"
|
||||
}
|
||||
tasks.named("sign${variant.name.capitalize()}Bundle", com.android.build.gradle.internal.tasks.FinalizeBundleTask) {
|
||||
File file = finalBundleFile.asFile.get()
|
||||
def channel = ''
|
||||
if (variant.name.startsWith('huawei')) {
|
||||
channel = "华为"
|
||||
} else if (variant.name.startsWith('samsung')) {
|
||||
channel = "三星"
|
||||
} else if (variant.name.startsWith('google')) {
|
||||
channel = "谷歌"
|
||||
} else {
|
||||
channel = "链接"
|
||||
}
|
||||
File finalFile = new File(file.parentFile, "[${new Date().format("yyyy-MM-dd HHmmss", TimeZone.getTimeZone("GMT+8"))}]PDLive-${defaultConfig.versionName}-${channel}-${variant.buildType.name}.aab")
|
||||
finalBundleFile.set(finalFile)
|
||||
}
|
||||
project.afterEvaluate { project ->
|
||||
project.tasks.each {
|
||||
if (it.name.startsWith('assemble') && it.name.endsWith('Release')) {
|
||||
it.doLast {
|
||||
def dir = it.name.replace('assemble', '').replace('Release', '').toLowerCase()
|
||||
println("处理assembleRelease ${project.rootDir}\\app\\$dir\\release\\ | " + new File("${project.rootDir}\\app\\$dir\\release\\").exists())
|
||||
if (new File("${project.rootDir}\\app\\$dir\\release\\").exists()) {
|
||||
println("准备拷贝apk文件")
|
||||
copy {
|
||||
from file("${project.rootDir}\\app\\$dir\\release\\")
|
||||
into file("${project.rootDir}\\outputs\\apk\\")
|
||||
include '**/*.apk'
|
||||
}
|
||||
|
||||
}
|
||||
println("打包apk结束")
|
||||
}
|
||||
} else if (it.name.startsWith('sign') && it.name.endsWith('ReleaseBundle')) {
|
||||
it.doLast {
|
||||
def dir = it.name.replace('sign', '').replace('ReleaseBundle', '').toLowerCase()
|
||||
println("处理signReleaseBundle ${project.rootDir}\\app\\$dir\\release\\ | " + new File("${project.rootDir}\\app\\$dir\\release\\").exists())
|
||||
if (new File("${project.rootDir}\\app\\$dir\\release\\").exists()) {
|
||||
println("准备拷贝aab文件")
|
||||
copy {
|
||||
from file("${project.rootDir}\\app\\$dir\\release\\")
|
||||
into file("${project.rootDir}\\outputs\\aab\\")
|
||||
include '**/*.aab'
|
||||
}
|
||||
|
||||
}
|
||||
println("打包aab结束")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
signingConfigs {
|
||||
release {
|
||||
|
||||
@@ -416,7 +416,7 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode;
|
||||
-ignorewarnings
|
||||
|
||||
# End of content from C:\Users\58381\Documents\AndroidProject\pandorapan\app\proguard-rules.pro
|
||||
# The proguard configuration file for the following section is C:\Users\58381\Documents\AndroidProject\pandorapan\app\build\intermediates\aapt_proguard_file\release\processReleaseResources\aapt_rules.txt
|
||||
# The proguard configuration file for the following section is C:\Users\58381\Documents\AndroidProject\pandorapan\app\build\intermediates\aapt_proguard_file\google_onlineRelease\processGoogle_onlineReleaseResources\aapt_rules.txt
|
||||
-keep class androidx.core.app.CoreComponentFactory { <init>(); }
|
||||
-keep class androidx.core.content.FileProvider { <init>(); }
|
||||
-keep class androidx.core.content.FileProvider4Utils { <init>(); }
|
||||
@@ -1090,10 +1090,10 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode;
|
||||
-keepclassmembers class * { *** videoEditClick(android.view.View); }
|
||||
|
||||
|
||||
# End of content from C:\Users\58381\Documents\AndroidProject\pandorapan\app\build\intermediates\aapt_proguard_file\release\processReleaseResources\aapt_rules.txt
|
||||
# The proguard configuration file for the following section is C:\Users\58381\Documents\AndroidProject\pandorapan\lib_faceunity\build\intermediates\consumer_proguard_dir\release\exportReleaseConsumerProguardFiles\lib0\proguard.txt
|
||||
# End of content from C:\Users\58381\Documents\AndroidProject\pandorapan\app\build\intermediates\aapt_proguard_file\google_onlineRelease\processGoogle_onlineReleaseResources\aapt_rules.txt
|
||||
# The proguard configuration file for the following section is C:\Users\58381\Documents\AndroidProject\pandorapan\lib_faceunity\build\intermediates\consumer_proguard_dir\google_onlineRelease\exportGoogle_onlineReleaseConsumerProguardFiles\lib0\proguard.txt
|
||||
|
||||
# End of content from C:\Users\58381\Documents\AndroidProject\pandorapan\lib_faceunity\build\intermediates\consumer_proguard_dir\release\exportReleaseConsumerProguardFiles\lib0\proguard.txt
|
||||
# End of content from C:\Users\58381\Documents\AndroidProject\pandorapan\lib_faceunity\build\intermediates\consumer_proguard_dir\google_onlineRelease\exportGoogle_onlineReleaseConsumerProguardFiles\lib0\proguard.txt
|
||||
# The proguard configuration file for the following section is C:\gradle-6.1.1\caches\transforms-3\8d3e3177c15403546de73d87508067d6\transformed\jetified-XPopup-2.10.0\proguard.txt
|
||||
# Generated keep rule for Lifecycle observer adapter.
|
||||
-if class com.lxj.xpopup.core.BasePopupView {
|
||||
@@ -1153,9 +1153,9 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode;
|
||||
|
||||
|
||||
# End of content from C:\gradle-6.1.1\caches\transforms-3\a1df9a6aa192455030f7c9970b70e0e9\transformed\material-1.4.0\proguard.txt
|
||||
# The proguard configuration file for the following section is C:\Users\58381\Documents\AndroidProject\pandorapan\lib_google\build\intermediates\consumer_proguard_dir\release\exportReleaseConsumerProguardFiles\lib0\proguard.txt
|
||||
# The proguard configuration file for the following section is C:\Users\58381\Documents\AndroidProject\pandorapan\lib_google\build\intermediates\consumer_proguard_dir\google_onlineRelease\exportGoogle_onlineReleaseConsumerProguardFiles\lib0\proguard.txt
|
||||
|
||||
# End of content from C:\Users\58381\Documents\AndroidProject\pandorapan\lib_google\build\intermediates\consumer_proguard_dir\release\exportReleaseConsumerProguardFiles\lib0\proguard.txt
|
||||
# End of content from C:\Users\58381\Documents\AndroidProject\pandorapan\lib_google\build\intermediates\consumer_proguard_dir\google_onlineRelease\exportGoogle_onlineReleaseConsumerProguardFiles\lib0\proguard.txt
|
||||
# The proguard configuration file for the following section is C:\gradle-6.1.1\caches\transforms-3\2929985d9627ba3bb45a0ebd18eaf9d3\transformed\jetified-linesdk-5.0.1\proguard.txt
|
||||
-keepattributes *Annotation*
|
||||
|
||||
|
||||
Reference in New Issue
Block a user