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
70e0b399
Commit
70e0b399
authored
Jan 17, 2017
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Misc improvements for plugin design
parent
0ffae32a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
17 deletions
+34
-17
mobile/src/main/AndroidManifest.xml
mobile/src/main/AndroidManifest.xml
+0
-3
mobile/src/main/res/values/strings.xml
mobile/src/main/res/values/strings.xml
+0
-6
mobile/src/main/scala/com/github/shadowsocks/plugin/PluginManager.scala
...n/scala/com/github/shadowsocks/plugin/PluginManager.scala
+3
-1
plugin/src/main/java/com/github/shadowsocks/plugin/PluginOptions.java
...ain/java/com/github/shadowsocks/plugin/PluginOptions.java
+20
-5
plugin/src/main/res/values/strings.xml
plugin/src/main/res/values/strings.xml
+9
-0
plugin/src/main/scala/com/github/shadowsocks/plugin/NativePluginProvider.scala
.../com/github/shadowsocks/plugin/NativePluginProvider.scala
+2
-2
No files found.
mobile/src/main/AndroidManifest.xml
View file @
70e0b399
...
...
@@ -18,11 +18,8 @@
android:targetSdkVersion=
"25"
/>
<application
android:allowBackup=
"true"
android:name=
".ShadowsocksApplication"
android:hardwareAccelerated=
"true"
android:icon=
"@mipmap/ic_launcher"
android:roundIcon=
"@mipmap/ic_launcher"
android:backupAgent=
".ShadowsocksBackupAgent"
android:label=
"@string/app_name"
android:banner=
"@drawable/ic_start_connected"
>
...
...
mobile/src/main/res/values/strings.xml
View file @
70e0b399
...
...
@@ -26,7 +26,6 @@
<string
name=
"connection_test_error_status_code"
>
Error code: #%d
</string>
<!-- proxy category -->
<string
name=
"proxy_cat"
>
Server Settings
</string>
<string
name=
"profile_name"
>
Profile Name
</string>
<string
name=
"proxy"
>
Server
</string>
<string
name=
"remote_port"
>
Remote Port
</string>
...
...
@@ -35,7 +34,6 @@
<string
name=
"enc_method"
>
Encrypt Method
</string>
<!-- feature category -->
<string
name=
"feature_cat"
>
Feature Settings
</string>
<string
name=
"ipv6"
>
IPv6 Route
</string>
<string
name=
"ipv6_summary"
>
Redirect IPv6 traffic to remote
</string>
<string
name=
"onetime_auth"
>
One-time Authentication
</string>
...
...
@@ -75,8 +73,6 @@
<string
name=
"profile_invalid_input"
>
No valid profile data found.
</string>
<!-- alert category -->
<string
name=
"yes"
>
Yes
</string>
<string
name=
"no"
>
No
</string>
<string
name=
"close"
>
Close
</string>
<string
name=
"profile_empty"
>
Please select a profile
</string>
<string
name=
"proxy_empty"
>
Proxy/Password should not be empty
</string>
...
...
@@ -105,8 +101,6 @@
<!-- profile -->
<string
name=
"profile_config"
>
Profile config
</string>
<string
name=
"unsaved_changes_prompt"
>
Changes not saved. Do you want to save?
</string>
<string
name=
"apply"
>
Apply
</string>
<string
name=
"delete"
>
Remove
</string>
<string
name=
"delete_confirm_prompt"
>
Are you sure you want to remove this profile?
</string>
<string
name=
"share_qr_nfc"
>
QR code/NFC
</string>
...
...
mobile/src/main/scala/com/github/shadowsocks/plugin/PluginManager.scala
View file @
70e0b399
...
...
@@ -38,7 +38,9 @@ object PluginManager {
case
null
=>
case
path
=>
return
path
}
catch
{
case
t
:
Throwable
=>
if
(
throwable
==
null
)
throwable
=
t
case
t
:
Throwable
=>
t
.
printStackTrace
()
if
(
throwable
==
null
)
throwable
=
t
}
// add other plugin types here
...
...
plugin/src/main/java/com/github/shadowsocks/plugin/PluginOptions.java
View file @
70e0b399
...
...
@@ -3,6 +3,7 @@ package com.github.shadowsocks.plugin;
import
android.text.TextUtils
;
import
java.util.HashMap
;
import
java.util.Objects
;
import
java.util.StringTokenizer
;
/**
...
...
@@ -23,7 +24,7 @@ public final class PluginOptions extends HashMap<String, String> {
super
(
initialCapacity
,
loadFactor
);
}
private
PluginOptions
(
String
options
,
boolean
parseId
)
throws
IllegalArgumentException
{
private
PluginOptions
(
String
options
,
boolean
parseId
)
{
if
(
TextUtils
.
isEmpty
(
options
))
return
;
final
StringTokenizer
tokenizer
=
new
StringTokenizer
(
options
,
"\\=;"
,
true
);
final
StringBuilder
current
=
new
StringBuilder
();
...
...
@@ -31,8 +32,7 @@ public final class PluginOptions extends HashMap<String, String> {
while
(
tokenizer
.
hasMoreTokens
())
{
String
nextToken
=
tokenizer
.
nextToken
();
if
(
"\\"
.
equals
(
nextToken
))
current
.
append
(
tokenizer
.
nextToken
());
else
if
(
"="
.
equals
(
nextToken
))
{
if
(
key
!=
null
)
throw
new
IllegalArgumentException
(
"Duplicate keys in "
+
options
);
else
if
(
"="
.
equals
(
nextToken
)
&&
key
==
null
)
{
key
=
current
.
toString
();
current
.
setLength
(
0
);
}
else
if
(
";"
.
equals
(
nextToken
))
...
...
@@ -46,12 +46,13 @@ public final class PluginOptions extends HashMap<String, String> {
put
(
current
.
toString
(),
null
);
current
.
setLength
(
0
);
}
else
current
.
append
(
nextToken
);
}
}
public
PluginOptions
(
String
options
)
throws
IllegalArgumentException
{
public
PluginOptions
(
String
options
)
{
this
(
options
,
true
);
}
public
PluginOptions
(
String
id
,
String
options
)
throws
IllegalArgumentException
{
public
PluginOptions
(
String
id
,
String
options
)
{
this
(
options
,
false
);
this
.
id
=
id
;
}
...
...
@@ -85,4 +86,18 @@ public final class PluginOptions extends HashMap<String, String> {
public
String
toString
()
{
return
toString
(
true
);
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
if
(!
super
.
equals
(
o
))
return
false
;
PluginOptions
that
=
(
PluginOptions
)
o
;
return
Objects
.
equals
(
id
,
that
.
id
)
&&
super
.
equals
(
that
);
}
@Override
public
int
hashCode
()
{
return
Objects
.
hash
(
super
.
hashCode
(),
id
);
}
}
plugin/src/main/res/values/strings.xml
0 → 100644
View file @
70e0b399
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string
name=
"proxy_cat"
>
Server Settings
</string>
<string
name=
"feature_cat"
>
Feature Settings
</string>
<string
name=
"unsaved_changes_prompt"
>
Changes not saved. Do you want to save?
</string>
<string
name=
"yes"
>
Yes
</string>
<string
name=
"no"
>
No
</string>
<string
name=
"apply"
>
Apply
</string>
</resources>
plugin/src/main/scala/com/github/shadowsocks/plugin/NativePluginProvider.scala
View file @
70e0b399
...
...
@@ -14,8 +14,8 @@ import android.os.ParcelFileDescriptor
* ...
* <application>
* ...
* <provider android:name="com.github.shadowsocks.$PLUGIN_ID.
Plugin
Provider"
* android:authorities="com.github.shadowsocks.$PLUGIN_ID">
* <provider android:name="com.github.shadowsocks.$PLUGIN_ID.
Binary
Provider"
* android:authorities="com.github.shadowsocks.
plugin.
$PLUGIN_ID">
* <intent-filter>
* <category android:name="com.github.shadowsocks.plugin.CATEGORY_NATIVE_PLUGIN" />
* </intent-filter>
...
...
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