Integrates the ZaStoGram Python plugin engine: embeds Chaquopy (CPython 3.11) and Pine (ART/Xposed-compatible hooking). Adds host-side Java implementation under TMessagesProj/src/main/java/org/telegram/plugins (PluginsController, PluginContext, PluginInfo, PluginUtils, PluginRequestInterceptor) to handle discovery, install/load/unload, settings bridge, request interception and hook lifecycle. Updates Gradle: apply Chaquopy plugin, add chaquopy gradle classpath, add Pine dependencies, configure Chaquopy (3.11, readable .py), and raise minSdkVersion to 24 across library and app modules to satisfy Chaquopy requirements.
189 lines
5.6 KiB
Groovy
189 lines
5.6 KiB
Groovy
plugins {
|
|
id 'com.android.application'
|
|
id 'com.google.gms.google-services'
|
|
id 'com.google.firebase.crashlytics'
|
|
}
|
|
|
|
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')
|
|
|
|
implementation "com.microsoft.appcenter:appcenter-distribute:3.3.1"
|
|
implementation "com.microsoft.appcenter:appcenter-crashes:3.3.1"
|
|
implementation "com.microsoft.appcenter:appcenter-analytics:3.3.1"
|
|
|
|
implementation platform("com.google.firebase:firebase-bom:32.7.0")
|
|
implementation "com.google.firebase:firebase-crashlytics:18.6.0"
|
|
}
|
|
|
|
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 {
|
|
HA_private {
|
|
debuggable false
|
|
jniDebuggable false
|
|
signingConfig signingConfigs.debug
|
|
applicationIdSuffix ".beta"
|
|
minifyEnabled true
|
|
multiDexEnabled true
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), '../TMessagesProj/proguard-rules.pro', '../TMessagesProj/proguard-rules-beta.pro'
|
|
ndk.debugSymbolLevel = 'FULL'
|
|
}
|
|
HA_public {
|
|
debuggable false
|
|
jniDebuggable false
|
|
signingConfig signingConfigs.debug
|
|
applicationIdSuffix ".beta"
|
|
minifyEnabled true
|
|
multiDexEnabled true
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), '../TMessagesProj/proguard-rules.pro', '../TMessagesProj/proguard-rules-beta.pro'
|
|
ndk.debugSymbolLevel = 'FULL'
|
|
}
|
|
HA_hardcore {
|
|
debuggable false
|
|
jniDebuggable false
|
|
signingConfig signingConfigs.debug
|
|
applicationIdSuffix ".beta"
|
|
minifyEnabled true
|
|
multiDexEnabled true
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), '../TMessagesProj/proguard-rules.pro', '../TMessagesProj/proguard-rules-beta.pro'
|
|
ndk.debugSymbolLevel = 'FULL'
|
|
}
|
|
}
|
|
|
|
sourceSets.HA_private {
|
|
manifest.srcFile '../TMessagesProj/config/debug/AndroidManifest.xml'
|
|
}
|
|
sourceSets.HA_public {
|
|
manifest.srcFile '../TMessagesProj/config/debug/AndroidManifest.xml'
|
|
}
|
|
sourceSets.HA_hardcore {
|
|
manifest.srcFile '../TMessagesProj/config/debug/AndroidManifest.xml'
|
|
}
|
|
|
|
flavorDimensions "minApi"
|
|
|
|
productFlavors {
|
|
bundleAfat {
|
|
ndk {
|
|
abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
|
|
}
|
|
ext {
|
|
abiVersionCode = 1
|
|
}
|
|
}
|
|
bundleAfat_SDK23 {
|
|
ndk {
|
|
abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
|
|
}
|
|
minSdkVersion 24 // ZaStoGram: Chaquopy requires minSdk >= 24
|
|
ext {
|
|
abiVersionCode = 2
|
|
}
|
|
}
|
|
afat {
|
|
ndk {
|
|
abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
|
|
}
|
|
ext {
|
|
abiVersionCode = 9
|
|
}
|
|
}
|
|
}
|
|
|
|
defaultConfig.versionCode = Integer.parseInt(APP_VERSION_CODE)
|
|
|
|
applicationVariants.all { variant ->
|
|
variant.outputs.all { output ->
|
|
outputFileName = "Telegram-Beta.apk"
|
|
output.versionCodeOverride = defaultConfig.versionCode * 10 + variant.productFlavors.get(0).abiVersionCode
|
|
}
|
|
}
|
|
|
|
variantFilter { variant ->
|
|
def names = variant.flavors*.name
|
|
if (variant.buildType.name != "release" && !names.contains("afat")) {
|
|
setIgnore(true)
|
|
}
|
|
}
|
|
|
|
defaultConfig {
|
|
minSdkVersion 24 // ZaStoGram: Chaquopy requires minSdk >= 24
|
|
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.regular'
|
|
|
|
lintOptions {
|
|
checkReleaseBuilds false
|
|
}
|
|
}
|
|
|