Commit 622cef04 authored by Mygod's avatar Mygod Committed by Max Lv

Add an FAQ section in drawer

parent 8dd60277
### Troubleshooting
Cannot connect to server:
1. Stop battery saver if it's active;
2. If an upgrade breaks anything, do a manual reset first by pressing Reset at the end of the list;
3. Check your config;
4. Wipe app data.
Crash: [Submit an issue](https://github.com/shadowsocks/shadowsocks-android/issues/new) with logcat attached, or submit a crash report to Google Play. Then, try wiping app data.
### UI tips
* Tap the number to enter the port you wish to use; (if the keyboard doesn't pop up automatically for some reason)
* Use Tasker integration to create a desktop widget.
### How to add QR code from local gallery?
Scan it with a third-party scanner like [QuickMark Barcode Scanner](https://play.google.com/store/apps/details?id=tw.com.quickmark) and click the `ss` url.
### Why is NAT mode deprecated?
1. Requiring ROOT permission;
2. No IPv6 support;
3. No UDP relay support.
### How to remove the exclamation mark when using VPN mode?
The exclamation mark in the Wi-Fi/cellular icon appears because the system fails to connect to portal server (defaults to `clients3.google.com`) without VPN connection. To remove it, follow the instructions in [this article](https://www.noisyfox.cn/45.html). (in Simplified Chinese)
### Why are MIUI, EMUI and other AOSPs in China not officially supported?
1. Broken VPNService implementation, especially for IPv6;
2. Aggressive (or called broken) background service killing policy.
Fixes for MIUI: [#772](https://github.com/shadowsocks/shadowsocks-android/issues/772)
### How to pause Shadowsocks service?
* For Android 7.0+: Use quick switch tile in Quick Settings;
* Use Tasker integration;
* Add a profile with per-app proxy enabled for Shadowsocks only, bypass mode off.
### Why does Shadowsocks consume so much battery on Android 5.0+?
As Shadowsocks takes over the whole device network, any battery used by network activities from other apps are also counted as those from Shadowsocks. So, the battery usage of Shadowsocks equals to the sum of all the network activities of your device. Shadowsocks itself is a totally I/O bound application on modern Android devices, which is expected not to consume any notable battery.
So if you notice a significant increase in battery usage after you use Shadowsocks, it's most likely caused by other apps. For example, Google Play services can consume more battery after being able to connecting to Google, etc.
### It works fine under Wi-Fi but can't connect through cellular data?
Allow this app to consume background data in app settings.
### Why Camera permission is required on devices below Android 6.0?
To scan the QR code through the integrated QR scanner.
...@@ -33,6 +33,7 @@ resConfigs := Seq("ja", "ru", "zh-rCN", "zh-rTW") ...@@ -33,6 +33,7 @@ resConfigs := Seq("ja", "ru", "zh-rCN", "zh-rTW")
resolvers += Resolver.jcenterRepo resolvers += Resolver.jcenterRepo
libraryDependencies ++= libraryDependencies ++=
"com.android.support" % "cardview-v7" % "25.1.0" :: "com.android.support" % "cardview-v7" % "25.1.0" ::
"com.android.support" % "customtabs" % "25.1.0" ::
"com.android.support" % "design" % "25.1.0" :: "com.android.support" % "design" % "25.1.0" ::
"com.android.support" % "gridlayout-v7" % "25.1.0" :: "com.android.support" % "gridlayout-v7" % "25.1.0" ::
"com.android.support" % "preference-v14" % "25.1.0" :: "com.android.support" % "preference-v14" % "25.1.0" ::
......
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M11,18h2v-2h-2v2zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM12,6c-2.21,0 -4,1.79 -4,4h2c0,-1.1 0.9,-2 2,-2s2,0.9 2,2c0,2 -3,1.75 -3,5h2c0,-2.25 3,-2.5 3,-5 0,-2.21 -1.79,-4 -4,-4z"/>
</vector>
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
<string name="profiles">配置文件</string> <string name="profiles">配置文件</string>
<string name="settings">设置选项</string> <string name="settings">设置选项</string>
<string name="remove_profile">删除此配置文件「%s」?</string> <string name="remove_profile">删除此配置文件「%s」?</string>
<string name="faq">常见问题</string>
<string name="recovery">重置</string> <string name="recovery">重置</string>
<string name="about">关于</string> <string name="about">关于</string>
<string name="about_title">影梭(shadowsocks)%s</string> <string name="about_title">影梭(shadowsocks)%s</string>
......
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
<string name="profiles">設定檔</string> <string name="profiles">設定檔</string>
<string name="settings">設定</string> <string name="settings">設定</string>
<string name="remove_profile">移除此設定檔 "%s"?</string> <string name="remove_profile">移除此設定檔 "%s"?</string>
<string name="faq">常問問題</string>
<string name="recovery">重設</string> <string name="recovery">重設</string>
<string name="about">關於</string> <string name="about">關於</string>
<string name="about_title">Shadowsocks %s</string> <string name="about_title">Shadowsocks %s</string>
......
...@@ -97,6 +97,8 @@ ...@@ -97,6 +97,8 @@
<!-- menu category --> <!-- menu category -->
<string name="profiles">Profiles</string> <string name="profiles">Profiles</string>
<string name="settings">Settings</string> <string name="settings">Settings</string>
<string name="faq">FAQ</string>
<string name="faq_url">https://github.com/shadowsocks/shadowsocks-android/blob/master/.github/faq.md</string>
<string name="recovery">Reset</string> <string name="recovery">Reset</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>
......
...@@ -28,9 +28,10 @@ import android.app.backup.BackupManager ...@@ -28,9 +28,10 @@ import android.app.backup.BackupManager
import android.app.{Activity, ProgressDialog} import android.app.{Activity, ProgressDialog}
import android.content.SharedPreferences.OnSharedPreferenceChangeListener import android.content.SharedPreferences.OnSharedPreferenceChangeListener
import android.content._ import android.content._
import android.net.VpnService import android.net.{Uri, VpnService}
import android.nfc.{NdefMessage, NfcAdapter} import android.nfc.{NdefMessage, NfcAdapter}
import android.os.{Build, Bundle, Handler, Message} import android.os.{Build, Bundle, Handler, Message}
import android.support.customtabs.CustomTabsIntent
import android.support.design.widget.{FloatingActionButton, Snackbar} import android.support.design.widget.{FloatingActionButton, Snackbar}
import android.support.v4.content.ContextCompat import android.support.v4.content.ContextCompat
import android.support.v7.app.AlertDialog import android.support.v7.app.AlertDialog
...@@ -60,6 +61,7 @@ object MainActivity { ...@@ -60,6 +61,7 @@ object MainActivity {
private final val DRAWER_GLOBAL_SETTINGS = 1L private final val DRAWER_GLOBAL_SETTINGS = 1L
private final val DRAWER_RECOVERY = 2L private final val DRAWER_RECOVERY = 2L
private final val DRAWER_ABOUT = 3L private final val DRAWER_ABOUT = 3L
private final val DRAWER_FAQ = 4L
} }
class MainActivity extends Activity with ServiceBoundContext with Drawer.OnDrawerItemClickListener class MainActivity extends Activity with ServiceBoundContext with Drawer.OnDrawerItemClickListener
...@@ -84,6 +86,9 @@ class MainActivity extends Activity with ServiceBoundContext with Drawer.OnDrawe ...@@ -84,6 +86,9 @@ class MainActivity extends Activity with ServiceBoundContext with Drawer.OnDrawe
private lazy val profilesFragment = new ProfilesFragment() private lazy val profilesFragment = new ProfilesFragment()
private lazy val globalSettingsFragment = new GlobalSettingsFragment() private lazy val globalSettingsFragment = new GlobalSettingsFragment()
private lazy val aboutFragment = new AboutFragment() private lazy val aboutFragment = new AboutFragment()
private lazy val customTabsIntent = new CustomTabsIntent.Builder()
.setToolbarColor(ContextCompat.getColor(this, R.color.material_primary_500))
.build()
// Services // Services
var state: Int = _ var state: Int = _
...@@ -193,6 +198,12 @@ class MainActivity extends Activity with ServiceBoundContext with Drawer.OnDrawe ...@@ -193,6 +198,12 @@ class MainActivity extends Activity with ServiceBoundContext with Drawer.OnDrawe
.withIconTintingEnabled(true) .withIconTintingEnabled(true)
) )
.addStickyDrawerItems( .addStickyDrawerItems(
new PrimaryDrawerItem()
.withIdentifier(DRAWER_FAQ)
.withName(R.string.faq)
.withIcon(AppCompatResources.getDrawable(this, R.drawable.ic_action_help_outline))
.withIconTintingEnabled(true)
.withSelectable(false),
new PrimaryDrawerItem() new PrimaryDrawerItem()
.withIdentifier(DRAWER_RECOVERY) .withIdentifier(DRAWER_RECOVERY)
.withName(R.string.recovery) .withName(R.string.recovery)
...@@ -363,6 +374,7 @@ class MainActivity extends Activity with ServiceBoundContext with Drawer.OnDrawe ...@@ -363,6 +374,7 @@ class MainActivity extends Activity with ServiceBoundContext with Drawer.OnDrawe
case DRAWER_ABOUT => case DRAWER_ABOUT =>
app.track(TAG, "about") app.track(TAG, "about")
displayFragment(aboutFragment) displayFragment(aboutFragment)
case DRAWER_FAQ => customTabsIntent.launchUrl(this, Uri.parse(getString(R.string.faq_url)))
} }
true // unexpected cases will throw exception true // unexpected cases will throw exception
} }
......
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