Skip to content

Commit

Permalink
Add debug icon
Browse files Browse the repository at this point in the history
  • Loading branch information
bubelov committed Jan 18, 2025
1 parent 130efdc commit 9829843
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 35 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
run: ./gradlew bundleData

- name: Assemble APKs
run: ./gradlew assemble
run: ./gradlew assembleFdroidDebug

- name: Create preview release
uses: softprops/action-gh-release@v2
Expand All @@ -41,4 +41,4 @@ jobs:
tag_name: 'preview'
prerelease: true
name: 'preview'
files: app/build/outputs/apk/fdroidSelfSigned/release/app-*.apk
files: app/build/outputs/apk/fdroid/debug/app-*.apk
38 changes: 6 additions & 32 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,10 @@ plugins {
alias(libs.plugins.kotlinAndroid)
}

//kotlin {
// androidTarget {
// compilations.all {
// kotlinOptions {
// jvmTarget = "11"
// freeCompilerArgs += "-opt-in=kotlinx.coroutines.DelicateCoroutinesApi"
// freeCompilerArgs += "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi"
// }
// }
// }
//}

android {
namespace = "org.btcmap"
compileSdk = 35

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

defaultConfig {
applicationId = "org.btcmap"
minSdk = 27
Expand All @@ -38,15 +22,6 @@ android {
targetCompatibility = JavaVersion.VERSION_11
}

signingConfigs {
create("selfSigned") {
storeFile = File(rootDir, "release.jks")
storePassword = "btcmap"
keyAlias = "btcmap"
keyPassword = "btcmap"
}
}

packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
Expand All @@ -63,7 +38,6 @@ android {
}

flavorDimensions += "store"
flavorDimensions += "signature"

productFlavors {
create("fdroid") {
Expand All @@ -74,19 +48,17 @@ android {
dimension = "store"
applicationIdSuffix = ".app"
}

create("selfSigned") {
dimension = "signature"
signingConfig = signingConfigs.getByName("selfSigned")
}
}

buildTypes {
debug {
applicationIdSuffix = ".debug"
manifestPlaceholders["appIcon"] = "@drawable/launcher_debug"
}

release {
manifestPlaceholders["appIcon"] = "@drawable/launcher"

// Enables code shrinking, obfuscation, and optimization
isMinifyEnabled = true

Expand All @@ -97,6 +69,8 @@ android {
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
)

signingConfig = signingConfigs.getByName("debug")
}
}

Expand Down Expand Up @@ -139,7 +113,7 @@ dependencies {

tasks.register("bundleData") {
doLast {
val destDir = File(projectDir, "src/androidMain/assets")
val destDir = File(projectDir, "src/main/assets")
destDir.mkdirs()

val elementsSrc = URI("https://static.btcmap.org/api/v3/elements.json")
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
android:allowBackup="false"
android:dataExtractionRules="@xml/backup_rules"
android:fullBackupContent="false"
android:icon="@drawable/launcher"
android:icon="${appIcon}"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/launcher_debug.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@android:color/white" />
<foreground android:drawable="@drawable/launcher_fg_debug" />
<monochrome android:drawable="@drawable/launcher_fg_monochrome_debug" />
</adaptive-icon>
14 changes: 14 additions & 0 deletions app/src/main/res/drawable/launcher_fg_debug.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#0B9072"
android:pathData="M35.289,48.581C35.289,36.968 44.734,30 53.87,30C63.005,30 72.45,36.968 72.45,48.581C72.45,59.729 55.728,76.761 54.954,77.535C54.644,77.845 54.334,78 53.87,78C53.405,78 53.096,77.845 52.786,77.535C52.012,76.761 35.289,59.574 35.289,48.581Z" />

<path
android:fillColor="#E4EBEC"
android:pathData="M53.544,49.559m-11.083,0a11.083,11.083 0,1 1,22.166 0a11.083,11.083 0,1 1,-22.166 0" />

</vector>
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/launcher_fg_monochrome_debug.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#ffffff"
android:fillType="evenOdd"
android:pathData="M35.29,48.581C35.29,36.968 44.735,30 53.871,30C63.006,30 72.451,36.968 72.451,48.581C72.451,59.729 55.729,76.761 54.954,77.535C54.645,77.845 54.335,78 53.871,78C53.406,78 53.097,77.845 52.787,77.535C52.013,76.761 35.29,59.574 35.29,48.581ZM64.627,49.559C64.627,55.68 59.665,60.642 53.544,60.642C47.423,60.642 42.461,55.68 42.461,49.559C42.461,43.438 47.423,38.475 53.544,38.475C59.665,38.475 64.627,43.438 64.627,49.559Z" />
</vector>
Binary file removed release.jks
Binary file not shown.

0 comments on commit 9829843

Please sign in to comment.