Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
com.ccwangluo.accelerator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sheteng
com.ccwangluo.accelerator
Commits
3b7d419f
Commit
3b7d419f
authored
Aug 04, 2020
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update dependencies
parent
9b2095cc
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
73 additions
and
61 deletions
+73
-61
detekt.yml
detekt.yml
+47
-43
mobile/build.gradle.kts
mobile/build.gradle.kts
+2
-2
mobile/src/main/java/com/github/shadowsocks/AppManager.kt
mobile/src/main/java/com/github/shadowsocks/AppManager.kt
+9
-6
mobile/src/main/java/com/github/shadowsocks/ProfilesFragment.kt
.../src/main/java/com/github/shadowsocks/ProfilesFragment.kt
+8
-6
mobile/src/main/java/com/github/shadowsocks/ScannerActivity.kt
...e/src/main/java/com/github/shadowsocks/ScannerActivity.kt
+1
-0
mobile/src/main/java/com/github/shadowsocks/acl/CustomRulesFragment.kt
...in/java/com/github/shadowsocks/acl/CustomRulesFragment.kt
+3
-2
plugin/src/main/java/com/github/shadowsocks/plugin/PluginOptions.kt
.../main/java/com/github/shadowsocks/plugin/PluginOptions.kt
+2
-1
repositories.gradle.kts
repositories.gradle.kts
+1
-1
No files found.
detekt.yml
View file @
3b7d419f
# https://github.com/arturbosch/detekt/blob/
1.7.1/detekt-cli
/src/main/resources/default-detekt-config.yml
# https://github.com/arturbosch/detekt/blob/
v1.10.0/detekt-core
/src/main/resources/default-detekt-config.yml
comments
:
comments
:
active
:
false
active
:
false
...
@@ -41,14 +41,14 @@ complexity:
...
@@ -41,14 +41,14 @@ complexity:
threshold
:
4
threshold
:
4
StringLiteralDuplication
:
StringLiteralDuplication
:
active
:
true
active
:
true
excludes
:
[
'
**/test/**'
,
'
**/androidTest/**'
,
'
**/
*.Test.kt'
,
'
**/*.Spec.kt'
,
'
**/*.Spek.kt
'
]
excludes
:
[
'
**/test/**'
,
'
**/androidTest/**'
,
'
**/
commonTest/**'
,
'
**/jvmTest/**'
,
'
**/jsTest/**'
,
'
**/iosTest/**
'
]
threshold
:
3
threshold
:
3
ignoreAnnotation
:
true
ignoreAnnotation
:
true
excludeStringsWithLessThan5Characters
:
true
excludeStringsWithLessThan5Characters
:
true
ignoreStringsRegex
:
'
$^'
ignoreStringsRegex
:
'
$^'
TooManyFunctions
:
TooManyFunctions
:
active
:
true
active
:
true
excludes
:
[
'
**/test/**'
,
'
**/androidTest/**'
,
'
**/
*.Test.kt'
,
'
**/*.Spec.kt'
,
'
**/*.Spek.kt
'
]
excludes
:
[
'
**/test/**'
,
'
**/androidTest/**'
,
'
**/
commonTest/**'
,
'
**/jvmTest/**'
,
'
**/jsTest/**'
,
'
**/iosTest/**
'
]
thresholdInFiles
:
11
thresholdInFiles
:
11
thresholdInClasses
:
11
thresholdInClasses
:
11
thresholdInInterfaces
:
11
thresholdInInterfaces
:
11
...
@@ -69,7 +69,7 @@ empty-blocks:
...
@@ -69,7 +69,7 @@ empty-blocks:
active
:
true
active
:
true
EmptyCatchBlock
:
EmptyCatchBlock
:
active
:
true
active
:
true
allowedExceptionNameRegex
:
'
^(_|(ignore|expected).*)
'
allowedExceptionNameRegex
:
'
_|(ignore|expected).*
'
EmptyClassBlock
:
EmptyClassBlock
:
active
:
true
active
:
true
EmptyDefaultConstructor
:
EmptyDefaultConstructor
:
...
@@ -123,7 +123,7 @@ exceptions:
...
@@ -123,7 +123,7 @@ exceptions:
-
NumberFormatException
-
NumberFormatException
-
ParseException
-
ParseException
-
MalformedURLException
-
MalformedURLException
allowedExceptionNameRegex
:
'
^(_|(ignore|expected).*)
'
allowedExceptionNameRegex
:
'
_|(ignore|expected).*
'
ThrowingExceptionFromFinally
:
ThrowingExceptionFromFinally
:
active
:
false
active
:
false
ThrowingExceptionInMain
:
ThrowingExceptionInMain
:
...
@@ -137,18 +137,7 @@ exceptions:
...
@@ -137,18 +137,7 @@ exceptions:
ThrowingNewInstanceOfSameException
:
ThrowingNewInstanceOfSameException
:
active
:
true
active
:
true
TooGenericExceptionCaught
:
TooGenericExceptionCaught
:
active
:
true
active
:
false
excludes
:
[
'
**/test/**'
,
'
**/androidTest/**'
,
'
**/*.Test.kt'
,
'
**/*.Spec.kt'
,
'
**/*.Spek.kt'
]
exceptionNames
:
-
ArrayIndexOutOfBoundsException
-
Error
-
Exception
-
IllegalMonitorStateException
-
NullPointerException
-
IndexOutOfBoundsException
-
RuntimeException
-
Throwable
allowedExceptionNameRegex
:
'
^(_|(ignore|expected).*)'
TooGenericExceptionThrown
:
TooGenericExceptionThrown
:
active
:
true
active
:
true
exceptionNames
:
exceptionNames
:
...
@@ -162,8 +151,7 @@ formatting:
...
@@ -162,8 +151,7 @@ formatting:
android
:
true
android
:
true
autoCorrect
:
true
autoCorrect
:
true
AnnotationOnSeparateLine
:
AnnotationOnSeparateLine
:
active
:
true
active
:
false
autoCorrect
:
true
ChainWrapping
:
ChainWrapping
:
active
:
true
active
:
true
autoCorrect
:
true
autoCorrect
:
true
...
@@ -179,12 +167,11 @@ formatting:
...
@@ -179,12 +167,11 @@ formatting:
autoCorrect
:
true
autoCorrect
:
true
insertFinalNewLine
:
true
insertFinalNewLine
:
true
ImportOrdering
:
ImportOrdering
:
active
:
false
Indentation
:
active
:
true
active
:
true
autoCorrect
:
true
autoCorrect
:
true
indentSize
:
4
layout
:
'
idea'
continuationIndentSize
:
4
Indentation
:
active
:
false
MaximumLineLength
:
MaximumLineLength
:
active
:
false
active
:
false
ModifierOrdering
:
ModifierOrdering
:
...
@@ -244,6 +231,9 @@ formatting:
...
@@ -244,6 +231,9 @@ formatting:
SpacingAroundDot
:
SpacingAroundDot
:
active
:
true
active
:
true
autoCorrect
:
true
autoCorrect
:
true
SpacingAroundDoubleColon
:
active
:
true
autoCorrect
:
true
SpacingAroundKeyword
:
SpacingAroundKeyword
:
active
:
true
active
:
true
autoCorrect
:
true
autoCorrect
:
true
...
@@ -256,6 +246,12 @@ formatting:
...
@@ -256,6 +246,12 @@ formatting:
SpacingAroundRangeOperator
:
SpacingAroundRangeOperator
:
active
:
true
active
:
true
autoCorrect
:
true
autoCorrect
:
true
SpacingBetweenDeclarationsWithAnnotations
:
active
:
false
autoCorrect
:
true
SpacingBetweenDeclarationsWithComments
:
active
:
false
autoCorrect
:
true
StringTemplate
:
StringTemplate
:
active
:
true
active
:
true
autoCorrect
:
true
autoCorrect
:
true
...
@@ -264,38 +260,39 @@ naming:
...
@@ -264,38 +260,39 @@ naming:
active
:
true
active
:
true
ClassNaming
:
ClassNaming
:
active
:
true
active
:
true
classPattern
:
'
[A-Z$][a-zA-Z0-9$]*'
excludes
:
[
'
**/test/**'
,
'
**/androidTest/**'
,
'
**/commonTest/**'
,
'
**/jvmTest/**'
,
'
**/jsTest/**'
,
'
**/iosTest/**'
]
excludes
:
[
'
**/test/**'
,
'
**/androidTest/**'
,
'
**/*.Test.kt'
,
'
**/*.Spec.kt'
,
'
**/*.Spek.kt'
]
classPattern
:
'
[A-Z][a-zA-Z0-9]*'
ConstructorParameterNaming
:
ConstructorParameterNaming
:
active
:
true
active
:
true
excludes
:
[
'
**/test/**'
,
'
**/androidTest/**'
,
'
**/
*.Test.kt'
,
'
**/*.Spec.kt'
,
'
**/*.Spek.kt
'
]
excludes
:
[
'
**/test/**'
,
'
**/androidTest/**'
,
'
**/
commonTest/**'
,
'
**/jvmTest/**'
,
'
**/jsTest/**'
,
'
**/iosTest/**
'
]
parameterPattern
:
'
[a-z][A-Za-z0-9]*'
parameterPattern
:
'
[a-z][A-Za-z0-9]*'
privateParameterPattern
:
'
[a-z][A-Za-z0-9]*'
privateParameterPattern
:
'
[a-z][A-Za-z0-9]*'
excludeClassPattern
:
'
$^'
excludeClassPattern
:
'
$^'
ignoreOverridden
:
true
ignoreOverridden
:
true
EnumNaming
:
EnumNaming
:
active
:
true
active
:
true
excludes
:
[
'
**/test/**'
,
'
**/androidTest/**'
,
'
**/
*.Test.kt'
,
'
**/*.Spec.kt'
,
'
**/*.Spek.kt
'
]
excludes
:
[
'
**/test/**'
,
'
**/androidTest/**'
,
'
**/
commonTest/**'
,
'
**/jvmTest/**'
,
'
**/jsTest/**'
,
'
**/iosTest/**
'
]
enumEntryPattern
:
'
^
[A-Z][_a-zA-Z0-9]*'
enumEntryPattern
:
'
[A-Z][_a-zA-Z0-9]*'
ForbiddenClassName
:
ForbiddenClassName
:
active
:
true
active
:
true
excludes
:
[
'
**/test/**'
,
'
**/androidTest/**'
,
'
**/
*.Test.kt'
,
'
**/*.Spec.kt'
,
'
**/*.Spek.kt
'
]
excludes
:
[
'
**/test/**'
,
'
**/androidTest/**'
,
'
**/
commonTest/**'
,
'
**/jvmTest/**'
,
'
**/jsTest/**'
,
'
**/iosTest/**
'
]
forbiddenName
:
[]
forbiddenName
:
[]
FunctionMaxLength
:
FunctionMaxLength
:
active
:
true
active
:
true
excludes
:
[
'
**/test/**'
,
'
**/androidTest/**'
,
'
**/
*.Test.kt'
,
'
**/*.Spec.kt'
,
'
**/*.Spek.kt
'
]
excludes
:
[
'
**/test/**'
,
'
**/androidTest/**'
,
'
**/
commonTest/**'
,
'
**/jvmTest/**'
,
'
**/jsTest/**'
,
'
**/iosTest/**
'
]
maximumFunctionNameLength
:
30
maximumFunctionNameLength
:
30
FunctionMinLength
:
FunctionMinLength
:
active
:
false
active
:
false
FunctionNaming
:
FunctionNaming
:
active
:
true
active
:
true
excludes
:
[
'
**/test/**'
,
'
**/androidTest/**'
,
'
**/
*.Test.kt'
,
'
**/*.Spec.kt'
,
'
**/*.Spek.kt
'
]
excludes
:
[
'
**/test/**'
,
'
**/androidTest/**'
,
'
**/
commonTest/**'
,
'
**/jvmTest/**'
,
'
**/jsTest/**'
,
'
**/iosTest/**
'
]
functionPattern
:
'
^([a-z$][a-zA-Z$0-9]*)|(`.*`)$
'
functionPattern
:
'
([a-z][a-zA-Z0-9]*)|(`.*`)
'
excludeClassPattern
:
'
$^'
excludeClassPattern
:
'
$^'
ignoreOverridden
:
true
ignoreOverridden
:
true
ignoreAnnotated
:
[
'
Composable'
]
FunctionParameterNaming
:
FunctionParameterNaming
:
active
:
true
active
:
true
excludes
:
[
'
**/test/**'
,
'
**/androidTest/**'
,
'
**/
*.Test.kt'
,
'
**/*.Spec.kt'
,
'
**/*.Spek.kt
'
]
excludes
:
[
'
**/test/**'
,
'
**/androidTest/**'
,
'
**/
commonTest/**'
,
'
**/jvmTest/**'
,
'
**/jsTest/**'
,
'
**/iosTest/**
'
]
parameterPattern
:
'
[a-z][A-Za-z0-9]*'
parameterPattern
:
'
[a-z][A-Za-z0-9]*'
excludeClassPattern
:
'
$^'
excludeClassPattern
:
'
$^'
ignoreOverridden
:
true
ignoreOverridden
:
true
...
@@ -309,29 +306,29 @@ naming:
...
@@ -309,29 +306,29 @@ naming:
active
:
false
active
:
false
ObjectPropertyNaming
:
ObjectPropertyNaming
:
active
:
true
active
:
true
excludes
:
[
'
**/test/**'
,
'
**/androidTest/**'
,
'
**/
*.Test.kt'
,
'
**/*.Spec.kt'
,
'
**/*.Spek.kt
'
]
excludes
:
[
'
**/test/**'
,
'
**/androidTest/**'
,
'
**/
commonTest/**'
,
'
**/jvmTest/**'
,
'
**/jsTest/**'
,
'
**/iosTest/**
'
]
constantPattern
:
'
[A-Za-z][_A-Za-z0-9]*'
constantPattern
:
'
[A-Za-z][_A-Za-z0-9]*'
propertyPattern
:
'
[A-Za-z][_A-Za-z0-9]*'
propertyPattern
:
'
[A-Za-z][_A-Za-z0-9]*'
privatePropertyPattern
:
'
(_)?[A-Za-z][_A-Za-z0-9]*'
privatePropertyPattern
:
'
(_)?[A-Za-z][_A-Za-z0-9]*'
PackageNaming
:
PackageNaming
:
active
:
true
active
:
true
excludes
:
[
'
**/test/**'
,
'
**/androidTest/**'
,
'
**/
*.Test.kt'
,
'
**/*.Spec.kt'
,
'
**/*.Spek.kt
'
]
excludes
:
[
'
**/test/**'
,
'
**/androidTest/**'
,
'
**/
commonTest/**'
,
'
**/jvmTest/**'
,
'
**/jsTest/**'
,
'
**/iosTest/**
'
]
packagePattern
:
'
^[a-z]+(\.[a-z][A-Za-z0-9]*)*$
'
packagePattern
:
'
[a-z]+(\.[a-z][A-Za-z0-9]*)*
'
TopLevelPropertyNaming
:
TopLevelPropertyNaming
:
active
:
true
active
:
true
excludes
:
[
'
**/test/**'
,
'
**/androidTest/**'
,
'
**/
*.Test.kt'
,
'
**/*.Spec.kt'
,
'
**/*.Spek.kt
'
]
excludes
:
[
'
**/test/**'
,
'
**/androidTest/**'
,
'
**/
commonTest/**'
,
'
**/jvmTest/**'
,
'
**/jsTest/**'
,
'
**/iosTest/**
'
]
constantPattern
:
'
[A-Z][_A-Z0-9]*'
constantPattern
:
'
[A-Z][_A-Z0-9]*'
propertyPattern
:
'
[A-Za-z][_A-Za-z0-9]*'
propertyPattern
:
'
[A-Za-z][_A-Za-z0-9]*'
privatePropertyPattern
:
'
_?[A-Za-z][_A-Za-z0-9]*'
privatePropertyPattern
:
'
_?[A-Za-z][_A-Za-z0-9]*'
VariableMaxLength
:
VariableMaxLength
:
active
:
true
active
:
true
excludes
:
[
'
**/test/**'
,
'
**/androidTest/**'
,
'
**/
*.Test.kt'
,
'
**/*.Spec.kt'
,
'
**/*.Spek.kt
'
]
excludes
:
[
'
**/test/**'
,
'
**/androidTest/**'
,
'
**/
commonTest/**'
,
'
**/jvmTest/**'
,
'
**/jsTest/**'
,
'
**/iosTest/**
'
]
maximumVariableNameLength
:
64
maximumVariableNameLength
:
64
VariableMinLength
:
VariableMinLength
:
active
:
false
active
:
false
VariableNaming
:
VariableNaming
:
active
:
true
active
:
true
excludes
:
[
'
**/test/**'
,
'
**/androidTest/**'
,
'
**/
*.Test.kt'
,
'
**/*.Spec.kt'
,
'
**/*.Spek.kt
'
]
excludes
:
[
'
**/test/**'
,
'
**/androidTest/**'
,
'
**/
commonTest/**'
,
'
**/jvmTest/**'
,
'
**/jsTest/**'
,
'
**/iosTest/**
'
]
variablePattern
:
'
[a-z][A-Za-z0-9]*'
variablePattern
:
'
[a-z][A-Za-z0-9]*'
privateVariablePattern
:
'
(_)?[a-z][A-Za-z0-9]*'
privateVariablePattern
:
'
(_)?[a-z][A-Za-z0-9]*'
excludeClassPattern
:
'
$^'
excludeClassPattern
:
'
$^'
...
@@ -343,10 +340,9 @@ performance:
...
@@ -343,10 +340,9 @@ performance:
active
:
true
active
:
true
ForEachOnRange
:
ForEachOnRange
:
active
:
true
active
:
true
excludes
:
[
'
**/test/**'
,
'
**/androidTest/**'
,
'
**/
*.Test.kt'
,
'
**/*.Spec.kt'
,
'
**/*.Spek.kt
'
]
excludes
:
[
'
**/test/**'
,
'
**/androidTest/**'
,
'
**/
commonTest/**'
,
'
**/jvmTest/**'
,
'
**/jsTest/**'
,
'
**/iosTest/**
'
]
SpreadOperator
:
SpreadOperator
:
active
:
true
active
:
false
excludes
:
[
'
**/test/**'
,
'
**/androidTest/**'
,
'
**/*.Test.kt'
,
'
**/*.Spec.kt'
,
'
**/*.Spek.kt'
]
UnnecessaryTemporaryInstantiation
:
UnnecessaryTemporaryInstantiation
:
active
:
true
active
:
true
...
@@ -364,8 +360,14 @@ potential-bugs:
...
@@ -364,8 +360,14 @@ potential-bugs:
active
:
true
active
:
true
HasPlatformType
:
HasPlatformType
:
active
:
true
active
:
true
IgnoredReturnValue
:
active
:
true
restrictToAnnotatedMethods
:
true
returnValueAnnotations
:
[
'
*.CheckReturnValue'
,
'
*.CheckResult'
]
ImplicitDefaultLocale
:
ImplicitDefaultLocale
:
active
:
true
active
:
true
ImplicitUnitReturnType
:
active
:
false
InvalidRange
:
InvalidRange
:
active
:
true
active
:
true
IteratorHasNextCallsNextMethod
:
IteratorHasNextCallsNextMethod
:
...
@@ -426,7 +428,7 @@ style:
...
@@ -426,7 +428,7 @@ style:
forbiddenPatterns
:
'
'
forbiddenPatterns
:
'
'
ForbiddenMethodCall
:
ForbiddenMethodCall
:
active
:
true
active
:
true
methods
:
[]
methods
:
[
'
kotlin.io.println'
,
'
kotlin.io.print'
]
ForbiddenPublicDataClass
:
ForbiddenPublicDataClass
:
active
:
true
active
:
true
ignorePackages
:
[
'
*.internal'
,
'
*.internal.*'
]
ignorePackages
:
[
'
*.internal'
,
'
*.internal.*'
]
...
@@ -448,6 +450,8 @@ style:
...
@@ -448,6 +450,8 @@ style:
active
:
false
active
:
false
MandatoryBracesIfStatements
:
MandatoryBracesIfStatements
:
active
:
false
active
:
false
MandatoryBracesLoops
:
active
:
false
MaxLineLength
:
MaxLineLength
:
active
:
true
active
:
true
maxLineLength
:
120
maxLineLength
:
120
...
...
mobile/build.gradle.kts
View file @
3b7d419f
...
@@ -18,10 +18,10 @@ dependencies {
...
@@ -18,10 +18,10 @@ dependencies {
implementation
(
"androidx.camera:camera-camera2:$cameraxVersion"
)
implementation
(
"androidx.camera:camera-camera2:$cameraxVersion"
)
implementation
(
"androidx.camera:camera-lifecycle:$cameraxVersion"
)
implementation
(
"androidx.camera:camera-lifecycle:$cameraxVersion"
)
implementation
(
"androidx.camera:camera-view:1.0.0-alpha14"
)
implementation
(
"androidx.camera:camera-view:1.0.0-alpha14"
)
implementation
(
"androidx.constraintlayout:constraintlayout:2.0.0-
beta8
"
)
implementation
(
"androidx.constraintlayout:constraintlayout:2.0.0-
rc1
"
)
implementation
(
"androidx.lifecycle:lifecycle-runtime-ktx:$lifecycleVersion"
)
implementation
(
"androidx.lifecycle:lifecycle-runtime-ktx:$lifecycleVersion"
)
implementation
(
"com.google.firebase:firebase-ads:19.3.0"
)
implementation
(
"com.google.firebase:firebase-ads:19.3.0"
)
implementation
(
"com.google.mlkit:barcode-scanning:16.0.
1
"
)
implementation
(
"com.google.mlkit:barcode-scanning:16.0.
2
"
)
implementation
(
"com.google.zxing:core:3.4.0"
)
implementation
(
"com.google.zxing:core:3.4.0"
)
implementation
(
"com.takisoft.preferencex:preferencex-simplemenu:1.1.0"
)
implementation
(
"com.takisoft.preferencex:preferencex-simplemenu:1.1.0"
)
implementation
(
"com.twofortyfouram:android-plugin-api-for-locale:1.0.4"
)
implementation
(
"com.twofortyfouram:android-plugin-api-for-locale:1.0.4"
)
...
...
mobile/src/main/java/com/github/shadowsocks/AppManager.kt
View file @
3b7d419f
...
@@ -278,8 +278,10 @@ class AppManager : AppCompatActivity() {
...
@@ -278,8 +278,10 @@ class AppManager : AppCompatActivity() {
return
true
return
true
}
}
R
.
id
.
action_export_clipboard
->
{
R
.
id
.
action_export_clipboard
->
{
Snackbar
.
make
(
list
,
if
(
Core
.
trySetPrimaryClip
(
"${DataStore.bypass}\n${DataStore.individual}"
))
val
success
=
Core
.
trySetPrimaryClip
(
"${DataStore.bypass}\n${DataStore.individual}"
)
R
.
string
.
action_export_msg
else
R
.
string
.
action_export_err
,
Snackbar
.
LENGTH_LONG
).
show
()
Snackbar
.
make
(
list
,
if
(
success
)
R
.
string
.
action_export_msg
else
R
.
string
.
action_export_err
,
Snackbar
.
LENGTH_LONG
).
show
()
return
true
return
true
}
}
R
.
id
.
action_import_clipboard
->
{
R
.
id
.
action_import_clipboard
->
{
...
@@ -287,8 +289,9 @@ class AppManager : AppCompatActivity() {
...
@@ -287,8 +289,9 @@ class AppManager : AppCompatActivity() {
if
(!
proxiedAppString
.
isNullOrEmpty
())
{
if
(!
proxiedAppString
.
isNullOrEmpty
())
{
val
i
=
proxiedAppString
.
indexOf
(
'\n'
)
val
i
=
proxiedAppString
.
indexOf
(
'\n'
)
try
{
try
{
val
(
enabled
,
apps
)
=
if
(
i
<
0
)
Pair
(
proxiedAppString
,
""
)
else
val
(
enabled
,
apps
)
=
if
(
i
<
0
)
{
Pair
(
proxiedAppString
.
substring
(
0
,
i
),
proxiedAppString
.
substring
(
i
+
1
))
proxiedAppString
to
""
}
else
proxiedAppString
.
substring
(
0
,
i
)
to
proxiedAppString
.
substring
(
i
+
1
)
bypassGroup
.
check
(
if
(
enabled
.
toBoolean
())
R
.
id
.
btn_bypass
else
R
.
id
.
btn_on
)
bypassGroup
.
check
(
if
(
enabled
.
toBoolean
())
R
.
id
.
btn_bypass
else
R
.
id
.
btn_on
)
DataStore
.
individual
=
apps
DataStore
.
individual
=
apps
DataStore
.
dirty
=
true
DataStore
.
dirty
=
true
...
@@ -307,9 +310,9 @@ class AppManager : AppCompatActivity() {
...
@@ -307,9 +310,9 @@ class AppManager : AppCompatActivity() {
override
fun
supportNavigateUpTo
(
upIntent
:
Intent
)
=
override
fun
supportNavigateUpTo
(
upIntent
:
Intent
)
=
super
.
supportNavigateUpTo
(
upIntent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_CLEAR_TOP
))
super
.
supportNavigateUpTo
(
upIntent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_CLEAR_TOP
))
override
fun
onKeyUp
(
keyCode
:
Int
,
event
:
KeyEvent
?)
=
if
(
keyCode
==
KeyEvent
.
KEYCODE_MENU
)
override
fun
onKeyUp
(
keyCode
:
Int
,
event
:
KeyEvent
?)
=
if
(
keyCode
==
KeyEvent
.
KEYCODE_MENU
)
{
if
(
toolbar
.
isOverflowMenuShowing
)
toolbar
.
hideOverflowMenu
()
else
toolbar
.
showOverflowMenu
()
if
(
toolbar
.
isOverflowMenuShowing
)
toolbar
.
hideOverflowMenu
()
else
toolbar
.
showOverflowMenu
()
else
super
.
onKeyUp
(
keyCode
,
event
)
}
else
super
.
onKeyUp
(
keyCode
,
event
)
override
fun
onDestroy
()
{
override
fun
onDestroy
()
{
instance
=
null
instance
=
null
...
...
mobile/src/main/java/com/github/shadowsocks/ProfilesFragment.kt
View file @
3b7d419f
...
@@ -324,8 +324,9 @@ class ProfilesFragment : ToolbarFragment(), Toolbar.OnMenuItemClickListener {
...
@@ -324,8 +324,9 @@ class ProfilesFragment : ToolbarFragment(), Toolbar.OnMenuItemClickListener {
true
true
}
}
R
.
id
.
action_export_clipboard
->
{
R
.
id
.
action_export_clipboard
->
{
(
activity
as
MainActivity
).
snackbar
().
setText
(
if
(
Core
.
trySetPrimaryClip
(
this
.
item
.
toString
()))
val
success
=
Core
.
trySetPrimaryClip
(
this
.
item
.
toString
())
R
.
string
.
action_export_msg
else
R
.
string
.
action_export_err
).
show
()
(
activity
as
MainActivity
).
snackbar
().
setText
(
if
(
success
)
R
.
string
.
action_export_msg
else
R
.
string
.
action_export_err
).
show
()
true
true
}
}
else
->
false
else
->
false
...
@@ -466,8 +467,9 @@ class ProfilesFragment : ToolbarFragment(), Toolbar.OnMenuItemClickListener {
...
@@ -466,8 +467,9 @@ class ProfilesFragment : ToolbarFragment(), Toolbar.OnMenuItemClickListener {
ItemTouchHelper
(
object
:
ItemTouchHelper
.
SimpleCallback
(
ItemTouchHelper
.
UP
or
ItemTouchHelper
.
DOWN
,
ItemTouchHelper
(
object
:
ItemTouchHelper
.
SimpleCallback
(
ItemTouchHelper
.
UP
or
ItemTouchHelper
.
DOWN
,
ItemTouchHelper
.
START
)
{
ItemTouchHelper
.
START
)
{
override
fun
getSwipeDirs
(
recyclerView
:
RecyclerView
,
viewHolder
:
RecyclerView
.
ViewHolder
):
Int
=
override
fun
getSwipeDirs
(
recyclerView
:
RecyclerView
,
viewHolder
:
RecyclerView
.
ViewHolder
):
Int
=
if
(
isProfileEditable
((
viewHolder
as
ProfileViewHolder
).
item
.
id
))
if
(
isProfileEditable
((
viewHolder
as
ProfileViewHolder
).
item
.
id
))
{
super
.
getSwipeDirs
(
recyclerView
,
viewHolder
)
else
0
super
.
getSwipeDirs
(
recyclerView
,
viewHolder
)
}
else
0
override
fun
getDragDirs
(
recyclerView
:
RecyclerView
,
viewHolder
:
RecyclerView
.
ViewHolder
):
Int
=
override
fun
getDragDirs
(
recyclerView
:
RecyclerView
,
viewHolder
:
RecyclerView
.
ViewHolder
):
Int
=
if
(
isEnabled
)
super
.
getDragDirs
(
recyclerView
,
viewHolder
)
else
0
if
(
isEnabled
)
super
.
getDragDirs
(
recyclerView
,
viewHolder
)
else
0
...
@@ -530,8 +532,8 @@ class ProfilesFragment : ToolbarFragment(), Toolbar.OnMenuItemClickListener {
...
@@ -530,8 +532,8 @@ class ProfilesFragment : ToolbarFragment(), Toolbar.OnMenuItemClickListener {
R
.
id
.
action_export_clipboard
->
{
R
.
id
.
action_export_clipboard
->
{
val
profiles
=
ProfileManager
.
getActiveProfiles
()
val
profiles
=
ProfileManager
.
getActiveProfiles
()
val
success
=
profiles
!=
null
&&
Core
.
trySetPrimaryClip
(
profiles
.
joinToString
(
"\n"
))
val
success
=
profiles
!=
null
&&
Core
.
trySetPrimaryClip
(
profiles
.
joinToString
(
"\n"
))
(
activity
as
MainActivity
).
snackbar
().
setText
(
if
(
success
)
(
activity
as
MainActivity
).
snackbar
().
setText
(
R
.
string
.
action_export_msg
else
R
.
string
.
action_export_err
).
show
()
if
(
success
)
R
.
string
.
action_export_msg
else
R
.
string
.
action_export_err
).
show
()
true
true
}
}
R
.
id
.
action_export_file
->
{
R
.
id
.
action_export_file
->
{
...
...
mobile/src/main/java/com/github/shadowsocks/ScannerActivity.kt
View file @
3b7d419f
...
@@ -58,6 +58,7 @@ class ScannerActivity : AppCompatActivity(), ImageAnalysis.Analyzer {
...
@@ -58,6 +58,7 @@ class ScannerActivity : AppCompatActivity(), ImageAnalysis.Analyzer {
private
val
imageAnalysis
by
lazy
{
private
val
imageAnalysis
by
lazy
{
ImageAnalysis
.
Builder
().
apply
{
ImageAnalysis
.
Builder
().
apply
{
setBackpressureStrategy
(
ImageAnalysis
.
STRATEGY_KEEP_ONLY_LATEST
)
setBackpressureStrategy
(
ImageAnalysis
.
STRATEGY_KEEP_ONLY_LATEST
)
setBackgroundExecutor
(
Dispatchers
.
Default
.
asExecutor
())
}.
build
().
also
{
it
.
setAnalyzer
(
Dispatchers
.
Main
.
immediate
.
asExecutor
(),
this
)
}
}.
build
().
also
{
it
.
setAnalyzer
(
Dispatchers
.
Main
.
immediate
.
asExecutor
(),
this
)
}
}
}
...
...
mobile/src/main/java/com/github/shadowsocks/acl/CustomRulesFragment.kt
View file @
3b7d419f
...
@@ -435,8 +435,9 @@ class CustomRulesFragment : ToolbarFragment(), Toolbar.OnMenuItemClickListener,
...
@@ -435,8 +435,9 @@ class CustomRulesFragment : ToolbarFragment(), Toolbar.OnMenuItemClickListener,
is
URL
->
acl
.
urls
.
add
(
it
)
is
URL
->
acl
.
urls
.
add
(
it
)
}
}
}
}
(
activity
as
MainActivity
).
snackbar
().
setText
(
if
(
Core
.
trySetPrimaryClip
(
acl
.
toString
()))
val
success
=
Core
.
trySetPrimaryClip
(
acl
.
toString
())
R
.
string
.
action_export_msg
else
R
.
string
.
action_export_err
).
show
()
(
activity
as
MainActivity
).
snackbar
().
setText
(
if
(
success
)
R
.
string
.
action_export_msg
else
R
.
string
.
action_export_err
).
show
()
}
}
override
fun
onMenuItemClick
(
item
:
MenuItem
):
Boolean
=
when
(
item
.
itemId
)
{
override
fun
onMenuItemClick
(
item
:
MenuItem
):
Boolean
=
when
(
item
.
itemId
)
{
...
...
plugin/src/main/java/com/github/shadowsocks/plugin/PluginOptions.kt
View file @
3b7d419f
...
@@ -52,8 +52,9 @@ class PluginOptions : HashMap<String, String?> {
...
@@ -52,8 +52,9 @@ class PluginOptions : HashMap<String, String?> {
if
(
key
!=
null
)
{
if
(
key
!=
null
)
{
put
(
key
,
current
.
toString
())
put
(
key
,
current
.
toString
())
key
=
null
key
=
null
}
else
if
(
current
.
isNotEmpty
())
}
else
if
(
current
.
isNotEmpty
())
{
if
(
parseId
)
id
=
current
.
toString
()
else
put
(
current
.
toString
(),
null
)
if
(
parseId
)
id
=
current
.
toString
()
else
put
(
current
.
toString
(),
null
)
}
current
.
setLength
(
0
)
current
.
setLength
(
0
)
parseId
=
false
parseId
=
false
}
}
...
...
repositories.gradle.kts
View file @
3b7d419f
rootProject
.
extra
.
apply
{
rootProject
.
extra
.
apply
{
set
(
"androidPlugin"
,
"com.android.tools.build:gradle:4.1.0-beta0
4
"
)
set
(
"androidPlugin"
,
"com.android.tools.build:gradle:4.1.0-beta0
5
"
)
set
(
"kotlinVersion"
,
"1.3.72"
)
set
(
"kotlinVersion"
,
"1.3.72"
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment