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
828cc457
Unverified
Commit
828cc457
authored
Jan 18, 2019
by
Max Lv
Committed by
GitHub
Jan 18, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2079 from shadowsocks/go-mod
Update overture and migrate to go mod
parents
cd027d84
0891a12e
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
41 additions
and
245 deletions
+41
-245
.circleci/config.yml
.circleci/config.yml
+0
-1
.gitignore
.gitignore
+0
-8
.gitmodules
.gitmodules
+3
-2
README.md
README.md
+0
-2
core/build.gradle
core/build.gradle
+3
-20
core/go-build.bash
core/go-build.bash
+30
-0
core/src/main/java/com/github/shadowsocks/bg/LocalDnsService.kt
...rc/main/java/com/github/shadowsocks/bg/LocalDnsService.kt
+2
-2
core/src/main/jni/overture
core/src/main/jni/overture
+1
-0
core/src/overture/clean.bash
core/src/overture/clean.bash
+0
-8
core/src/overture/clean.bat
core/src/overture/clean.bat
+0
-10
core/src/overture/make.bash
core/src/overture/make.bash
+0
-58
core/src/overture/make.bat
core/src/overture/make.bat
+0
-131
core/src/overture/src/github.com/shadowsocks/overture
core/src/overture/src/github.com/shadowsocks/overture
+0
-1
mobile/build.gradle
mobile/build.gradle
+1
-1
tv/build.gradle
tv/build.gradle
+1
-1
No files found.
.circleci/config.yml
View file @
828cc457
...
...
@@ -10,7 +10,6 @@ jobs:
steps
:
-
checkout
-
run
:
git submodule update --init --recursive
-
run
:
pushd core/src/overture; ./make.bash 21; popd
-
restore_cache
:
key
:
jars-{{ checksum "build.gradle" }}
-
run
:
...
...
.gitignore
View file @
828cc457
...
...
@@ -9,13 +9,5 @@ release/
.idea/
*.iml
core/src/overture/.deps
core/src/overture/bin
core/src/overture/pkg
core/src/overture/src/github.com/Sirupsen
core/src/overture/src/github.com/miekg
core/src/overture/src/golang.org
# release apks
*.apk
.gitmodules
View file @
828cc457
...
...
@@ -30,6 +30,7 @@
[submodule "core/src/main/jni/libev"]
path = core/src/main/jni/libev
url = https://github.com/shadowsocks/libev.git
[submodule "core/src/
overture/src/github.com/shadowsocks
/overture"]
path = core/src/
overture/src/github.com/shadowsocks
/overture
[submodule "core/src/
main/jni
/overture"]
path = core/src/
main/jni
/overture
url = https://github.com/shadowsocks/overture.git
branch = shadowsocks
README.md
View file @
828cc457
...
...
@@ -23,8 +23,6 @@ for Android TV
### BUILD
You can check whether the latest commit builds under UNIX environment by checking Travis status.
Building on Windows is also possible since
[
#1570
](
https://github.com/shadowsocks/shadowsocks-android/pull/1570
)
,
but probably painful. Further contributions regarding building on Windows are also welcome.
*
Clone the repo using
`git clone --recurse-submodules <repo>`
or update submodules using
`git submodule update --init --recursive`
*
Build it using Android Studio or gradle script
...
...
core/build.gradle
View file @
828cc457
...
...
@@ -29,12 +29,6 @@ android {
}
}
buildTypes
{
release
{
minifyEnabled
false
}
}
externalNativeBuild
{
ndkBuild
{
path
'src/main/jni/Android.mk'
...
...
@@ -48,26 +42,15 @@ android {
task
goBuild
(
type:
Exec
)
{
if
(
Os
.
isFamily
(
Os
.
FAMILY_WINDOWS
))
{
executable
"cmd.exe"
args
"/c"
,
file
(
"src/overture/make.bat"
).
absolutePath
,
minSdkVersion
println
"Warning: Building on Windows is not supported"
}
else
{
executable
"sh"
args
"
-c"
,
"src/overture/make.bash "
+
minSdkVersion
executable
"
/bin/ba
sh"
args
"
go-build.bash"
,
minSdkVersion
environment
"ANDROID_HOME"
,
android
.
sdkDirectory
environment
"ANDROID_NDK_HOME"
,
android
.
ndkDirectory
}
}
task
goClean
(
type:
Exec
)
{
if
(
Os
.
isFamily
(
Os
.
FAMILY_WINDOWS
))
{
executable
"cmd.exe"
args
"/c"
,
file
(
"src/overture/clean.bat"
).
absolutePath
}
else
{
executable
"sh"
args
"-c"
,
"src/overture/clean.bash"
}
}
tasks
.
whenTaskAdded
{
task
->
if
((
task
.
name
==
'generateJsonModelDebug'
||
task
.
name
==
'generateJsonModelRelease'
))
{
task
.
dependsOn
(
goBuild
)
...
...
core/go-build.bash
0 → 100755
View file @
828cc457
#!/bin/bash
[[
-z
"
${
ANDROID_NDK_HOME
}
"
]]
&&
ANDROID_NDK_HOME
=
"
${
ANDROID_HOME
}
/ndk-bundle"
TOOLCHAIN
=
"
$(
find
${
ANDROID_NDK_HOME
}
/toolchains/llvm/prebuilt/
*
-maxdepth
1
-type
d
-print
-quit
)
/bin"
ABIS
=(
armeabi-v7a arm64-v8a x86 x86_64
)
GO_ARCHS
=(
'arm GOARM=7'
arm64 386 amd64
)
CLANG_ARCHS
=(
armv7a-linux-androideabi aarch64-linux-android i686-linux-android x86_64-linux-android
)
STRIP_ARCHS
=(
arm-linux-androideabi aarch64-linux-android i686-linux-android x86_64-linux-android
)
MIN_API
=
"
$1
"
ROOT
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
"
OUT_DIR
=
"
$ROOT
/build/go"
cd
"
$ROOT
/src/main/jni/overture/main"
BIN
=
"liboverture.so"
for
i
in
"
${
!ABIS[@]
}
"
;
do
ABI
=
"
${
ABIS
[
$i
]
}
"
[[
-f
"
${
OUT_DIR
}
/
${
ABI
}
/
${
BIN
}
"
]]
&&
continue
echo
"Build
${
BIN
}
${
ABI
}
"
mkdir
-p
${
OUT_DIR
}
/
${
ABI
}
\
&&
env
\
CGO_ENABLED
=
1
CC
=
"
${
TOOLCHAIN
}
/
${
CLANG_ARCHS
[
$i
]
}${
MIN_API
}
-clang"
\
GOOS
=
android
GOARCH
=
${
GO_ARCHS
[
$i
]
}
\
go build
-v
-ldflags
=
'-s -w'
-o
"
${
OUT_DIR
}
/unstripped"
\
&&
"
${
TOOLCHAIN
}
/
${
STRIP_ARCHS
[
$i
]
}
-strip"
"
${
OUT_DIR
}
/unstripped"
-o
"
${
OUT_DIR
}
/
${
ABI
}
/
${
BIN
}
"
\
||
exit
-1
rm
"
${
OUT_DIR
}
/unstripped"
done
cd
"
$ROOT
"
core/src/main/java/com/github/shadowsocks/bg/LocalDnsService.kt
View file @
828cc457
...
...
@@ -69,8 +69,8 @@ object LocalDnsService {
Acl
.
BYPASS_CHN
,
Acl
.
BYPASS_LAN_CHN
,
Acl
.
GFWLIST
,
Acl
.
CUSTOM_RULES
->
{
put
(
"PrimaryDNS"
,
localDns
)
put
(
"AlternativeDNS"
,
remoteDns
)
put
(
"IPNetworkFile"
,
"china_ip_list.txt"
)
put
(
"
Domain
File"
,
"domain_exceptions.acl"
)
put
(
"IPNetworkFile"
,
JSONObject
(
mapOf
(
"Alternative"
to
"china_ip_list.txt"
))
)
put
(
"
Acl
File"
,
"domain_exceptions.acl"
)
}
Acl
.
CHINALIST
->
{
put
(
"PrimaryDNS"
,
localDns
)
...
...
overture
@
6d1e1854
Subproject commit 6d1e18544504c41600d9d682aa980eaa24448558
core/src/overture/clean.bash
deleted
100755 → 0
View file @
cd027d84
#!/bin/bash
DIR
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
"
rm
-rf
$DIR
/.deps
rm
-rf
$DIR
/bin
echo
"Successfully clean overture"
core/src/overture/clean.bat
deleted
100644 → 0
View file @
cd027d84
@ECHO
OFF
SET
DIR
=
%~dp0
SET
DEPS
=
%DIR%
\.deps
RD
/S /Q
%DEPS%
RD
/S /Q
%DIR%
\go\bin
RD
/S /Q
%DIR%
\bin
ECHO
"Successfully clean overture"
core/src/overture/make.bash
deleted
100755 → 0
View file @
cd027d84
#!/bin/bash
function
try
()
{
"
$@
"
||
exit
-1
}
[
-z
"
$ANDROID_NDK_HOME
"
]
&&
ANDROID_NDK_HOME
=
$ANDROID_HOME
/ndk-bundle
TOOLCHAIN
=
$(
find
$ANDROID_NDK_HOME
/toolchains/llvm/prebuilt/
*
-maxdepth
1
-type
d
-print
-quit
)
/bin
DIR
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
"
MIN_API
=
$1
TARGET
=
$DIR
/bin
try
mkdir
-p
$TARGET
/armeabi-v7a
$TARGET
/x86
$TARGET
/arm64-v8a
$TARGET
/x86_64
export
GOPATH
=
$DIR
if
[
!
-f
"
$TARGET
/armeabi-v7a/liboverture.so"
]
||
[
!
-f
"
$TARGET
/arm64-v8a/liboverture.so"
]
||
[
!
-f
"
$TARGET
/x86/liboverture.so"
]
||
[
!
-f
"
$TARGET
/x86_64/liboverture.so"
]
;
then
pushd
$GOPATH
/src/github.com/shadowsocks/overture/main
echo
"Get dependences for overture"
go get
-v
github.com/shadowsocks/overture/main
echo
"Cross compile overture for arm"
if
[
!
-f
"
$TARGET
/armeabi-v7a/liboverture.so"
]
;
then
try
env
CGO_ENABLED
=
1
CC
=
$TOOLCHAIN
/armv7a-linux-androideabi
${
MIN_API
}
-clang
GOOS
=
android
GOARCH
=
arm
GOARM
=
7 go build
-ldflags
=
"-s -w"
try
$TOOLCHAIN
/arm-linux-androideabi-strip main
try
mv
main
$TARGET
/armeabi-v7a/liboverture.so
fi
echo
"Cross compile overture for arm64"
if
[
!
-f
"
$TARGET
/arm64-v8a/liboverture.so"
]
;
then
try
env
CGO_ENABLED
=
1
CC
=
$TOOLCHAIN
/aarch64-linux-android
${
MIN_API
}
-clang
GOOS
=
android
GOARCH
=
arm64 go build
-ldflags
=
"-s -w"
try
$TOOLCHAIN
/aarch64-linux-android-strip main
try
mv
main
$TARGET
/arm64-v8a/liboverture.so
fi
echo
"Cross compile overture for 386"
if
[
!
-f
"
$TARGET
/x86/liboverture.so"
]
;
then
try
env
CGO_ENABLED
=
1
CC
=
$TOOLCHAIN
/i686-linux-android
${
MIN_API
}
-clang
GOOS
=
android
GOARCH
=
386 go build
-ldflags
=
"-s -w"
try
$TOOLCHAIN
/i686-linux-android-strip main
try
mv
main
$TARGET
/x86/liboverture.so
fi
echo
"Cross compile overture for amd64"
if
[
!
-f
"
$TARGET
/x86_64/liboverture.so"
]
;
then
try
env
CGO_ENABLED
=
1
CC
=
$TOOLCHAIN
/x86_64-linux-android
${
MIN_API
}
-clang
GOOS
=
android
GOARCH
=
amd64 go build
-ldflags
=
"-s -w"
try
$TOOLCHAIN
/x86_64-linux-android-strip main
try
mv
main
$TARGET
/x86_64/liboverture.so
fi
popd
fi
echo
"Successfully build overture"
core/src/overture/make.bat
deleted
100644 → 0
View file @
cd027d84
@ECHO
OFF
SETLOCAL
IF
NOT
DEFINED
ANDROID_NDK_HOME
(
SET
ANDROID_NDK_HOME
=
%ANDROID_HOME%
\ndk
-bundle
)
SET
DIR
=
%~dp0
SET
MIN_API
=
%
1
%
SET
TARGET
=
%DIR%
\bin
SET
DEPS
=
%DIR%
\.deps
SET
ANDROID_ARM_TOOLCHAIN
=
%DEPS%
\android
-toolchain
-
%MIN_API%
-arm
SET
ANDROID_ARM64_TOOLCHAIN
=
%DEPS%
\android
-toolchain
-
%MIN_API%
-arm
64
SET
ANDROID_X86_TOOLCHAIN
=
%DEPS%
\android
-toolchain
-
%MIN_API%
-x
86
SET
ANDROID_ARM_CC
=
%ANDROID_ARM_TOOLCHAIN%
\bin\arm
-linux-androideabi-clang
SET
ANDROID_ARM_STRIP
=
%ANDROID_ARM_TOOLCHAIN%
\bin\arm
-linux-androideabi-strip
SET
ANDROID_ARM64_CC
=
%ANDROID
_ARM64_TOOLCHAIN
%
\bin\aarch64
-linux-android-clang
SET
ANDROID_ARM64_STRIP
=
%ANDROID
_ARM64_TOOLCHAIN
%
\bin\aarch64
-linux-android-strip
SET
ANDROID_X86_CC
=
%ANDROID
_X86_TOOLCHAIN
%
\bin\i686
-linux-android-clang
SET
ANDROID_X86_STRIP
=
%ANDROID
_X86_TOOLCHAIN
%
\bin\i686
-linux-android-strip
MKDIR
%DEPS%
>
nul
2
>
nul
MKDIR
%TARGET%
\armeabi
-v
7
a
>
nul
2
>
nul
MKDIR
%TARGET%
\x86>nul
2
>
nul
MKDIR
%TARGET%
\arm64
-v
8
a
>
nul
2
>
nul
SET
CC
=
%ANDROID_ARM_TOOLCHAIN%
\bin\arm
-linux-androideabi-gcc
.exe
IF
NOT
EXIST
%ANDROID_ARM_CC%
(
ECHO
"Make standalone toolchain for ARM arch"
python
.exe
%ANDROID_NDK_HOME%
\build\tools\make_standalone_toolchain.py
-
-arch
arm
^
-
-api
%MIN_API%
-
-install-dir
%ANDROID_ARM_TOOLCHAIN%
)
IF
NOT
EXIST
%ANDROID
_ARM64_CC
%
(
ECHO
"Make standalone toolchain for ARM64 arch"
python
.exe
%ANDROID_NDK_HOME%
\build\tools\make_standalone_toolchain.py
-
-arch
arm64
^
-
-api
%MIN_API%
-
-install-dir
%ANDROID
_ARM64_TOOLCHAIN
%
)
IF
NOT
EXIST
%ANDROID
_X86_CC
%
(
ECHO
"Make standalone toolchain for X86 arch"
python
.exe
%ANDROID_NDK_HOME%
\build\tools\make_standalone_toolchain.py
-
-arch
x86
^
-
-api
%MIN_API%
-
-install-dir
%ANDROID
_X86_TOOLCHAIN
%
)
REM Check environment availability
IF
NOT
EXIST
%CC%
(
ECHO
"gcc not found"
EXIT
1
)
WHERE
python
.exe
IF
"
%ERRORLEVEL%
"
==
1
(
ECHO
"python not found"
EXIT
1
)
WHERE
go
.exe
IF
NOT
EXIST
%GOROOT%
(
ECHO
"GOROOT not found"
EXIT
1
)
SET
GOPATH
=
%DIR%
SET
PATH
=
%GOROOT%
\bin
;
%GOPATH%
\bin
;
%PATH%
SET
BUILD
=
1
IF
EXIST
"
%TARGET%
\armeabi-v7a\liboverture.so"
(
IF
EXIST
"
%TARGET%
\arm64-v8a\liboverture.so"
(
IF
EXIST
"
%TARGET%
\x86\liboverture.so"
(
SET
BUILD
=
0
)
)
)
IF
%BUILD%
==
1
(
PUSHD
%GOPATH%
\src\github.com\shadowsocks\overture\main
ECHO
"Get dependences for overture"
go
.exe
get
-v
github
.com/shadowsocks/overture/main
ECHO
"Cross compile overture for arm"
IF
NOT
EXIST
"
%TARGET%
\armeabi-v7a\liboverture.so"
(
SETLOCAL
SET
CGO_ENABLED
=
1
SET
CC
=
%ANDROID_ARM_CC%
SET
GOOS
=
android
SET
GOARCH
=
arm
SET
GOARM
=
7
go
.exe
build
-ldflags
=
"-s -w"
%ANDROID_ARM_STRIP%
main
MOVE
main
%TARGET%
\armeabi
-v
7
a
\liboverture.so>nul
2
>
nul
ENDLOCAL
)
ECHO
"Cross compile overture for arm64"
IF
NOT
EXIST
"
%TARGET%
\arm64-v8a\liboverture.so"
(
SETLOCAL
SET
CGO_ENABLED
=
1
SET
CC
=
%ANDROID
_ARM64_CC
%
SET
GOOS
=
android
SET
GOARCH
=
arm64
go
.exe
build
-ldflags
=
"-s -w"
%ANDROID
_ARM64_STRIP
%
main
MOVE
main
%TARGET%
\arm64
-v
8
a
\liboverture.so>nul
2
>
nul
ENDLOCAL
)
ECHO
"Cross compile overture for x86"
IF
NOT
EXIST
"
%TARGET%
\x86\liboverture.so"
(
SETLOCAL
SET
CGO_ENABLED
=
1
SET
CC
=
%ANDROID
_X86_CC
%
SET
GOOS
=
android
SET
GOARCH
=
386
go
.exe
build
-ldflags
=
"-s -w"
%ANDROID
_X86_STRIP
%
main
MOVE
main
%TARGET%
\x86\liboverture.so>nul
2
>
nul
ENDLOCAL
)
POPD
)
ECHO
"Successfully build overture"
ENDLOCAL
overture
@
ffc00f97
Subproject commit ffc00f97fa7663a91011a10e46ae954cfda3837f
mobile/build.gradle
View file @
828cc457
...
...
@@ -48,7 +48,7 @@ android {
}
sourceSets
.
main
.
jniLibs
.
srcDirs
+=
new
File
(
project
(
':core'
).
buildDir
,
"intermediates/bundles/${getCurrentFlavor()}/jni"
)
sourceSets
.
main
.
jniLibs
.
srcDirs
+=
new
File
(
project
(
':core'
).
projectDir
,
"
src/overture/bin
"
)
sourceSets
.
main
.
jniLibs
.
srcDirs
+=
new
File
(
project
(
':core'
).
projectDir
,
"
build/go
"
)
}
dependencies
{
...
...
tv/build.gradle
View file @
828cc457
...
...
@@ -48,7 +48,7 @@ android {
}
sourceSets
.
main
.
jniLibs
.
srcDirs
+=
new
File
(
project
(
':core'
).
buildDir
,
"intermediates/bundles/${getCurrentFlavor()}/jni"
)
sourceSets
.
main
.
jniLibs
.
srcDirs
+=
new
File
(
project
(
':core'
).
projectDir
,
"
src/overture/bin
"
)
sourceSets
.
main
.
jniLibs
.
srcDirs
+=
new
File
(
project
(
':core'
).
projectDir
,
"
build/go
"
)
}
dependencies
{
...
...
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