disable update popup until origin_hash changes

- renamed commit_hash to origin_hash
- added current_hash for later use
This commit is contained in:
int3debug 2024-03-20 10:54:20 +01:00
parent 1ff0b5dccd
commit 4ef513c05b
4 changed files with 6 additions and 5 deletions

View file

@ -63,7 +63,8 @@ android {
versionName = "4.3.2" versionName = "4.3.2"
resValue("string", "app_version", "${defaultConfig.versionName}${versionNameSuffix ?: ""}") resValue("string", "app_version", "${defaultConfig.versionName}${versionNameSuffix ?: ""}")
resValue("string", "commit_hash", "git rev-parse --short HEAD".execute() ?: "") resValue("string", "origin_hash", "git rev-parse --short ORIG_HEAD".execute() ?: "")
resValue("string", "current_hash", "git rev-parse --short HEAD".execute() ?: "")
resValue("bool", "is_prerelease", "false") resValue("bool", "is_prerelease", "false")
// Reads local.properties // Reads local.properties

View file

@ -179,7 +179,7 @@ class SettingsFragment : Fragment() {
} }
val appVersion = getString(R.string.app_version) val appVersion = getString(R.string.app_version)
val commitInfo = getString(R.string.commit_hash) val commitInfo = getString(R.string.origin_hash)
val buildDate = BuildConfig.BUILDDATE val buildDate = BuildConfig.BUILDDATE
binding?.buildDate?.text = buildDate binding?.buildDate?.text = buildDate

View file

@ -180,7 +180,7 @@ class InAppUpdater {
Log.d(LOG_TAG, "Fetched GitHub tag: ${tagResponse.github_object.sha.take(7)}") Log.d(LOG_TAG, "Fetched GitHub tag: ${tagResponse.github_object.sha.take(7)}")
val shouldUpdate = val shouldUpdate =
(getString(R.string.commit_hash) (getString(R.string.origin_hash)
.trim { c -> c.isWhitespace() } .trim { c -> c.isWhitespace() }
.take(7) .take(7)
!= !=

View file

@ -129,12 +129,12 @@
android:textColor="?attr/textColor" /> android:textColor="?attr/textColor" />
<TextView <TextView
android:id="@+id/commit_hash" android:id="@+id/origin_hash"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
android:padding="10dp" android:padding="10dp"
android:text="@string/commit_hash" android:text="@string/origin_hash"
android:textColor="?attr/textColor" /> android:textColor="?attr/textColor" />
<TextView <TextView