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