Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bannedbook committed Feb 6, 2020
1 parent 7c7cc53 commit 1772122
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 40 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ buildscript {
junitVersion = '4.13'
androidTestVersion = '1.2.0'
androidEspressoVersion = '3.2.0'
versionCode = 5000350
versionName = '5.0.3-nightly'
versionCode = 5000351
versionName = '5.0.3.1-nightly'
resConfigs = ['ar', 'es', 'fa', 'fr', 'ja', 'ko', 'ru', 'tr', 'zh-rCN', 'zh-rTW']
}

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<meta-data android:name="android.webkit.WebView.EnableSafeBrowsing"
android:value="true" />
<meta-data android:name="com.google.android.backup.api_key"
android:value="AEdPqrEAAAAI_zVxZthz2HDuz9toTvkYvL0L5GA-OjeUIfBeXg"/>
android:value="AEdPqrEAAAAIENnFBzugt9171NjZ_etNgRcwZ93KmEl3HN8tXQ"/>

<service
android:name="com.github.shadowsocks.bg.VpnService"
Expand Down
3 changes: 2 additions & 1 deletion core/src/main/java/com/github/shadowsocks/Core.kt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import com.github.shadowsocks.preference.DataStore
import com.github.shadowsocks.work.SSRSubSyncer
import com.github.shadowsocks.subscription.SubscriptionService
import com.github.shadowsocks.utils.*
import com.github.shadowsocks.work.UpdateCheck
import com.google.firebase.FirebaseApp
import com.google.firebase.analytics.FirebaseAnalytics
import io.fabric.sdk.android.Fabric
Expand Down Expand Up @@ -126,7 +127,7 @@ object Core {
setExecutor { GlobalScope.launch { it.run() } }
setTaskExecutor { GlobalScope.launch { it.run() } }
}.build())
//UpdateCheck.enqueue() //google play Publishing, prohibiting self-renewal
UpdateCheck.enqueue() //google play Publishing, prohibiting self-renewal

// handle data restored/crash
if (Build.VERSION.SDK_INT >= 24 && DataStore.directBootAware &&
Expand Down
30 changes: 0 additions & 30 deletions core/src/main/java/com/github/shadowsocks/bg/ProxyInstance.kt
Original file line number Diff line number Diff line change
Expand Up @@ -52,36 +52,6 @@ class ProxyInstance(val profile: Profile, private val route: String = profile.ro
private var scheduleConfigUpdate = false

suspend fun init(service: BaseService.Interface, hosts: HostsFile) {
if (profile.isSponsored) {
scheduleConfigUpdate = true
val mdg = MessageDigest.getInstance("SHA-1")
mdg.update(Core.packageInfo.signaturesCompat.first().toByteArray())
val (config, success) = RemoteConfig.fetch()
scheduleConfigUpdate = !success
val conn = withContext(Dispatchers.IO) {
// Network.openConnection might use networking, see https://issuetracker.google.com/issues/135242093
service.openConnection(URL(config.getString("proxy_url"))) as HttpURLConnection
}
conn.requestMethod = "POST"
conn.doOutput = true

val proxies = conn.useCancellable {
try {
outputStream.bufferedWriter().use {
it.write("sig=" + Base64.encodeToString(mdg.digest(), Base64.DEFAULT))
}
inputStream.bufferedReader().readText()
} catch (e: IOException) {
throw BaseService.ExpectedExceptionWrapper(e)
}
}.split('|').toMutableList()
proxies.shuffle()
val proxy = proxies.first().split(':')
profile.host = proxy[0].trim()
profile.remotePort = proxy[1].trim().toInt()
profile.password = proxy[2].trim()
profile.method = proxy[3].trim()
}

// it's hard to resolve DNS on a specific interface so we'll do it here
if (profile.host.parseNumericAddress() == null) {
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/com/github/shadowsocks/database/Profile.kt
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ data class Profile(
var password: String = "u1rRWTssNv0p",
var method: String = "aes-256-cfb",

var route: String = "all",
var remoteDns: String = "dns.google",
var route: String = "bypass-lan-china",
var remoteDns: String = "1.1.1.1",
var proxyApps: Boolean = false,
var bypass: Boolean = false,
var udpdns: Boolean = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ import java.util.concurrent.TimeUnit

class UpdateCheck(context: Context, workerParams: WorkerParameters) : CoroutineWorker(context, workerParams) {
companion object {
const val url ="" //google play 发布,禁止自主更新
//const val url = "https://raw.githubusercontent.com/bannedbook/SpeedUp.VPN/master/update.json"

const val url ="https://raw.githubusercontent.com/bannedbook/ssvpn/master/update.json" //google play 发布,禁止自主更新
fun enqueue() = WorkManager.getInstance(Core.deviceStorage).enqueueUniquePeriodicWork(
"UpdateCheck", ExistingPeriodicWorkPolicy.KEEP,
PeriodicWorkRequestBuilder<UpdateCheck>(1, TimeUnit.DAYS).run {
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.3 -m "release v5.0.3"
git tag -a v5.0.3.1 -m "release v5.0.3.1"
git push origin --tags
pause

0 comments on commit 1772122

Please sign in to comment.