Remove unused resources and add TLS decryption help

This commit is contained in:
emanuele-f 2021-03-04 23:46:40 +01:00
parent e8a56aa669
commit 569523f091
10 changed files with 30 additions and 60 deletions

View File

@ -110,7 +110,7 @@ public class HTTPServer extends NanoHTTPD {
public Response serve(IHTTPSession session) {
if(!mAcceptConnections)
return newFixedLengthResponse(Status.FORBIDDEN, MIME_PLAINTEXT,
mContext.getString(R.string.capture_not_started));
mContext.getString(R.string.capture_not_running));
if(session.getUri().endsWith("/")) {
/* Use a redirect to provide a file name */

View File

@ -316,7 +316,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
Intent intent = new Intent(MainActivity.this, StatsActivity.class);
startActivity(intent);
} else
Utils.showToast(this, R.string.capture_not_started);
Utils.showToast(this, R.string.capture_not_running);
} else if (id == R.id.action_about) {
Intent intent = new Intent(MainActivity.this, AboutActivity.class);
startActivity(intent);

View File

@ -27,6 +27,7 @@ import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.preference.EditTextPreference;
import androidx.preference.ListPreference;
import androidx.preference.Preference;
import androidx.preference.PreferenceFragmentCompat;
import androidx.preference.SwitchPreference;
@ -54,6 +55,7 @@ public class SettingsActivity extends AppCompatActivity {
private SwitchPreference mTlsDecryptionEnabled;
private EditTextPreference mTlsProxyIp;
private EditTextPreference mTlsProxyPort;
private Preference mTlsHelp;
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
@ -96,6 +98,8 @@ public class SettingsActivity extends AppCompatActivity {
}
private void setupTlsProxyPrefs() {
mTlsHelp = findPreference("tls_how_to");
mTlsDecryptionEnabled = findPreference(Prefs.PREF_TLS_DECRYPTION_ENABLED_KEY);
mTlsDecryptionEnabled.setOnPreferenceChangeListener((preference, newValue) -> {
tlsDecryptionHideShow((Boolean) newValue);
@ -118,6 +122,7 @@ public class SettingsActivity extends AppCompatActivity {
private void tlsDecryptionHideShow(boolean decryptionEnabled) {
mTlsProxyIp.setVisible(decryptionEnabled);
mTlsProxyPort.setVisible(decryptionEnabled);
mTlsHelp.setVisible(decryptionEnabled);
}
}
}

View File

@ -1,8 +0,0 @@
<!--
Source https://github.com/encharm/Font-Awesome-SVG-PNG/blob/master/black/svg/search.svg
All brand icons are trademarks of their respective owners.
-->
<vector android:height="24dp" android:viewportHeight="1792"
android:viewportWidth="1792" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M1216,832q0,-185 -131.5,-316.5t-316.5,-131.5 -316.5,131.5 -131.5,316.5 131.5,316.5 316.5,131.5 316.5,-131.5 131.5,-316.5zM1728,1664q0,52 -38,90t-90,38q-54,0 -90,-38l-343,-342q-179,124 -399,124 -143,0 -273.5,-55.5t-225,-150 -150,-225 -55.5,-273.5 55.5,-273.5 150,-225 225,-150 273.5,-55.5 273.5,55.5 225,150 150,225 55.5,273.5q0,220 -124,399l343,343q37,37 37,90z"/>
</vector>

View File

@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
android:layout_height="match_parent">
<com.emanuelef.remote_capture.views.EmptyRecyclerView
android:layout_width="match_parent"

View File

@ -29,7 +29,7 @@
android:icon="@drawable/ic_telegram" />
<item
android:id="@+id/action_open_github"
android:title="@string/open_github"
android:title="@string/source_code"
android:icon="@drawable/ic_github" />
<item

View File

@ -1,5 +1,4 @@
<resources>
<string name="app_name" translatable="false">PCAPdroid</string>
<string name="start_button">启动</string>
<string name="stop_button">停止</string>
<string name="title_activity_settings">设置</string>
@ -11,22 +10,10 @@
<string name="app_and_proto" translatable="false">%1$s (%2$s)</string>
<string name="query">查询</string>
<string name="host">主机</string>
<string name="capture_not_started">流量捕获未在运行!</string>
<!-- Defaults -->
<string name="default_collector_ip" translatable="false">127.0.0.1</string>
<string name="default_collector_port" translatable="false">1234</string>
<!-- Preferences -->
<string name="collector_prefs_header">远程收集器</string>
<string name="ip_address">IP 地址</string>
<string name="port">端口</string>
<string name="capture_not_running">流量捕获未在运行!</string>
<string name="app_filter">应用过滤器</string>
<string name="ready">就绪</string>
<string name="stopping">停止中...</string>
<string name="starting">启动中...</string>
<string name="about">关于</string>
<string name="misc_prefs">杂项</string>
<string name="status">状态</string>
<string name="connections_view">连接</string>
<string name="no_connections">无连接</string>
@ -55,13 +42,10 @@
<string name="enable_tls_decryption">启用 TLS 解密</string>
<string name="enable_tls_decryption_summary">启用后,所有 TLS 通信都将被重定向到远程 mitmproxy 实例进行解密。</string>
<string name="default_proxy_port">8080</string>
<string name="with_tls_decryption">+解密</string>
<string name="pcap_dump">PCAP 转储</string>
<string name="tls_decryption">TLS 解密</string>
<string name="user_guide">用户指南</string>
<string name="rate_app">评价本应用</string>
<string name="open_telegram_group">Telegram 群组</string>
<string name="open_github">Github 项目</string>
<string name="yes"></string>
<string name="no"></string>
<string name="existing_vpn_confirm">当前处于活跃状态的 VPN 应用将被断开。你想继续吗?</string>

View File

@ -8,20 +8,10 @@
<string name="up_and_down">%1$s pobrane — %2$s wysłane</string>
<string name="query">Zapytanie</string>
<string name="host">Host</string>
<string name="capture_not_started">Przechwytywanie nie jest włączone!</string>
<!-- Defaults -->
<!-- Preferences -->
<string name="collector_prefs_header">Zdalna usługa zbierająca</string>
<string name="ip_address">Adres IP</string>
<string name="port">Port</string>
<string name="capture_not_running">Przechwytywanie nie jest włączone!</string>
<string name="app_filter">Filtr aplikacji</string>
<string name="ready">Gotowy</string>
<string name="stopping">Wyłączanie...</string>
<string name="starting">Włączanie...</string>
<string name="about">O aplikacji</string>
<string name="misc_prefs">Różne</string>
<string name="status">Status</string>
<string name="connections_view">Połączenia</string>
<string name="no_connections">Brak połączeń</string>

View File

@ -1,6 +1,10 @@
<resources>
<string name="app_name" translatable="false">PCAPdroid</string>
<string name="about_copyright" translatable="false">Copyright (C) 2020-21 - Emanuele Faranda black.silver@hotmail.it</string>
<string name="default_collector_ip" translatable="false">127.0.0.1</string>
<string name="default_collector_port" translatable="false">1234</string>
<!-- Localized -->
<string name="start_button">Start</string>
<string name="stop_button">Stop</string>
<string name="title_activity_settings">Settings</string>
@ -12,22 +16,11 @@
<string name="app_and_proto" translatable="false">%1$s (%2$s)</string>
<string name="query">Query</string>
<string name="host">Host</string>
<string name="capture_not_started">Capture not running!</string>
<!-- Defaults -->
<string name="default_collector_ip" translatable="false">127.0.0.1</string>
<string name="default_collector_port" translatable="false">1234</string>
<!-- Preferences -->
<string name="collector_prefs_header">Remote Collector</string>
<string name="ip_address">IP Address</string>
<string name="port">Port</string>
<string name="capture_not_running">Capture not running!</string>
<string name="capture_not_started">Capture not started!</string>
<string name="app_filter">App Filter</string>
<string name="ready">Ready</string>
<string name="stopping">Stopping...</string>
<string name="starting">Starting...</string>
<string name="about">About</string>
<string name="misc_prefs">Misc</string>
<string name="status">Status</string>
<string name="connections_view">Connections</string>
<string name="no_connections">No connections</string>
@ -56,13 +49,11 @@
<string name="enable_tls_decryption">Enable TLS Decryption</string>
<string name="enable_tls_decryption_summary">When enabled, all the TLS traffic will be redirected to a remote mitmproxy instance for decryption.</string>
<string name="default_proxy_port">8080</string>
<string name="with_tls_decryption">+decryption</string>
<string name="pcap_dump">PCAP Dump</string>
<string name="tls_decryption">TLS Decryption</string>
<string name="user_guide">User Guide</string>
<string name="rate_app">Rate</string>
<string name="open_telegram_group">Telegram Group</string>
<string name="open_github">Source Code</string>
<string name="source_code">Source Code</string>
<string name="yes">YES</string>
<string name="no">NO</string>
<string name="existing_vpn_confirm">The currently active VPN app will be disconnected. Do you want to proceed?</string>
@ -82,7 +73,6 @@
<string name="dns_queries">DNS Queries</string>
<string name="search_apps">Search Apps</string>
<string name="no_apps">No apps</string>
<string name="show_system_apps">Show system apps</string>
<string name="dns_server">DNS Server</string>
<string name="apps">Apps</string>
<string name="remove_app_filter">Remove the app filter</string>
@ -101,7 +91,6 @@
<string name="capture_running">Capture running</string>
<string name="notification_msg">%1$s captured, %2$s connections</string>
<string name="no_app_filter">No app filter set</string>
<string name="ip_x">IP: %1$s</string>
<string name="proto_and_port">%1$s, %2$d</string>
<string name="conn_status_open">Open</string>
<string name="first_seen">First Seen</string>
@ -117,5 +106,6 @@
<string name="app_no_warranty">PCAPdroid is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</string>
<string name="gpl_license_link">GPLv3 License</string>
<string name="get_app">Get it:</string>
<string name="tls_how_to">How to setup TLS Decryption</string>
</resources>

View File

@ -14,7 +14,9 @@
~ limitations under the License.
-->
<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceScreen
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory app:title="@string/http_server" app:iconSpaceReserved="false">
<EditTextPreference
@ -49,6 +51,14 @@
app:summary="@string/enable_tls_decryption_summary"
app:defaultValue="false" />
<Preference
app:key="tls_how_to"
app:title="@string/tls_how_to"
app:iconSpaceReserved="false">
<intent android:action="android.intent.action.VIEW"
android:data="https://emanuele-f.github.io/PCAPdroid/tls_decryption" />
</Preference>
<EditTextPreference
app:key="tls_proxy_ip_address"
app:title="@string/tls_proxy_ip_address"