https://github.com/n7ghtm4r3/octocatkdu
Kotlin Desktop Updater based on GitHub releases. From the Github's repository of the application get the release marked as the last-release to warn the user of that application about a new version available
https://github.com/n7ghtm4r3/octocatkdu
component compose-multiplatform desktop-app desktop-application destkop jetpack-compose kotlin-multiplatform tecknobit updater
Last synced: 3 months ago
JSON representation
Kotlin Desktop Updater based on GitHub releases. From the Github's repository of the application get the release marked as the last-release to warn the user of that application about a new version available
- Host: GitHub
- URL: https://github.com/n7ghtm4r3/octocatkdu
- Owner: N7ghtm4r3
- License: mit
- Created: 2023-12-31T11:52:54.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-02T14:57:40.000Z (6 months ago)
- Last Synced: 2025-02-08T13:27:09.022Z (5 months ago)
- Topics: component, compose-multiplatform, desktop-app, desktop-application, destkop, jetpack-compose, kotlin-multiplatform, tecknobit, updater
- Language: Kotlin
- Homepage:
- Size: 465 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OctocatKDU


**v1.0.5**
Kotlin Desktop Updater based on GitHub releases. From the GitHub's repository of the application get the release marked as the last-release to warn the user of that application about a new version available
## Implementation
### Version catalog
```gradle
[versions]
octocatkdu = "1.0.5"[libraries]
octocatkdu = { module = "io.github.n7ghtm4r3:octocatkdu", version.ref = "octocatkdu" }
```### Gradle
Add the JitPack repository to your build file
- Add it in your root build.gradle at the end of repositories
```gradle
repositories {
...
maven { url 'https://jitpack.io' }
}
```#### Gradle (Kotlin)
```gradle
repositories {
...
maven("https://jitpack.io")
}
```- Add the dependency
```gradle
dependencies {
implementation 'io.github.n7ghtm4r3:octocatkdu:1.0.5'
}
```#### Gradle (Kotlin)
```gradle
dependencies {
implementation("io.github.n7ghtm4r3:octocatkdu:1.0.5")
}
```#### Gradle (version catalog)
```gradle
dependencies {
implementation(libs.octocatkdu)
}
```### Latest supported properties configuration
``` properties
kotlin.version=2.0.21
compose.version=1.7.3
```### Usage/Examples
#### Resources file
You must place the resource file, named **octocat_kdu.config**, in the resources folder of your application:
> [!CAUTION]
> Note: you must keep this file safe and not share in public repositories, but keep in local to be included only in the
> executable file, because it contains sensitive data like the GitHub's personal access token``` bash
src
|-- main
|-- resources
| |-- octocat_kdu.config
```Content example:
```json
{
"personal_access_token": "your_personal_access_token_for_github",
"owner": "owner_of_the_repository_of_the_application",
"repo": "the_repository_of_the_application"
}
```#### Testing purposes
Use the fake updater dialog to testing the workflow of your application with the OctocatKDU
```kotlin
FakeUpdaterDialog(
config = OctocatKDUFakeConfig(
appName = "MyApplication",
onUpdateAvailable = {
// the application flow when there is an update available and the dialog is displayed
},
releaseNotes = releaseNotes, // if there are
dismissAction = {
// the rest of the application flow
},
confirmAction = { isInstalling ->
// the action to execute if the user chosen to update the current version
}
)
)
```#### Real workflow
Use the real updater dialog in the release
```kotlin
UpdaterDialog(
config = OctocatKDUConfig(
appName = "MyApplication",
currentVersion = "current_version_of_the_application",
onUpdateAvailable = {
// the application flow when there is an update available and the dialog is displayed
},
dismissAction = {
// the rest of the application flow
},
confirmAction = { isInstalling ->
// the action to execute if the user chosen to update the current version
}
)
)
```#### Customization
The customization can be both with the faker and with the real dialog
- Application theme
Customize the dialog for your application theme
```kotlin
MyApplicationTheme {
FakeUpdaterDialog(
config = OctocatKDUFakeConfig(
appName = "MyApplication",
onUpdateAvailable = {
// the application flow when there is an update available and the dialog is displayed
},
releaseNotes = releaseNotes, // if there are
dismissAction = {
// the rest of the application flow
},
confirmAction = { isInstalling ->
// the action to execute if the user chosen to update the current version
}
)
)
}
```- Specific for the dialog
Customize only the dialog theme
```kotlin
FakeUpdaterDialog(
config = OctocatKDUFakeConfig(
appName = "MyApplication",
onUpdateAvailable = {
// the application flow when there is an update available and the dialog is displayed
},
releaseNotes = releaseNotes, // if there are
dismissAction = {
// the rest of the application flow
},
confirmAction = { isInstalling ->
// the action to execute if the user chosen to update the current version
}
),
style = OctocatKDUStyle(
locale = // the locale language to use",
shape = // the shape for the dialog,
titleModifier = // the modifier for the title of the dialog,
titleColor = // the color for the title of the dialog,
titleFontSize = // the size for the title of the dialog,
titleFontStyle = // the style for the title of the dialog,
titleFontWeight = // the weight for the title of the dialog,
titleFontFamily = // the font family for the title of the dialog,
textModifier = // the modifier for the text of the dialog,
textColor = // the color for the text of the dialog,
textFontSize = // the size for the text of the dialog,
textFontStyle = // the style for the text of the dialog,
textFontWeight = // the weight for the text of the dialog,
textFontFamily = // the font family for the text of the dialog
)
)
```#### Custom options that can be activated
- `not_show_at_next_launch`
```kotlin
FakeUpdaterDialog(
config = OctocatKDUFakeConfig(
...
// allow the user to avoid to be warned about new updates available hiding the dialog
notShowAtNextLaunchOptionEnabled = false / true
...
)
)
```- `not_show_at_next_launch`
```kotlin
UpdaterDialog(
config = OctocatKDUConfig(
...
// allow the user to be warned about new updates available only in a specific intervals
frequencyVisibility = ENUM[ALWAYS, ONCE_PER_DAY, ONCE_PER_WEEK, ONCE_PER_MONTH]
...
)
)
```#### Release distribution
> [!IMPORTANT]
> When you need to create the release distribution you must insert in the **compose-desktop.pro** file this proguard setting
> to correctly run the distribution:
>
> ```txt
> -keepclassmembers enum * {
> public static **[] values();
> public static ** valueOf(java.lang.String);
> }
> ```## Appearance (default application theme)

## Authors
- [@N7ghtm4r3](https://www.github.com/N7ghtm4r3)
## Support
If you need help using the library or encounter any problems or bugs, please contact us via the following links:
- Support via email
- Support via GitHubThank you for your help!
## Badges
[](https://play.google.com/store/apps/developer?id=Tecknobit)
[](https://twitter.com/tecknobit)[](https://www.oracle.com/java/)
[](https://kotlinlang.org/)## Donations
If you want support project and developer
| Crypto | Address | Network |
|-----------------------------------------------------------------------------------------------------|--------------------------------------------------|----------|
|  | **3H3jyCzcRmnxroHthuXh22GXXSmizin2yp** | Bitcoin |
|  | **0x1b45bc41efeb3ed655b078f95086f25fc83345c4** | Ethereum |
|  | **AtPjUnxYFHw3a6Si9HinQtyPTqsdbfdKX3dJ1xiDjbrL** | Solana |If you want support project and developer with PayPal
Copyright © 2025 Tecknobit