-
Notifications
You must be signed in to change notification settings - Fork 480
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]>
- Loading branch information
Showing
3 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
android/src/main/java/com/tailscale/ipn/ui/util/AppVersion.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters