141 lines
4.3 KiB
Groovy
141 lines
4.3 KiB
Groovy
plugins {
|
|
id 'com.android.application'
|
|
id 'kotlin-android'
|
|
id 'dev.flutter.flutter-gradle-plugin'
|
|
}
|
|
|
|
apply plugin: 'top.niunaijun.blackobfuscator'
|
|
apply plugin: 'walle'
|
|
|
|
def bundledReleaseKeystore = file('../keystore/nut.jks')
|
|
def legacyBundledReleaseKeystore = file('../keystore/nut.jks.old')
|
|
def resolvedReleaseKeystore = bundledReleaseKeystore.exists() ? bundledReleaseKeystore : legacyBundledReleaseKeystore
|
|
|
|
android {
|
|
namespace "com.xvproject"
|
|
compileSdk 36
|
|
ndkVersion "28.2.13676358"
|
|
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_17
|
|
targetCompatibility JavaVersion.VERSION_17
|
|
coreLibraryDesugaringEnabled true
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = JavaVersion.VERSION_17.toString()
|
|
}
|
|
|
|
sourceSets {
|
|
main.java.srcDirs += 'src/main/kotlin'
|
|
}
|
|
|
|
defaultConfig {
|
|
applicationId "com.noporn.newchatone_twelve_five"
|
|
minSdk = 24
|
|
targetSdk = 36
|
|
versionCode = 1
|
|
versionName = "1.0.0"
|
|
}
|
|
|
|
signingConfigs {
|
|
release {
|
|
storeFile resolvedReleaseKeystore
|
|
storePassword 'jiahua123456'
|
|
storeType 'jks'
|
|
keyAlias 'nut'
|
|
keyPassword 'jiahua123456'
|
|
v1SigningEnabled false
|
|
v2SigningEnabled true
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled true
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
shrinkResources true
|
|
signingConfig signingConfigs.release
|
|
}
|
|
debug {
|
|
minifyEnabled false
|
|
shrinkResources false
|
|
versionNameSuffix "test"
|
|
}
|
|
}
|
|
|
|
packagingOptions {
|
|
jniLibs {
|
|
excludes += ['**/armeabi-v7a/**', '**/x86/**', '**/x86_64/**']
|
|
}
|
|
}
|
|
|
|
applicationVariants.configureEach { variant ->
|
|
println "variant.name= ${variant.name}"
|
|
variant.outputs.configureEach {
|
|
//只处理生产版本
|
|
if (buildType.name == 'release') {
|
|
println "buildType= ${variant.buildType.getName()}"
|
|
def outputFileDir = "${project.projectDir.absolutePath}/release/"
|
|
def createTime = new Date().format("MM-dd-HH-mm", TimeZone.getTimeZone("GMT+08:00"))
|
|
println "outputFileDir= ${outputFileDir}"
|
|
def abi = filters.find { it.filterType.toString() == "ABI" }?.identifier
|
|
def abiSuffix = (variant.outputs.size() > 1 && abi) ? "_${abi}" : ""
|
|
def path = "hgdj" + '_release' + "_" + variant.versionName + abiSuffix + "_" + createTime + ".apk"
|
|
println("path= " + path)
|
|
outputFileName = path
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
flutter {
|
|
source '../..'
|
|
}
|
|
|
|
configurations.configureEach {
|
|
resolutionStrategy {
|
|
force 'androidx.core:core-ktx:1.6.0'
|
|
}
|
|
}
|
|
|
|
configurations.all {
|
|
resolutionStrategy {
|
|
force 'com.tencent:mmkv:1.2.14'
|
|
}
|
|
}
|
|
|
|
// 加入混淆配置
|
|
BlackObfuscator {
|
|
// 是否启用
|
|
enabled true
|
|
// 混淆深度
|
|
depth 3
|
|
// 需要混淆的包或者类(匹配前面一段)
|
|
obfClass = ["lib"]
|
|
// blackClass中的包或者类不会进行混淆(匹配前面一段)
|
|
// blackClass = ["top.niunaijun.black"]
|
|
}
|
|
|
|
dependencies {
|
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
|
|
// android 读取渠道号码
|
|
implementation 'com.mcxiaoke.packer-ng:helper:2.0.1'
|
|
implementation 'androidx.appcompat:appcompat:1.6.1'
|
|
implementation 'androidx.core:core-ktx:1.12.0'
|
|
implementation 'androidx.lifecycle:lifecycle-common:2.6.2'
|
|
def camerax_version = "1.0.0-beta11"
|
|
implementation "androidx.camera:camera-core:${camerax_version}"
|
|
implementation "androidx.camera:camera-camera2:${camerax_version}"
|
|
implementation "androidx.camera:camera-lifecycle:${camerax_version}"
|
|
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
|
|
// 协程核心库
|
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4"
|
|
// 协程Android支持库
|
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4"
|
|
// 协程Java8支持库
|
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.6.4"
|
|
implementation 'com.qiniu:happy-dns:2.0.1'
|
|
implementation 'com.github.Petterpx.walle:library:1.0.5'
|
|
}
|