Skip to content

Commit

Permalink
More life quality improvements to this app
Browse files Browse the repository at this point in the history
  • Loading branch information
D4rK7355608 committed Jul 13, 2024
1 parent d9ef199 commit 16afff1
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 14 additions & 12 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.util.archivesName

plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("com.google.gms.google-services")
id("com.google.firebase.crashlytics")
id("com.google.android.gms.oss-licenses-plugin")
alias(libs.plugins.androidApplication)
alias(libs.plugins.jetbrainsKotlinAndroid)
alias(libs.plugins.googlePlayServices)
alias(libs.plugins.googleOssServices)
alias(libs.plugins.googleFirebase)
alias(libs.plugins.compose.compiler)
}

android {
compileSdk = 34
namespace = "com.d4rk.cleaner"
defaultConfig {
applicationId = "com.d4rk.cleaner"
minSdk = 26
targetSdk = 34
versionCode = 94
versionCode = 95
versionName = "2.0.0"
archivesName = "${applicationId}-v${versionName}"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
resourceConfigurations += listOf(
"en",
Expand All @@ -41,6 +40,7 @@ android {
useSupportLibrary = true
}
}

buildTypes {
release {
multiDexEnabled = true
Expand All @@ -63,32 +63,34 @@ android {
)
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}

buildFeatures {
viewBinding = true
buildConfig = true
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.11"
}

packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}

bundle {
storeArchive {
enable = true
}
}
}

dependencies {

//AndroidX
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.d4rk.cleaner.constants.permissions

object PermissionsConstants {
const val REQUEST_CODE_STORAGE_PERMISSIONS = 1
const val REQUEST_CODE_NOTIFICATION_PERMISSION = 2
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class AppManagerViewModel(private val application: Application) : ViewModel() {
}

private fun loadInstalledApps() {
viewModelScope.launch {
viewModelScope.launch(Dispatchers.IO) {
_installedApps.value = getInstalledApps()
}
}
Expand All @@ -59,7 +59,7 @@ class AppManagerViewModel(private val application: Application) : ViewModel() {
}

private fun loadApkFiles() {
viewModelScope.launch {
viewModelScope.launch(Dispatchers.IO) {
_apkFiles.value = getApkFilesFromStorage()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ import android.os.Environment
import android.provider.Settings
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
import com.d4rk.cleaner.constants.permissions.PermissionsConstants

/**
* Utility class for handling runtime permissions.
*/
object PermissionsUtils {

const val REQUEST_CODE_STORAGE_PERMISSIONS = 1
const val REQUEST_CODE_NOTIFICATION_PERMISSION = 2

/**
* Checks if the app has all necessary storage permissions.
*
Expand Down Expand Up @@ -114,7 +112,7 @@ object PermissionsUtils {
ActivityCompat.requestPermissions(
activity,
requiredPermissions.toTypedArray(),
REQUEST_CODE_STORAGE_PERMISSIONS
PermissionsConstants.REQUEST_CODE_STORAGE_PERMISSIONS
)
}

Expand Down Expand Up @@ -166,7 +164,7 @@ object PermissionsUtils {
ActivityCompat.requestPermissions(
activity,
arrayOf(Manifest.permission.POST_NOTIFICATIONS),
REQUEST_CODE_NOTIFICATION_PERMISSION
PermissionsConstants.REQUEST_CODE_NOTIFICATION_PERMISSION
)
}
}
Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
alias(libs.plugins.androidApplication) apply false
alias(libs.plugins.androidLibrary) apply false
alias(libs.plugins.jetbrainsKotlinAndroid) apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.googlePlayServices) apply false
alias(libs.plugins.googleOssServices) apply false
alias(libs.plugins.googleFirebase) apply false
Expand Down
7 changes: 4 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
agp = "8.5.0"
agp = "8.5.1"
appcompat = "1.7.0"
appUpdateKtx = "2.1.0"
billing = "7.0.0"
Expand All @@ -13,7 +13,7 @@ firebaseBom = "32.8.1"
glide = "4.16.0"
lifecycle = "2.8.3"
volley = "1.2.1"
kotlin = "1.9.23"
kotlin = "2.0.0"
coreKtx = "1.13.1"
junit = "4.13.2"
junitVersion = "1.2.1"
Expand Down Expand Up @@ -89,4 +89,5 @@ androidLibrary = { id = "com.android.library", version.ref = "agp" }
jetbrainsKotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
googlePlayServices = { id = "com.google.gms.google-services", version.ref = "google-services" }
googleOssServices = { id = "com.google.android.gms.oss-licenses-plugin", version.ref = "google-oss-services" }
googleFirebase = { id = "com.google.firebase.crashlytics", version.ref = "google-firebase-crashlytics" }
googleFirebase = { id = "com.google.firebase.crashlytics", version.ref = "google-firebase-crashlytics" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
2 changes: 2 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pluginManagement {
}
}
}

@Suppress("UnstableApiUsage") dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
Expand All @@ -25,5 +26,6 @@ pluginManagement {
}
}
}

rootProject.name = "Cleaner for Android"
include(":app")

0 comments on commit 16afff1

Please sign in to comment.