plugins { id 'com.android.application' } android { namespace 'com.xixun.xixunplayer' compileSdk 34 defaultConfig { applicationId "com.xixun.xixunplayer" minSdk 26 targetSdk 34 versionCode 1 versionName "1.0-timerboard" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } buildFeatures { aidl true } compileOptions { sourceCompatibility JavaVersion.VERSION_11 targetCompatibility JavaVersion.VERSION_11 } } dependencies { implementation 'androidx.appcompat:appcompat:1.6.1' implementation files('libs/gnph.jar') implementation files('libs/xixun_card_settings_1.2.4.jar') } def getAppName() { def stringsFile = android.sourceSets.main.res.sourceFiles.find { it.name.equals 'strings.xml' } String s = new XmlParser().parse(stringsFile).string.find { it.@name.equals 'app_name' }.text(); return s.replaceAll("\"", ""); } // Change the Apk name android.applicationVariants.configureEach { variant -> variant.outputs.configureEach { def fileName = "${getAppName()}-${versionName}.apk" outputFileName = fileName } }