Simple-Voice-Recorder/app/build.gradle

72 lines
2.0 KiB
Groovy
Raw Normal View History

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
2020-03-30 21:28:12 +02:00
def keystorePropertiesFile = rootProject.file("keystore.properties")
def keystoreProperties = new Properties()
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
2022-04-13 11:39:51 +02:00
compileSdkVersion 31
defaultConfig {
applicationId "com.simplemobiletools.voicerecorder"
minSdkVersion 21
2022-04-13 11:39:51 +02:00
targetSdkVersion 31
2022-04-13 16:57:39 +02:00
versionCode 20
versionName "5.7.0"
setProperty("archivesBaseName", "voice-recorder")
vectorDrawables.useSupportLibrary = true
}
2020-03-30 21:28:12 +02:00
signingConfigs {
if (keystorePropertiesFile.exists()) {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
}
buildTypes {
debug {
applicationIdSuffix ".debug"
}
release {
2022-02-10 22:13:55 +01:00
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2020-03-30 21:28:12 +02:00
if (keystorePropertiesFile.exists()) {
signingConfig signingConfigs.release
}
}
}
2022-01-03 22:58:02 +01:00
flavorDimensions "variants"
productFlavors {
2022-02-02 22:45:22 +01:00
core {}
2022-01-03 22:58:02 +01:00
fdroid {}
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
}
dependencies {
allow users to customise recording folder - use SAF on SDK 30+ to give user a change to change the default location where recordings are stored - since we have requestLegacyExternalStorage="true" in the AndroidManifest, we can enable WRITE_EXTERNAL_STORAGE up to SDK 29 (Android 10) - modify methods to store recordings in RecorderService to use SAF for SDK 30+ and normal file paths for lower SDK versions. - at first installation, the app would not have SAF permissions, so we use the old method, using MediaStore and the app's cacheDir until the users decide to change; then we can switch to using SAF - modify methods to get all recordings in PlayerFragment - on SDK 30+, we need to combine recordings got from the MediaStore (getMediaStoreRecordings) and the ones from the recordings folder SAF (getSAFRecordings) - on SDK 29, we combine recordings got from the MediaStore (getMediaStoreRecordings) and the ones from direct file path (getLegacyRecordings) - on lower SDKs, we just use the file paths (getLegacyRecordings) - modify method for playing recordings in PlayerFragment - SDK 30+, when getting recordings with SAF, we store the string of the SAF URI of the file as the Recording#path field, we check if the path is a Document URI and pass that to the MediaPlayer#setDataSource method - if the Recording#path field is empty, we get the MediaStore URI using the ID and pass that to the MediaPlayer#setDataSource method - in other cases, the Recording#path field is a file path, so we use it. - in RecordingsAdapter, add support for changes to the paths used for in sharing the recordings - update the commons module
2022-04-17 17:13:51 +02:00
implementation 'com.github.SimpleMobileTools:Simple-Commons:202656a071'
implementation 'org.greenrobot:eventbus:3.2.0'
2021-12-07 11:19:20 +01:00
implementation 'com.github.Armen101:AudioRecordView:1.0.4'
implementation 'androidx.documentfile:documentfile:1.0.1'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
2022-02-09 20:23:28 +01:00
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
}