586 lines
19 KiB
Groovy
586 lines
19 KiB
Groovy
apply plugin: 'com.android.application'
|
||
apply plugin: "com.tencent.android.tpns"
|
||
|
||
static def appName() {
|
||
return "FLYSN"
|
||
}
|
||
|
||
static def releaseTime() {
|
||
return new Date().format("yyyyMMdd-HHmmss", TimeZone.getDefault())
|
||
}
|
||
|
||
android {
|
||
// gradle.projectsEvaluated {
|
||
// tasks.withType(JavaCompile) {
|
||
// Set<File> fileSet = options.bootstrapClasspath.getFiles()
|
||
// List<File> newFileList = new ArrayList<>();
|
||
// //JAVA语法,可连续调用,输入参数建议为相对路径
|
||
// newFileList.add(new File("libs/framework.jar"))
|
||
// //最后将原始参数添加
|
||
// newFileList.addAll(fileSet)
|
||
// options.bootstrapClasspath = files(
|
||
// newFileList.toArray()
|
||
// )
|
||
// }
|
||
// }
|
||
|
||
compileSdkVersion 29
|
||
buildToolsVersion "29.0.3"
|
||
|
||
defaultConfig {
|
||
applicationId "com.fuying.sn"
|
||
minSdkVersion 24
|
||
targetSdkVersion 29
|
||
|
||
multiDexEnabled true
|
||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||
|
||
ndk {
|
||
//选择要添加的对应 cpu 类型的 .so 库。
|
||
abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a', "x86"
|
||
// 还可以添加 'x86', 'x86_64', 'mips', 'mips64'
|
||
}
|
||
|
||
compileOptions {
|
||
sourceCompatibility JavaVersion.VERSION_1_8
|
||
targetCompatibility JavaVersion.VERSION_1_8
|
||
}
|
||
|
||
javaCompileOptions {
|
||
annotationProcessorOptions {
|
||
includeCompileClasspath true
|
||
}
|
||
}
|
||
|
||
lintOptions {
|
||
checkReleaseBuilds false
|
||
}
|
||
|
||
dataBinding {
|
||
enabled true
|
||
}
|
||
|
||
manifestPlaceholders = [
|
||
XG_ACCESS_ID : "1500031216",
|
||
XG_ACCESS_KEY: "A1HBG2922B9Z",
|
||
]
|
||
buildConfigField "String", "SCREEN_URL", '"https://as.fuyingy.com:3018/wm/is_online"'
|
||
buildConfigField "String", "WEBSOCKET_URL", '"wss://as.fuyingy.com:3018"'
|
||
}
|
||
|
||
//多版本
|
||
productFlavors {
|
||
// beta {
|
||
// flavorDimensions "default"
|
||
// versionCode 33
|
||
// versionName "4.2"
|
||
// }
|
||
|
||
official {
|
||
flavorDimensions "default"
|
||
versionCode 87
|
||
versionName "3.4.7"
|
||
}
|
||
}
|
||
|
||
//签名
|
||
signingConfigs {
|
||
zhanRui {
|
||
storeFile file("keystore/zhanxun.keystore")
|
||
storePassword "123456"
|
||
keyAlias "zhanxun"
|
||
keyPassword "123456"
|
||
v1SigningEnabled true
|
||
v2SigningEnabled true
|
||
}
|
||
|
||
zhanRuiUserdebug {
|
||
storeFile file("keystore/zhanxunUserdebug.keystore")
|
||
storePassword "123456"
|
||
keyAlias "zhanxunUserdebug"
|
||
keyPassword "123456"
|
||
v1SigningEnabled true
|
||
v2SigningEnabled false
|
||
}
|
||
|
||
teclastUnisoc {
|
||
storeFile file("keystore/TeclastUnisoc.keystore")
|
||
storePassword "123456"
|
||
keyAlias "TeclastUnisoc"
|
||
keyPassword "123456"
|
||
v1SigningEnabled true
|
||
v2SigningEnabled true
|
||
}
|
||
|
||
teclastUnisocUserdebug {
|
||
storeFile file("keystore/TeclastUnisocUserDebug.jks")
|
||
storePassword "123456"
|
||
keyAlias "teclast"
|
||
keyPassword "123456"
|
||
v1SigningEnabled true
|
||
v2SigningEnabled true
|
||
}
|
||
|
||
teclastMTK {
|
||
storeFile file("keystore/TeclastMTK.jks")
|
||
storePassword "123456"
|
||
keyAlias "TeclastMTK"
|
||
keyPassword "123456"
|
||
v1SigningEnabled true
|
||
v2SigningEnabled true
|
||
}
|
||
|
||
mtk {
|
||
storeFile file("keystore/xueshibaoos.jks")
|
||
storePassword "123456"
|
||
keyAlias "xueshibaoos"
|
||
keyPassword "123456"
|
||
v1SigningEnabled true
|
||
v2SigningEnabled true
|
||
}
|
||
|
||
mtkAndroid11 {
|
||
storeFile file("keystore/mtkAndroid11.jks")
|
||
storePassword "123456"
|
||
keyAlias "mtk11"
|
||
keyPassword "123456"
|
||
v1SigningEnabled true
|
||
v2SigningEnabled true
|
||
}
|
||
|
||
unisoc {
|
||
storeFile file("keystore/Unisoc.jks")
|
||
storePassword "123456"
|
||
keyAlias "unisoc"
|
||
keyPassword "123456"
|
||
v1SigningEnabled true
|
||
v2SigningEnabled true
|
||
}
|
||
|
||
G10P {
|
||
storeFile file("keystore/G10PMTK11.jks")
|
||
storePassword "123456"
|
||
keyAlias "G10PMTK11"
|
||
keyPassword "123456"
|
||
v1SigningEnabled true
|
||
v2SigningEnabled true
|
||
}
|
||
|
||
Teclast8515 {
|
||
storeFile file("keystore/Teclast8515.keystore")
|
||
storePassword "123456"
|
||
keyAlias "Teclast8515"
|
||
keyPassword "123456"
|
||
v1SigningEnabled true
|
||
v2SigningEnabled true
|
||
}
|
||
|
||
iPlay50SE {
|
||
storeFile file("keystore/iPlay50SE.keystore")
|
||
storePassword "123456"
|
||
keyAlias "iplay50se"
|
||
keyPassword "123456"
|
||
v1SigningEnabled true
|
||
v2SigningEnabled true
|
||
}
|
||
|
||
Huaruian8768 {
|
||
storeFile file("keystore/Huaruian8768.jks")
|
||
storePassword "123456"
|
||
keyAlias "Huaruian8768"
|
||
keyPassword "123456"
|
||
v1SigningEnabled true
|
||
v2SigningEnabled true
|
||
}
|
||
|
||
MT6789 {
|
||
storeFile file("keystore/MT6789.keystore")
|
||
storePassword "123456"
|
||
keyAlias "mt6789"
|
||
keyPassword "123456"
|
||
v1SigningEnabled true
|
||
v2SigningEnabled true
|
||
}
|
||
|
||
}
|
||
|
||
buildTypes {
|
||
MT6789Debug.initWith(debug)
|
||
MT6789Debug {
|
||
manifestPlaceholders = [
|
||
AK: "7IubK1Ugeuxga4KKC5VQyjTeQlExsYZq"
|
||
]
|
||
buildConfigField "String", "platform", '"G12NL"'
|
||
versionNameSuffix "-debug"
|
||
debuggable true
|
||
signingConfig signingConfigs.MT6789
|
||
}
|
||
|
||
MT6789Release.initWith(release)
|
||
MT6789Release {
|
||
manifestPlaceholders = [
|
||
AK: "7IubK1Ugeuxga4KKC5VQyjTeQlExsYZq"
|
||
]
|
||
buildConfigField "String", "platform", '"G12NL"'
|
||
signingConfig signingConfigs.MT6789
|
||
}
|
||
|
||
Huaruian8768Debug.initWith(debug)
|
||
Huaruian8768Debug {
|
||
manifestPlaceholders = [
|
||
AK: "7IubK1Ugeuxga4KKC5VQyjTeQlExsYZq"
|
||
]
|
||
buildConfigField "String", "platform", '"G10J"'
|
||
versionNameSuffix "-debug"
|
||
debuggable true
|
||
signingConfig signingConfigs.Huaruian8768
|
||
}
|
||
|
||
Huaruian8768Release.initWith(release)
|
||
Huaruian8768Release {
|
||
manifestPlaceholders = [
|
||
AK: "7IubK1Ugeuxga4KKC5VQyjTeQlExsYZq"
|
||
]
|
||
buildConfigField "String", "platform", '"G10J"'
|
||
signingConfig signingConfigs.Huaruian8768
|
||
}
|
||
|
||
iPlay50SEDebug.initWith(debug)
|
||
iPlay50SEDebug {
|
||
manifestPlaceholders = [
|
||
AK: "7IubK1Ugeuxga4KKC5VQyjTeQlExsYZq"
|
||
]
|
||
buildConfigField "String", "platform", '"ipaly50"'
|
||
versionNameSuffix "-debug"
|
||
debuggable true
|
||
signingConfig signingConfigs.iPlay50SE
|
||
}
|
||
|
||
iPlay50SERelease.initWith(release)
|
||
iPlay50SERelease {
|
||
manifestPlaceholders = [
|
||
AK: "7IubK1Ugeuxga4KKC5VQyjTeQlExsYZq"
|
||
]
|
||
buildConfigField "String", "platform", '"ipaly50"'
|
||
signingConfig signingConfigs.iPlay50SE
|
||
}
|
||
|
||
unisocDebug.initWith(debug)
|
||
unisocDebug {
|
||
manifestPlaceholders = [
|
||
AK: "7IubK1Ugeuxga4KKC5VQyjTeQlExsYZq"
|
||
]
|
||
buildConfigField "String", "platform", '"ZhanRui"'
|
||
versionNameSuffix "-debug"
|
||
debuggable true
|
||
signingConfig signingConfigs.unisoc
|
||
}
|
||
|
||
unisocRelease.initWith(debug)
|
||
unisocRelease {
|
||
manifestPlaceholders = [
|
||
AK: "7IubK1Ugeuxga4KKC5VQyjTeQlExsYZq"
|
||
]
|
||
buildConfigField "String", "platform", '"ZhanRui"'
|
||
debuggable true
|
||
signingConfig signingConfigs.unisoc
|
||
}
|
||
|
||
mtk11Debug.initWith(debug)
|
||
mtk11Debug {
|
||
manifestPlaceholders = [
|
||
AK: "7IubK1Ugeuxga4KKC5VQyjTeQlExsYZq"
|
||
]
|
||
buildConfigField "String", "platform", '"MTK"'
|
||
versionNameSuffix "-debug"
|
||
debuggable true
|
||
signingConfig signingConfigs.mtkAndroid11
|
||
}
|
||
|
||
mtk11Release.initWith(release)
|
||
mtk11Release {
|
||
manifestPlaceholders = [
|
||
AK: "7IubK1Ugeuxga4KKC5VQyjTeQlExsYZq"
|
||
]
|
||
buildConfigField "String", "platform", '"MTK"'
|
||
signingConfig signingConfigs.mtkAndroid11
|
||
}
|
||
|
||
teclastMTKDebug.initWith(debug)
|
||
teclastMTKDebug {
|
||
manifestPlaceholders = [
|
||
AK: "7IubK1Ugeuxga4KKC5VQyjTeQlExsYZq"
|
||
]
|
||
buildConfigField "String", "platform", '"T30PRO"'
|
||
versionNameSuffix "-debug"
|
||
debuggable true
|
||
signingConfig signingConfigs.teclastMTK
|
||
}
|
||
|
||
teclastMTKRelease.initWith(release)
|
||
teclastMTKRelease {
|
||
manifestPlaceholders = [
|
||
AK: "7IubK1Ugeuxga4KKC5VQyjTeQlExsYZq"
|
||
]
|
||
buildConfigField "String", "platform", '"T30PRO"'
|
||
signingConfig signingConfigs.teclastMTK
|
||
}
|
||
|
||
G6Debug.initWith(debug)
|
||
G6Debug {
|
||
manifestPlaceholders = [
|
||
AK: "7IubK1Ugeuxga4KKC5VQyjTeQlExsYZq"
|
||
]
|
||
buildConfigField "String", "platform", '"G6"'
|
||
versionNameSuffix "-debug"
|
||
debuggable true
|
||
signingConfig signingConfigs.G10P
|
||
}
|
||
|
||
G6Release.initWith(release)
|
||
G6Release {
|
||
manifestPlaceholders = [
|
||
AK: "7IubK1Ugeuxga4KKC5VQyjTeQlExsYZq"
|
||
]
|
||
buildConfigField "String", "platform", '"G6"'
|
||
signingConfig signingConfigs.G10P
|
||
}
|
||
|
||
G13Debug.initWith(debug)
|
||
G13Debug {
|
||
manifestPlaceholders = [
|
||
AK: "7IubK1Ugeuxga4KKC5VQyjTeQlExsYZq"
|
||
]
|
||
buildConfigField "String", "platform", '"G13"'
|
||
versionNameSuffix "-debug"
|
||
debuggable true
|
||
signingConfig signingConfigs.G10P
|
||
}
|
||
|
||
G13Release.initWith(release)
|
||
G13Release {
|
||
manifestPlaceholders = [
|
||
AK: "7IubK1Ugeuxga4KKC5VQyjTeQlExsYZq"
|
||
]
|
||
buildConfigField "String", "platform", '"G13"'
|
||
signingConfig signingConfigs.G10P
|
||
}
|
||
|
||
Teclast8515Debug.initWith(debug)
|
||
Teclast8515Debug {
|
||
manifestPlaceholders = [
|
||
AK: "7IubK1Ugeuxga4KKC5VQyjTeQlExsYZq"
|
||
]
|
||
buildConfigField "String", "platform", '"8515"'
|
||
versionNameSuffix "-debug"
|
||
debuggable true
|
||
signingConfig signingConfigs.Teclast8515
|
||
}
|
||
|
||
Teclast8515Release.initWith(release)
|
||
Teclast8515Release {
|
||
manifestPlaceholders = [
|
||
AK: "7IubK1Ugeuxga4KKC5VQyjTeQlExsYZq"
|
||
]
|
||
buildConfigField "String", "platform", '"8515"'
|
||
signingConfig signingConfigs.Teclast8515
|
||
}
|
||
|
||
//m40se
|
||
teclastUnisocdebug.initWith(zhanRuiDebug)
|
||
teclastUnisocdebug {
|
||
manifestPlaceholders = [
|
||
AK: "u5qGsILQ7qlXI8GDv6T6cGl8IWMtsPSu"
|
||
]
|
||
buildConfigField "String", "platform", '"M40SE"'
|
||
versionNameSuffix "-debug"
|
||
debuggable true
|
||
signingConfig signingConfigs.teclastUnisoc
|
||
}
|
||
|
||
teclastUnisocrelease.initWith(zhanRuiDebug)
|
||
teclastUnisocrelease {
|
||
manifestPlaceholders = [
|
||
AK: "u5qGsILQ7qlXI8GDv6T6cGl8IWMtsPSu"
|
||
]
|
||
buildConfigField "String", "platform", '"M40SE"'
|
||
signingConfig signingConfigs.teclastUnisoc
|
||
}
|
||
|
||
teclastUnisocUserdebug.initWith(zhanRuiDebug)
|
||
teclastUnisocUserdebug {
|
||
manifestPlaceholders = [
|
||
AK: "u5qGsILQ7qlXI8GDv6T6cGl8IWMtsPSu"
|
||
]
|
||
buildConfigField "String", "platform", '"M40SE"'
|
||
versionNameSuffix "-debug"
|
||
debuggable true
|
||
signingConfig signingConfigs.teclastUnisocUserdebug
|
||
}
|
||
|
||
zhanRuiDebug.initWith(debug)
|
||
zhanRuiDebug {
|
||
manifestPlaceholders = [
|
||
AK: "EiqcGW9LWDvfMKl7mZxUtt1UkNKpdQI5"
|
||
]
|
||
buildConfigField "String", "platform", '"ZhanRui"'
|
||
versionNameSuffix "-debug"
|
||
debuggable true
|
||
signingConfig signingConfigs.zhanRui
|
||
}
|
||
|
||
zhanRuiRelease.initWith(release)
|
||
zhanRuiRelease {
|
||
manifestPlaceholders = [
|
||
AK: "EiqcGW9LWDvfMKl7mZxUtt1UkNKpdQI5"
|
||
]
|
||
buildConfigField "String", "platform", '"ZhanRui"'
|
||
signingConfig signingConfigs.zhanRui
|
||
}
|
||
|
||
zhanRuiUserdebugReleas.initWith(debug)
|
||
zhanRuiUserdebugReleas {
|
||
manifestPlaceholders = [
|
||
AK: "EiqcGW9LWDvfMKl7mZxUtt1UkNKpdQI5"
|
||
]
|
||
buildConfigField "String", "platform", '"ZhanRui"'
|
||
signingConfig signingConfigs.zhanRuiUserdebug
|
||
}
|
||
|
||
debug {
|
||
buildConfigField "String", "platform", '"MTK"'
|
||
versionNameSuffix "-debug"
|
||
//Zipalign优化
|
||
zipAlignEnabled true
|
||
minifyEnabled false
|
||
signingConfig signingConfigs.mtk
|
||
applicationVariants.all { variant ->
|
||
variant.outputs.each { output ->
|
||
if (outputFile != null) {
|
||
def fileName = "${appName()}-${variant.versionCode}-V${variant.versionName}-${releaseTime()}-${buildType.name}.apk"
|
||
output.outputFileName = fileName
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
release {
|
||
buildConfigField "String", "platform", '"MTK"'
|
||
//Zipalign优化
|
||
zipAlignEnabled true
|
||
//混淆
|
||
minifyEnabled false
|
||
//前一部分代表系统默认的android程序的混淆文件,该文件已经包含了基本的混淆声明,后一个文件是自己的定义混淆文件
|
||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||
//签名
|
||
signingConfig signingConfigs.mtk
|
||
// 将release版本的包名重命名,加上版本及日期
|
||
applicationVariants.all { variant ->
|
||
variant.outputs.each { output ->
|
||
def outputFile = ""
|
||
if (outputFile != null) {
|
||
def fileName = "${appName()}-${variant.versionCode}-V${variant.versionName}-${releaseTime()}-${buildType.name}.apk"
|
||
output.outputFileName = new File(outputFile, fileName)
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
lintOptions {
|
||
checkReleaseBuilds false
|
||
// Or, if you prefer, you can continue to check for errors in release builds,
|
||
// but continue the build even when errors are found:
|
||
abortOnError false
|
||
}
|
||
}
|
||
|
||
dependencies {
|
||
// implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||
compileOnly files('libs/framework.jar')
|
||
|
||
//implementation 'com.android.support:multidex:1.0.3'
|
||
implementation 'androidx.appcompat:appcompat:1.3.1'
|
||
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
||
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||
|
||
testImplementation 'junit:junit:4.13.2'
|
||
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
||
|
||
//okhttp
|
||
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
|
||
//Retrofit
|
||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||
implementation 'com.squareup.retrofit2:adapter-rxjava3:2.9.0'
|
||
//RxJava
|
||
implementation 'io.reactivex.rxjava3:rxjava:3.0.0'
|
||
implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'
|
||
//生命周期管理
|
||
implementation 'com.trello.rxlifecycle4:rxlifecycle:4.0.2'
|
||
implementation 'com.trello.rxlifecycle4:rxlifecycle-android:4.0.2'
|
||
implementation 'com.trello.rxlifecycle4:rxlifecycle-components:4.0.2'
|
||
implementation 'com.trello.rxlifecycle4:rxlifecycle-components-preference:4.0.2'
|
||
implementation 'com.trello.rxlifecycle4:rxlifecycle-android-lifecycle:4.0.2'
|
||
//Google
|
||
implementation 'com.google.code.gson:gson:2.9.0'
|
||
implementation 'com.google.zxing:core:3.5.0'
|
||
//图片加载框架
|
||
implementation 'com.github.bumptech.glide:glide:4.13.2'
|
||
annotationProcessor 'com.github.bumptech.glide:compiler:4.13.2'
|
||
//磁盘缓存
|
||
implementation 'com.jakewharton:disklrucache:2.0.2'
|
||
//Aria
|
||
implementation 'com.arialyy.aria:core:3.8.15'
|
||
annotationProcessor 'com.arialyy.aria:compiler:3.8.15'
|
||
//Java WebSocket
|
||
implementation "org.java-websocket:Java-WebSocket:1.5.3"
|
||
//MMKV
|
||
implementation 'com.tencent:mmkv-static:1.2.13'
|
||
//bugly
|
||
implementation 'com.tencent.bugly:crashreport:4.1.9.2'
|
||
//腾讯移动推送 TPNS
|
||
implementation 'com.tencent.tpns:tpns:1.4.4.2-release'
|
||
//阿里云推送
|
||
implementation 'com.aliyun.ams:alicloud-android-push:3.8.0'
|
||
//百度地图
|
||
implementation 'com.baidu.lbsyun:BaiduMapSDK_Location:9.1.8'
|
||
//工具类
|
||
implementation 'com.blankj:utilcodex:1.31.0'
|
||
//autosize会改变第三方view的大小
|
||
//https://github.com/JessYanCoding/AndroidAutoSize
|
||
//implementation 'me.jessyan:autosize:1.2.1'
|
||
implementation 'com.flyco.tablayout:FlycoTabLayout_Lib:2.1.2@aar'
|
||
implementation 'com.github.chrisbanes:PhotoView:2.0.0'
|
||
//沉浸状态栏
|
||
implementation 'com.gitee.zackratos:UltimateBarX:0.8.0'
|
||
//验证码输入
|
||
implementation 'com.jacktuotuo.customview:verificationcodeview:1.0.5'
|
||
// implementation 'com.king.view:splitedittext:1.0.0'
|
||
//动态权限框架
|
||
// implementation 'com.hjq:xxpermissions:6.0'
|
||
}
|
||
|
||
preBuild {
|
||
doLast {
|
||
def imlFile = file(project.name + ".iml")
|
||
println 'Change ' + project.name + '.iml order'
|
||
try {
|
||
def parsedXml = (new XmlParser()).parse(imlFile)
|
||
def jdkNode = parsedXml.component[1].orderEntry.find { it.'@type' == 'jdk' }
|
||
parsedXml.component[1].remove(jdkNode)
|
||
def sdkString = "Android API " + android.compileSdkVersion.substring("android-".length()) + " Platform"
|
||
println 'what' + sdkString
|
||
new Node(parsedXml.component[1], 'orderEntry', ['type': 'jdk', 'jdkName': sdkString, 'jdkType': 'Android SDK'])
|
||
groovy.xml.XmlUtil.serialize(parsedXml, new FileOutputStream(imlFile))
|
||
} catch (FileNotFoundException e) {
|
||
// nop, iml not found
|
||
println "no iml found"
|
||
}
|
||
}
|
||
//https://www.pianshen.com/article/93481144911/
|
||
//使用系统编译后的framework.jar
|
||
}
|