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
[versions]
octocatkdu = "1.0.5"
[libraries]
octocatkdu = { module = "io.github.n7ghtm4r3:octocatkdu", version.ref = "octocatkdu" }
Add the JitPack repository to your build file
-
Add it in your root build.gradle at the end of repositories
repositories { ... maven { url 'https://jitpack.io' } }
repositories { ... maven("https://jitpack.io") }
-
Add the dependency
dependencies { implementation 'io.github.n7ghtm4r3:octocatkdu:1.0.5' }
dependencies { implementation("io.github.n7ghtm4r3:octocatkdu:1.0.5") }
dependencies { implementation(libs.octocatkdu) }
kotlin.version=2.0.21
compose.version=1.7.3
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
src
|-- main
|-- resources
| |-- octocat_kdu.config
Content example:
{
"personal_access_token": "your_personal_access_token_for_github",
"owner": "owner_of_the_repository_of_the_application",
"repo": "the_repository_of_the_application"
}
Use the fake updater dialog to testing the workflow of your application with the OctocatKDU
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
}
)
)
Use the real updater dialog in the release
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
}
)
)
The customization can be both with the faker and with the real dialog
-
Application theme
Customize the dialog for your application theme
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
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 ) )
-
not_show_at_next_launch
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
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] ... ) )
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:
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
If you need help using the library or encounter any problems or bugs, please contact us via the following links:
Thank you for your help!
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