From 0612a004748a9d55674dcc769098540267f1bd29 Mon Sep 17 00:00:00 2001 From: Mygod Date: Fri, 25 Dec 2015 23:00:39 +0800 Subject: [PATCH 1/3] Remove deprecated permission --- src/main/AndroidManifest.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml index 4f6479b9..f17450ae 100644 --- a/src/main/AndroidManifest.xml +++ b/src/main/AndroidManifest.xml @@ -6,7 +6,6 @@ - Date: Fri, 25 Dec 2015 23:26:27 +0800 Subject: [PATCH 2/3] Fix upgrading database from 13 --- .../scala/com/github/shadowsocks/database/DBHelper.scala | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/main/scala/com/github/shadowsocks/database/DBHelper.scala b/src/main/scala/com/github/shadowsocks/database/DBHelper.scala index afd64535..d1be0107 100644 --- a/src/main/scala/com/github/shadowsocks/database/DBHelper.scala +++ b/src/main/scala/com/github/shadowsocks/database/DBHelper.scala @@ -110,16 +110,11 @@ class DBHelper(val context: Context) profileDao.executeRawNoArgs("ALTER TABLE `profile` ADD COLUMN rx LONG;") profileDao.executeRawNoArgs("ALTER TABLE `profile` ADD COLUMN date VARCHAR;") } - if (oldVersion < 14) { - for (profile <- profileDao.queryForAll.asScala) { - profile.individual = updateProxiedApps(context, profile.individual) - profileDao.update(profile) - } - } if (oldVersion < 15) { profileDao.executeRawNoArgs("ALTER TABLE `profile` ADD COLUMN userOrder LONG;") var i = 0 for (profile <- profileDao.queryForAll.asScala) { + if (oldVersion < 14) profile.individual = updateProxiedApps(context, profile.individual) profile.userOrder = i profileDao.update(profile) i += 1 From 92c8e0856c75514c9c5fb255fb096f954b4b3422 Mon Sep 17 00:00:00 2001 From: Mygod Date: Sat, 26 Dec 2015 00:00:11 +0800 Subject: [PATCH 3/3] Hide adview if default profile is no longer active --- src/main/scala/com/github/shadowsocks/Shadowsocks.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/scala/com/github/shadowsocks/Shadowsocks.scala b/src/main/scala/com/github/shadowsocks/Shadowsocks.scala index d2c6646d..2c739d72 100644 --- a/src/main/scala/com/github/shadowsocks/Shadowsocks.scala +++ b/src/main/scala/com/github/shadowsocks/Shadowsocks.scala @@ -450,13 +450,13 @@ class Shadowsocks private def updatePreferenceScreen() { val profile = currentProfile - if (profile.host == "198.199.101.152" && adView == null) { + if (profile.host == "198.199.101.152") if (adView == null) { adView = new AdView(this) adView.setAdUnitId("ca-app-pub-9097031975646651/7760346322") adView.setAdSize(AdSize.SMART_BANNER) preferences.getView.asInstanceOf[ViewGroup].addView(adView, 0) adView.loadAd(new AdRequest.Builder().build()) - } + } else adView.setVisibility(View.VISIBLE) else if (adView != null) adView.setVisibility(View.GONE) preferences.update(profile) }