ui: hide commit hashes in user-facing version string (#534)
We currently show the full version number everywhere. This pointlessly causes confusion for users, and is only really useful for Tailscale employees. Let's show the marketing version everywhere instead. Users can still tap on the version number to copy the full version string. The extended version is also available in the Android settings, when inspecting Tailscale from the Apps list. Signed-off-by: Andrea Gottardo <andrea@gottardo.me>pull/535/head
parent
a32c2aa0df
commit
cd993fee43
@ -0,0 +1,20 @@
|
||||
// Copyright (c) Tailscale Inc & AUTHORS
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
package com.tailscale.ipn.ui.util
|
||||
|
||||
import com.tailscale.ipn.BuildConfig
|
||||
|
||||
class AppVersion {
|
||||
companion object {
|
||||
// Returns the short version of the build version, which is what users typically expect.
|
||||
// For instance, if the build version is "1.75.80-t8fdffb8da-g2daeee584df",
|
||||
// this function returns "1.75.80".
|
||||
fun Short(): String {
|
||||
// Split the full version string by hyphen (-)
|
||||
val parts = BuildConfig.VERSION_NAME.split("-")
|
||||
// Return only the part before the first hyphen
|
||||
return parts[0]
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue