diff options
author | pacien | 2020-12-08 16:16:08 +0100 |
---|---|---|
committer | pacien | 2020-12-08 16:16:08 +0100 |
commit | 20ecd9840f1e237dba79674b71e49b43b074902e (patch) | |
tree | 4594947f1faf96e9851d95c9cfc7bfad0c9ff923 /app/src/main/res | |
parent | b1f98caca2f6960f7abb3ef7f7c27b903e1ef929 (diff) | |
download | tincapp-20ecd9840f1e237dba79674b71e49b43b074902e.tar.gz |
app: add configuration FTP server
This is a ridiculous workaround to make the configuration (and other files) accessible to the user
necessary after the new storage access restriction enforced in Android 11 which prevent other
applications from accessing the supposedly public application's directory.
The app's internal private storage directory is now exposed to the user through an embedded FTP
server that the user can turn on and off from the configuration activity. The user can then play
with the configuration and retrieve logs through a remote or local FTP client application of their
choice.
GitHub: closes #103
Diffstat (limited to 'app/src/main/res')
-rw-r--r-- | app/src/main/res/layout/configure_activity.xml | 24 | ||||
-rw-r--r-- | app/src/main/res/layout/configure_tools_configuration_ftp_server_fragment.xml | 86 | ||||
-rw-r--r-- | app/src/main/res/values-nb-rNO/strings.xml | 1 | ||||
-rw-r--r-- | app/src/main/res/values-zh-rCN/strings.xml | 1 | ||||
-rw-r--r-- | app/src/main/res/values-zh-rHK/strings.xml | 1 | ||||
-rw-r--r-- | app/src/main/res/values-zh-rTW/strings.xml | 1 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 8 |
7 files changed, 110 insertions, 12 deletions
diff --git a/app/src/main/res/layout/configure_activity.xml b/app/src/main/res/layout/configure_activity.xml index 6097384..2fde4a2 100644 --- a/app/src/main/res/layout/configure_activity.xml +++ b/app/src/main/res/layout/configure_activity.xml | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | <!-- | 3 | <!-- |
4 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon | 4 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon |
5 | * Copyright (C) 2017-2018 Pacien TRAN-GIRARD | 5 | * Copyright (C) 2017-2020 Pacien TRAN-GIRARD |
6 | * | 6 | * |
7 | * This program is free software: you can redistribute it and/or modify | 7 | * This program is free software: you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License as published by | 8 | * it under the terms of the GNU General Public License as published by |
@@ -28,23 +28,33 @@ | |||
28 | android:layout_height="wrap_content" | 28 | android:layout_height="wrap_content" |
29 | android:orientation="vertical"> | 29 | android:orientation="vertical"> |
30 | 30 | ||
31 | <TextView | ||
32 | style="@style/AppTheme.SectionTitle" | ||
33 | android:text="@string/configure_activity_title_configuration_server"/> | ||
34 | |||
35 | <fragment | ||
36 | android:id="@+id/configure_activity_configuration_sftp_server_fragment" | ||
37 | android:name="org.pacien.tincapp.activities.configure.ConfigurationFtpServerFragment" | ||
38 | android:layout_width="match_parent" | ||
39 | android:layout_height="wrap_content"/> | ||
40 | |||
31 | <TextView | 41 | <TextView |
32 | style="@style/AppTheme.SectionTitle" | 42 | style="@style/AppTheme.SectionTitle" |
33 | android:text="@string/configure_activity_title_path_info"/> | 43 | android:text="@string/configure_activity_title_tools"/> |
34 | 44 | ||
35 | <fragment | 45 | <fragment |
36 | android:id="@+id/configure_activity_path_info_fragment" | 46 | android:id="@+id/configure_activity_tools_fragment" |
37 | android:name="org.pacien.tincapp.activities.configure.PathInfoFragment" | 47 | android:name="org.pacien.tincapp.activities.configure.ToolsFragment" |
38 | android:layout_width="match_parent" | 48 | android:layout_width="match_parent" |
39 | android:layout_height="wrap_content"/> | 49 | android:layout_height="wrap_content"/> |
40 | 50 | ||
41 | <TextView | 51 | <TextView |
42 | style="@style/AppTheme.SectionTitle" | 52 | style="@style/AppTheme.SectionTitle" |
43 | android:text="@string/configure_activity_title_tools"/> | 53 | android:text="@string/configure_activity_title_internal_paths_info"/> |
44 | 54 | ||
45 | <fragment | 55 | <fragment |
46 | android:id="@+id/configure_activity_tools_fragment" | 56 | android:id="@+id/configure_activity_path_info_fragment" |
47 | android:name="org.pacien.tincapp.activities.configure.ToolsFragment" | 57 | android:name="org.pacien.tincapp.activities.configure.PathInfoFragment" |
48 | android:layout_width="match_parent" | 58 | android:layout_width="match_parent" |
49 | android:layout_height="wrap_content"/> | 59 | android:layout_height="wrap_content"/> |
50 | 60 | ||
diff --git a/app/src/main/res/layout/configure_tools_configuration_ftp_server_fragment.xml b/app/src/main/res/layout/configure_tools_configuration_ftp_server_fragment.xml new file mode 100644 index 0000000..24f3c36 --- /dev/null +++ b/app/src/main/res/layout/configure_tools_configuration_ftp_server_fragment.xml | |||
@@ -0,0 +1,86 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | |||
3 | <!-- | ||
4 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon | ||
5 | * Copyright (C) 2017-2020 Pacien TRAN-GIRARD | ||
6 | * | ||
7 | * This program is free software: you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation, either version 3 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
19 | --> | ||
20 | |||
21 | <layout xmlns:android="http://schemas.android.com/apk/res/android"> | ||
22 | |||
23 | <data> | ||
24 | |||
25 | <variable | ||
26 | name="ftpEnabled" | ||
27 | type="boolean" /> | ||
28 | |||
29 | <variable | ||
30 | name="ftpUsername" | ||
31 | type="String" /> | ||
32 | |||
33 | <variable | ||
34 | name="ftpPassword" | ||
35 | type="String" /> | ||
36 | |||
37 | <variable | ||
38 | name="ftpPort" | ||
39 | type="int" /> | ||
40 | |||
41 | <variable | ||
42 | name="toggleFtpState" | ||
43 | type="kotlin.jvm.functions.Function0<kotlin.Unit>" /> | ||
44 | |||
45 | </data> | ||
46 | |||
47 | <LinearLayout style="@style/AppTheme.List"> | ||
48 | |||
49 | <LinearLayout | ||
50 | style="@style/AppTheme.ListBlock.Clickable" | ||
51 | android:onClick="@{() -> toggleFtpState.invoke()}" | ||
52 | android:orientation="horizontal"> | ||
53 | |||
54 | <LinearLayout | ||
55 | android:layout_width="wrap_content" | ||
56 | android:layout_height="wrap_content" | ||
57 | android:layout_weight="1" | ||
58 | android:orientation="vertical"> | ||
59 | |||
60 | <TextView | ||
61 | style="@style/AppTheme.BlockTitle" | ||
62 | android:layout_width="wrap_content" | ||
63 | android:layout_height="wrap_content" | ||
64 | android:text="@string/configure_configuration_server_ftp_access" /> | ||
65 | |||
66 | <TextView | ||
67 | style="@style/AppTheme.BlockContent" | ||
68 | android:layout_width="wrap_content" | ||
69 | android:layout_height="wrap_content" | ||
70 | android:text="@{ftpEnabled ? @string/configure_configuration_server_ftp_access_endpoint_format(ftpUsername, ftpPassword, ftpPort) : @string/configure_configuration_server_ftp_access_not_active}" | ||
71 | android:textIsSelectable="@{ftpEnabled}" /> | ||
72 | |||
73 | </LinearLayout> | ||
74 | |||
75 | <androidx.appcompat.widget.SwitchCompat | ||
76 | android:layout_width="wrap_content" | ||
77 | android:layout_height="match_parent" | ||
78 | android:layout_weight="0" | ||
79 | android:checked="@{ftpEnabled}" | ||
80 | android:onClick="@{() -> toggleFtpState.invoke()}" /> | ||
81 | |||
82 | </LinearLayout> | ||
83 | |||
84 | </LinearLayout> | ||
85 | |||
86 | </layout> | ||
diff --git a/app/src/main/res/values-nb-rNO/strings.xml b/app/src/main/res/values-nb-rNO/strings.xml index 9c330a7..346a2d1 100644 --- a/app/src/main/res/values-nb-rNO/strings.xml +++ b/app/src/main/res/values-nb-rNO/strings.xml | |||
@@ -80,7 +80,6 @@ | |||
80 | <string name="configure_tools_message_invalid_network_name">Ugyldig nettverksnavn.</string> | 80 | <string name="configure_tools_message_invalid_network_name">Ugyldig nettverksnavn.</string> |
81 | <string name="configure_tools_message_network_configuration_written">Nettverksoppsett skrevet.</string> | 81 | <string name="configure_tools_message_network_configuration_written">Nettverksoppsett skrevet.</string> |
82 | 82 | ||
83 | <string name="configure_activity_title_path_info">Sti-info</string> | ||
84 | <string name="configure_path_info_title_configuration_directory">Oppsettsmappe</string> | 83 | <string name="configure_path_info_title_configuration_directory">Oppsettsmappe</string> |
85 | <string name="configure_path_info_title_log_directory">Loggingsmappe</string> | 84 | <string name="configure_path_info_title_log_directory">Loggingsmappe</string> |
86 | <string name="configure_path_info_title_tinc_binary">tinc-binærfil</string> | 85 | <string name="configure_path_info_title_tinc_binary">tinc-binærfil</string> |
diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index b5d12b1..536403e 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml | |||
@@ -80,7 +80,6 @@ | |||
80 | <string name="configure_tools_message_invalid_network_name">网络名称无效。</string> | 80 | <string name="configure_tools_message_invalid_network_name">网络名称无效。</string> |
81 | <string name="configure_tools_message_network_configuration_written">网络配置写入成功。</string> | 81 | <string name="configure_tools_message_network_configuration_written">网络配置写入成功。</string> |
82 | 82 | ||
83 | <string name="configure_activity_title_path_info">路径信息</string> | ||
84 | <string name="configure_path_info_title_configuration_directory">配置目录</string> | 83 | <string name="configure_path_info_title_configuration_directory">配置目录</string> |
85 | <string name="configure_path_info_title_log_directory">日志目录</string> | 84 | <string name="configure_path_info_title_log_directory">日志目录</string> |
86 | <string name="configure_path_info_title_tinc_binary">Tinc 二进制文件</string> | 85 | <string name="configure_path_info_title_tinc_binary">Tinc 二进制文件</string> |
diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index bddb004..e9c48d2 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml | |||
@@ -80,7 +80,6 @@ | |||
80 | <string name="configure_tools_message_invalid_network_name">網絡名稱無效。</string> | 80 | <string name="configure_tools_message_invalid_network_name">網絡名稱無效。</string> |
81 | <string name="configure_tools_message_network_configuration_written">網絡配置寫入成功。</string> | 81 | <string name="configure_tools_message_network_configuration_written">網絡配置寫入成功。</string> |
82 | 82 | ||
83 | <string name="configure_activity_title_path_info">路徑信息</string> | ||
84 | <string name="configure_path_info_title_configuration_directory">配置目錄</string> | 83 | <string name="configure_path_info_title_configuration_directory">配置目錄</string> |
85 | <string name="configure_path_info_title_log_directory">日誌目錄</string> | 84 | <string name="configure_path_in |