| 7 |
| } |
| 8 |
| 9 | configurations { |
| 10 | compile.exclude module: 'support-v4' |
| 11 | } |
| 12 |
| 13 | configurations.all { |
| 14 | exclude group: 'com.google.firebase', module: 'firebase-core' |
| 15 | } |
| 16 |
| 17 | dependencies { |
| 18 | implementation 'androidx.core:core:1.1.0-beta01' |
| 19 | implementation 'androidx.palette:palette:1.0.0' |
| 20 | implementation 'androidx.exifinterface:exifinterface:1.1.0' |
| 21 |
| 22 | compileOnly 'org.checkerframework:checker-qual:2.5.2' |
| 23 | compileOnly 'org.checkerframework:checker-compat-qual:2.5.0' |
| 24 | implementation 'com.google.firebase:firebase-messaging:20.1.0' |
| 25 | implementation 'com.google.android.gms:play-services-maps:17.0.0' |
| 26 | implementation 'com.google.android.gms:play-services-auth:17.0.0' |
| 27 | implementation 'com.google.android.gms:play-services-vision:16.2.0' |
| 28 | implementation 'com.google.android.gms:play-services-wallet:17.0.0' |
| 29 | implementation 'com.google.android.gms:play-services-wearable:17.0.0' |
| 30 | implementation 'com.google.android.gms:play-services-location:17.0.0' |
| 31 | implementation 'com.googlecode.mp4parser:isoparser:1.0.6' |
| 32 | implementation 'com.stripe:stripe-android:2.0.2' |
| 33 | implementation 'com.google.code.gson:gson:2.8.6' |
| 34 | implementation files('libs/libgsaverification-client.aar') |
| 35 | implementation "com.microsoft.appcenter:appcenter-analytics:2.5.1" |
| 36 | } |
| 37 |
| 38 | android { |
| 39 | compileSdkVersion 29 |
| 40 | buildToolsVersion '29.0.2' |
| 41 | //ndkVersion "20.0.5594570" |
| 42 |
| 43 | defaultConfig.applicationId = "tw.nekomimi.nekogram" |
| 44 |
| 45 | sourceSets.main.jniLibs.srcDirs = ['./jni/'] |
| 46 |
| 47 | externalNativeBuild { |
| 48 | ndkBuild { |
| 49 | path "jni/Android.mk" |
| 50 | } |
| 51 | } |
| 52 |
| 53 | lintOptions { |
| 54 | disable 'MissingTranslation' |
| 55 | disable 'ExtraTranslation' |
| 56 | disable 'BlockedPrivateApi' |
| 57 | } |
| 58 |
| 59 | dexOptions { |
| 60 | jumboMode = true |
| 61 | } |
| 62 |
| 63 | compileOptions { |
| 64 | sourceCompatibility JavaVersion.VERSION_1_8 |
| 65 | targetCompatibility JavaVersion.VERSION_1_8 |
| 66 | } |
| 67 |
| 68 | signingConfigs { |
| 69 | def keystorePwd = null |
| 70 | def alias = null |
| 71 | def pwd = null |
| 72 | if (project.rootProject.file('local.properties').exists()) { |
| 73 | Properties properties = new Properties() |
| 74 | properties.load(project.rootProject.file('local.properties').newDataInputStream()) |
| 75 | keystorePwd = properties.getProperty("RELEASE_STORE_PASSWORD") |
| 76 | alias = properties.getProperty("RELEASE_KEY_ALIAS") |
| 77 | pwd = properties.getProperty("RELEASE_KEY_PASSWORD") |
| 78 | } |
| 79 | release { |
| 80 | storeFile file("config/release.keystore") |
| 81 | storePassword keystorePwd != null ? keystorePwd : System.getenv("KEYSTORE_PASS") |
| 82 | keyAlias alias != null ? alias : System.getenv("ALIAS_NAME") |
| 83 | keyPassword pwd != null ? pwd : System.getenv("ALIAS_PASS") |
| 84 | } |
| 85 | debug { |
| 86 | storeFile file("config/release.keystore") |
| 87 | storePassword keystorePwd != null ? keystorePwd : System.getenv("KEYSTORE_PASS") |
| 88 | keyAlias alias != null ? alias : System.getenv("ALIAS_NAME") |
| 89 | keyPassword pwd != null ? pwd : System.getenv("ALIAS_PASS") |
| 90 | } |
| 91 | } |
| 92 |
| 93 |
| 94 | buildTypes { |
| 95 | debug { |
| 96 | debuggable true |
| 97 | jniDebuggable true |
| 98 | signingConfig signingConfigs.debug |
| 99 | applicationIdSuffix ".beta" |
| 100 | minifyEnabled true |
| 101 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
| 102 | } |
| 103 |
| 104 | /*debugAsan { |
| 105 | debuggable true |
| 106 | jniDebuggable true |
| 107 | signingConfig signingConfigs.debug |
| 108 | applicationIdSuffix ".beta" |
| 109 | minifyEnabled true |
| 110 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
| 111 |
| 112 | packagingOptions { |
| 113 | doNotStrip "**.so" |
| 114 | } |
| 115 |
| 116 | sourceSets { |
| 117 | main { |
| 118 | jniLibs { |
| 119 | srcDir { |
| 120 | 'jniLibs' |
| 121 | } |
| 122 | } |
| 123 | resources { |
| 124 | srcDir { |
| 125 | 'jniRes' |
| 126 | } |
| 127 | } |
| 128 | } |
| 129 | } |
| 130 | }*/ |
| 131 |
| 132 | debugMultidex { |
| 133 | initWith debug |
| 134 | minifyEnabled false |
| 135 | multiDexEnabled true |
| 136 | dependencies { |
| 137 | implementation 'com.android.support:multidex:1.0.3' |
| 138 | } |
| 139 | manifestPlaceholders = [applicationClassName: "MultiDexApplicationLoader"] |
| 140 | } |
| 141 |
| 142 | HA { |
| 143 | debuggable false |
| 144 | jniDebuggable false |
| 145 | signingConfig signingConfigs.debug |
| 146 | applicationIdSuffix ".beta" |
| 147 | minifyEnabled true |
| 148 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
| 149 | } |
| 150 |
| 151 | release { |
| 152 | debuggable false |
| 153 | jniDebuggable false |
| 154 | signingConfig signingConfigs.release |
| 155 | minifyEnabled true |
| 156 | shrinkResources false |
| 157 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
| 158 | multiDexEnabled true |
| 159 | dependencies { |
| 160 | implementation 'com.android.support:multidex:1.0.3' |
| 161 | } |
| 162 | manifestPlaceholders = [applicationClassName: "MultiDexApplicationLoader"] |
| 163 | } |
| 164 | } |
| 165 |
| 166 | sourceSets.debug { |
| 167 | manifest.srcFile 'config/debug/AndroidManifest.xml' |
| 168 | } |
| 169 |
| 170 | /*sourceSets.debugAsan { |
| 171 | manifest.srcFile 'config/debug/AndroidManifest.xml' |
| 172 | }*/ |
| 173 |
| 174 | sourceSets.debugMultidex { |
| 175 | manifest.srcFile 'config/debug/AndroidManifest.xml' |
| 176 | java.srcDirs = ['src/multidex/java'] |
| 177 | } |
| 178 |
| 179 | sourceSets.HA { |
| 180 | manifest.srcFile 'config/debug/AndroidManifest.xml' |
| 181 | } |
| 182 |
| 183 | sourceSets.release { |
| 184 | manifest.srcFile 'config/release/AndroidManifest.xml' |
| 185 | java.srcDirs = ['src/multidex/java'] |
| 186 | } |
| 187 |
| 188 | flavorDimensions "minApi" |
| 189 |
| 190 | productFlavors { |
| 191 | armv7 { |
| 192 | ndk { |
| 193 | abiFilters "armeabi-v7a" |
| 194 | } |
| 195 | ext { |
| 196 | abiVersionCode = 1 |
| 197 | } |
| 198 | } |
| 199 | x86 { |
| 200 | ndk { |
| 201 | abiFilters "x86" |
| 202 | } |
| 203 | ext { |
| 204 | abiVersionCode = 2 |
| 205 | } |
| 206 | } |
| 207 | armv7_SDK23 { |
| 208 | ndk { |
| 209 | abiFilters "armeabi-v7a" |
| 210 | } |
| 211 | sourceSets.debug { |
| 212 | manifest.srcFile 'config/debug/AndroidManifest_SDK23.xml' |
| 213 | } |
| 214 | sourceSets.release { |
| 215 | manifest.srcFile 'config/release/AndroidManifest_SDK23.xml' |
| 216 | } |
| 217 | minSdkVersion 23 |
| 218 | ext { |
| 219 | abiVersionCode = 3 |
| 220 | } |
| 221 | } |
| 222 | x86_SDK23 { |
| 223 | ndk { |
| 224 | abiFilters "x86" |
| 225 | } |
| 226 | sourceSets.debug { |
| 227 | manifest.srcFile 'config/debug/AndroidManifest_SDK23.xml' |
| 228 | } |
| 229 | sourceSets.release { |
| 230 | manifest.srcFile 'config/release/AndroidManifest_SDK23.xml' |
| 231 | } |
| 232 | minSdkVersion 23 |
| 233 | ext { |
| 234 | abiVersionCode = 4 |
| 235 | } |
| 236 | } |
| 237 | arm64 { |
| 238 | ndk { |
| 239 | abiFilters "arm64-v8a" |
| 240 | } |
| 241 | ext { |
| 242 | abiVersionCode = 5 |
| 243 | } |
| 244 | } |
| 245 | x64 { |
| 246 | ndk { |
| 247 | abiFilters "x86_64" |
| 248 | } |
| 249 | ext { |
| 250 | abiVersionCode = 6 |
| 251 | } |
| 252 | } |
| 253 | arm64_SDK23 { |
| 254 | ndk { |
| 255 | abiFilters "arm64-v8a" |
| 256 | } |
| 257 | sourceSets.debug { |
| 258 | manifest.srcFile 'config/debug/AndroidManifest_SDK23.xml' |
| 259 | } |
| 260 | /*sourceSets.debugAsan { |
| 261 | manifest.srcFile 'config/debug/AndroidManifest_SDK23.xml' |
| 262 | }*/ |
| 263 | sourceSets.release { |
| 264 | manifest.srcFile 'config/release/AndroidManifest_SDK23.xml' |
| 265 | } |
| 266 | minSdkVersion 23 |
| 267 | ext { |
| 268 | abiVersionCode = 7 |
| 269 | } |
| 270 | } |
| 271 | x64_SDK23 { |
| 272 | ndk { |
| 273 | abiFilters "x86_64" |
| 274 | } |
| 275 | sourceSets.debug { |
| 276 | manifest.srcFile 'config/debug/AndroidManifest_SDK23.xml' |
| 277 | } |
| 278 | sourceSets.release { |
| 279 | manifest.srcFile 'config/release/AndroidManifest_SDK23.xml' |
| 280 | } |
| 281 | minSdkVersion 23 |
| 282 | ext { |
| 283 | abiVersionCode = 8 |
| 284 | } |
| 285 | } |
| 286 | afat { |
| 287 | sourceSets.debug { |
| 288 | manifest.srcFile 'config/debug/AndroidManifest_SDK23.xml' |
| 289 | } |
| 290 | /*sourceSets.debugAsan { |
| 291 | manifest.srcFile 'config/debug/AndroidManifest_SDK23.xml' |
| 292 | }*/ |
| 293 | sourceSets.release { |
| 294 | manifest.srcFile 'config/release/AndroidManifest_SDK23.xml' |
| 295 | } |
| 296 | ext { |
| 297 | abiVersionCode = 9 |
| 298 | } |
| 299 | } |
| 300 | } |
| 301 |
| 302 | defaultConfig.versionCode = 10 * 1868 |
| 303 |
| 304 | applicationVariants.all { variant -> |
| 305 | variant.outputs.all { output -> |
| 306 | outputFileName = "Nekogram-${defaultConfig.versionName}-${defaultConfig.versionCode / 10}-${variant.productFlavors.get(0).name}-${buildType.name}.apk" |
| 307 | output.getProcessManifestProvider().get().doLast { |
| 308 | def abiVersion = variant.productFlavors.get(0).abiVersionCode |
| 309 |
| 310 | def outputDir = manifestOutputDirectory |
| 311 | File directory |
| 312 | if (outputDir instanceof File) { |
| 313 | directory = outputDir |
| 314 | } else { |
| 315 | directory = outputDir.get().asFile |
| 316 | } |
| 317 |
| 318 | String manifestPath = directory.toString() + "/AndroidManifest.xml" |
| 319 | def manifestContent = file(manifestPath).getText() |
| 320 |
| 321 | manifestContent = manifestContent.replace(String.format('android:versionCode="%d"', defaultConfig.versionCode), String.format('android:versionCode="%s"', defaultConfig.versionCode + abiVersion)) |
| 322 | file(manifestPath).write(manifestContent) |
| 323 | } |
| 324 | } |
| 325 | } |
| 326 |
| 327 | variantFilter { variant -> |
| 328 | def names = variant.flavors*.name |
| 329 | if (variant.buildType.name != "release" && !names.contains("afat")) { |
| 330 | setIgnore(true) |
| 331 | } |
| 332 | } |
| 333 |
| 334 | defaultConfig { |
| 335 | minSdkVersion 16 |
| 336 | targetSdkVersion 28 |
| 337 | versionName "5.15.0" |
| 338 |
| 339 | vectorDrawables.generatedDensities = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi'] |
| 340 |
| 341 | externalNativeBuild { |
| 342 | ndkBuild { |
| 343 | arguments "NDK_APPLICATION_MK:=jni/Application.mk", "APP_PLATFORM:=android-16", "--jobs=8" |
| 344 | abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64" |
| 345 | } |
| 346 | } |
| 347 |
| 348 | manifestPlaceholders = [applicationClassName: "ApplicationLoader"] |
| 349 | } |
| 350 | } |
| 351 |
| 352 | apply plugin: 'com.google.gms.google-services' |
| 353 |