Replace universal fat APK build with architecture-specific APKs for arm64-v8a, armeabi-v7a, x86, and x86_64. GitHub Actions now builds all variants in parallel using a matrix strategy with separate ccache keys and version codes (multiplied by 100 instead of 10 to allow updates over previously installed universal APKs). Refactor DNS resolver to implement a multi-provider DoH fallback chain (Cloudflare, Google) with shared connection helpers, proper error handling, and debug-level logging for expected DNS failures. Extract common TXT record parsing and random padding generation into reusable helper methods. Add validation scripts to ensure build workflow consistency and DNS resolver fallback correctness.
196 lines
5.5 KiB
Groovy
196 lines
5.5 KiB
Groovy
apply plugin: 'com.android.application'
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
google()
|
|
}
|
|
|
|
configurations {
|
|
compile.exclude module: 'support-v4'
|
|
}
|
|
|
|
configurations.all {
|
|
exclude group: 'com.google.firebase', module: 'firebase-core'
|
|
exclude group: 'androidx.recyclerview', module: 'recyclerview'
|
|
}
|
|
|
|
dependencies {
|
|
implementation project(':TMessagesProj')
|
|
implementation 'androidx.fragment:fragment:1.8.9'
|
|
implementation 'androidx.core:core:1.16.0'
|
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
|
|
implementation files('../TMessagesProj/libs/libgsaverification-client.aar')
|
|
}
|
|
|
|
android {
|
|
compileSdkVersion 35
|
|
buildToolsVersion '35.0.0'
|
|
|
|
defaultConfig.applicationId = APP_PACKAGE
|
|
|
|
sourceSets.main.jniLibs.srcDirs = ['../TMessagesProj/jni/']
|
|
|
|
lintOptions {
|
|
disable 'MissingTranslation'
|
|
disable 'ExtraTranslation'
|
|
disable 'BlockedPrivateApi'
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
|
|
coreLibraryDesugaringEnabled true
|
|
}
|
|
|
|
signingConfigs {
|
|
debug {
|
|
storeFile file("../TMessagesProj/config/release.keystore")
|
|
storePassword RELEASE_STORE_PASSWORD
|
|
keyAlias RELEASE_KEY_ALIAS
|
|
keyPassword RELEASE_KEY_PASSWORD
|
|
}
|
|
|
|
release {
|
|
storeFile file("../TMessagesProj/config/release.keystore")
|
|
storePassword RELEASE_STORE_PASSWORD
|
|
keyAlias RELEASE_KEY_ALIAS
|
|
keyPassword RELEASE_KEY_PASSWORD
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
debug {
|
|
debuggable true
|
|
jniDebuggable true
|
|
signingConfig signingConfigs.debug
|
|
applicationIdSuffix ".web"
|
|
minifyEnabled false
|
|
multiDexEnabled true
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), '../TMessagesProj/proguard-rules.pro', '../TMessagesProj/proguard-rules-beta.pro'
|
|
ndk.debugSymbolLevel = 'FULL'
|
|
}
|
|
standalone {
|
|
debuggable false
|
|
jniDebuggable false
|
|
signingConfig signingConfigs.release
|
|
minifyEnabled true
|
|
multiDexEnabled true
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), '../TMessagesProj/proguard-rules.pro'
|
|
ndk.debugSymbolLevel = 'FULL'
|
|
}
|
|
}
|
|
|
|
sourceSets.debug {
|
|
manifest.srcFile '../TMessagesProj/config/release/AndroidManifest_standalone.xml'
|
|
}
|
|
sourceSets.standalone {
|
|
manifest.srcFile '../TMessagesProj/config/release/AndroidManifest_standalone.xml'
|
|
}
|
|
|
|
flavorDimensions "minApi"
|
|
|
|
productFlavors {
|
|
afat {
|
|
ndk {
|
|
abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
|
|
}
|
|
ext {
|
|
abiVersionCode = 9
|
|
}
|
|
sourceSets.standalone {
|
|
manifest.srcFile '../TMessagesProj/config/release/AndroidManifest_standalone.xml'
|
|
}
|
|
}
|
|
arm64 {
|
|
ndk {
|
|
abiFilters "arm64-v8a"
|
|
}
|
|
ext {
|
|
abiVersionCode = 11
|
|
}
|
|
sourceSets.standalone {
|
|
manifest.srcFile '../TMessagesProj/config/release/AndroidManifest_standalone.xml'
|
|
}
|
|
}
|
|
armv7 {
|
|
ndk {
|
|
abiFilters "armeabi-v7a"
|
|
}
|
|
ext {
|
|
abiVersionCode = 12
|
|
}
|
|
sourceSets.standalone {
|
|
manifest.srcFile '../TMessagesProj/config/release/AndroidManifest_standalone.xml'
|
|
}
|
|
}
|
|
x86 {
|
|
ndk {
|
|
abiFilters "x86"
|
|
}
|
|
ext {
|
|
abiVersionCode = 13
|
|
}
|
|
sourceSets.standalone {
|
|
manifest.srcFile '../TMessagesProj/config/release/AndroidManifest_standalone.xml'
|
|
}
|
|
}
|
|
x64 {
|
|
ndk {
|
|
abiFilters "x86_64"
|
|
}
|
|
ext {
|
|
abiVersionCode = 14
|
|
}
|
|
sourceSets.standalone {
|
|
manifest.srcFile '../TMessagesProj/config/release/AndroidManifest_standalone.xml'
|
|
}
|
|
}
|
|
}
|
|
|
|
defaultConfig.versionCode = Integer.parseInt(APP_VERSION_CODE)
|
|
|
|
applicationVariants.all { variant ->
|
|
variant.outputs.all { output ->
|
|
outputFileName = "app.apk"
|
|
output.versionCodeOverride = defaultConfig.versionCode * 100 + variant.productFlavors.get(0).abiVersionCode
|
|
}
|
|
}
|
|
|
|
def standaloneBuildFlavors = ["afat", "arm64", "armv7", "x86", "x64"]
|
|
variantFilter { variant ->
|
|
def names = variant.flavors*.name
|
|
if (variant.buildType.name != "release" && !names.any { standaloneBuildFlavors.contains(it) }) {
|
|
setIgnore(true)
|
|
}
|
|
}
|
|
|
|
defaultConfig {
|
|
minSdkVersion 21
|
|
targetSdkVersion 35
|
|
versionName APP_VERSION_NAME
|
|
ndkVersion "27.2.12479018"
|
|
|
|
multiDexEnabled true
|
|
|
|
vectorDrawables.generatedDensities = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi']
|
|
|
|
externalNativeBuild {
|
|
cmake {
|
|
version '3.10.2'
|
|
arguments '-DANDROID_STL=c++_static', '-DANDROID_PLATFORM=android-21' //, '-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON'
|
|
}
|
|
}
|
|
}
|
|
|
|
buildFeatures {
|
|
buildConfig = true
|
|
}
|
|
namespace 'org.telegram.messenger.web'
|
|
|
|
lintOptions {
|
|
checkReleaseBuilds false
|
|
}
|
|
}
|
|
|
|
apply plugin: 'com.google.gms.google-services'
|