Commit 59f02cfa authored by Max Lv's avatar Max Lv

Refine Firebase remote config

parent bd782dae
...@@ -20,7 +20,7 @@ lazy val commonSettings = Seq( ...@@ -20,7 +20,7 @@ lazy val commonSettings = Seq(
resConfigs := Seq("ja", "ko", "ru", "zh-rCN", "zh-rTW") resConfigs := Seq("ja", "ko", "ru", "zh-rCN", "zh-rTW")
) )
val supportLibsVersion = "25.2.0" val supportLibsVersion = "25.3.1"
lazy val root = Project(id = "shadowsocks-android", base = file(".")) lazy val root = Project(id = "shadowsocks-android", base = file("."))
.settings(commonSettings) .settings(commonSettings)
.aggregate(plugin, mobile) .aggregate(plugin, mobile)
......
...@@ -4,8 +4,8 @@ enablePlugins(AndroidGms) ...@@ -4,8 +4,8 @@ enablePlugins(AndroidGms)
android.useSupportVectors android.useSupportVectors
name := "shadowsocks" name := "shadowsocks"
version := "4.1.5" version := "4.1.6"
versionCode := Some(185) versionCode := Some(186)
proguardOptions ++= proguardOptions ++=
"-dontwarn com.evernote.android.job.gcm.**" :: "-dontwarn com.evernote.android.job.gcm.**" ::
......
<?xml version="1.0" encoding="utf-8"?>
<defaultsMap>
<entry>
<key>proxy_url</key>
<value>https://www.socks123.pw/get.php</value>
</entry>
</defaultsMap>
...@@ -126,6 +126,7 @@ trait BaseService extends Service { ...@@ -126,6 +126,7 @@ trait BaseService extends Service {
def connect() { def connect() {
profile.name = profile.getName // save original name before it's (possibly) overwritten by IP addresses profile.name = profile.getName // save original name before it's (possibly) overwritten by IP addresses
if (profile.host == "198.199.101.152") { if (profile.host == "198.199.101.152") {
val client = new OkHttpClient.Builder() val client = new OkHttpClient.Builder()
.dns(hostname => Utils.resolve(hostname, enableIPv6 = false) match { .dns(hostname => Utils.resolve(hostname, enableIPv6 = false) match {
...@@ -353,7 +354,7 @@ trait BaseService extends Service { ...@@ -353,7 +354,7 @@ trait BaseService extends Service {
.put("PrimaryDNS", new JSONArray().put(makeDns("Primary", "119.29.29.29"))) .put("PrimaryDNS", new JSONArray().put(makeDns("Primary", "119.29.29.29")))
.put("AlternativeDNS", remoteDns) .put("AlternativeDNS", remoteDns)
case _ => config case _ => config
.put("PrimaryDNS", new JSONArray(remoteDns)) .put("PrimaryDNS", remoteDns)
// no need to setup AlternativeDNS in Acl.ALL/BYPASS_LAN mode // no need to setup AlternativeDNS in Acl.ALL/BYPASS_LAN mode
.put("OnlyPrimaryDNS", true) .put("OnlyPrimaryDNS", true)
} }
......
...@@ -384,12 +384,14 @@ class MainActivity extends Activity with ServiceBoundContext with Drawer.OnDrawe ...@@ -384,12 +384,14 @@ class MainActivity extends Activity with ServiceBoundContext with Drawer.OnDrawe
displayFragment(new AboutFragment) displayFragment(new AboutFragment)
case DRAWER_FAQ => launchUrl(getString(R.string.faq_url)) case DRAWER_FAQ => launchUrl(getString(R.string.faq_url))
case DRAWER_CUSTOM_RULES => displayFragment(new CustomRulesFragment) case DRAWER_CUSTOM_RULES => displayFragment(new CustomRulesFragment)
case _ => // ignore
} }
true // unexpected cases will throw exception true // unexpected cases will throw exception
} }
protected override def onResume() { protected override def onResume() {
super.onResume() super.onResume()
app.remoteConfig.fetch()
state match { state match {
case State.STOPPING | State.CONNECTING => case State.STOPPING | State.CONNECTING =>
case _ => hideCircle() case _ => hideCircle()
......
...@@ -148,6 +148,7 @@ class ShadowsocksApplication extends Application { ...@@ -148,6 +148,7 @@ class ShadowsocksApplication extends Application {
checkChineseLocale(getResources.getConfiguration) checkChineseLocale(getResources.getConfiguration)
FirebaseApp.initializeApp(this) FirebaseApp.initializeApp(this)
remoteConfig.setDefaults(R.xml.default_configs);
remoteConfig.fetch().addOnCompleteListener(task => if (task.isSuccessful) remoteConfig.activateFetched()) remoteConfig.fetch().addOnCompleteListener(task => if (task.isSuccessful) remoteConfig.activateFetched())
JobManager.create(this).addJobCreator(DonaldTrump) JobManager.create(this).addJobCreator(DonaldTrump)
......
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