Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.android.library") version "8.4.2" apply false
id("org.jetbrains.kotlin.android") version "2.2.0" apply false
id("com.android.library") version "8.2.0" apply false
id("org.jetbrains.kotlin.android") version "1.9.10" apply false
id("org.jlleitschuh.gradle.ktlint") version "11.5.1" apply true
id("org.mozilla.rust-android-gradle.rust-android") version "0.9.6" apply false
id("org.mozilla.rust-android-gradle.rust-android") version "0.9.3" apply false
id("maven-publish") apply true
}

allprojects {
group = "com.kape.android"
version = "0.1.0"
version = "0.1.1"
apply(plugin = "org.jlleitschuh.gradle.ktlint")
apply(plugin = "maven-publish")
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Dec 12 13:54:33 CET 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
37 changes: 15 additions & 22 deletions obfuscator/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ plugins {
android {
namespace = "com.kape.obfuscator"
ndkVersion = sdkDirectory.resolve("ndk").listFilesOrdered().last().name
// ndkVersion = "26.1.10909125"

compileSdk = 36
compileSdk = 34
defaultConfig {
minSdk = 24
externalNativeBuild.ndkBuild {
abiFilters("armeabi-v7a", "arm64-v8a", "x86", "x86_64")
arguments("-j${Runtime.getRuntime().availableProcessors()}")
ndk {
abiFilters += listOf("armeabi-v7a", "arm64-v8a", "x86", "x86_64")
}
}

Expand All @@ -38,16 +38,14 @@ android {
}
}

kotlin {
jvmToolchain(17)
}

cargo {
module = "src/main/rust/shadowsocks-rust"
libname = "sslocal"
targets = listOf("arm", "arm64", "x86", "x86_64")
profile = "release"
extraCargoBuildArguments = listOf("--bin", libname!!)
cargoCommand = "${System.getProperty("user.home")}/.cargo/bin/cargo"
rustcCommand = "${System.getProperty("user.home")}/.cargo/bin/rustc"
features {
noDefaultBut(
arrayOf(
Expand All @@ -64,20 +62,11 @@ cargo {
exec = { spec, toolchain ->
run {
try {
Runtime.getRuntime().exec(arrayOf("python3", "-V"))
Runtime.getRuntime().exec("python3 -V >/dev/null 2>&1")
spec.environment("RUST_ANDROID_GRADLE_PYTHON_COMMAND", "python3")
project.logger.lifecycle("Python 3 detected.")
} catch (e: java.io.IOException) {
project.logger.lifecycle("No python 3 detected.")
try {
Runtime.getRuntime().exec(arrayOf("python", "-V"))
spec.environment("RUST_ANDROID_GRADLE_PYTHON_COMMAND", "python")
project.logger.lifecycle("Python detected.")
} catch (e: java.io.IOException) {
throw GradleException("No any python version detected. You should install the python first to compile project.")
}
throw GradleException("Please install Python3 in order to compile.")
}
// https://developer.android.com/guide/practices/page-sizes#other-build-systems
spec.environment("RUST_ANDROID_GRADLE_CC_LINK_ARG", "-Wl,-z,max-page-size=16384,-soname,lib$libname.so")
spec.environment("RUST_ANDROID_GRADLE_LINKER_WRAPPER_PY", "$projectDir/$module/../linker-wrapper.py")
spec.environment("RUST_ANDROID_GRADLE_TARGET", "target/${toolchain.target}/$profile/lib$libname.so")
Expand All @@ -86,11 +75,15 @@ cargo {
}

tasks.whenTaskAdded {
when (name) {
"mergeDebugJniLibFolders", "mergeReleaseJniLibFolders" -> dependsOn("cargoBuild")
if (this.name == "javaPreCompileDebug" || this.name == "javaPreCompileRelease") {
this.dependsOn("cargoBuild")
}
}

kotlin {
jvmToolchain(17)
}

dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3")
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1

orbs:
windows: circleci/windows@5.1.0
windows: circleci/windows@2.4.0

jobs:
build-linux:
Expand Down Expand Up @@ -186,7 +186,7 @@ jobs:

publish-github-releases:
docker:
- image: circleci/golang:1.17
- image: circleci/golang:1.12
steps:
- attach_workspace:
at: /tmp/workspace
Expand Down
21 changes: 20 additions & 1 deletion obfuscator/src/main/rust/shadowsocks-rust/.github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,23 @@ updates:
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 0
open-pull-requests-limit: 10
ignore:
- dependency-name: libc
versions:
- 0.2.92
- dependency-name: tokio
versions:
- 1.4.0
- dependency-name: bloomfilter
versions:
- 1.0.5
- dependency-name: regex
versions:
- 1.4.5
- dependency-name: serde
versions:
- 1.0.124
- dependency-name: tower
versions:
- 0.4.6
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
name: Build & Test

on: [push, pull_request]
on:
push:
branches: [master]
pull_request:
branches: [master]

env:
CARGO_TERM_COLOR: always
RUST_LOG: "trace"

jobs:
build-and-test:
buid-test-check:
strategy:
matrix:
platform:
Expand All @@ -17,16 +21,8 @@ jobs:
runs-on: ${{ matrix.platform }}

steps:
- if: ${{ matrix.platform == 'ubuntu-latest' }}
name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
- uses: actions/checkout@v4
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- if: ${{ runner.os == 'Windows' }}
uses: ilammy/setup-nasm@v1
- if: ${{ matrix.platform == 'ubuntu-latest' }}
name: Install LLVM and Clang
run: sudo apt update && sudo apt install -y clang
- name: Install Rust
run: |
rustup set profile minimal
Expand All @@ -35,10 +31,6 @@ jobs:
rustup override set stable
- name: Build & Test (Default)
run: cargo test --verbose --no-fail-fast
- name: Build & Test (full)
run: cargo test --features "full" --verbose --no-fail-fast
- name: Build & Test (full-extra)
run: cargo test --features "full-extra" --verbose --no-fail-fast
- name: Build & Test (Default) - shadowsocks
run: cargo test --manifest-path ./crates/shadowsocks/Cargo.toml --verbose --no-fail-fast
- name: Build & Test (--no-default-features)
Expand All @@ -47,9 +39,9 @@ jobs:
run: cargo test --manifest-path ./crates/shadowsocks/Cargo.toml --verbose --no-default-features --no-fail-fast
- name: Build with All Features Enabled (Unix)
if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }}
run: cargo build --verbose --features "full-extra local-flow-stat utility-url-outline"
run: cargo build --verbose --features "local-http-rustls local-redir local-dns local-tun dns-over-tls dns-over-https stream-cipher aead-cipher-2022"
- name: Build with All Features Enabled (Windows)
if: ${{ runner.os == 'Windows' }}
run: cargo build --verbose --features "full-extra local-flow-stat utility-url-outline winservice"
run: cargo build --verbose --features "local-http-rustls local-dns dns-over-tls dns-over-https stream-cipher aead-cipher-2022"
- name: Build with All Features Enabled - shadowsocks
run: cargo build --manifest-path ./crates/shadowsocks/Cargo.toml --verbose --features "stream-cipher aead-cipher-extra aead-cipher-2022 aead-cipher-2022-extra security-replay-attack-detect"
run: cargo build --manifest-path ./crates/shadowsocks/Cargo.toml --verbose --features "stream-cipher aead-cipher-2022"
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- v*

jobs:
build-docker-image:
build:
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -14,22 +14,22 @@ jobs:
- sslocal
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker metadata
id: metadata
uses: docker/metadata-action@v5
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository_owner }}/${{ matrix.bin }}-rust
- name: Build and release Docker images
uses: docker/build-push-action@v6
uses: docker/build-push-action@v3
with:
platforms: linux/386,linux/amd64,linux/arm64/v8
target: ${{ matrix.bin }}
Expand Down

This file was deleted.

Loading