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
34387bb1
Commit
34387bb1
authored
Jun 22, 2019
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update doc
parent
3c6d5a89
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
8 deletions
+25
-8
plugin/doc.md
plugin/doc.md
+12
-3
plugin/src/main/java/com/github/shadowsocks/plugin/NativePluginProvider.kt
...ava/com/github/shadowsocks/plugin/NativePluginProvider.kt
+5
-1
plugin/src/main/java/com/github/shadowsocks/plugin/PluginContract.kt
...main/java/com/github/shadowsocks/plugin/PluginContract.kt
+8
-4
No files found.
plugin/doc.md
View file @
34387bb1
...
...
@@ -136,8 +136,8 @@ Every native mode plugin MUST have a content provider to provide the native exec
*
MUST implement
`query`
that returns the file list which MUST include
`$PLUGIN_ID`
when having
these as arguments:
-
`uri = "content://$authority_of_your_provider`
;
-
`projection = ["path", "mode"]`
; (relative path, for example
`obfs-local`
; file mode, for
example
`
755
`
)
-
`projection = ["path", "mode"]`
; (relative path, for example
`obfs-local`
; file mode
as integer
, for
example
`
0b110100100
`
)
-
`selection = null`
;
-
`selectionArgs = null`
;
-
`sortOrder = null`
;
...
...
@@ -186,10 +186,19 @@ If your plugin binary executable can run in place, you can support native mode w
`com.github.shadowsocks.plugin.EXTRA_ENTRY`
when having
`method = "shadowsocks:getExecutable"`
;
(
`com.github.shadowsocks.plugin.EXTRA_OPTIONS`
is provided in extras as well just in case you
need them)
*
SHOULD define
`android:installLocation="internalOnly"`
for
`<manifest>`
in AndroidManifest.xml;
*
SHOULD define
`android:extractNativeLibs="true"`
for
`<application>`
in AndroidManifest.xml;
If you don't plan to support this mode, you can just throw
`UnsupportedOperationException`
when
being invoked. It will fallback to the slow routine automatically.
### Native mode without binary copying and setup
Additionally, if your plugin only needs to supply the path of your executable without doing any extra setup work,
you can use an additional
`meta-data`
with name
`com.github.shadowsocks.plugin.executable_path`
to supply executable path to your native binary.
This allows the host app to launch your plugin without ever launching your app.
## JVM mode
This feature hasn't been implemented yet.
...
...
@@ -229,7 +238,7 @@ Plugin app must include this in their application tag: (which should be automati
```
<meta-data android:name="com.github.shadowsocks.plugin.version"
android:value="
0.0.2
"/>
android:value="
1.0.0
"/>
```
# Android TV
...
...
plugin/src/main/java/com/github/shadowsocks/plugin/NativePluginProvider.kt
View file @
34387bb1
...
...
@@ -69,7 +69,11 @@ abstract class NativePluginProvider : ContentProvider() {
}
/**
* Returns executable entry absolute path. This is used if plugin is sharing UID with the host.
* Returns executable entry absolute path.
* This is used for fast mode initialization where ss-local launches your native binary at the path given directly.
* In order for this to work, plugin app is encouraged to have the following in its AndroidManifest.xml:
* - android:installLocation="internalOnly" for <manifest>
* - android:extractNativeLibs="true" for <application>
*
* Default behavior is throwing UnsupportedOperationException. If you don't wish to use this feature, use the
* default behavior.
...
...
plugin/src/main/java/com/github/shadowsocks/plugin/PluginContract.kt
View file @
34387bb1
...
...
@@ -88,7 +88,11 @@ object PluginContract {
* The metadata key to retrieve executable path to your native binary.
* This path should be relative to your application's nativeLibraryDir.
*
* If this is set, the host app will prefer this value and (probably) not launch your app at all.
* If this is set, the host app will prefer this value and (probably) not launch your app at all (aka faster mode).
* In order for this to work, plugin app is encouraged to have the following in its AndroidManifest.xml:
* - android:installLocation="internalOnly" for <manifest>
* - android:extractNativeLibs="true" for <application>
*
* Do not use this if you plan to do some setup work before giving away your binary path,
* or your native binary is not at a fixed location relative to your application's nativeLibraryDir.
*
...
...
@@ -112,11 +116,11 @@ object PluginContract {
*/
const
val
COLUMN_PATH
=
"path"
/**
* File mode bits. Default value is
"644"
.
* File mode bits. Default value is
644 in octal
.
*
* Example:
"755"
* Example:
0b110100100 (for 755 in octal)
*
* Type:
String
* Type:
Int or String (deprecated)
*/
const
val
COLUMN_MODE
=
"mode"
...
...
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