Files
2022-04-25 04:40:54 +05:30

317 lines
12 KiB
Groovy

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-parcelize'
apply plugin: 'com.hiya.jacoco-android'
apply plugin: "com.starter.easylauncher"
android {
compileSdkVersion 31
packagingOptions {
resources {
excludes += ['proguard-project.txt', 'project.properties', 'META-INF/LICENSE.txt', 'META-INF/LICENSE', 'META-INF/NOTICE.txt', 'META-INF/NOTICE', 'META-INF/DEPENDENCIES.txt', 'META-INF/DEPENDENCIES']
}
}
defaultConfig {
applicationId "com.amaze.filemanager"
minSdkVersion 14
targetSdkVersion 30
versionCode 108
versionName "3.7.0"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
javaCompileOptions {
annotationProcessorOptions {
arguments += ["room.schemaLocation" : "$projectDir/src/test/resources/schemas".toString(),
"room.incremental" : "true",
"room.expandProjection": "true"]
}
}
}
signingConfigs {
release
config
}
buildTypes {
debug {
applicationIdSuffix ".debug"
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.cfg'
testProguardFile 'tests-proguard.cfg'
buildConfigField "String", "CRYPTO_IV", "\"LxbHiJhhUXcj\""
buildConfigField "String", "FTP_SERVER_KEYSTORE_PASSWORD", "\"vishal007\""
debuggable true //For "debug" banner on icon
}
release {
signingConfig signingConfigs.release
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.cfg'
buildConfigField "String", "CRYPTO_IV", "\"LxbHiJhhUXcj\""
buildConfigField "String", "FTP_SERVER_KEYSTORE_PASSWORD", "\"vishal007\""
}
}
buildFeatures {
viewBinding true
}
flavorDimensions 'static'
productFlavors {
fdroid {
dimension 'static'
buildConfigField "boolean", "IS_VERSION_FDROID", "true"
}
play {
dimension 'static'
buildConfigField "boolean", "IS_VERSION_FDROID", "false"
signingConfig signingConfigs.config
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
useIR = true
}
testOptions {
unitTests {
includeAndroidResources = true
returnDefaultValues = true
}
}
lint {
abortOnError false
}
}
dependencies {
modules {
module("org.bouncycastle:bcprov-jdk15to18") {
replacedBy("org.bouncycastle:bcprov-jdk15on")
}
module("org.bouncycastle:bcpkix-jdk15to18") {
replacedBy("org.bouncycastle:bcpkix-jdk15on")
}
}
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.readystatesoftware.systembartint:systembartint:1.0.3'
implementation 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
implementation 'androidx.legacy:legacy-support-v13:1.0.0'
implementation "com.google.android.material:material:$androidMaterialVersion"
implementation "androidx.fragment:fragment-ktx:$androidXFragmentVersion"
implementation "androidx.appcompat:appcompat:$androidXAppCompatVersion"
implementation 'androidx.palette:palette-ktx:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation "androidx.room:room-runtime:$roomVersion"
implementation "com.android.billingclient:billing:$androidBillingVersion"
kapt "androidx.room:room-compiler:$roomVersion"
// RxJava support for Room
implementation "androidx.room:room-rxjava2:$roomVersion"
kapt 'androidx.annotation:annotation:1.2.0'
implementation "androidx.preference:preference:$androidXPrefVersion"
implementation "androidx.preference:preference-ktx:$androidXPrefVersion"
//For tests
testImplementation "junit:junit:$junitVersion"//tests the app logic
testImplementation "org.robolectric:robolectric:$robolectricVersion"//tests android interaction
testImplementation "org.robolectric:shadows-httpclient:$robolectricVersion"//tests android interaction
testImplementation "androidx.test:core:$androidXTestVersion"
testImplementation "androidx.test:runner:$androidXTestVersion"
testImplementation "androidx.test:rules:$androidXTestVersion"
testImplementation "androidx.test.ext:junit:$androidXTestExtVersion"
testImplementation "org.mockito:mockito-core:$mockitoVersion"
testImplementation "org.mockito:mockito-inline:$mockitoVersion"
testImplementation "org.mockito.kotlin:mockito-kotlin:$mockitoKotlinVersion"
testImplementation "org.apache.sshd:sshd-core:1.7.0"
testImplementation "org.awaitility:awaitility:$awaitilityVersion"
testImplementation 'org.jsoup:jsoup:1.11.2'
testImplementation 'commons-net:commons-net:3.6'
testImplementation "androidx.room:room-migration:$roomVersion"
testImplementation "io.mockk:mockk:$mockkVersion"
kaptTest "com.google.auto.service:auto-service:1.0-rc4"
androidTestImplementation "junit:junit:$junitVersion"//tests the app logic
androidTestImplementation "androidx.test.espresso:espresso-core:$espressoVersion"
androidTestImplementation "androidx.test:core:$androidXTestVersion"
androidTestImplementation "androidx.test:runner:$androidXTestVersion"
androidTestImplementation "androidx.test:rules:$androidXTestVersion"
androidTestImplementation "androidx.test.ext:junit:$androidXTestExtVersion"
// androidTestImplementation "androidx.test.uiautomator:uiautomator:$uiAutomatorVersion"
androidTestImplementation 'commons-net:commons-net:3.6'
androidTestImplementation "org.awaitility:awaitility:$awaitilityVersion"
//Detect memory leaks
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'
implementation "org.apache.commons:commons-compress:$commonsCompressVersion"
implementation "com.github.junrar:junrar:$junrarVersion"
implementation "com.afollestad.material-dialogs:core:$materialDialogsVersion"
implementation "com.afollestad.material-dialogs:commons:$materialDialogsVersion"
// https://mvnrepository.com/artifact/org.apache.mina/mina-core
implementation group: 'org.apache.mina', name: 'mina-core', version: '2.0.16'
// https://mvnrepository.com/artifact/org.slf4j/slf4j-api
implementation group: 'org.slf4j', name: 'slf4j-api', version: slf4jVersion
// https://mvnrepository.com/artifact/org.slf4j/slf4j-simple
implementation group: 'org.slf4j', name: 'slf4j-simple', version: slf4jVersion
// https://mvnrepository.com/artifact/org.slf4j/jcl-over-slf4j
implementation group: 'org.slf4j', name: 'jcl-over-slf4j', version: slf4jVersion
//implementation files('libs/ftplet-api-1.1.0-SNAPSHOT.jar')
// https://mvnrepository.com/artifact/org.apache.ftpserver/ftplet-api
implementation group: 'org.apache.ftpserver', name: 'ftplet-api', version: '1.1.0'
//implementation files('libs/ftpserver-core-1.1.0-SNAPSHOT.jar')
// https://mvnrepository.com/artifact/org.apache.ftpserver/ftpserver-core
implementation group: 'org.apache.ftpserver', name: 'ftpserver-core', version: '1.1.0'
implementation 'org.greenrobot:eventbus:3.3.1'
implementation 'com.android.volley:volley:1.2.1'
implementation "com.github.topjohnwu.libsu:core:${libsuVersion}"
implementation "com.github.topjohnwu.libsu:io:${libsuVersion}"
implementation 'com.cloudrail:cloudrail-si-android:2.22.4'
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.2'//Nice charts and graphs
implementation 'com.github.npgall:concurrent-trees:2.6.1'//Concurrent tries
//SFTP
implementation "com.hierynomus:sshj:$sshjVersion"
//smb
implementation "eu.agno3.jcifs:jcifs-ng:$jcifsVersion"
implementation "org.bouncycastle:bcpkix-jdk15on:$bouncyCastleVersion"
implementation "org.bouncycastle:bcprov-jdk15on:$bouncyCastleVersion"
//Glide: loads icons seemlessly
implementation "com.github.bumptech.glide:glide:$glideVersion"
implementation ("com.github.bumptech.glide:recyclerview-integration:$glideVersion") {
// Excludes the support library because it's already included by Glide.
transitive = false
}
kapt "com.github.bumptech.glide:compiler:$glideVersion"
implementation "com.leinardi.android:speed-dial:$fabSpeedDialVersion"
//Simple library show
implementation('com.mikepenz:aboutlibraries:6.1.1@aar') {
transitive = true
}
implementation 'androidx.multidex:multidex:2.0.1'//Multiple dex files
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
//zip4j: support password-protected zips
implementation "net.lingala.zip4j:zip4j:$zip4jVersion"
implementation 'org.tukaani:xz:1.8'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
// Because RxAndroid releases are few and far between, it is recommended you also
// explicitly depend on RxJava's latest version for bug fixes and new features.
// (see https://github.com/ReactiveX/RxJava/releases for latest 3.x.x version)
implementation group: 'io.reactivex.rxjava2', name: 'rxjava', version: '2.2.9'
implementation project(':commons_compress_7z')
implementation project(':file_operations')
implementation "androidx.core:core-ktx:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "ch.acra:acra-core:5.7.0"
}
configurations.all {
resolutionStrategy {
dependencySubstitution {
substitute module("commons-logging:commons-logging-api:1.1") with module("commons-logging:commons-logging:1.1.1")
substitute module("com.android.support:support-annotations:27.1.1") with module("com.android.support:support-annotations:27.0.2")
// These two lines are added to prevent possible class clashes between awaitility (which uses hamcrest 2.1) and junit (which uses hamcrest 1.3).
substitute module('org.hamcrest:hamcrest-core:1.3') with module("org.hamcrest:hamcrest:2.1")
substitute module('org.hamcrest:hamcrest-library:1.3') with module("org.hamcrest:hamcrest:2.1")
}
}
}
task supportOldLangCodes
[['id', 'in'], ['yi', 'ji'], ['he', 'iw']].forEach { sourceCode, destinationCode ->
def copyTask = tasks.create('copyStrings' + sourceCode + 'Into' + destinationCode, Copy) {
description('copying values-' + sourceCode + ' strings into values-' + destinationCode)
from('src/main/res/values-' + sourceCode)
into('src/main/res/values-' + destinationCode)
include('strings.xml')
}
supportOldLangCodes.dependsOn copyTask
}
project.afterEvaluate {
preBuild.dependsOn supportOldLangCodes
}
clean.dependsOn supportOldLangCodes
clean.mustRunAfter supportOldLangCodes
jacoco {
toolVersion = "${jacocoVersion}"
}
tasks.withType(Test) {
jacoco.includeNoLocationClasses = true
jacoco.excludes = ['jdk.internal.*']
}
Properties props = new Properties()
def propFile = new File('signing.properties')
if (propFile.canRead()) {
props.load(new FileInputStream(propFile))
if (props != null &&
props.containsKey('STORE_FILE') &&
props.containsKey('STORE_PASSWORD') &&
props.containsKey('KEY_ALIAS') &&
props.containsKey('KEY_PASSWORD')) {
android.signingConfigs.release.storeFile = file(props['STORE_FILE'])
android.signingConfigs.release.storePassword = props['STORE_PASSWORD']
android.signingConfigs.release.keyAlias = props['KEY_ALIAS']
android.signingConfigs.release.keyPassword = props['KEY_PASSWORD']
} else {
println 'signing.properties found but some entries are missing'
android.buildTypes.release.signingConfig = null
}
} else {
println 'signing.properties not found'
android.buildTypes.release.signingConfig = null
}
repositories {
mavenCentral()
}