apply plugin: 'com.android.application' def releaseTime() { return new Date().format("yyyyMMdd", TimeZone.getTimeZone("UTC")) } //必须配置 def mfph = [ //包名 "apk.applicationId" : "com.xwkj.sqjw", ] android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] useLibrary 'org.apache.http.legacy' compileOptions { targetCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_1_8 } aaptOptions.cruncherEnabled = false aaptOptions.useNewCruncher = false defaultConfig { applicationId "com.xwkj.sqjw" minSdkVersion rootProject.ext.android["minSdkVersion"] targetSdkVersion 28 versionCode 52 versionName "5.2" testInstrumentationRunner rootProject.ext.dependencies["androidJUnitRunner"] flavorDimensions "1" ndk { abiFilters "armeabi", "armeabi-v7a", "arm64-v8a", "x86" } } sourceSets { main { jniLibs.srcDirs = ['libs'] } } signingConfigs { debug { keyAlias 'zkjc_police' keyPassword 'jlszkjc777888' storeFile file("../sign/keystore.jks") storePassword 'jlszkjc777888' // v2SigningEnabled false } release { keyAlias 'zkjc_police' keyPassword 'jlszkjc777888' storeFile file("../sign/keystore.jks") storePassword 'jlszkjc777888' // v2SigningEnabled false } } buildTypes { debug { buildConfigField "boolean", "LOG_DEBUG", "true" buildConfigField "boolean", "USE_CANARY", "true" minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } release { buildConfigField "boolean", "LOG_DEBUG", "false" buildConfigField "boolean", "USE_CANARY", "false" /*minifyEnabled false shrinkResources true zipAlignEnabled true*/ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } productFlavors { //应用商店版本 sqjw { resValue "string", "app_name", "社区警务APP" signingConfig signingConfigs.release manifestPlaceholders = [UMENG_CHANNEL: "appstore", CATEGORY: "android.intent.category.DEFAULT", APP_ICON: "@mipmap/ic_launcher"] } //非应用商店版本 jdrh { resValue "string", "app_name", "警地融合" signingConfig signingConfigs.release manifestPlaceholders = [UMENG_CHANNEL: "unappstore", CATEGORY: "android.intent.category.LAUNCHER", APP_ICON: "@mipmap/ic_launcher"] } } productFlavors.all { flavor -> flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: name, CATEGORY_VALUE: flavor.manifestPlaceholders.CATEGORY, APP_ICON: flavor.manifestPlaceholders.APP_ICON] // flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: name] } applicationVariants.all { variant -> variant.outputs.all { if (variant.buildType.name == 'release') { // release:输出文件名必须命名为 outputFileName outputFileName = "${variant.productFlavors[0].name}_${variant.productFlavors[0].applicationId}_${buildType.name}_v${variant.versionName}_${releaseTime()}.apk" // output.outputFile = new File(output.outputFile.parent, apkName) } else { // debug 输出文件名必须命名为 outputFileName outputFileName = "${variant.productFlavors[0].name}_${project.getName()}_${buildType.name}.apk" // output.outputFile = new File(output.outputFile.parent, apkName) } } } configurations.all { resolutionStrategy { force 'androidx.core:core-ktx:1.6.0' } } lintOptions { disable 'InvalidPackage' disable "ResourceType" abortOnError false } //此处配置必须添加 否则无法正确运行 aaptOptions { additionalParameters '--auto-add-overlay' //noCompress 'foo', 'bar' ignoreAssetsPattern "!.svn:!.git:.*:!CVS:!thumbs.db:!picasa.ini:!*.scc:*~" } } repositories { flatDir { dirs 'libs', '../common/libs' } } dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation fileTree(include: ['*.aar'], dir: 'libs') /* implementation 'me.jessyan:arms:2.5.2' implementation 'me.jessyan:arms-imageloader-glide:2.5.2'*/ //view implementation 'androidx.appcompat:appcompat:1.0.2' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' annotationProcessor(rootProject.ext.dependencies["butterknife-compiler"]) { exclude module: 'support-annotations' } //tools annotationProcessor rootProject.ext.dependencies["dagger2-compiler"] //注意 Arms 核心库现在并不会依赖某个 EventBus, 要想使用 EventBus, 还请在项目中自行依赖对应的 EventBus //现在支持两种 EventBus, greenrobot 的 EventBus 和畅销书 《Android源码设计模式解析与实战》的作者 何红辉 所作的 AndroidEventBus //依赖后 Arms 会自动检测您依赖的 EventBus 并自动注册 //建议使用 AndroidEventBus, 特别是组件化项目, 原因请看 https://github.com/hehonghui/AndroidEventBus/issues/49 //这种做法可以让使用者有自行选择三方库的权利, 并且还可以减轻 Arms 的体积 // implementation rootProject.ext.dependencies["androideventbus"] // implementation rootProject.ext.dependencies["eventbus"] //test debugImplementation rootProject.ext.dependencies["canary-debug"] releaseImplementation rootProject.ext.dependencies["canary-release"] testImplementation rootProject.ext.dependencies["canary-release"] testImplementation rootProject.ext.dependencies["junit"] implementation rootProject.ext.dependencies["eventbus"] // implementation rootProject.ext.dependencies["design"] implementation project(':thirdparty') implementation project(':common') implementation 'com.github.chrisbanes.photoview:library:1.2.4' implementation rootProject.ext.dependencies["toast"] implementation rootProject.ext.dependencies["picasso"] // implementation 'me.jessyan:progressmanager:1.5.0' //页面引导 // implementation 'com.binioter:guideview:1.0.0' implementation 'io.github.youth5201314:banner:2.2.2' implementation 'com.google.android.material:material:1.1.0' //粒子爆炸效果 // implementation 'tyrantgit:explosionfield:1.0.1' // //添加StatusBarUtil的依赖 implementation 'com.jaeger.statusbarutil:library:1.5.1' // implementation 'net.lingala.zip4j:zip4j:1.3.2' implementation 'com.xm.permissions:XmPermissions:1.0.1' implementation rootProject.ext.dependencies["SmartRefreshLayout"] implementation rootProject.ext.dependencies["SmartRefreshHeader"] implementation rootProject.ext.dependencies["SmartRefreshFooter"] implementation 'com.github.chrisbanes.photoview:library:1.2.4' // implementation(name: 'imagepicker-release', ext: 'aar') //implementation 'com.contrarywind:Android-PickerView:4.1.8' implementation 'com.teprinciple:updateapputilsx:2.3.0' implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.4' // implementation(name: 'ocrsdk', ext: 'aar') implementation project(path: ':ocr_ui') //视频相关 implementation 'com.github.LuckSiege.PictureSelector:picture_library:v2.2.4' implementation 'com.github.gcacace:signature-pad:1.3.1' implementation 'fm.jiecao:jiecaovideoplayer:5.5.4' implementation project(path: ':camera') //扫一扫支持全屏、从相册选择:需要支持7.0以下 implementation 'com.google.zxing:core:3.3.3' implementation 'com.github.maning0303:MNZXingCode:V2.1.8' implementation 'q.rorbin:badgeview:1.1.3' implementation 'com.xiaosu:VerticalRollingTextView:2.0.9' implementation 'com.google.android.flexbox:flexbox:3.0.0' api 'com.google.vr:sdk-panowidget:1.80.0' implementation 'androidx.percentlayout:percentlayout:1.0.0' implementation 'de.hdodenhof:circleimageview:2.0.0' implementation 'com.contrarywind:Android-PickerView:4.1.8' //依赖版本错误可能导致Class not found, Android O minsdk, jdk版本等异常 implementation 'org.postgresql:postgresql:42.1.2' implementation 'com.android.support:recyclerview-v7:28.0.0' implementation 'com.android.support:support-v4:28.0.0' implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'com.alibaba:fastjson:1.2.83' implementation 'com.facebook.fresco:fresco:1.13.0' implementation 'com.facebook.fresco:animated-gif:1.13.0' implementation 'com.github.bumptech.glide:glide:4.9.0' implementation 'androidx.webkit:webkit:1.3.0' implementation 'com.moxun:tagcloudlib:1.2.0' implementation 'com.github.yuruiyin:AppbarLayoutBehavior:v1.0.4' }