//file:noinspection UnnecessaryQualifiedReference, GrDeprecatedAPIUsage apply plugin: 'com.android.application' android.namespace 'com.vectras.vm' android.defaultConfig.minSdkVersion 21 android.compileSdkVersion 34 android.buildTypes.debug.signingConfig null android.buildFeatures.buildConfig true android.compileOptions.sourceCompatibility JavaVersion.VERSION_1_8 android.compileOptions.targetCompatibility JavaVersion.VERSION_1_8 dependencies.compileOnly project(':shell-loader:stub') android.applicationVariants.configureEach { outputs.configureEach { outputFileName = "loader.apk" } } def signingConfig = project(':app').android.signingConfigs.debug def keyStore = java.security.KeyStore.getInstance(java.security.KeyStore.getDefaultType()) keyStore.load(new FileInputStream(signingConfig.storeFile), signingConfig.keyPassword.toCharArray()) android.defaultConfig.buildConfigField "String", "logTag", "\"Termux:X11 loader\"" android.defaultConfig.buildConfigField "int", "SIGNATURE", String.valueOf(Arrays.hashCode(keyStore.getCertificate(signingConfig.keyAlias).getEncoded())) android.defaultConfig.buildConfigField "String", "CLASS_ID", "\"com.vectras.vm.x11.CmdEntryPoint\"" android.defaultConfig.buildConfigField "String", "packageNotInstalledErrorText", """\"Termux:X11 application is not found.\" + \"You should choose latest successful workflow here: https://github.com/termux/termux-x11/actions/workflows/debug_build.yml\" + \"After this you should download \\"termux-x11-ARCH-debug\\" or \\"termux-x11-universal-debug\\" artifact and install apk contained in this zip file.\"""" android.defaultConfig.buildConfigField "String", "packageSignatureMismatchErrorText", "\"Signature verification of target application " + android.namespace + " failed.\\nPlease, reinstall both termux-x11 package and Termux:X11 application from the same source\"" android.defaultConfig.buildConfigField "String", "COMMIT", "\"" + ("git rev-parse HEAD\n".execute().getText().trim() ?: (System.getenv('CURRENT_COMMIT') ?: "NO_COMMIT")) + "\""