Notification Fix $ Store Key Conf Added

This commit is contained in:
shabinder 2021-04-20 16:56:30 +05:30
parent 575a32d223
commit 6821fe0601
6 changed files with 29 additions and 8 deletions

View File

@ -14,6 +14,7 @@
* * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties
import org.jetbrains.compose.compose
plugins {
@ -33,7 +34,21 @@ repositories {
}
android {
val props = gradleLocalProperties(rootDir)
if(props.containsKey("storeFileDir")) {
signingConfigs {
create("release") {
storeFile = file(props.getProperty("storeFileDir"))
storePassword = props.getProperty("storePassword")
keyAlias = props.getProperty("keyAlias")
keyPassword = props.getProperty("keyPassword")
}
}
}
compileSdkVersion(29)
buildToolsVersion = "30.0.3"
defaultConfig {
applicationId = "com.shabinder.spotiflyer"
minSdkVersion(Versions.minSdkVersion)
@ -41,12 +56,14 @@ android {
versionCode = Versions.versionCode
versionName = Versions.versionName
}
buildToolsVersion = "30.0.3"
buildTypes {
getByName("release") {
isMinifyEnabled = true
isShrinkResources = true
if(props.containsKey("storeFileDir")){
signingConfig = signingConfigs.getByName("release")
}
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}

View File

@ -37,7 +37,6 @@ import androidx.compose.material.icons.rounded.SystemSecurityUpdate
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.drawBehind
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalView
import androidx.compose.ui.text.font.FontWeight
@ -66,7 +65,6 @@ import com.shabinder.common.models.TrackDetails
import com.shabinder.common.root.SpotiFlyerRoot
import com.shabinder.common.root.callbacks.SpotiFlyerRootCallBacks
import com.shabinder.common.uikit.*
import com.shabinder.common.uikit.utils.verticalGradientScrim
import com.shabinder.spotiflyer.utils.*
import com.tonyodev.fetch2.Status
import kotlinx.coroutines.*

View File

@ -18,7 +18,7 @@
object Versions {
// App's Version (To be bumped at each update)
const val versionName = "2.2.0"
const val versionName = "2.2.5"
// Kotlin
const val kotlinVersion = "1.4.32"
@ -44,7 +44,7 @@ object Versions {
const val slf4j = "1.7.30"
// Android
const val versionCode = 15
const val versionCode = 16
const val minSdkVersion = 21
const val compileSdkVersion = 29
const val targetSdkVersion = 29

View File

@ -57,7 +57,9 @@ actual fun ImageLoad(
}
Crossfade(pic) {
if (it == null) Image(PlaceHolderImage(), desc, modifier, contentScale = ContentScale.Crop) else Image(it, desc, modifier, contentScale = ContentScale.Crop)
if (it == null) {
Image(PlaceHolderImage(), desc, modifier, contentScale = ContentScale.Crop)
} else Image(it, desc, modifier, contentScale = ContentScale.Crop)
}
}
@ -104,7 +106,7 @@ actual fun DownloadAllImage() = painterResource(R.drawable.ic_download_arrow)
actual fun ShareImage() = painterResource(R.drawable.ic_share_open)
@Composable
actual fun PlaceHolderImage() = painterResource(R.drawable.music)
actual fun PlaceHolderImage() = painterResource(R.drawable.ic_song_placeholder)
@Composable
actual fun SpotiFlyerLogo() = painterResource(R.drawable.ic_spotiflyer_logo)

View File

@ -16,6 +16,7 @@
package com.shabinder.common.di
import android.util.Log
import com.shabinder.common.models.TrackDetails
import java.io.File
import com.mpatric.mp3agic.ID3v1Tag
@ -119,6 +120,7 @@ suspend fun Mp3File.setId3v2TagsAndSaveFile(track: TrackDetails) {
this.id3v2Tag = id3v2Tag
saveFile(track.outputFilePath)
} catch (e: java.io.FileNotFoundException) {
Log.e("Error", "Couldn't Write Cached Mp3 Album Art, error: ${e.stackTrace}")
try {
// Image Still Not Downloaded!
// Lets Download Now and Write it into Album Art
@ -134,7 +136,8 @@ suspend fun Mp3File.setId3v2TagsAndSaveFile(track: TrackDetails) {
}
}
} catch (e: Exception) {
// log("Error", "Couldn't Write Mp3 Album Art, error: ${e.stackTrace}")
Log.e("Error", "Couldn't Write Mp3 Album Art, error:")
e.printStackTrace()
}
}
}

View File

@ -458,6 +458,7 @@ class ForegroundService : Service(), CoroutineScope {
serviceJob.cancel()
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
stopForeground(true)
stopSelf()
} else {
stopSelf() // System will automatically close it
}