Commit a7d72938 authored by Max Lv's avatar Max Lv

refine the UI

parent 1b1f4233
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.github.shadowsocks" package="com.github.shadowsocks"
android:versionCode="120" android:versionCode="121"
android:versionName="2.8.3"> android:versionName="2.8.4">
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
......
Subproject commit 177a84bc6b77c53e1ccc22b97170928d54c1ce92 Subproject commit 67560ab12c1ff3413f971f9f1ba59ff28cb052ce
Subproject commit 890e880dc61ad4f2e9a340a78c797c4aabee6429 Subproject commit 772de6fdeb15fd7d2b7853b4d3e0372713f16b81
...@@ -52,9 +52,11 @@ ...@@ -52,9 +52,11 @@
<string name="settings">设置选项</string> <string name="settings">设置选项</string>
<string name="remove_profile">删除此配置文件「%s」?</string> <string name="remove_profile">删除此配置文件「%s」?</string>
<string name="recovery">重置</string> <string name="recovery">重置</string>
<string name="recovery_summary">重置所有后台服务</string>
<string name="about">关于</string> <string name="about">关于</string>
<string name="about_title">影梭(shadowsocks)%s</string> <string name="about_title">影梭(shadowsocks)%s</string>
<string name="flush_dnscache">刷新 DNS 缓存</string> <string name="flush_dnscache">刷新 DNS 缓存</string>
<string name="flush_dnscache_summary">需要 ROOT 权限</string>
<string name="flushing">刷新中……</string> <string name="flushing">刷新中……</string>
<string name="qrcode">二维码</string> <string name="qrcode">二维码</string>
<string name="add_profile">添加配置文件</string> <string name="add_profile">添加配置文件</string>
......
...@@ -78,10 +78,12 @@ ...@@ -78,10 +78,12 @@
<string name="profiles">Profiles</string> <string name="profiles">Profiles</string>
<string name="settings">Settings</string> <string name="settings">Settings</string>
<string name="recovery">Reset</string> <string name="recovery">Reset</string>
<string name="recovery_summary">Reset all the background services</string>
<string name="about">About</string> <string name="about">About</string>
<string name="about_title">Shadowsocks %s</string> <string name="about_title">Shadowsocks %s</string>
<string name="qrcode">QR Code</string> <string name="qrcode">QR Code</string>
<string name="flush_dnscache">Flush DNS Cache</string> <string name="flush_dnscache">Flush DNS cache</string>
<string name="flush_dnscache_summary">Require ROOT permission</string>
<string name="flushing">Flushing</string> <string name="flushing">Flushing</string>
<string name="add_profile">Add Profile</string> <string name="add_profile">Add Profile</string>
<string name="action_export">Export to Clipboard</string> <string name="action_export">Export to Clipboard</string>
......
...@@ -2,26 +2,12 @@ ...@@ -2,26 +2,12 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/com.github.shadowsocks"> xmlns:app="http://schemas.android.com/apk/res/com.github.shadowsocks">
<PreferenceCategory android:title="@string/global_cat">
<Preference android:summary="@string/profile_summary" android:title="@string/profile">
<intent android:action="com.github.shadowsocks.ProfileManagerActivity"/>
</Preference>
<com.github.shadowsocks.preferences.NatSwitchPreference android:key="isNAT"
android:title="@string/nat"
android:summary="@string/nat_summary"/>
<SwitchPreference
android:key="isAutoConnect"
android:summary="@string/auto_connect_summary"
android:title="@string/auto_connect"/>
<Preference android:key="recovery" android:title="@string/recovery"/>
<Preference android:key="flush_dnscache" android:title="@string/flush_dnscache"/>
</PreferenceCategory>
<PreferenceCategory <PreferenceCategory
android:title="@string/proxy_cat"> android:title="@string/proxy_cat">
<Preference android:summary="@string/profile_summary" android:title="@string/profiles">
<intent android:action="com.github.shadowsocks.ProfileManagerActivity"/>
</Preference>
<com.github.shadowsocks.preferences.SummaryEditTextPreference <com.github.shadowsocks.preferences.SummaryEditTextPreference
android:defaultValue="Default" android:defaultValue="Default"
android:key="profileName" android:key="profileName"
...@@ -56,6 +42,11 @@ ...@@ -56,6 +42,11 @@
app:entryValues="@array/enc_method_value" app:entryValues="@array/enc_method_value"
app:summary="%s" app:summary="%s"
android:title="@string/enc_method"/> android:title="@string/enc_method"/>
<SwitchPreference
android:key="isAuth"
android:defaultValue="false"
android:summary="@string/onetime_auth_summary"
android:title="@string/onetime_auth"/>
</PreferenceCategory> </PreferenceCategory>
...@@ -92,12 +83,23 @@ ...@@ -92,12 +83,23 @@
android:defaultValue="false" android:defaultValue="false"
android:summary="@string/udp_dns_summary" android:summary="@string/udp_dns_summary"
android:title="@string/udp_dns"/> android:title="@string/udp_dns"/>
</PreferenceCategory>
<PreferenceCategory android:title="@string/global_cat">
<com.github.shadowsocks.preferences.NatSwitchPreference android:key="isNAT"
android:title="@string/nat"
android:summary="@string/nat_summary"/>
<SwitchPreference <SwitchPreference
android:key="isAuth" android:key="isAutoConnect"
android:defaultValue="false" android:summary="@string/auto_connect_summary"
android:summary="@string/onetime_auth_summary" android:title="@string/auto_connect"/>
android:title="@string/onetime_auth"/> <Preference android:key="recovery" android:title="@string/recovery"
android:summary="@string/recovery_summary"/>
<Preference android:key="flush_dnscache" android:title="@string/flush_dnscache"
android:summary="@string/flush_dnscache_summary"/>
</PreferenceCategory> </PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>
...@@ -271,7 +271,13 @@ class Shadowsocks ...@@ -271,7 +271,13 @@ class Shadowsocks
cmd.append("chmod 666 %s%s-nat.pid".formatLocal(Locale.ENGLISH, Path.BASE, task)) cmd.append("chmod 666 %s%s-nat.pid".formatLocal(Locale.ENGLISH, Path.BASE, task))
cmd.append("chmod 666 %s%s-vpn.pid".formatLocal(Locale.ENGLISH, Path.BASE, task)) cmd.append("chmod 666 %s%s-vpn.pid".formatLocal(Locale.ENGLISH, Path.BASE, task))
} }
Console.runRootCommand(cmd.toArray)
if (!ShadowsocksApplication.isVpnEnabled) {
Console.runRootCommand(cmd.toArray)
} else {
Console.runCommand(cmd.toArray)
}
cmd.clear() cmd.clear()
for (task <- Array("ss-local", "ss-tunnel", "pdnsd", "redsocks", "tun2socks")) { for (task <- Array("ss-local", "ss-tunnel", "pdnsd", "redsocks", "tun2socks")) {
...@@ -291,8 +297,10 @@ class Shadowsocks ...@@ -291,8 +297,10 @@ class Shadowsocks
cmd.append("rm -f %s%s-vpn.conf".formatLocal(Locale.ENGLISH, Path.BASE, task)) cmd.append("rm -f %s%s-vpn.conf".formatLocal(Locale.ENGLISH, Path.BASE, task))
} }
Console.runCommand(cmd.toArray) Console.runCommand(cmd.toArray)
Console.runRootCommand(cmd.toArray) if (!ShadowsocksApplication.isVpnEnabled) {
Console.runRootCommand(Utils.getIptables + " -t nat -F OUTPUT") Console.runRootCommand(cmd.toArray)
Console.runRootCommand(Utils.getIptables + " -t nat -F OUTPUT")
}
} }
def isTextEmpty(s: String, msg: String): Boolean = { def isTextEmpty(s: String, msg: String): Boolean = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment