Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bannedbook committed Apr 21, 2020
1 parent dbb7ec3 commit ace8915
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 21 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ buildscript {
compileSdkVersion = 29
buildToolsVersion = '29.0.3'
desugarLibsVersion = '1.0.5'
versionCode = 420
versionName = '5.0.6R'
versionCode = 421
versionName = '5.0.6.1R'
resConfigs = ['ar', 'es', 'fa', 'fr', 'ja', 'ko', 'ru', 'tr', 'zh-rCN', 'zh-rTW']
}

Expand All @@ -24,7 +24,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:4.0.0-beta03'
classpath 'com.android.tools.build:gradle:4.0.0-beta04'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath 'com.google.gms:google-services:4.3.3'
classpath 'io.fabric.tools:gradle:1.31.2'
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/SpeedUpVPN/VpnEncrypt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ object VpnEncrypt{
private const val theKey="your aes key"
const val freesuburl="https://raw.githubusercontent.com/ssrsub/ssr/master/ssrsub"
const val vpnGroupName="SpeedUp.VPN"
const val freesubGroupName="free.SSR"
const val freesubGroupName="https://git.io/jmsfq"
const val testing="test..."
@JvmStatic fun aesEncrypt(v:String, secretKey:String=theKey) = AES256.encrypt(v, secretKey)
@JvmStatic fun aesDecrypt(v:String, secretKey:String=theKey) = AES256.decrypt(v, secretKey)
Expand Down
19 changes: 12 additions & 7 deletions core/src/main/java/com/github/shadowsocks/Core.kt
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,18 @@ object Core {
}

fun alertMessage(msg: String,activity:Context) {
val builder: AlertDialog.Builder? = activity.let {
AlertDialog.Builder(activity)
try {
if(activity==null || (activity as Activity).isFinishing)return

val builder: AlertDialog.Builder? = activity.let {
AlertDialog.Builder(activity)
}
builder?.setMessage(msg)?.setTitle("SpeedUp VPN")?.setPositiveButton("ok", DialogInterface.OnClickListener {
_, _ ->
})
val dialog: AlertDialog? = builder?.create()
dialog?.show()
}
builder?.setMessage(msg)?.setTitle("SS VPN")?.setPositiveButton("ok", DialogInterface.OnClickListener {
_, _ ->
})
val dialog: AlertDialog? = builder?.create()
dialog?.show()
catch (t:Throwable){}
}
}
3 changes: 3 additions & 0 deletions core/src/main/java/com/github/shadowsocks/database/SSRSub.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ class SSRSub(
@Query("SELECT * FROM `SSRSub` WHERE `id` = :id")
operator fun get(id: Long): SSRSub?

@Query("SELECT * FROM `SSRSub` WHERE `url_group` = :url_group")
fun getByGroup(url_group: String): SSRSub?

@Query("DELETE FROM `SSRSub` WHERE `id` = :id")
fun delete(id: Long): Int

Expand Down
6 changes: 3 additions & 3 deletions core/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@
<string name="title_ping_all_server">测试全部配置Tcping</string>
<string name="title_real_ping_all_server">测试全部配置真连接</string>
<string name="title_retest_invalid_servers">再测无效服务器</string>
<string name="title_remove_invalid_servers">删除无效服务器</string>
<string name="title_remove_invalid_servers">删除无效/按组排序</string>
<string name="title_sort_servers_by_speed">按测速结果排序</string>
<string name="toast_test_ended">啊!测试结束啦!</string>
<string name="toast_test_interrupted">服务器:s或前一个服务器导致测试中断,请检查之。</string>
<string name="toast_test_interrupted">"服务器:%s或前一个服务器导致测试中断,请检查之。"</string>
<string name="recommended_site_1">"<![CDATA[
<html xmlns='http://www.w3.org/1999/xhtml' dir='ltr' lang='zh-CN'>
<head profile='http://gmpg.org/xfn/11'>
Expand All @@ -205,7 +205,7 @@
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
</head>
<body style=\'margin:0 auto;padding:5px 0;font-size:14px;text-align:center\'>
<a href=\'https://www.bannedbook.org/?utm_source=speedup.vpn.cn\' style=\'color:#e4f2fd\'>翻墙必看:每日热点禁闻,武汉肺炎内幕挖掘,疫情追踪</a>
<a href=\'https://www.bannedbook.org/?utm_source=speedup.vpn.cn\' style=\'color:#e4f2fd\'>翻墙必看:每日热点禁闻,火爆评论,精彩视频</a>
</body>
</html>
]]>"</string>
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@
<string name="title_ping_all_server">測試全部配置Tcping</string>
<string name="title_real_ping_all_server">測試全部配置真連接</string>
<string name="title_retest_invalid_servers">再測無效伺服器</string>
<string name="title_remove_invalid_servers">刪除無效伺服器</string>
<string name="title_remove_invalid_servers">刪除無效/按組排序</string>
<string name="title_sort_servers_by_speed">按測速結果排序</string>
<string name="toast_test_ended">啊!測試結束啦!</string>
<string name="toast_test_interrupted">伺服器:s或前一個伺服器導致測試中斷,請檢查之。</string>
<string name="toast_test_interrupted">"伺服器:%s或前一個伺服器導致測試中斷,請檢查之。"</string>
<string name="recommended_site_1"><![CDATA[
<html>
<body style=\'margin:0;padding:0;font-size:14px;text-align:right\'>
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
<string name="title_ping_all_server">Tcping all servers</string>
<string name="title_real_ping_all_server">Real test all servers</string>
<string name="title_retest_invalid_servers">Re-test invalid servers</string>
<string name="title_remove_invalid_servers">Remove invalid servers</string>
<string name="title_remove_invalid_servers">Remove invalid/Sort By Group</string>
<string name="title_sort_servers_by_speed">Sort servers by speed</string>
<string name="toast_test_ended">The test ended successfully</string>
<string name="toast_test_interrupted">Server:%s or the previous one caused the test to be interrupted, please check them.</string>
Expand Down
2 changes: 1 addition & 1 deletion gitupdate.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ git pull origin master
git add -A
git commit -m "update"
git push origin master
git tag -a v5.0.6 -m "release v5.0.6"
git tag -a v5.0.6.1 -m "release v5.0.6.1"
git push origin --tags
pause
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

package com.github.shadowsocks

import SpeedUpVPN.VpnEncrypt
import android.app.Activity
import android.content.Intent
import android.os.Build
Expand All @@ -30,6 +31,9 @@ import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.SwitchPreference
import com.github.shadowsocks.bg.BaseService
import com.github.shadowsocks.database.PrivateDatabase
import com.github.shadowsocks.database.SSRSub
import com.github.shadowsocks.database.SSRSubManager
import com.github.shadowsocks.net.TcpFastOpen
import com.github.shadowsocks.plugin.showAllowingStateLoss
import com.github.shadowsocks.preference.*
Expand Down Expand Up @@ -59,6 +63,13 @@ class GlobalSettingsPreferenceFragment : PreferenceFragmentCompat() {
findPreference<SwitchPreference>(Key.is_get_free_servers)!!.setOnPreferenceChangeListener { _, value ->
DataStore.publicStore.putBoolean(Key.is_get_free_servers, value as Boolean)
if(value)Core.importFreeSubs()
if(!value){
val freesub= PrivateDatabase.ssrSubDao.getByGroup(VpnEncrypt.freesubGroupName)
if (freesub!=null) {
SSRSubManager.deletProfiles(freesub)
SSRSubManager.delSSRSub(freesub.id)
}
}
true
}
findPreference<SwitchPreference>(Key.persistAcrossReboot)!!.setOnPreferenceChangeListener { _, value ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ class ProfilesFragment : ToolbarFragment(), Toolbar.OnMenuItemClickListener {
}
}.asSequence().toList().reversed()) {
try {
val viewHolder = profilesList.findViewHolderForAdapterPosition(i) as ProfileViewHolder
var viewHolder = profilesList.findViewHolderForAdapterPosition(i)
if(viewHolder==null)continue
viewHolder = viewHolder as ProfileViewHolder
if (true /*viewHolder.item.isBuiltin()*/) {
viewHolder.populateUnifiedNativeAdView(nativeAd!!, nativeAdView!!)
// might be in the middle of a layout after scrolling, need to wait
Expand Down Expand Up @@ -264,7 +266,7 @@ class ProfilesFragment : ToolbarFragment(), Toolbar.OnMenuItemClickListener {
// This method tells the Google Mobile Ads SDK that you have finished populating your
// native ad view with this native ad.
adView.setNativeAd(nativeAd)
adView.setBackgroundColor(Color.WHITE) //Adding dividing line for ads
//adView.setBackgroundColor(Color.WHITE) //Adding dividing line for ads
adContainer.setPadding(0,1,0,0) //Adding dividing line for ads
adContainer.addView(adView)
adHost = this
Expand Down Expand Up @@ -670,6 +672,9 @@ class ProfilesFragment : ToolbarFragment(), Toolbar.OnMenuItemClickListener {
//profilesAdapter.remove(k)
}
}
val list=profilesAdapter.profiles.sortedWith(compareBy({ it.url_group }, { it.elapsed }))
profilesAdapter.profiles.clear()
profilesAdapter.profiles.addAll(list)
profilesAdapter.notifyDataSetChanged()
}
catch (e:Exception){
Expand Down
2 changes: 1 addition & 1 deletion mobile/src/main/res/layout/layout_profile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@
</RelativeLayout>

<LinearLayout
android:background="#cccccc"
android:id="@+id/ad_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginLeft="16dp"
android:orientation="vertical" />
</LinearLayout>

0 comments on commit ace8915

Please sign in to comment.