From ae596c2dd415eb2cb9f71331f0a0270339af8ee4 Mon Sep 17 00:00:00 2001 From: Hannes Achleitner Date: Sat, 17 Dec 2022 10:20:02 +0100 Subject: [PATCH 1/2] Artifactory --- app/build.gradle | 4 +- .../info/hannes/github/sample/MainActivity.kt | 11 ++++- app/src/main/res/layout/activity_main.xml | 17 +++++-- build.gradle | 1 + githubAppUpdate/build.gradle | 6 ++- .../info/hannes/github/AppUpdateHelper.kt | 49 +++++++++++++++++++ 6 files changed, 80 insertions(+), 8 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 2ca08cb..0deb75e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,14 +10,14 @@ android { versionCode getGitCommitCount() versionName "1.0" - minSdkVersion 21 + minSdkVersion 26 targetSdkVersion 33 buildConfigField "String", 'GIT_REPOSITORY', "\"" + getGitOriginRemote() + "\"" } packagingOptions { resources { - pickFirsts += ['META-INF/atomicfu.kotlin_module'] + pickFirsts += ['META-INF/atomicfu.kotlin_module', 'META-INF/DEPENDENCIES'] } } diff --git a/app/src/main/java/info/hannes/github/sample/MainActivity.kt b/app/src/main/java/info/hannes/github/sample/MainActivity.kt index 2b8c883..b64254f 100644 --- a/app/src/main/java/info/hannes/github/sample/MainActivity.kt +++ b/app/src/main/java/info/hannes/github/sample/MainActivity.kt @@ -27,7 +27,7 @@ class MainActivity : AppCompatActivity() { BuildConfig.GIT_REPOSITORY ) - binding.button.setOnClickListener { + binding.buttonGithub.setOnClickListener { AppUpdateHelper.checkWithDialog( this, BuildConfig.GIT_REPOSITORY, @@ -35,6 +35,15 @@ class MainActivity : AppCompatActivity() { force = true // just to enable debugging, without you can only debug once a day ) } + + binding.buttonArtifactory.setOnClickListener { + AppUpdateHelper.checkArtifactoryDialog( + this, + "https://artifactory.myserver.info", + { msg -> Log.d("result", msg) }, + force = true // just to enable debugging, without you can only debug once a day + ) + } } } diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 746ee3a..7c09803 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -6,19 +6,28 @@ android:layout_width="match_parent" android:layout_height="match_parent"> -