Skip to content

Commit

Permalink
Merge pull request #18 from feliperce/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
feliperce authored Jul 6, 2024
2 parents c3112d8 + fe676bd commit 1f566b8
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 11 deletions.
11 changes: 6 additions & 5 deletions composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ kotlin {
//implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar", "*.aar"))))

implementation(libs.bundletool)
implementation(libs.kotlin.multiplatform.appdirs)

}
desktopMain.dependencies {
Expand All @@ -66,19 +67,19 @@ kotlin {
}

android {
namespace = "br.com.mobileti.aabtoapk"
namespace = "io.github.feliperce.aabtoapk"
compileSdk = libs.versions.android.compileSdk.get().toInt()

sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
sourceSets["main"].res.srcDirs("src/androidMain/res")
sourceSets["main"].resources.srcDirs("src/commonMain/resources")

defaultConfig {
applicationId = "br.com.mobileti.aabtoapk"
applicationId = "io.github.feliperce.aabtoapk"
minSdk = libs.versions.android.minSdk.get().toInt()
targetSdk = libs.versions.android.targetSdk.get().toInt()
versionCode = 1
versionName = "0.5"
versionCode = 2
versionName = "0.5.1"
}
packaging {
resources {
Expand Down Expand Up @@ -112,7 +113,7 @@ compose.desktop {
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb, TargetFormat.AppImage, TargetFormat.Exe)
packageName = "AabToApk"
description = "Extract .apk from .aab"
packageVersion = "1.0.0"
packageVersion = "1.0.1"
macOS {
iconFile.set(project.file("icons/ic_aabtoapk.icns"))
}
Expand Down
2 changes: 1 addition & 1 deletion composeApp/src/androidMain/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<provider
android:name="androidx.core.content.FileProvider"
android:authorities="br.com.mobileti.aabtoapk.fileprovider"
android:authorities="io.github.feliperce.aabtoapk.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package br.com.mobileti.aabtoapk
package io.github.feliperce.aabtoapk

import android.app.Application
import di.initKoin
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package br.com.mobileti.aabtoapk
package io.github.feliperce.aabtoapk

import android.os.Bundle
import android.util.Log
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package br.com.mobileti.aabtoapk
package io.github.feliperce.aabtoapk

import android.app.Activity
import android.content.Context
Expand Down
8 changes: 8 additions & 0 deletions composeApp/src/commonMain/kotlin/utils/FileExtensions.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package utils

import ca.gosyer.appdirs.AppDirs

fun getUserDataDirPath(): String {
val appDirs = AppDirs("AabToApk", "feliperce")
return appDirs.getUserDataDir()
}
6 changes: 4 additions & 2 deletions composeApp/src/desktopMain/kotlin/shared/data/DataActual.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@ import androidx.datastore.core.DataStore
import androidx.datastore.preferences.core.Preferences
import androidx.room.Room
import androidx.room.RoomDatabase
import ca.gosyer.appdirs.AppDirs
import data.local.db.ExtractorDatabase
import shared.settings.AppSettings
import shared.settings.createDataStore
import utils.getUserDataDirPath
import java.io.File

fun dataStore(): DataStore<Preferences> =
createDataStore(
producePath = { System.getProperty("java.io.tmpdir")+"/"+AppSettings.DATA_STORE_FILE }
producePath = { getUserDataDirPath()+"/"+AppSettings.DATA_STORE_FILE }
)

fun getDatabaseBuilder(): RoomDatabase.Builder<ExtractorDatabase> {
val dbFile = File(System.getProperty("java.io.tmpdir"), ExtractorDatabase.DATABASE_NAME)
val dbFile = File(getUserDataDirPath(), ExtractorDatabase.DATABASE_NAME)
return Room.databaseBuilder<ExtractorDatabase>(
name = dbFile.absolutePath,
)
Expand Down
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[versions]
agp = "8.2.0"
bundletool = "1.16.0"
kotlinMultiplatformAppdirs = "1.1.1"
ksp = "2.0.0-1.0.21"
android-compileSdk = "34"
android-minSdk = "26"
Expand Down Expand Up @@ -35,6 +36,7 @@ koin-android = { module = "io.insert-koin:koin-android", version.ref = "koin" }
koin-test = { module = "io.insert-koin:koin-test", version.ref = "koin" }
koin-compose = { module = "io.insert-koin:koin-compose", version.ref = "koinCompose" }
koin-compose-viewmodel = { module = "io.insert-koin:koin-compose-viewmodel", version.ref = "koinCompose" }
kotlin-multiplatform-appdirs = { module = "ca.gosyer:kotlin-multiplatform-appdirs", version.ref = "kotlinMultiplatformAppdirs" }
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" }
junit = { group = "junit", name = "junit", version.ref = "junit" }
Expand Down

0 comments on commit 1f566b8

Please sign in to comment.