From da3646b79fbd1eac8877b02204db357889c80d73 Mon Sep 17 00:00:00 2001 From: Andy Wang Date: Sun, 7 Jul 2024 00:19:11 +0100 Subject: [PATCH] Make Cloak a submodule --- .github/workflows/android.yml | 4 +++- .gitmodules | 3 +++ README.md | 2 +- app/src/Cloak | 1 + app/src/{make.sh => build.sh} | 12 ++---------- 5 files changed, 10 insertions(+), 12 deletions(-) create mode 100644 .gitmodules create mode 160000 app/src/Cloak rename app/src/{make.sh => build.sh} (91%) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 6381eb0..3be5de3 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -12,6 +12,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + submodules: true - name: Set up Go uses: actions/setup-go@v5.0.1 @@ -36,7 +38,7 @@ jobs: - name: Compile Go libs run: | pushd 'app/src' - ./make.sh + ./build.sh popd - name: Build with Gradle diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..9692c14 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "app/src/Cloak"] + path = app/src/Cloak + url = https://github.com/cbeuw/Cloak diff --git a/README.md b/README.md index a62e4a8..c886821 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/app/src/Cloak b/app/src/Cloak new file mode 160000 index 0000000..dc2e83f --- /dev/null +++ b/app/src/Cloak @@ -0,0 +1 @@ +Subproject commit dc2e83f75f2d78a2cf314c2a2a8c99d741215714 diff --git a/app/src/make.sh b/app/src/build.sh similarity index 91% rename from app/src/make.sh rename to app/src/build.sh index 6025a43..56bf805 100755 --- a/app/src/make.sh +++ b/app/src/build.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -e +set -euxo pipefail function getHostTag() { # Copyright (C) 2022 The Android Open Source Project @@ -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 @@ -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"