Skip to content

Commit

Permalink
The VCS commit string is already a [0,7] substring (PP-1895).
Browse files Browse the repository at this point in the history
  • Loading branch information
io7m committed Nov 12, 2024
1 parent 225af47 commit 8c93300
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,16 @@ class SettingsMainFragment2 : Fragment() {

private fun formatVersion(): String {
return try {
val context = this.requireContext()
val pkgManager = context.packageManager
val pkgInfo = pkgManager.getPackageInfo(context.packageName, 0)
val context =
this.requireContext()
val pkgManager =
context.packageManager
val pkgInfo =
pkgManager.getPackageInfo(context.packageName, 0)
val versionName =
SettingsModel.buildConfig.simplifiedVersion
val commit =
SettingsModel.buildConfig.vcsCommit.substring(IntRange(0, 7))
SettingsModel.buildConfig.vcsCommit

"Palace $versionName (${pkgInfo.versionCode}) [$commit]"
} catch (e: Throwable) {
Expand Down

0 comments on commit 8c93300

Please sign in to comment.