aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/org/pacien/tincapp/context/AppInfo.kt
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/org/pacien/tincapp/context/AppInfo.kt')
-rw-r--r--app/src/main/java/org/pacien/tincapp/context/AppInfo.kt47
1 files changed, 47 insertions, 0 deletions
diff --git a/app/src/main/java/org/pacien/tincapp/context/AppInfo.kt b/app/src/main/java/org/pacien/tincapp/context/AppInfo.kt
new file mode 100644
index 0000000..e0d49f1
--- /dev/null
+++ b/app/src/main/java/org/pacien/tincapp/context/AppInfo.kt
@@ -0,0 +1,47 @@
1/*
2 * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon
3 * Copyright (C) 2017-2018 Pacien TRAN-GIRARD
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18
19package org.pacien.tincapp.context
20
21import android.os.Build
22import org.pacien.tincapp.BuildConfig
23import org.pacien.tincapp.R
24
25/**
26 * @author pacien
27 */
28object AppInfo {
29 private fun appVersion(): String = App.getResources().getString(
30 R.string.info_version_format,
31 BuildConfig.VERSION_NAME,
32 BuildConfig.BUILD_TYPE)
33
34 private fun androidVersion(): String = App.getResources().getString(
35 R.string.info_running_on_format,
36 Build.VERSION.CODENAME,
37 Build.VERSION.RELEASE)
38
39 private fun supportedABIs(): String = App.getResources().getString(
40 R.string.info_supported_abis_format,
41 Build.SUPPORTED_ABIS.joinToString(","))
42
43 fun all(): String = listOf(
44 appVersion(),
45 androidVersion(),
46 supportedABIs()).joinToString("\n")
47}