Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bannedbook committed May 26, 2020
1 parent a1eb655 commit 7fb43f6
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 56 deletions.
6 changes: 3 additions & 3 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 = 5000758
versionName = '5.1.0-nightly'
versionCode = 5000768
versionName = '5.1.1-nightly'
resConfigs = ['ar', 'es', 'fa', 'fr', 'ja', 'ko', 'ru', 'tr', 'zh-rCN', 'zh-rTW']
}

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

dependencies {
classpath 'com.android.tools.build:gradle:4.0.0-beta05'
classpath 'com.android.tools.build:gradle:4.0.0-rc01'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.27.0'
classpath 'com.google.android.gms:oss-licenses-plugin:0.9.5'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.0.0-beta04'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ object SSRSubManager {
}

val count = profiles.count()

var limitProfiles:ArrayList<Profile> = arrayListOf()

if (limit != -1 && limit < count) {
Expand Down
102 changes: 51 additions & 51 deletions core/src/main/java/com/github/shadowsocks/database/V2rayConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@ package com.github.shadowsocks.database

data class V2rayConfig(
val stats: Any?=null,
val log: LogBean,
val policy: PolicyBean,
val inbounds: ArrayList<InboundBean>,
var outbounds: ArrayList<OutboundBean>,
var dns: DnsBean,
val routing: RoutingBean) {
val log: LogBean = LogBean(),
val policy: PolicyBean = PolicyBean(),
val inbounds: ArrayList<InboundBean> = arrayListOf(InboundBean()),
var outbounds: ArrayList<OutboundBean> = arrayListOf(OutboundBean()),
var dns: DnsBean = DnsBean(),
val routing: RoutingBean = RoutingBean()) {

data class LogBean(val access: String,
val error: String,
val loglevel: String)
data class LogBean(val access: String="",
val error: String="",
val loglevel: String="")

data class InboundBean(
var tag: String,
var port: Int,
var protocol: String,
var tag: String ="",
var port: Int?=null,
var protocol: String ="",
var listen: String?=null,
val settings: InSettingsBean,
val sniffing: SniffingBean?) {
val settings: InSettingsBean?=InSettingsBean(),
val sniffing: SniffingBean?=SniffingBean()) {

data class InSettingsBean(val auth: String? = null,
val udp: Boolean? = null,
Expand All @@ -28,48 +28,48 @@ data class V2rayConfig(
val port: Int? = null,
val network: String? = null)

data class SniffingBean(var enabled: Boolean,
val destOverride: List<String>)
data class SniffingBean(var enabled: Boolean?=null,
val destOverride: List<String>?=null)
}

data class OutboundBean(val tag: String,
var protocol: String,
var settings: OutSettingsBean?,
var streamSettings: StreamSettingsBean?,
var mux: MuxBean?) {
data class OutboundBean(val tag: String="",
var protocol: String="",
var settings: OutSettingsBean?=OutSettingsBean(),
var streamSettings: StreamSettingsBean?=null,
var mux: MuxBean?=MuxBean()) {

data class OutSettingsBean(var vnext: List<VnextBean>?,
var servers: List<ServersBean>?,
var response: Response) {
data class OutSettingsBean(var vnext: List<VnextBean>?= listOf(VnextBean()),
var servers: List<ServersBean>?=listOf(ServersBean()),
var response: Response=Response()) {

data class VnextBean(var address: String,
var port: Int,
var users: List<UsersBean>) {
data class VnextBean(var address: String ="",
var port: Int = 0,
var users: List<UsersBean> = listOf(UsersBean())) {

data class UsersBean(var id: String,
var alterId: Int,
var security: String,
var level: Int)
data class UsersBean(var id: String="",
var alterId: Int=2,
var security: String="",
var level: Int=2)
}

data class ServersBean(var address: String,
var method: String,
var ota: Boolean,
var password: String,
var port: Int,
var level: Int)
data class ServersBean(var address: String="",
var method: String="",
var ota: Boolean=false,
var password: String="",
var port: Int=0,
var level: Int=0)

data class Response(var type: String)
data class Response(var type: String="")
}

data class StreamSettingsBean(var network: String,
var security: String,
var tcpSettings: TcpsettingsBean?,
var kcpsettings: KcpsettingsBean?,
var wssettings: WssettingsBean?,
var httpsettings: HttpsettingsBean?,
var tlssettings: TlssettingsBean?,
var quicsettings: QuicsettingBean?
data class StreamSettingsBean(var network: String="",
var security: String="",
var tcpSettings: TcpsettingsBean?=TcpsettingsBean(),
var kcpsettings: KcpsettingsBean?=KcpsettingsBean(),
var wssettings: WssettingsBean?=WssettingsBean(),
var httpsettings: HttpsettingsBean?=HttpsettingsBean(),
var tlssettings: TlssettingsBean?=TlssettingsBean(),
var quicsettings: QuicsettingBean?=QuicsettingBean()
) {

data class TcpsettingsBean(var connectionReuse: Boolean = true,
Expand Down Expand Up @@ -108,7 +108,7 @@ data class V2rayConfig(
}
}

data class MuxBean(var enabled: Boolean)
data class MuxBean(var enabled: Boolean = false)
}

//data class DnsBean(var servers: List<String>)
Expand All @@ -120,8 +120,8 @@ data class V2rayConfig(
var domains: List<String>?)
}

data class RoutingBean(var domainStrategy: String,
var rules: ArrayList<RulesBean>) {
data class RoutingBean(var domainStrategy: String="",
var rules: ArrayList<RulesBean> =arrayListOf(RulesBean())) {

data class RulesBean(var type: String = "",
var ip: ArrayList<String>? = null,
Expand All @@ -131,8 +131,8 @@ data class V2rayConfig(
var inboundTag: ArrayList<String>? = null)
}

data class PolicyBean(var levels: Map<String, LevelBean>,
var system: Any?=null) {
data class PolicyBean(var levels: Map<String, LevelBean>?= mapOf("" to LevelBean()),
var system: Any?=null) {
data class LevelBean(
var handshake: Int? = null,
var connIdle: Int? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ object V2rayConfigUtil {
}

//转成Json
val v2rayConfig = Gson().fromJson(assets, V2rayConfig::class.java) ?: return result
val theInstance=V2rayConfig()
val v2rayConfig = Gson().fromJson(assets, theInstance::class.java) ?: return result
// if (v2rayConfig == null) {
// return result
// }
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.1.0 -m "release v5.1.0"
git tag -a v5.1.1 -m "release v5.1.1"
git push origin --tags
pause

0 comments on commit 7fb43f6

Please sign in to comment.