Nagram/TMessagesProj/build.gradle

385 lines
11 KiB
Groovy
Raw Normal View History

apply plugin: 'com.android.application'
2020-06-24 16:15:30 +00:00
apply plugin: 'kotlin-android'
2013-10-25 15:19:00 +00:00
2021-01-07 09:47:52 +00:00
def verName = "7.3.1-rc11"
def verCode = 152
2020-07-22 03:23:05 +00:00
2020-07-08 04:00:22 +00:00
def serviceAccountCredentialsFile = rootProject.file("service_account_credentials.json")
2020-07-22 03:23:05 +00:00
def beta = verName.contains("preview")
2020-07-08 04:00:22 +00:00
if (serviceAccountCredentialsFile.isFile()) {
2020-07-22 03:23:05 +00:00
setupPlay(beta)
2020-07-08 04:00:22 +00:00
play.serviceAccountCredentials = serviceAccountCredentialsFile
} else if (System.getenv().containsKey("ANDROID_PUBLISHER_CREDENTIALS")) {
2020-07-22 03:23:05 +00:00
setupPlay(beta)
2020-07-08 04:00:22 +00:00
}
2020-07-22 03:23:05 +00:00
void setupPlay(boolean beta) {
2020-07-08 04:00:22 +00:00
apply plugin: 'com.github.triplet.play'
play {
2020-07-22 03:23:05 +00:00
track = beta ? "beta" : "production"
2020-07-08 04:00:22 +00:00
defaultToAppBundles = true
}
}
2016-10-11 11:57:01 +00:00
configurations {
compile.exclude module: 'support-v4'
}
2020-09-14 04:25:40 +00:00
def okHttpVersion = '4.9.0'
2020-12-23 10:52:32 +00:00
def fcmVersion = '21.0.1'
def crashlyticsVersion = '17.3.0'
2020-12-08 14:05:46 +00:00
def playCoreVersion = '1.9.0'
2020-06-24 16:15:30 +00:00
2020-07-08 03:28:13 +00:00
repositories {
2020-07-19 07:44:11 +00:00
jcenter()
2020-07-08 03:28:13 +00:00
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
2013-10-25 15:19:00 +00:00
dependencies {
2020-06-24 16:15:30 +00:00
2020-11-15 14:13:57 +00:00
implementation 'androidx.core:core-ktx:1.5.0-alpha05'
2020-07-22 03:23:05 +00:00
implementation 'androidx.palette:palette-ktx:1.0.0'
implementation 'androidx.viewpager:viewpager:1.0.0'
2020-12-08 14:05:46 +00:00
implementation 'androidx.exifinterface:exifinterface:1.3.2'
2020-06-24 16:15:30 +00:00
implementation "androidx.interpolator:interpolator:1.0.0"
2020-04-24 09:21:58 +00:00
implementation 'androidx.dynamicanimation:dynamicanimation:1.0.0'
2020-07-26 08:03:38 +00:00
implementation 'androidx.multidex:multidex:2.0.1'
implementation "androidx.sharetarget:sharetarget:1.0.0"
2019-05-14 12:08:05 +00:00
2020-06-25 14:01:18 +00:00
// replace zxing with latest
// TODO: fix problem with android L
2020-10-01 04:30:37 +00:00
implementation 'com.google.zxing:core:3.4.1'
2020-06-25 14:01:18 +00:00
2020-12-08 14:05:46 +00:00
compileOnly 'org.checkerframework:checker-qual:3.8.0'
compileOnly 'org.checkerframework:checker-compat-qual:2.5.5'
2020-07-02 09:08:56 +00:00
// don't change this :)
//noinspection GradleDependency
implementation 'com.googlecode.mp4parser:isoparser:1.0.6'
2020-01-18 11:57:04 +00:00
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'org.osmdroid:osmdroid-android:6.1.8'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.21-2'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.2'
2020-06-24 16:15:30 +00:00
implementation "com.squareup.okhttp3:okhttp:$okHttpVersion"
implementation "com.squareup.okhttp3:okhttp-dnsoverhttps:$okHttpVersion"
Merge remote-tracking branch 'upstream/master' # Conflicts: # TMessagesProj/build.gradle # TMessagesProj/src/main/AndroidManifest.xml # TMessagesProj/src/main/java/org/telegram/messenger/AndroidUtilities.java # TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java # TMessagesProj/src/main/java/org/telegram/messenger/FileLoader.java # TMessagesProj/src/main/java/org/telegram/messenger/LocaleController.java # TMessagesProj/src/main/java/org/telegram/messenger/MediaDataController.java # TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java # TMessagesProj/src/main/java/org/telegram/messenger/SendMessagesHelper.java # TMessagesProj/src/main/java/org/telegram/tgnet/ConnectionsManager.java # TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarPopupWindow.java # TMessagesProj/src/main/java/org/telegram/ui/ActionBar/Theme.java # TMessagesProj/src/main/java/org/telegram/ui/Adapters/DialogsSearchAdapter.java # TMessagesProj/src/main/java/org/telegram/ui/Adapters/DrawerLayoutAdapter.java # TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMessageCell.java # TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerProfileCell.java # TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java # TMessagesProj/src/main/java/org/telegram/ui/ChatUsersActivity.java # TMessagesProj/src/main/java/org/telegram/ui/Components/AlertsCreator.java # TMessagesProj/src/main/java/org/telegram/ui/Components/Bulletin.java # TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java # TMessagesProj/src/main/java/org/telegram/ui/Components/FragmentContextView.java # TMessagesProj/src/main/java/org/telegram/ui/GroupCreateFinalActivity.java # TMessagesProj/src/main/java/org/telegram/ui/LocationActivity.java # TMessagesProj/src/main/java/org/telegram/ui/PaymentFormActivity.java # TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java # TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java # build.gradle # gradle/wrapper/gradle-wrapper.properties
2020-10-30 14:57:47 +00:00
implementation 'dnsjava:dnsjava:3.3.1'
implementation 'org.dizitart:nitrite:3.4.3'
2020-06-24 16:15:30 +00:00
2020-12-30 03:12:55 +00:00
implementation 'cn.hutool:hutool-core:5.5.6'
implementation 'cn.hutool:hutool-crypto:5.5.6'
implementation 'cn.hutool:hutool-http:5.5.6'
2020-06-24 16:15:30 +00:00
2020-11-28 07:39:49 +00:00
implementation 'com.jakewharton:process-phoenix:2.0.0'
2020-07-19 07:44:11 +00:00
implementation project(":openpgp-api")
2020-06-24 16:15:30 +00:00
compileOnly files('libs/libv2ray.aar')
compileOnly "com.google.firebase:firebase-messaging:$fcmVersion"
compileOnly "com.google.firebase:firebase-crashlytics:$crashlyticsVersion"
2020-06-24 16:15:30 +00:00
compileOnly "com.google.android.play:core:$playCoreVersion"
2020-12-23 10:52:32 +00:00
debugImplementation "com.google.firebase:firebase-messaging:$fcmVersion"
debugImplementation "com.google.firebase:firebase-crashlytics:$crashlyticsVersion"
2020-12-23 10:52:32 +00:00
debugImplementation "com.google.android.play:core:$playCoreVersion"
2020-06-24 16:15:30 +00:00
releaseImplementation "com.google.firebase:firebase-messaging:$fcmVersion"
releaseImplementation "com.google.firebase:firebase-crashlytics:$crashlyticsVersion"
2020-06-24 16:15:30 +00:00
releaseImplementation "com.google.android.play:core:$playCoreVersion"
2020-12-17 17:32:45 +00:00
testImplementation 'junit:junit:4.13.1'
testImplementation 'androidx.test:core:1.3.0'
testImplementation "org.robolectric:robolectric:4.4"
2020-11-15 14:13:57 +00:00
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.1'
}
2020-06-24 16:15:30 +00:00
2013-10-25 15:19:00 +00:00
android {
2020-07-26 08:03:38 +00:00
compileSdkVersion 30
2020-12-08 14:05:46 +00:00
buildToolsVersion '30.0.3'
2020-06-24 16:15:30 +00:00
ndkVersion rootProject.ext.ndkVersion
defaultConfig.applicationId = "nekox.messenger"
2017-12-08 17:35:59 +00:00
2020-06-24 16:15:30 +00:00
defaultConfig {
minSdkVersion 16
2020-11-04 12:43:49 +00:00
//noinspection ExpiredTargetSdkVersion,OldTargetApi
2020-12-13 18:41:07 +00:00
targetSdkVersion 29
2015-10-29 17:10:07 +00:00
2020-06-24 16:15:30 +00:00
versionName verName
versionCode verCode
def appId = null
def appHash = null
//obtain your own keys at https://core.telegram.org/api/obtaining_api_id
if (project.rootProject.file('local.properties').exists()) {
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
appId = properties.getProperty("TELEGRAM_APP_ID") ?: System.getenv("TELEGRAM_APP_ID")
appHash = properties.getProperty("TELEGRAM_APP_HASH") ?: System.getenv("TELEGRAM_APP_HASH")
}
buildConfigField 'int', 'APP_ID', appId != null ? appId : "1391584"
buildConfigField 'String', 'APP_HASH', "\"" + (appHash != null ? appHash : "355c91550b0d658cfb7ff89dcf91a08c") + "\""
externalNativeBuild {
cmake {
version '3.10.2'
arguments '-DANDROID_STL=c++_static', '-DANDROID_PLATFORM=android-16', "-j=16"
2020-06-24 16:15:30 +00:00
}
}
}
bundle {
language {
enableSplit = false
}
}
2016-10-11 11:57:01 +00:00
externalNativeBuild {
2020-09-30 13:48:47 +00:00
cmake {
path 'jni/CMakeLists.txt'
2016-10-11 11:57:01 +00:00
}
}
2018-07-30 02:07:02 +00:00
lintOptions {
disable 'MissingTranslation'
disable 'ExtraTranslation'
2019-09-10 10:56:11 +00:00
disable 'BlockedPrivateApi'
2018-07-30 02:07:02 +00:00
}
2020-06-24 16:15:30 +00:00
packagingOptions {
exclude '/fabric/**'
exclude '/META-INF/*.version'
exclude '/META-INF/*.kotlin_module'
exclude '/builddef.lst'
exclude '/*.txt'
}
2017-03-30 23:58:05 +00:00
dexOptions {
jumboMode = true
}
2015-01-02 22:15:07 +00:00
compileOptions {
2018-08-27 08:33:11 +00:00
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
2020-08-14 16:58:22 +00:00
coreLibraryDesugaringEnabled true
2015-01-02 22:15:07 +00:00
}
2020-06-24 16:15:30 +00:00
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
2020-12-17 17:32:45 +00:00
testOptions {
unitTests.includeAndroidResources = true
}
2013-12-20 19:25:49 +00:00
signingConfigs {
2020-01-28 07:01:42 +00:00
def keystorePwd = null
def alias = null
def pwd = null
2020-06-24 16:15:30 +00:00
Properties properties
2020-01-28 07:01:42 +00:00
if (project.rootProject.file('local.properties').exists()) {
2020-06-24 16:15:30 +00:00
properties = new Properties()
2020-01-28 07:01:42 +00:00
properties.load(project.rootProject.file('local.properties').newDataInputStream())
2020-06-24 16:15:30 +00:00
} else {
def base64 = System.getenv("LOCAL_PROPERTIES")
if (base64 != null && !base64.isBlank()) {
properties = new Properties()
properties.load(new ByteArrayInputStream(Base64.decoder.decode(base64)))
}
2020-01-28 07:01:42 +00:00
}
2020-06-24 16:15:30 +00:00
if (properties != null) {
keystorePwd = properties.getProperty("KEYSTORE_PASS")
alias = properties.getProperty("ALIAS_NAME")
pwd = properties.getProperty("ALIAS_PASS")
}
keystorePwd = keystorePwd ?: System.getenv("KEYSTORE_PASS")
alias = alias ?: System.getenv("ALIAS_NAME")
pwd = pwd ?: System.getenv("ALIAS_PASS")
2019-06-11 05:56:33 +00:00
release {
2020-06-24 16:15:30 +00:00
storeFile project.file('release.keystore')
storePassword keystorePwd
keyAlias alias
keyPassword pwd
2013-12-20 19:25:49 +00:00
}
2020-06-24 16:15:30 +00:00
2013-12-20 19:25:49 +00:00
}
buildTypes {
debug {
2020-11-22 09:26:11 +00:00
isDefault true
2013-12-20 19:25:49 +00:00
debuggable true
2020-11-22 09:26:11 +00:00
jniDebuggable false
2020-04-24 09:21:58 +00:00
multiDexEnabled true
2020-11-22 02:57:43 +00:00
zipAlignEnabled true
2020-11-22 09:26:11 +00:00
signingConfig signingConfigs.release
2020-06-24 16:15:30 +00:00
}
2019-12-31 13:08:08 +00:00
2020-06-24 16:15:30 +00:00
releaseNoGcm {
2019-01-23 17:03:33 +00:00
debuggable false
jniDebuggable false
minifyEnabled true
2020-06-24 16:15:30 +00:00
shrinkResources true
2020-09-03 15:37:42 +00:00
multiDexEnabled true
2020-11-22 02:57:43 +00:00
zipAlignEnabled true
2020-09-03 15:37:42 +00:00
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2020-07-19 07:44:11 +00:00
matchingFallbacks = ['debug']
2020-07-27 04:49:42 +00:00
signingConfig signingConfigs.release
2019-01-23 17:03:33 +00:00
}
2013-12-20 19:25:49 +00:00
release {
2020-09-03 15:37:42 +00:00
debuggable false
jniDebuggable false
minifyEnabled true
shrinkResources true
multiDexEnabled true
2020-11-22 02:57:43 +00:00
zipAlignEnabled true
2020-09-03 15:37:42 +00:00
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
matchingFallbacks = ['debug']
signingConfig signingConfigs.release
2020-06-24 16:15:30 +00:00
}
foss {
2020-09-03 15:37:42 +00:00
debuggable false
jniDebuggable false
minifyEnabled true
shrinkResources true
multiDexEnabled true
2020-11-22 02:57:43 +00:00
zipAlignEnabled true
2020-09-03 15:37:42 +00:00
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2020-08-10 10:20:22 +00:00
matchingFallbacks = ['debug']
2013-12-20 19:25:49 +00:00
}
}
2020-07-08 04:00:22 +00:00
sourceSets {
2014-11-21 19:36:21 +00:00
2020-07-08 04:00:22 +00:00
main {
2020-10-04 10:14:58 +00:00
jni.srcDirs = []
2020-07-08 04:00:22 +00:00
}
2020-06-24 16:15:30 +00:00
2020-07-08 04:00:22 +00:00
debug {
jniLibs.srcDir 'src/main/libs'
2020-12-08 14:05:46 +00:00
manifest.srcFile 'src/gservcies/AndroidManifest.xml'
2020-07-08 04:00:22 +00:00
}
2020-06-24 16:15:30 +00:00
2020-07-08 04:00:22 +00:00
releaseNoGcm {
jniLibs.srcDir 'src/main/libs'
}
2020-06-24 16:15:30 +00:00
2020-07-08 04:00:22 +00:00
release {
jniLibs.srcDir 'src/main/libs'
manifest.srcFile 'src/gservcies/AndroidManifest.xml'
}
2020-06-24 16:15:30 +00:00
2020-07-08 04:00:22 +00:00
foss {
jni.srcDirs = ['./jni/']
}
2020-06-24 16:15:30 +00:00
2020-07-08 04:00:22 +00:00
}
2020-06-24 16:15:30 +00:00
2020-07-08 04:00:22 +00:00
splits.abi {
2017-12-08 17:35:59 +00:00
2020-07-08 04:00:22 +00:00
enable true
2020-08-16 01:08:56 +00:00
universalApk false
2016-03-16 12:26:32 +00:00
2020-06-24 16:15:30 +00:00
}
2020-03-30 12:00:09 +00:00
2020-06-24 16:15:30 +00:00
flavorDimensions "version"
2019-05-14 12:08:05 +00:00
2020-06-24 16:15:30 +00:00
productFlavors {
mini {
versionNameSuffix '-mini'
}
2021-01-03 07:13:57 +00:00
miniAppleEmoji {
versionNameSuffix '-mini'
}
2020-08-16 01:08:56 +00:00
full {
2020-11-04 12:43:49 +00:00
isDefault true
2020-08-20 09:08:26 +00:00
}
2021-01-03 07:13:57 +00:00
fullAppleEmoji {
versionNameSuffix '-full-apple-emoji'
}
2020-10-11 09:30:08 +00:00
fullPlay {
versionNameSuffix '-play'
2020-10-21 11:07:30 +00:00
versionCode verCode - 1
2020-10-11 09:30:08 +00:00
}
2020-06-24 16:15:30 +00:00
}
2019-05-14 12:08:05 +00:00
2020-07-08 03:28:13 +00:00
sourceSets.all { set ->
2020-10-11 06:35:19 +00:00
if (set.name.startsWith("full")) {
set.dependencies {
implementation files('libs/libv2ray.aar', 'libs/ss-rust-release.aar', 'libs/ssr-libev-release.aar')
2020-10-11 06:35:19 +00:00
}
}
2020-07-08 03:28:13 +00:00
if (set.name.matches("(mini|full).*")) {
2021-01-03 07:13:57 +00:00
if (set.name.contains("Apple")) {
2020-08-16 01:08:56 +00:00
set.assets.srcDirs = ["src/main/assets", "src/emojis/apple"]
2020-12-29 16:16:49 +00:00
/*} else if (set.name.contains("Twitter")) {
2021-01-03 07:13:57 +00:00
set.assets.srcDirs = ["src/main/assets", "src/emojis/twitter"]*/
2020-12-29 16:16:49 +00:00
} else {
2021-01-03 07:13:57 +00:00
set.assets.srcDirs = ["src/main/assets", "src/emojis/twitter"]
}
2020-06-24 16:15:30 +00:00
}
}
tasks.all { task ->
if (((task.name.endsWith('Ndk') || task.name.startsWith('generateJsonModel') || task.name.startsWith('externalNativeBuild'))) && !task.name.contains("Foss")) {
task.enabled = false
}
if (task.name.contains("uploadCrashlyticsMappingFile")) {
enabled = false
}
}
applicationVariants.all { variant ->
variant.outputs.all { output ->
2020-07-08 03:28:13 +00:00
outputFileName = outputFileName.replace("TMessagesProj", "NekoX")
2017-12-08 17:35:59 +00:00
}
2016-03-16 12:26:32 +00:00
}
2013-10-25 15:19:00 +00:00
}
2016-04-22 13:49:00 +00:00
2020-06-24 16:15:30 +00:00
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
android {
tasks.all { task ->
if (task.name.startsWith('uploadCrashlyticsMappingFile')) {
task.enabled = false
2021-01-03 07:13:57 +00:00
} else if (task.name.contains('Crashlytics') && task.name.contains("NoGcm")) {
2020-06-24 16:15:30 +00:00
task.enabled = false
2021-01-03 07:13:57 +00:00
} else if (task.name.endsWith('GoogleServices') && task.name.contains("NoGcm")) {
2020-06-24 16:15:30 +00:00
task.enabled = false
}
}
}