Skip to content

Commit

Permalink
Switch upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Jun 9, 2022
1 parent a405372 commit a594286
Show file tree
Hide file tree
Showing 19 changed files with 1,430 additions and 605 deletions.
5 changes: 1 addition & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "clash-foss"]
path = core/src/foss/golang/clash
url = https://github.com/Kr328/clash.git
[submodule "clash-premium"]
path = core/src/premium/golang/clash
url = https://github.com/Kr328/clash.git
url = https://github.com/MetaCubeX/Clash.Meta
57 changes: 2 additions & 55 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,3 @@
## Clash for Android
## CFA

A Graphical user interface of [clash](https://github.com/Dreamacro/clash) for Android

<a href="https://play.google.com/store/apps/details?id=com.github.kr328.clash"><img width="200px" alt="Get it on Google Play" src="https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png"/></a> or [Releases](https://github.com/Kr328/ClashForAndroid/releases)

### Feature

Fully feature of [clash](https://github.com/Dreamacro/clash) ~~(Exclude `external-controller`~~

### Requirement

- Android 5.0+ (minimum)
- Android 7.0+ (recommend)
- `armeabi-v7a` , `arm64-v8a`, `x86` or `x86_64` Architecture

### License

See also [LICENSE](./LICENSE) and [NOTICE](./NOTICE)

### Privacy Policy

See also [PRIVACY_POLICY.md](./PRIVACY_POLICY.md)

### Build

1. Update submodules

```bash
git submodule update --init --recursive
```

2. Install **OpenJDK 11**, **Android SDK**, **CMake** and **Golang**

3. Create `local.properties` in project root with

```properties
sdk.dir=/path/to/android-sdk
```

4. Create `signing.properties` in project root with

```properties
keystore.path=/path/to/keystore/file
keystore.password=<key store password>
key.alias=<key alias>
key.password=<key password>
```

5. Build

```bash
./gradlew app:assembleFossRelease
```

6. Pick `app-foss-<arch>-release.apk` in `app/build/outputs/apk/foss/release/`
?
5 changes: 0 additions & 5 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ dependencies {
implementation(libs.androidx.coordinator)
implementation(libs.androidx.recyclerview)
implementation(libs.google.material)

val premiumImplementation by configurations

premiumImplementation(libs.appcenter.analytics)
premiumImplementation(libs.appcenter.crashes)
}

tasks.getByName("clean", type = Delete::class) {
Expand Down
31 changes: 0 additions & 31 deletions app/src/premium/java/com/github/kr328/clash/Tracker.kt

This file was deleted.

34 changes: 8 additions & 26 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ subprojects {
extensions.configure<BaseExtension> {
defaultConfig {
if (isApp) {
applicationId = "com.github.kr328.clash"
applicationId = "com.github.metacubex.clash"
}

minSdk = 21
Expand Down Expand Up @@ -72,35 +72,22 @@ subprojects {
productFlavors {
flavorDimensions("feature")

create("foss") {
create("meta") {
isDefault = true
dimension = flavorDimensionList[0]
versionNameSuffix = ".foss"
versionNameSuffix = ".meta"

buildConfigField("boolean", "PREMIUM", "Boolean.parseBoolean(\"false\")")

if (isApp) {
applicationIdSuffix = ".foss"
applicationIdSuffix = ".meta"
}
}
create("premium") {
dimension = flavorDimensionList[0]
versionNameSuffix = ".premium"

buildConfigField("boolean", "PREMIUM", "Boolean.parseBoolean(\"true\")")

val tracker = rootProject.file("tracker.properties")
if (tracker.exists()) {
val prop = Properties().apply {
tracker.inputStream().use(this::load)
}
}

buildConfigField(
"String",
"APP_CENTER_KEY",
"\"${prop.getProperty("appcenter.key")!!}\""
)
}
sourceSets {
getByName("meta") {
java.srcDirs("src/foss/java")
}
}

Expand Down Expand Up @@ -141,11 +128,6 @@ subprojects {
}
}

variantFilter {
ignore = name.startsWith("premium") && !project(":core")
.file("src/premium/golang/clash/go.mod").exists()
}

if (isApp) {
this as AppExtension

Expand Down
6 changes: 1 addition & 5 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,10 @@ val golangSource = file("src/main/golang/native")

golang {
sourceSets {
create("foss") {
create("meta") {
tags.set(listOf("foss"))
srcDir.set(file("src/foss/golang"))
}
create("premium") {
tags.set(listOf("premium", "without_gvisor", "without_system"))
srcDir.set(file("src/premium/golang"))
}
all {
fileName.set("libclash.so")
packageName.set("cfa/native")
Expand Down
2 changes: 1 addition & 1 deletion core/src/foss/golang/clash
Submodule clash updated from c0174c to bb797d
68 changes: 52 additions & 16 deletions core/src/foss/golang/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,70 @@ require cfa v0.0.0
require (
cfa/blob v0.0.0 // indirect
github.com/Dreamacro/clash v1.7.1 // indirect
github.com/Dreamacro/go-shadowsocks2 v0.1.7 // indirect
github.com/Kr328/tun2socket v0.0.0-20220414050025-d07c78d06d34 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cheekybits/genny v1.0.0 // indirect
github.com/coreos/go-iptables v0.6.0 // indirect
github.com/dlclark/regexp2 v1.4.0 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect
github.com/gofrs/uuid v4.2.0+incompatible // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gopacket v1.1.19 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/insomniacslk/dhcp v0.0.0-20220119180841-3c283ff8b7dd // indirect
github.com/kr/pretty v0.1.0 // indirect
github.com/miekg/dns v1.1.47 // indirect
github.com/oschwald/geoip2-golang v1.6.1 // indirect
github.com/oschwald/maxminddb-golang v1.8.0 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/insomniacslk/dhcp v0.0.0-20220504074936-1ca156eafb9f // indirect
github.com/klauspost/cpuid/v2 v2.0.12 // indirect
github.com/lucas-clemente/quic-go v0.27.0 // indirect
github.com/lunixbochs/struc v0.0.0-20200707160740-784aaebc1d40 // indirect
github.com/marten-seemann/qtls-go1-16 v0.1.5 // indirect
github.com/marten-seemann/qtls-go1-17 v0.1.1 // indirect
github.com/marten-seemann/qtls-go1-18 v0.1.1 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/miekg/dns v1.1.49 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/onsi/ginkgo v1.16.5 // indirect
github.com/oschwald/geoip2-golang v1.7.0 // indirect
github.com/oschwald/maxminddb-golang v1.9.0 // indirect
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
github.com/prometheus/client_golang v1.12.2 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.32.1 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/sagernet/sing v0.0.0-20220606113732-5efacc1c7db5 // indirect
github.com/sagernet/sing-shadowsocks v0.0.0-20220607021139-f9c820eb0fc8 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/u-root/uio v0.0.0-20210528151154-e40b768296a7 // indirect
github.com/tobyxdd/hysteria v1.0.4 // indirect
github.com/txthinking/runnergroup v0.0.0-20210608031112-152c7c4432bf // indirect
github.com/txthinking/socks5 v0.0.0-20220212043548-414499347d4a // indirect
github.com/txthinking/x v0.0.0-20210326105829-476fab902fbe // indirect
github.com/u-root/uio v0.0.0-20220204230159-dac05f7d2cb4 // indirect
github.com/xtls/go v0.0.0-20210920065950-d4af136d3672 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
go.uber.org/atomic v1.9.0 // indirect
golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd // indirect
golang.org/x/mod v0.4.2 // indirect
golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/tools v0.1.6-0.20210726203631-07bc1bf47fb2 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect
golang.org/x/exp v0.0.0-20220518171630-0b5c67f07fdf // indirect
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect
golang.org/x/net v0.0.0-20220526153639-5463443f8c37 // indirect
golang.org/x/sync v0.0.0-20220513210516-0976fa681c29 // indirect
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect
golang.org/x/text v0.3.8-0.20220124021120-d1c84af989ab // indirect
golang.org/x/tools v0.1.10 // indirect
golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0 // indirect
lukechampine.com/blake3 v1.1.7 // indirect
)

replace cfa => ../../main/golang

replace github.com/Dreamacro/clash => ./clash

replace cfa/blob => ../../../build/intermediates/golang_blob

replace github.com/tobyxdd/hysteria => github.com/MetaCubeX/hysteria v1.0.5-0.20220607074613-210c46c75b15

replace github.com/lucas-clemente/quic-go => github.com/tobyxdd/quic-go v0.27.1-0.20220512040129-ed2a645d9218
Loading

0 comments on commit a594286

Please sign in to comment.