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
f0be9a3f
Commit
f0be9a3f
authored
Apr 14, 2019
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix new nullability issues
parent
98ed1f78
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
19 additions
and
18 deletions
+19
-18
build.gradle
build.gradle
+1
-1
core/src/main/java/com/github/shadowsocks/plugin/ResolvedPlugin.kt
...main/java/com/github/shadowsocks/plugin/ResolvedPlugin.kt
+2
-2
mobile/src/main/java/com/github/shadowsocks/AppManager.kt
mobile/src/main/java/com/github/shadowsocks/AppManager.kt
+2
-2
mobile/src/main/java/com/github/shadowsocks/ProfilesFragment.kt
.../src/main/java/com/github/shadowsocks/ProfilesFragment.kt
+4
-4
mobile/src/main/java/com/github/shadowsocks/acl/CustomRulesFragment.kt
...in/java/com/github/shadowsocks/acl/CustomRulesFragment.kt
+1
-1
plugin/src/main/java/com/github/shadowsocks/plugin/NativePluginProvider.kt
...ava/com/github/shadowsocks/plugin/NativePluginProvider.kt
+8
-7
tv/src/main/java/com/github/shadowsocks/tv/MainPreferenceFragment.kt
.../java/com/github/shadowsocks/tv/MainPreferenceFragment.kt
+1
-1
No files found.
build.gradle
View file @
f0be9a3f
...
...
@@ -26,7 +26,7 @@ buildscript {
}
dependencies
{
classpath
'com.android.tools.build:gradle:3.4.0-rc0
2
'
classpath
'com.android.tools.build:gradle:3.4.0-rc0
3
'
classpath
'com.github.ben-manes:gradle-versions-plugin:0.21.0'
classpath
'com.google.gms:google-services:4.2.0'
classpath
'com.vanniktech:gradle-maven-publish-plugin:0.8.0'
...
...
core/src/main/java/com/github/shadowsocks/plugin/ResolvedPlugin.kt
View file @
f0be9a3f
...
...
@@ -30,10 +30,10 @@ import com.github.shadowsocks.utils.signaturesCompat
abstract
class
ResolvedPlugin
(
protected
val
resolveInfo
:
ResolveInfo
)
:
Plugin
()
{
protected
abstract
val
metaData
:
Bundle
override
val
id
:
String
by
lazy
{
metaData
.
getString
(
PluginContract
.
METADATA_KEY_ID
)
}
override
val
id
:
String
by
lazy
{
metaData
.
getString
(
PluginContract
.
METADATA_KEY_ID
)
!!
}
override
val
label
:
CharSequence
by
lazy
{
resolveInfo
.
loadLabel
(
app
.
packageManager
)
}
override
val
icon
:
Drawable
by
lazy
{
resolveInfo
.
loadIcon
(
app
.
packageManager
)
}
override
val
defaultConfig
:
String
by
lazy
{
metaData
.
getString
(
PluginContract
.
METADATA_KEY_DEFAULT_CONFIG
)
}
override
val
defaultConfig
:
String
?
by
lazy
{
metaData
.
getString
(
PluginContract
.
METADATA_KEY_DEFAULT_CONFIG
)
}
override
val
packageName
:
String
get
()
=
resolveInfo
.
resolvePackageName
override
val
trusted
by
lazy
{
Core
.
getPackageInfo
(
packageName
).
signaturesCompat
.
any
(
PluginManager
.
trustedSignatures
::
contains
)
...
...
mobile/src/main/java/com/github/shadowsocks/AppManager.kt
View file @
f0be9a3f
...
...
@@ -264,8 +264,8 @@ class AppManager : AppCompatActivity() {
return
true
}
R
.
id
.
action_export_clipboard
->
{
clipboard
.
primaryClip
=
ClipData
.
newPlainText
(
Key
.
individual
,
"${DataStore.bypass}\n${DataStore.individual}"
)
clipboard
.
setPrimaryClip
(
ClipData
.
newPlainText
(
Key
.
individual
,
"${DataStore.bypass}\n${DataStore.individual}"
)
)
Snackbar
.
make
(
list
,
R
.
string
.
action_export_msg
,
Snackbar
.
LENGTH_LONG
).
show
()
return
true
}
...
...
mobile/src/main/java/com/github/shadowsocks/ProfilesFragment.kt
View file @
f0be9a3f
...
...
@@ -208,7 +208,7 @@ class ProfilesFragment : ToolbarFragment(), Toolbar.OnMenuItemClickListener {
true
}
R
.
id
.
action_export_clipboard
->
{
clipboard
.
primaryClip
=
ClipData
.
newPlainText
(
null
,
this
.
item
.
toString
(
))
clipboard
.
setPrimaryClip
(
ClipData
.
newPlainText
(
null
,
this
.
item
.
toString
()
))
true
}
else
->
false
...
...
@@ -404,7 +404,7 @@ class ProfilesFragment : ToolbarFragment(), Toolbar.OnMenuItemClickListener {
R
.
id
.
action_export_clipboard
->
{
val
profiles
=
ProfileManager
.
getAllProfiles
()
(
activity
as
MainActivity
).
snackbar
().
setText
(
if
(
profiles
!=
null
)
{
clipboard
.
primaryClip
=
ClipData
.
newPlainText
(
null
,
profiles
.
joinToString
(
"\n"
))
clipboard
.
setPrimaryClip
(
ClipData
.
newPlainText
(
null
,
profiles
.
joinToString
(
"\n"
)
))
R
.
string
.
action_export_msg
}
else
R
.
string
.
action_export_err
).
show
()
true
...
...
@@ -436,7 +436,7 @@ class ProfilesFragment : ToolbarFragment(), Toolbar.OnMenuItemClickListener {
try
{
ProfileManager
.
createProfilesFromJson
(
data
!!
.
datas
.
asSequence
().
map
{
activity
.
contentResolver
.
openInputStream
(
it
)
})
}
.
filterNotNull
()
)
}
catch
(
e
:
Exception
)
{
activity
.
snackbar
(
e
.
readableMessage
).
show
()
}
...
...
@@ -446,7 +446,7 @@ class ProfilesFragment : ToolbarFragment(), Toolbar.OnMenuItemClickListener {
try
{
ProfileManager
.
createProfilesFromJson
(
data
!!
.
datas
.
asSequence
().
map
{
activity
.
contentResolver
.
openInputStream
(
it
)
},
true
)
}
.
filterNotNull
()
,
true
)
}
catch
(
e
:
Exception
)
{
activity
.
snackbar
(
e
.
readableMessage
).
show
()
}
...
...
mobile/src/main/java/com/github/shadowsocks/acl/CustomRulesFragment.kt
View file @
f0be9a3f
...
...
@@ -424,7 +424,7 @@ class CustomRulesFragment : ToolbarFragment(), Toolbar.OnMenuItemClickListener,
is
URL
->
acl
.
urls
.
add
(
it
)
}
}
clipboard
.
primaryClip
=
ClipData
.
newPlainText
(
null
,
acl
.
toString
(
))
clipboard
.
setPrimaryClip
(
ClipData
.
newPlainText
(
null
,
acl
.
toString
()
))
}
override
fun
onMenuItemClick
(
item
:
MenuItem
):
Boolean
=
when
(
item
.
itemId
)
{
...
...
plugin/src/main/java/com/github/shadowsocks/plugin/NativePluginProvider.kt
View file @
f0be9a3f
...
...
@@ -49,7 +49,7 @@ import androidx.core.os.bundleOf
*</manifest></pre>
*/
abstract
class
NativePluginProvider
:
ContentProvider
()
{
override
fun
getType
(
p0
:
Uri
?):
String
=
"application/x-elf"
override
fun
getType
(
uri
:
Uri
):
String
?
=
"application/x-elf"
override
fun
onCreate
():
Boolean
=
true
...
...
@@ -61,7 +61,7 @@ abstract class NativePluginProvider : ContentProvider() {
protected
abstract
fun
populateFiles
(
provider
:
PathProvider
)
override
fun
query
(
uri
:
Uri
,
projection
:
Array
<
out
String
>?,
selection
:
String
?,
selectionArgs
:
Array
<
out
String
>?,
sortOrder
:
String
?):
Cursor
{
sortOrder
:
String
?):
Cursor
?
{
check
(
selection
==
null
&&
selectionArgs
==
null
&&
sortOrder
==
null
)
val
result
=
MatrixCursor
(
projection
)
populateFiles
(
PathProvider
(
uri
,
result
))
...
...
@@ -78,8 +78,8 @@ abstract class NativePluginProvider : ContentProvider() {
*/
open
fun
getExecutable
():
String
=
throw
UnsupportedOperationException
()
abstract
fun
openFile
(
uri
:
Uri
?
):
ParcelFileDescriptor
override
fun
openFile
(
uri
:
Uri
?,
mode
:
String
?
):
ParcelFileDescriptor
{
abstract
fun
openFile
(
uri
:
Uri
):
ParcelFileDescriptor
override
fun
openFile
(
uri
:
Uri
,
mode
:
String
):
ParcelFileDescriptor
{
check
(
mode
==
"r"
)
return
openFile
(
uri
)
}
...
...
@@ -90,8 +90,9 @@ abstract class NativePluginProvider : ContentProvider() {
}
// Methods that should not be used
override
fun
insert
(
p0
:
Uri
?,
p1
:
ContentValues
?):
Uri
=
throw
UnsupportedOperationException
()
override
fun
update
(
p0
:
Uri
?,
p1
:
ContentValues
?,
p2
:
String
?,
p3
:
Array
<
out
String
>?):
Int
=
override
fun
insert
(
uri
:
Uri
,
values
:
ContentValues
?):
Uri
?
=
throw
UnsupportedOperationException
()
override
fun
update
(
uri
:
Uri
,
values
:
ContentValues
?,
selection
:
String
?,
selectionArgs
:
Array
<
out
String
>?):
Int
=
throw
UnsupportedOperationException
()
override
fun
delete
(
uri
:
Uri
,
selection
:
String
?,
selectionArgs
:
Array
<
out
String
>?):
Int
=
throw
UnsupportedOperationException
()
override
fun
delete
(
p0
:
Uri
?,
p1
:
String
?,
p2
:
Array
<
out
String
>?):
Int
=
throw
UnsupportedOperationException
()
}
tv/src/main/java/com/github/shadowsocks/tv/MainPreferenceFragment.kt
View file @
f0be9a3f
...
...
@@ -297,7 +297,7 @@ class MainPreferenceFragment : LeanbackPreferenceFragmentCompat(), ShadowsocksCo
try
{
ProfileManager
.
createProfilesFromJson
(
data
!!
.
datas
.
asSequence
().
map
{
context
.
contentResolver
.
openInputStream
(
it
)
},
true
)
}
.
filterNotNull
()
,
true
)
}
catch
(
e
:
Exception
)
{
printLog
(
e
)
Toast
.
makeText
(
context
,
e
.
readableMessage
,
Toast
.
LENGTH_SHORT
).
show
()
...
...
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