| 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.0.0' |
| 21 |
| 22 | implementation 'com.airbnb.android:lottie:3.0.3' |
| 23 |
| 24 | compileOnly 'org.checkerframework:checker-qual:2.5.2' |
| 25 | compileOnly 'org.checkerframework:checker-compat-qual:2.5.0' |
| 26 | implementation 'com.google.firebase:firebase-messaging:18.0.0' |
| 27 | implementation 'com.google.firebase:firebase-config:16.5.0' |
| 28 | implementation 'com.google.android.gms:play-services-maps:16.1.0' |
| 29 | implementation 'com.google.android.gms:play-services-auth:16.0.1' |
| 30 | implementation 'com.google.android.gms:play-services-vision:16.2.0' |
| 31 | implementation 'com.google.android.gms:play-services-wallet:16.0.1' |
| 32 | implementation 'com.google.android.gms:play-services-wearable:16.0.1' |
| 33 | implementation 'net.hockeyapp.android:HockeySDK:5.1.1' |
| 34 | implementation 'com.googlecode.mp4parser:isoparser:1.0.6' |
| 35 | implementation 'com.stripe:stripe-android:2.0.2' |
| 36 | } |
| 37 |
| 38 | def getAppId(){ |
| 39 | Properties properties = new Properties() |
| 40 | properties.load(project.rootProject.file('local.properties').newDataInputStream()) |
| 41 | return properties.get("APP_ID") |
| 42 | } |
| 43 | def getAppHash(){ |
| 44 | Properties properties = new Properties() |
| 45 | properties.load(project.rootProject.file('local.properties').newDataInputStream()) |
| 46 | return "\"" + properties.get("APP_HASH") + "\"" |
| 47 | } |
| 48 |
| 49 | android { |
| 50 | compileSdkVersion 28 |
| 51 | buildToolsVersion '28.0.3' |
| 52 |
| 53 | defaultConfig.applicationId = "tw.nekomimi.nekogram" |
| 54 |
| 55 | sourceSets.main.jniLibs.srcDirs = ['./jni/'] |
| 56 |
| 57 | externalNativeBuild { |
| 58 | ndkBuild { |
| 59 | path "jni/Android.mk" |
| 60 | } |
| 61 | } |
| 62 |
| 63 | lintOptions { |
| 64 | disable 'MissingTranslation' |
| 65 | disable 'ExtraTranslation' |
| 66 | } |
| 67 |
| 68 | dexOptions { |
| 69 | jumboMode = true |
| 70 | } |
| 71 |
| 72 | compileOptions { |
| 73 | sourceCompatibility JavaVersion.VERSION_1_8 |
| 74 | targetCompatibility JavaVersion.VERSION_1_8 |
| 75 | } |
| 76 |
| 77 | signingConfigs { |
| 78 | Properties properties = new Properties() |
| 79 | properties.load(project.rootProject.file('local.properties').newDataInputStream()) |
| 80 | release { |
| 81 | storeFile file("config/release.keystore") |
| 82 | storePassword properties.getProperty("RELEASE_STORE_PASSWORD") |
| 83 | keyAlias properties.getProperty("RELEASE_KEY_ALIAS") |
| 84 | keyPassword properties.getProperty("RELEASE_KEY_PASSWORD") |
| 85 | } |
| 86 | debug { |
| 87 | storeFile file("config/release.keystore") |
| 88 | storePassword properties.getProperty("RELEASE_STORE_PASSWORD") |
| 89 | keyAlias properties.getProperty("RELEASE_KEY_ALIAS") |
| 90 | keyPassword properties.getProperty("RELEASE_KEY_PASSWORD") |
| 91 | } |
| 92 | } |
| 93 |
| 94 |
| 95 | buildTypes { |
| 96 | debug { |
| 97 | debuggable true |
| 98 | jniDebuggable true |
| 99 | signingConfig signingConfigs.debug |
| 100 | //applicationIdSuffix ".beta" |
| 101 | minifyEnabled true |
| 102 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
| 103 | } |
| 104 |
| 105 | debugMultidex { |
| 106 | initWith debug |
| 107 | minifyEnabled false |
| 108 | multiDexEnabled true |
| 109 | dependencies { |
| 110 | implementation 'com.android.support:multidex:1.0.3' |
| 111 | } |
| 112 | manifestPlaceholders = [applicationClassName: "MultiDexApplicationLoader"] |
| 113 | } |
| 114 |
| 115 | HA { |
| 116 | debuggable false |
| 117 | jniDebuggable false |
| 118 | signingConfig signingConfigs.debug |
| 119 | //applicationIdSuffix ".beta" |
| 120 | minifyEnabled true |
| 121 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
| 122 | } |
| 123 |
| 124 | release { |
| 125 | debuggable false |
| 126 | jniDebuggable false |
| 127 | signingConfig signingConfigs.release |
| 128 | minifyEnabled true |
| 129 | shrinkResources false |
| 130 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
| 131 | } |
| 132 | } |
| 133 |
| 134 | sourceSets.debug { |
| 135 | manifest.srcFile 'config/debug/AndroidManifest.xml' |
| 136 | } |
| 137 |
| 138 | sourceSets.debugMultidex { |
| 139 | manifest.srcFile 'config/debug/AndroidManifest.xml' |
| 140 | java.srcDirs = ['src/multidex/java'] |
| 141 | } |
| 142 |
| 143 | sourceSets.HA { |
| 144 | manifest.srcFile 'config/debug/AndroidManifest.xml' |
| 145 | } |
| 146 |
| 147 | sourceSets.release { |
| 148 | manifest.srcFile 'config/release/AndroidManifest.xml' |
| 149 | } |
| 150 |
| 151 | flavorDimensions "minApi" |
| 152 |
| 153 | productFlavors { |
| 154 | armv7 { |
| 155 | ndk { |
| 156 | abiFilters "armeabi-v7a" |
| 157 | } |
| 158 | ext { |
| 159 | abiVersionCode = 1 |
| 160 | } |
| 161 | } |
| 162 | x86 { |
| 163 | ndk { |
| 164 | abiFilters "x86" |
| 165 | } |
| 166 | ext { |
| 167 | abiVersionCode = 2 |
| 168 | } |
| 169 | } |
| 170 | armv7_SDK23 { |
| 171 | ndk { |
| 172 | abiFilters "armeabi-v7a" |
| 173 | } |
| 174 | sourceSets.debug { |
| 175 | manifest.srcFile 'config/debug/AndroidManifest_SDK23.xml' |
| 176 | } |
| 177 | sourceSets.release { |
| 178 | manifest.srcFile 'config/release/AndroidManifest_SDK23.xml' |
| 179 | } |
| 180 | minSdkVersion 23 |
| 181 | ext { |
| 182 | abiVersionCode = 3 |
| 183 | } |
| 184 | } |
| 185 | x86_SDK23 { |
| 186 | ndk { |
| 187 | abiFilters "x86" |
| 188 | } |
| 189 | sourceSets.debug { |
| 190 | manifest.srcFile 'config/debug/AndroidManifest_SDK23.xml' |
| 191 | } |
| 192 | sourceSets.release { |
| 193 | manifest.srcFile 'config/release/AndroidManifest_SDK23.xml' |
| 194 | } |
| 195 | minSdkVersion 23 |
| 196 | ext { |
| 197 | abiVersionCode = 4 |
| 198 | } |
| 199 | } |
| 200 | arm64 { |
| 201 | ndk { |
| 202 | abiFilters "arm64-v8a" |
| 203 | } |
| 204 | ext { |
| 205 | abiVersionCode = 5 |
| 206 | } |
| 207 | } |
| 208 | x64 { |
| 209 | ndk { |
| 210 | abiFilters "x86_64" |
| 211 | } |
| 212 | ext { |
| 213 | abiVersionCode = 6 |
| 214 | } |
| 215 | } |
| 216 | arm64_SDK23 { |
| 217 | ndk { |
| 218 | abiFilters "arm64-v8a" |
| 219 | } |
| 220 | sourceSets.debug { |
| 221 | manifest.srcFile 'config/debug/AndroidManifest_SDK23.xml' |
| 222 | } |
| 223 | sourceSets.release { |
| 224 | manifest.srcFile 'config/release/AndroidManifest_SDK23.xml' |
| 225 | } |
| 226 | minSdkVersion 23 |
| 227 | ext { |
| 228 | abiVersionCode = 7 |
| 229 | } |
| 230 | } |
| 231 | x64_SDK23 { |
| 232 | ndk { |
| 233 | abiFilters "x86_64" |
| 234 | } |
| 235 | sourceSets.debug { |
| 236 | manifest.srcFile 'config/debug/AndroidManifest_SDK23.xml' |
| 237 | } |
| 238 | sourceSets.release { |
| 239 | manifest.srcFile 'config/release/AndroidManifest_SDK23.xml' |
| 240 | } |
| 241 | minSdkVersion 23 |
| 242 | ext { |
| 243 | abiVersionCode = 8 |
| 244 | } |
| 245 | } |
| 246 | afat { |
| 247 | sourceSets.debug { |
| 248 | manifest.srcFile 'config/debug/AndroidManifest_SDK23.xml' |
| 249 | } |
| 250 | sourceSets.release { |
| 251 | manifest.srcFile 'config/release/AndroidManifest_SDK23.xml' |
| 252 | } |
| 253 | ext { |
| 254 | abiVersionCode = 0 |
| 255 | } |
| 256 | } |
| 257 | } |
| 258 |
| 259 | defaultConfig.versionCode = 1608 |
| 260 |
| 261 | applicationVariants.all { variant -> |
| 262 | variant.outputs.all { output -> |
| 263 | output.getProcessManifestProvider().get().doLast { |
| 264 | def abiVersion = variant.productFlavors.get(0).abiVersionCode |
| 265 |
| 266 | def outputDir = manifestOutputDirectory |
| 267 | File directory |
| 268 | if (outputDir instanceof File) { |
| 269 | directory = outputDir |
| 270 | } else { |
| 271 | directory = outputDir.get().asFile |
| 272 | } |
| 273 |
| 274 | String manifestPath = directory.toString() + "/AndroidManifest.xml" |
| 275 | def manifestContent = file(manifestPath).getText() |
| 276 |
| 277 | manifestContent = manifestContent.replace(String.format('android:versionCode="%d"', defaultConfig.versionCode), String.format('android:versionCode="%s"', defaultConfig.versionCode * 10 + abiVersion)) |
| 278 | file(manifestPath).write(manifestContent) |
| 279 | } |
| 280 | } |
| 281 | } |
| 282 |
| 283 | variantFilter { variant -> |
| 284 | def names = variant.flavors*.name |
| 285 | if (variant.buildType.name != "release" && !names.contains("afat")) { |
| 286 | setIgnore(true) |
| 287 | } |
| 288 | } |
| 289 |
| 290 | defaultConfig { |
| 291 | minSdkVersion 16 |
| 292 | targetSdkVersion 27 |
| 293 | versionName "5.7.1" |
| 294 |
| 295 | vectorDrawables.generatedDensities = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi'] |
| 296 |
| 297 | buildConfigField 'int', 'APP_ID', getAppId() |
| 298 | buildConfigField 'String', 'APP_HASH', getAppHash() |
| 299 |
| 300 | externalNativeBuild { |
| 301 | ndkBuild { |
| 302 | arguments "NDK_APPLICATION_MK:=jni/Application.mk", "APP_PLATFORM:=android-16", "-j8" |
| 303 | abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64" |
| 304 | } |
| 305 | } |
| 306 |
| 307 | manifestPlaceholders = [applicationClassName: "ApplicationLoader"] |
| 308 | } |
| 309 | } |
| 310 |
| 311 | apply plugin: 'com.google.gms.google-services' |
| 312 |