apply plugin: 'com.android.application' apply plugin: 'com.tencent.vasdolly' buildscript { repositories { mavenLocal() mavenCentral() google() } dependencies { classpath "com.tencent.vasdolly:plugin:3.0.6" } } android { namespace 'com.info666.app.infraredRemote' compileSdk 33 defaultConfig { applicationId "com.info666.app.infraredRemote" minSdk 21 targetSdk 33 versionCode 4 versionName "1.0.4" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } signingConfigs { release { storeFile file("../keyStore/key.jks") storePassword "Info666.com" keyAlias "key0" keyPassword "Info666.com" enableV1Signing true enableV2Signing true enableV3Signing false } } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' signingConfig signingConfigs.release } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } packagingOptions { exclude 'META-INF/INDEX.LIST' } } //VasDolly插件配置 //gradle channelDebug/channelRelease 编译生成apk后,再根据生成的Apk生成渠道包 channel{ channelFile = file("app_channel.txt") //多渠道包的输出目录,默认为new File(project.buildDir,"channel") outputDir = new File(project.buildDir,"channels") //多渠道包的命名规则,默认为:${appName}-${versionName}-${versionCode}-${flavorName}-${buildType}-${buildTime} apkNameFormat ='${appName}-${flavorName}-${buildType}' //快速模式:生成渠道包时不进行校验(速度可以提升10倍以上,默认为false) fastMode = false //buildTime的时间格式,默认格式:yyyyMMdd-HHmmss buildTimeDateFormat = 'yyyyMMdd-HH:mm:ss' //低内存模式(仅针对V2签名,默认为false):只把签名块、中央目录和EOCD读取到内存,不把最大头的内容块读取到内存,在手机上合成APK时,可以使用该模式 lowMemory = false } // gradle rebuildChannel 配置此任务用于不希望重新构建apk,直接根据指定的apk生成渠道包 rebuildChannel { channelFile = file("app_channel.txt") //指定的apk生成渠道包,文件名中如果有base将被替换为渠道名,否则渠道名将作为前缀 baseApk = new File(project.buildDir, "outputs/apk/debug/app-debug.apk") //默认为new File(project.buildDir, "rebuildChannel") outputDir = new File(project.buildDir, "rebuildChannels") //快速模式:生成渠道包时不进行校验(速度可以提升10倍以上,默认为false) fastMode = false //低内存模式(仅针对V2签名,默认为false):只把签名块、中央目录和EOCD读取到内存,不把最大头的内容块读取到内存,在手机上合成APK时,可以使用该模式 lowMemory = false } dependencies { implementation 'androidx.appcompat:appcompat:1.4.1' implementation 'com.google.android.material:material:1.5.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.3' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' implementation 'com.alibaba.fastjson2:fastjson2:2.0.35.android4' // AndroidX 版本 implementation 'com.github.jenly1314:zxing-lite:2.2.1' implementation group: 'cn.hutool', name: 'hutool-core', version: '5.8.20' implementation group: 'cn.hutool', name: 'hutool-http', version: '5.8.20' api "com.tencent.vasdolly:helper:3.0.6" }