mirror of
https://github.com/xoureldeen/Vectras-VM-Android.git
synced 2026-05-05 01:32:37 +00:00
38 lines
2.1 KiB
Groovy
38 lines
2.1 KiB
Groovy
//file:noinspection UnnecessaryQualifiedReference, GrDeprecatedAPIUsage
|
|
apply plugin: 'com.android.application'
|
|
|
|
android {
|
|
|
|
buildToolsVersion '36.1.0'
|
|
compileSdk 36
|
|
}
|
|
|
|
android.namespace 'com.vectras.vm'
|
|
android.defaultConfig.minSdkVersion 21
|
|
android.buildTypes.debug.signingConfig null
|
|
android.buildFeatures.buildConfig true
|
|
android.compileOptions.sourceCompatibility SDK_VERSION
|
|
android.compileOptions.targetCompatibility SDK_VERSION
|
|
dependencies.compileOnly project(':shell-loader:stub')
|
|
androidComponents {
|
|
onVariants(selector().all()) { variant ->
|
|
variant.outputs.forEach { output ->
|
|
output.outputFileName.set("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")) + "\""
|