-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathbuild.gradle
More file actions
381 lines (319 loc) · 12.9 KB
/
Copy pathbuild.gradle
File metadata and controls
381 lines (319 loc) · 12.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
import java.util.concurrent.TimeUnit
import com.android.build.gradle.internal.cxx.configure.GradleLocalPropertiesKt
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-parcelize'
apply plugin: "com.mxalbert.gradle.jacoco-android"
apply plugin: "com.starter.easylauncher"
apply plugin: 'com.google.devtools.ksp'
android {
namespace "com.amaze.filemanager"
compileSdk libs.versions.compileSdk.get().toInteger()
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', 'META-INF/versions/9/OSGI-INF/MANIFEST.MF']
}
}
defaultConfig {
applicationId "com.amaze.filemanager"
minSdkVersion libs.versions.minSdk.get().toInteger()
targetSdkVersion libs.versions.targetSdk.get().toInteger()
versionCode 124
versionName "3.11.2"
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"]
}
}
def googleClientId = getValueFromEnvOrProperties("AMAZE_CLOUD_GOOGLE_CLIENT_ID")
def bareGoogleClientId = googleClientId.replace(".apps.googleusercontent.com", "")
manifestPlaceholders["googleClientIdForRedirect"] = "com.googleusercontent.apps.${bareGoogleClientId}"
}
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
enableUnitTestCoverage true
}
release {
signingConfig signingConfigs.release
debuggable true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.cfg'
buildConfigField "String", "CRYPTO_IV", "\"LxbHiJhhUXcj\""
buildConfigField "String", "FTP_SERVER_KEYSTORE_PASSWORD", "\"vishal007\""
}
}
buildFeatures {
viewBinding true
buildConfig 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
}
}
dependenciesInfo {
// Disables dependency metadata when building APKs.
includeInApk = false
// Disables dependency metadata when building Android App Bundles.
includeInBundle = false
}
sourceSets {
test.java.srcDirs += '../testShared/src/test/java'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '17'
}
testOptions {
unitTests {
includeAndroidResources = true
returnDefaultValues = true
}
}
lint {
abortOnError false
}
}
dependencies {
modules {
module("org.bouncycastle:bcprov-jdk15on") {
replacedBy("org.bouncycastle:bcprov-jdk18on")
}
module("org.bouncycastle:bcpkix-jdk15on") {
replacedBy("org.bouncycastle:bcpkix-jdk18on")
}
module("org.bouncycastle:bcprov-jdk15to18") {
replacedBy("org.bouncycastle:bcprov-jdk18on")
}
module("org.bouncycastle:bcpkix-jdk15to18") {
replacedBy("org.bouncycastle:bcpkix-jdk18on")
}
}
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation libs.systembarTint
implementation libs.androidX.vectordrawable.animated
implementation libs.androidX.legacySupportV13
implementation libs.androidX.material
implementation libs.androidX.fragment
implementation libs.androidX.appcompat
implementation libs.androidX.preference
implementation libs.androidX.core
implementation libs.androidX.palette
implementation libs.androidX.cardview
implementation libs.androidX.constraintLayout
implementation libs.androidX.multidex //Multiple dex files
implementation libs.androidX.biometric
implementation libs.androidX.security
implementation libs.androidX.browser.customtabs
implementation libs.room.runtime
implementation libs.room.rxjava2
ksp libs.room.compiler
ksp libs.androidX.annotation
//For tests
testImplementation libs.junit//tests the app logic
testImplementation libs.robolectric//tests android interaction
testImplementation libs.robolectric.shadows.httpclient//tests android interaction
testImplementation libs.androidX.test.core
testImplementation libs.androidX.test.runner
testImplementation libs.androidX.test.rules
testImplementation libs.androidX.test.ext.junit
testImplementation libs.androidX.fragment.testing
testImplementation libs.mockito.core
testImplementation libs.mockito.inline
testImplementation libs.mockito.kotlin
testImplementation libs.apache.sshd
testImplementation libs.awaitility
testImplementation libs.jsoup
testImplementation libs.room.migration
testImplementation libs.mockk
testImplementation libs.kotlin.coroutines.test
testImplementation libs.androidX.core.testing
kspTest libs.auto.service
testImplementation 'ch.qos.logback:logback-classic:1.4.14'
androidTestImplementation libs.junit //tests the app logic
androidTestImplementation libs.androidX.test.expresso
androidTestImplementation libs.androidX.test.core
androidTestImplementation libs.androidX.test.runner
androidTestImplementation libs.androidX.test.rules
androidTestImplementation libs.androidX.test.ext.junit
androidTestImplementation libs.androidX.test.uiautomator
androidTestImplementation libs.androidX.fragment.testing
androidTestImplementation libs.commons.net
androidTestImplementation libs.awaitility
//Detect memory leaks
debugImplementation libs.leakcanary.android
implementation libs.commons.compress
implementation libs.materialdialogs.core
implementation libs.materialdialogs.commons
implementation libs.apache.mina.core
implementation libs.apache.ftpserver.ftplet.api
implementation libs.apache.ftpserver.core
implementation libs.libsu.core
implementation libs.libsu.io
playImplementation libs.junrar
playImplementation libs.google.play.billing
implementation libs.mpAndroidChart//Nice charts and graphs
implementation libs.concurrent.trees//Concurrent tries
//SFTP
implementation libs.sshj
//smb
implementation libs.jcifs.ng
//FTP
implementation libs.commons.net
//OkHttp
implementation libs.okhttp
implementation libs.okhttp.loggingInterceptor
implementation libs.bcpkix.jdk18on
implementation libs.bcprov.jdk18on
//Glide: loads icons seemlessly
implementation libs.glide
implementation (libs.glide.recyclerView) {
// Excludes the support library because it's already included by Glide.
transitive = false
}
ksp libs.glide.ksp
implementation libs.speedDial
//Simple library show
implementation(libs.aboutLibraries) {
transitive = true
}
implementation(libs.google.api.client) {
transitive = false
}
implementation(libs.google.oauth.client) {
transitive = false
}
implementation(libs.google.http.client) {
transitive = false
}
implementation(libs.google.http.client.gson)
//zip4j: support password-protected zips
implementation libs.zip4j
implementation libs.xz
implementation libs.rxandroid
// 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 libs.rxjava
implementation project(':commons_compress_7z')
implementation project(':file_operations')
implementation project(':portscanner')
implementation libs.kotlin.reflect
implementation platform(libs.kotlin.coroutines.bom)
implementation libs.kotlin.coroutines.android
implementation libs.kotlin.coroutines.rxjava2
implementation libs.kotlin.stdlib.jdk8
implementation libs.acra.core
implementation libs.slf4j.api
implementation libs.logback.android
testImplementation libs.logback.classic
implementation libs.gson
implementation libs.amaze.trashBin
implementation libs.retrofit
implementation libs.retrofit.jacksonConverter
implementation libs.jackson.module.kotlin
implementation fileTree(include: ['*.jar','*.aar'], dir: 'libs')
}
kotlin {
jvmToolchain(17)
}
configurations.configureEach {
resolutionStrategy {
cacheChangingModulesFor(0, TimeUnit.SECONDS)
dependencySubstitution {
substitute module("commons-logging:commons-logging-api:1.1") using module("commons-logging:commons-logging:1.1.1")
substitute module("com.android.support:support-annotations:27.1.1") using 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') using module("org.hamcrest:hamcrest:2.1")
substitute module('org.hamcrest:hamcrest-library:1.3') using module("org.hamcrest:hamcrest:2.1")
// Force coroutines to a specific version to avoid conflicts
substitute module("org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:*") using module("org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.10.2")
substitute module("org.jetbrains.kotlinx:kotlinx-coroutines-android:*") using module("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2")
}
}
}
configurations.testImplementation {
exclude module: 'logback-android'
}
tasks.register('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
rootProject.tasks.named('spotlessJava').configure { dependsOn copyTask }
rootProject.tasks.named('spotlessKotlin').configure { dependsOn copyTask }
}
project.afterEvaluate {
preBuild.dependsOn supportOldLangCodes
}
clean.dependsOn supportOldLangCodes
clean.mustRunAfter supportOldLangCodes
jacoco {
toolVersion = libs.versions.jacoco.get()
}
tasks.withType(Test).configureEach {
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 {
google()
mavenCentral()
maven { url "https://jitpack.io" }
maven { url "https://jcenter.bintray.com" }
}
String getValueFromEnvOrProperties(String name) {
def localProperties = GradleLocalPropertiesKt.gradleLocalProperties(rootDir, project.providers)
return System.getenv(name) ?: localProperties[name]
}