| 7 |
| google() |
| 8 | maven { url 'https://developer.huawei.com/repo/' } |
| 9 | } |
| 10 |
| 11 | configurations { |
| 12 | compile.exclude module: 'support-v4' |
| 13 | } |
| 14 |
| 15 | configurations.all { |
| 16 | exclude group: 'com.google.firebase', module: 'firebase-core' |
| 17 | exclude group: 'androidx.recyclerview', module: 'recyclerview' |
| 18 | } |
| 19 |
| 20 | dependencies { |
| 21 | implementation project(':TMessagesProj') |
| 22 | implementation 'androidx.fragment:fragment:1.8.9' |
| 23 | coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5' |
| 24 | implementation files('../TMessagesProj/libs/libgsaverification-client.aar') |
| 25 |
| 26 | implementation 'com.google.firebase:firebase-messaging:22.0.0' |
| 27 | implementation 'com.huawei.hms:push:6.5.0.300' |
| 28 | implementation 'com.huawei.hms:maps:6.6.0.300' |
| 29 | implementation 'com.huawei.hms:location:6.4.0.300' |
| 30 | } |
| 31 |
| 32 | android { |
| 33 | compileSdkVersion 36 |
| 34 | buildToolsVersion '36.0.0' |
| 35 |
| 36 | defaultConfig.applicationId = APP_PACKAGE |
| 37 |
| 38 |
| 39 | lintOptions { |
| 40 | disable 'MissingTranslation' |
| 41 | disable 'ExtraTranslation' |
| 42 | disable 'BlockedPrivateApi' |
| 43 | } |
| 44 |
| 45 | compileOptions { |
| 46 | sourceCompatibility JavaVersion.VERSION_1_8 |
| 47 | targetCompatibility JavaVersion.VERSION_1_8 |
| 48 |
| 49 | coreLibraryDesugaringEnabled true |
| 50 | } |
| 51 |
| 52 | androidResources { |
| 53 | noCompress += "pack" |
| 54 | localeFilters += ["zz"] |
| 55 | } |
| 56 |
| 57 | signingConfigs { |
| 58 | debug { |
| 59 | storeFile file("../TMessagesProj/config/release.keystore") |
| 60 | storePassword RELEASE_STORE_PASSWORD |
| 61 | keyAlias RELEASE_KEY_ALIAS |
| 62 | keyPassword RELEASE_KEY_PASSWORD |
| 63 | } |
| 64 |
| 65 | release { |
| 66 | storeFile file("../TMessagesProj/config/release.keystore") |
| 67 | storePassword RELEASE_STORE_PASSWORD |
| 68 | keyAlias RELEASE_KEY_ALIAS |
| 69 | keyPassword RELEASE_KEY_PASSWORD |
| 70 | } |
| 71 | } |
| 72 |
| 73 | packagingOptions { |
| 74 | jniLibs { |
| 75 | useLegacyPackaging = true |
| 76 | } |
| 77 | } |
| 78 |
| 79 | buildTypes { |
| 80 | debug { |
| 81 | debuggable true |
| 82 | jniDebuggable true |
| 83 | signingConfig signingConfigs.debug |
| 84 | minifyEnabled false |
| 85 | shrinkResources false |
| 86 | multiDexEnabled true |
| 87 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), '../TMessagesProj/proguard-rules.pro' |
| 88 | ndk.debugSymbolLevel = 'FULL' |
| 89 | } |
| 90 | release { |
| 91 | debuggable false |
| 92 | jniDebuggable false |
| 93 | signingConfig signingConfigs.release |
| 94 | minifyEnabled true |
| 95 | shrinkResources false |
| 96 | multiDexEnabled true |
| 97 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), '../TMessagesProj/proguard-rules.pro' |
| 98 | ndk.debugSymbolLevel = 'FULL' |
| 99 | } |
| 100 | } |
| 101 |
| 102 | sourceSets.debug { |
| 103 | manifest.srcFile '../TMessagesProj/config/debug/AndroidManifest.xml' |
| 104 | } |
| 105 |
| 106 | sourceSets.release { |
| 107 | manifest.srcFile '../TMessagesProj/config/release/AndroidManifest.xml' |
| 108 | } |
| 109 |
| 110 | flavorDimensions "minApi" |
| 111 |
| 112 | productFlavors { |
| 113 | afat { |
| 114 | ndk { |
| 115 | abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64" |
| 116 | } |
| 117 | sourceSets.debug { |
| 118 | manifest.srcFile '../TMessagesProj/config/debug/AndroidManifest_SDK23.xml' |
| 119 | } |
| 120 | sourceSets.release { |
| 121 | manifest.srcFile '../TMessagesProj/config/release/AndroidManifest_SDK23.xml' |
| 122 | } |
| 123 | ext { |
| 124 | abiVersionCode = 9 |
| 125 | } |
| 126 | } |
| 127 | } |
| 128 |
| 129 | defaultConfig.versionCode = Integer.parseInt(APP_VERSION_CODE) |
| 130 |
| 131 | applicationVariants.all { variant -> |
| 132 | variant.outputs.all { output -> |
| 133 | outputFileName = "app-huawei.apk" |
| 134 | output.versionCodeOverride = defaultConfig.versionCode * 10 + variant.productFlavors.get(0).abiVersionCode |
| 135 | } |
| 136 | } |
| 137 |
| 138 | variantFilter { variant -> |
| 139 | def names = variant.flavors*.name |
| 140 | if (variant.buildType.name != "release" && !names.contains("afat")) { |
| 141 | setIgnore(true) |
| 142 | } |
| 143 | } |
| 144 |
| 145 | defaultConfig { |
| 146 | minSdkVersion 23 |
| 147 | targetSdkVersion 36 |
| 148 | versionName APP_VERSION_NAME |
| 149 | ndkVersion "27.2.12479018" |
| 150 |
| 151 | multiDexEnabled true |
| 152 |
| 153 | vectorDrawables.generatedDensities = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi'] |
| 154 |
| 155 | externalNativeBuild { |
| 156 | cmake { |
| 157 | version '3.22.1' |
| 158 | arguments '-DANDROID_STL=c++_static', '-DANDROID_PLATFORM=android-23' //, '-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON' |
| 159 | targets 'tmessages.49' |
| 160 | } |
| 161 | } |
| 162 | } |
| 163 |
| 164 | buildFeatures { |
| 165 | buildConfig = true |
| 166 | } |
| 167 | namespace 'org.telegram.messenger.huawei' |
| 168 |
| 169 | lintOptions { |
| 170 | checkReleaseBuilds false |
| 171 | } |
| 172 | } |
| 173 |
| 174 | apply plugin: 'com.google.gms.google-services' |
| 175 |