Skip to content

Commit

Permalink
Make Cloak a submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeuw committed Jul 6, 2024
1 parent f9bd443 commit da3646b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Set up Go
uses: actions/[email protected]
Expand All @@ -36,7 +38,7 @@ jobs:
- name: Compile Go libs
run: |
pushd 'app/src'
./make.sh
./build.sh
popd
- name: Build with Gradle
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "app/src/Cloak"]
path = app/src/Cloak
url = https://github.com/cbeuw/Cloak
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ Shadowsocks plugin Cloak for Android
## Build Instructions

1. Install the appropriate SDK & NDK versions in Android Studio's SDK manager
2. Execute `cd app/src && ./make.sh`
2. Execute `cd app/src && ./build.sh`
3. Build with Android Studio
1 change: 1 addition & 0 deletions app/src/Cloak
Submodule Cloak added at dc2e83
12 changes: 2 additions & 10 deletions app/src/make.sh → app/src/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

set -e
set -euxo pipefail

function getHostTag() {
# Copyright (C) 2022 The Android Open Source Project
Expand Down Expand Up @@ -55,7 +55,6 @@ function getHostTag() {

pushd ../..
ANDROID_NDK_HOME="${ANDROID_NDK_HOME:-$(./gradlew -q printNDKPath)}"
CK_RELEASE_TAG=v"$(./gradlew -q printVersionName)"
popd

while [ ! -d "$ANDROID_NDK_HOME" ]; do
Expand All @@ -76,17 +75,10 @@ ANDROID_X86_CC="$ANDROID_PREBUILT_TOOLCHAIN/bin/i686-linux-android${MIN_API}-cla
ANDROID_X86_64_CC="$ANDROID_PREBUILT_TOOLCHAIN/bin/x86_64-linux-android${MIN_API}-clang"

SRC_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
DEPS="$(pwd)/.deps"
mkdir -p "$DEPS" "$SRC_DIR/main/jniLibs/armeabi-v7a" "$SRC_DIR/main/jniLibs/x86" "$SRC_DIR/main/jniLibs/arm64-v8a" "$SRC_DIR/main/jniLibs/x86_64"
mkdir -p "$SRC_DIR/main/jniLibs/armeabi-v7a" "$SRC_DIR/main/jniLibs/x86" "$SRC_DIR/main/jniLibs/arm64-v8a" "$SRC_DIR/main/jniLibs/x86_64"

cd "$DEPS"
echo "Getting Cloak source code"
rm -rf Cloak
git clone https://github.com/cbeuw/Cloak
cd Cloak
git checkout tags/$CK_RELEASE_TAG
go get ./...

cd cmd/ck-client

echo "Cross compiling ckclient for arm"
Expand Down

0 comments on commit da3646b

Please sign in to comment.