diff --git a/.github/faq.md b/.github/faq.md new file mode 100644 index 00000000..d8bb966f --- /dev/null +++ b/.github/faq.md @@ -0,0 +1,58 @@ +### 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. + diff --git a/build.sbt b/build.sbt index e6f3ae3b..fa1ae0d9 100644 --- a/build.sbt +++ b/build.sbt @@ -33,6 +33,7 @@ resConfigs := Seq("ja", "ru", "zh-rCN", "zh-rTW") resolvers += Resolver.jcenterRepo libraryDependencies ++= "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" % "gridlayout-v7" % "25.1.0" :: "com.android.support" % "preference-v14" % "25.1.0" :: diff --git a/src/main/res/drawable/ic_action_help_outline.xml b/src/main/res/drawable/ic_action_help_outline.xml new file mode 100644 index 00000000..e7cf8ea2 --- /dev/null +++ b/src/main/res/drawable/ic_action_help_outline.xml @@ -0,0 +1,9 @@ + + + diff --git a/src/main/res/values-zh-rCN/strings.xml b/src/main/res/values-zh-rCN/strings.xml index f70c282b..e61589e9 100644 --- a/src/main/res/values-zh-rCN/strings.xml +++ b/src/main/res/values-zh-rCN/strings.xml @@ -53,6 +53,7 @@ 配置文件 设置选项 删除此配置文件「%s」? + 常见问题 重置 关于 影梭(shadowsocks)%s diff --git a/src/main/res/values-zh-rTW/strings.xml b/src/main/res/values-zh-rTW/strings.xml index 6f75eeb5..0a25a95e 100644 --- a/src/main/res/values-zh-rTW/strings.xml +++ b/src/main/res/values-zh-rTW/strings.xml @@ -54,6 +54,7 @@ 設定檔 設定 移除此設定檔 "%s"? + 常問問題 重設 關於 Shadowsocks %s diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index f5e5e3a3..5757db9b 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -97,6 +97,8 @@ Profiles Settings + FAQ + https://github.com/shadowsocks/shadowsocks-android/blob/master/.github/faq.md Reset About Shadowsocks %s diff --git a/src/main/scala/com/github/shadowsocks/MainActivity.scala b/src/main/scala/com/github/shadowsocks/MainActivity.scala index 48b00a0d..178ff6a9 100644 --- a/src/main/scala/com/github/shadowsocks/MainActivity.scala +++ b/src/main/scala/com/github/shadowsocks/MainActivity.scala @@ -28,9 +28,10 @@ import android.app.backup.BackupManager import android.app.{Activity, ProgressDialog} import android.content.SharedPreferences.OnSharedPreferenceChangeListener import android.content._ -import android.net.VpnService +import android.net.{Uri, VpnService} import android.nfc.{NdefMessage, NfcAdapter} import android.os.{Build, Bundle, Handler, Message} +import android.support.customtabs.CustomTabsIntent import android.support.design.widget.{FloatingActionButton, Snackbar} import android.support.v4.content.ContextCompat import android.support.v7.app.AlertDialog @@ -60,6 +61,7 @@ object MainActivity { private final val DRAWER_GLOBAL_SETTINGS = 1L private final val DRAWER_RECOVERY = 2L private final val DRAWER_ABOUT = 3L + private final val DRAWER_FAQ = 4L } class MainActivity extends Activity with ServiceBoundContext with Drawer.OnDrawerItemClickListener @@ -84,6 +86,9 @@ class MainActivity extends Activity with ServiceBoundContext with Drawer.OnDrawe private lazy val profilesFragment = new ProfilesFragment() private lazy val globalSettingsFragment = new GlobalSettingsFragment() private lazy val aboutFragment = new AboutFragment() + private lazy val customTabsIntent = new CustomTabsIntent.Builder() + .setToolbarColor(ContextCompat.getColor(this, R.color.material_primary_500)) + .build() // Services var state: Int = _ @@ -193,6 +198,12 @@ class MainActivity extends Activity with ServiceBoundContext with Drawer.OnDrawe .withIconTintingEnabled(true) ) .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() .withIdentifier(DRAWER_RECOVERY) .withName(R.string.recovery) @@ -363,6 +374,7 @@ class MainActivity extends Activity with ServiceBoundContext with Drawer.OnDrawe case DRAWER_ABOUT => app.track(TAG, "about") displayFragment(aboutFragment) + case DRAWER_FAQ => customTabsIntent.launchUrl(this, Uri.parse(getString(R.string.faq_url))) } true // unexpected cases will throw exception }