Skip to content

Commit 7d9798c

Browse files
committed
upload code
0 parents  commit 7d9798c

513 files changed

Lines changed: 46925 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: Bug Report zh_CN
3+
about: 问题反馈,在提出问题前请先自行排除服务器端问题和升级到最新客户端。
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**描述问题**
11+
12+
预期行为:
13+
14+
实际行为:
15+
16+
**如何复现**
17+
18+
提供有帮助的截图,录像,文字说明,订阅链接等。
19+
20+
**日志**
21+
22+
如果有日志,请上传。请在文档内查看导出日志的详细步骤。
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
name: Feature Request zh_CN
3+
about: 功能请求,提出建议。
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**描述建议**
11+
12+
**建议的必要性**

.github/workflows/release.yml

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
name: Release Build
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
tag:
6+
description: 'Release Tag'
7+
required: true
8+
upload:
9+
description: 'Upload: If want ignore'
10+
required: false
11+
publish:
12+
description: 'Publish: If want ignore'
13+
required: false
14+
play:
15+
description: 'Play: If want ignore'
16+
required: false
17+
jobs:
18+
libcore:
19+
name: Native Build (LibCore)
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v3
24+
- name: Golang Status
25+
run: find buildScript libcore/*.sh | xargs cat | sha1sum > golang_status
26+
- name: Libcore Status
27+
run: git ls-files libcore | xargs cat | sha1sum > libcore_status
28+
- name: LibCore Cache
29+
id: cache
30+
uses: actions/cache@v3
31+
with:
32+
path: |
33+
app/libs/libcore.aar
34+
key: ${{ hashFiles('.github/workflows/*', 'golang_status', 'libcore_status') }}
35+
- name: Golang Cache
36+
if: steps.cache.outputs.cache-hit != 'true'
37+
uses: actions/cache@v3
38+
with:
39+
path: build/golang
40+
key: go-${{ hashFiles('.github/workflows/*', 'golang_status') }}
41+
- name: Native Build
42+
if: steps.cache.outputs.cache-hit != 'true'
43+
run: ./run init action go && ./run lib core
44+
build:
45+
name: Build OSS APK
46+
runs-on: ubuntu-latest
47+
needs:
48+
- libcore
49+
steps:
50+
- name: Checkout
51+
uses: actions/checkout@v3
52+
- name: Golang Status
53+
run: find buildScript libcore/*.sh | xargs cat | sha1sum > golang_status
54+
- name: Libcore Status
55+
run: git ls-files libcore | xargs cat | sha1sum > libcore_status
56+
- name: LibCore Cache
57+
uses: actions/cache@v3
58+
with:
59+
path: |
60+
app/libs/libcore.aar
61+
key: ${{ hashFiles('.github/workflows/*', 'golang_status', 'libcore_status') }}
62+
- name: Gradle cache
63+
uses: actions/cache@v3
64+
with:
65+
path: ~/.gradle
66+
key: gradle-oss-${{ hashFiles('**/*.gradle.kts') }}
67+
- name: Gradle Build
68+
env:
69+
BUILD_PLUGIN: none
70+
run: |
71+
echo "sdk.dir=${ANDROID_HOME}" > local.properties
72+
echo "ndk.dir=${ANDROID_HOME}/ndk/25.0.8775105" >> local.properties
73+
export LOCAL_PROPERTIES="${{ secrets.LOCAL_PROPERTIES }}"
74+
./run init action gradle
75+
./gradlew app:assembleOssRelease
76+
APK=$(find app/build/outputs/apk -name '*arm64-v8a*.apk')
77+
APK=$(dirname $APK)
78+
echo "APK=$APK" >> $GITHUB_ENV
79+
- uses: actions/upload-artifact@v3
80+
with:
81+
name: APKs
82+
path: ${{ env.APK }}
83+
publish:
84+
name: Publish Release
85+
if: github.event.inputs.publish != 'y'
86+
runs-on: ubuntu-latest
87+
needs: build
88+
steps:
89+
- name: Checkout
90+
uses: actions/checkout@v3
91+
- name: Donwload Artifacts
92+
uses: actions/download-artifact@v3
93+
with:
94+
name: APKs
95+
path: artifacts
96+
- name: Release
97+
run: |
98+
wget -O ghr.tar.gz https://github.com/tcnksm/ghr/releases/download/v0.13.0/ghr_v0.13.0_linux_amd64.tar.gz
99+
tar -xvf ghr.tar.gz
100+
mv ghr*linux_amd64/ghr .
101+
mkdir apks
102+
find artifacts -name "*.apk" -exec cp {} apks \;
103+
./ghr -delete -t "${{ github.token }}" -n "${{ github.event.inputs.tag }}" "${{ github.event.inputs.tag }}" apks
104+
upload:
105+
name: Upload Release
106+
if: github.event.inputs.upload != 'y'
107+
runs-on: ubuntu-latest
108+
needs: build
109+
steps:
110+
- name: Donwload Artifacts
111+
uses: actions/download-artifact@v3
112+
with:
113+
name: APKs
114+
path: artifacts
115+
- name: Release
116+
run: |
117+
mkdir apks
118+
find artifacts -name "*.apk" -exec cp {} apks \;
119+
120+
function upload() {
121+
for apk in $@; do
122+
echo ">> Uploading $apk"
123+
curl https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN }}/sendDocument \
124+
-X POST \
125+
-F chat_id="${{ secrets.TELEGRAM_CHANNEL }}" \
126+
-F document="@$apk" \
127+
--silent --show-error --fail >/dev/null &
128+
done
129+
for job in $(jobs -p); do
130+
wait $job || exit 1
131+
done
132+
}
133+
upload apks/*
134+
play:
135+
name: Build Play Bundle
136+
if: github.event.inputs.play != 'y'
137+
runs-on: ubuntu-latest
138+
needs:
139+
- libcore
140+
steps:
141+
- name: Checkout
142+
uses: actions/checkout@v3
143+
- name: Golang Status
144+
run: find buildScript libcore/*.sh | xargs cat | sha1sum > golang_status
145+
- name: Libcore Status
146+
run: git ls-files libcore | xargs cat | sha1sum > libcore_status
147+
- name: LibCore Cache
148+
uses: actions/cache@v3
149+
with:
150+
path: |
151+
app/libs/libcore.aar
152+
key: ${{ hashFiles('.github/workflows/*', 'golang_status', 'libcore_status') }}
153+
- name: Gradle cache
154+
uses: actions/cache@v3
155+
with:
156+
path: ~/.gradle
157+
key: gradle-play-${{ hashFiles('**/*.gradle.kts') }}
158+
- name: Checkout Library
159+
run: |
160+
git submodule update --init 'app/*'
161+
- name: Gradle Build
162+
run: |
163+
echo "sdk.dir=${ANDROID_HOME}" > local.properties
164+
echo "ndk.dir=${ANDROID_HOME}/ndk/25.0.8775105" >> local.properties
165+
export LOCAL_PROPERTIES="${{ secrets.LOCAL_PROPERTIES }}"
166+
./run init action gradle
167+
./gradlew bundlePlayRelease
168+
- uses: actions/upload-artifact@v3
169+
with:
170+
name: AAB
171+
path: app/build/outputs/bundle/playRelease/app-play-release.aab

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
*.iml
2+
.gradle
3+
.idea
4+
.vscode
5+
.DS_Store
6+
build/
7+
/captures
8+
.externalNativeBuild
9+
.cxx
10+
local.properties
11+
/app/libs/
12+
/app/src/main/assets/sing-box
13+
/service_account_credentials.json
14+
jniLibs/
15+
/library/libcore_build/
16+
.idea/deploymentTargetDropDown.xml
17+
/nkmr
18+
19+
# submodules
20+
/external

AUTHORS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
SagerNet was originally created in late 2021, by
2+
nekohasekai <contact-sagernet@sekai.icu>.
3+
4+
Here is an inevitably incomplete list of MUCH-APPRECIATED CONTRIBUTORS --
5+
people who have submitted patches, fixed bugs, added translations, and
6+
generally made SagerNet that much better:
7+
8+
https://github.com/SagerNet/SagerNet/graphs/contributors

LICENSE

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Copyright (C) 2021 by nekohasekai <contact-sagernet@sekai.icu>
2+
3+
This program is free software: you can redistribute it and/or modify
4+
it under the terms of the GNU General Public License as published by
5+
the Free Software Foundation, either version 3 of the License, or
6+
(at your option) any later version.
7+
8+
This program is distributed in the hope that it will be useful,
9+
but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
GNU General Public License for more details.
12+
13+
You should have received a copy of the GNU General Public License
14+
along with this program. If not, see <http://www.gnu.org/licenses/>.

README.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# NekoBox for Android
2+
3+
[![API](https://img.shields.io/badge/API-21%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=21)
4+
[![Releases](https://img.shields.io/github/v/release/MatsuriDayo/NekoBoxForAndroid)](https://github.com/MatsuriDayo/NekoBoxForAndroid/releases)
5+
[![License: GPL-3.0](https://img.shields.io/badge/license-GPL--3.0-orange.svg)](https://www.gnu.org/licenses/gpl-3.0)
6+
7+
sing-box / universal proxy toolchain for Android.
8+
9+
## 下载 / Downloads
10+
11+
### GitHub Releases
12+
13+
[![GitHub All Releases](https://img.shields.io/github/downloads/Matsuridayo/NekoBoxForAndroid/total?label=downloads-total&logo=github&style=flat-square)](https://github.com/Matsuridayo/NekoBoxForAndroid/releases)
14+
15+
[下载](https://github.com/Matsuridayo/NekoBoxForAndroid/releases)
16+
17+
## 更改记录 & 发布频道 / Changelog & Telegram channel
18+
19+
https://t.me/Matsuridayo
20+
21+
## 项目主页 & 文档 / Homepage & Documents
22+
23+
https://matsuridayo.github.io
24+
25+
## 代理 / Proxy
26+
27+
* SOCKS (4/4a/5)
28+
* HTTP(S)
29+
* SSH
30+
* Shadowsocks
31+
* VMess
32+
* VLESS
33+
* WireGuard
34+
* Trojan
35+
* Trojan-Go ( trojan-go-plugin )
36+
* NaïveProxy ( naive-plugin )
37+
* Hysteria ( hysteria-plugin )
38+
39+
请到项目主页下载插件。
40+
41+
Please go to the project homepage to download plugins.
42+
43+
### 订阅 / Subscription
44+
45+
* Raw: some widely used formats (like shadowsocks, clash and v2rayN)
46+
* 原始格式:一些广泛使用的格式(如 shadowsocks、clash 和 v2rayN)
47+
* [Open Online Config](https://github.com/Shadowsocks-NET/OpenOnlineConfig)
48+
* [Shadowsocks SIP008](https://shadowsocks.org/guide/sip008.html)
49+
50+
### 捐助 / Donate
51+
52+
欢迎捐赠以支持项目开发。
53+
54+
USDT TRC20
55+
56+
`TRhnA7SXE5Sap5gSG3ijxRmdYFiD4KRhPs`
57+
58+
XMR
59+
60+
`49bwESYQjoRL3xmvTcjZKHEKaiGywjLYVQJMUv79bXonGiyDCs8AzE3KiGW2ytTybBCpWJUvov8SjZZEGg66a4e59GXa6k5`

app/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/build
2+
/schemas

app/build.gradle.kts

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
plugins {
2+
id("com.android.application")
3+
id("kotlin-android")
4+
id("kotlin-kapt")
5+
id("kotlin-parcelize")
6+
}
7+
8+
setupApp()
9+
10+
android {
11+
compileOptions {
12+
isCoreLibraryDesugaringEnabled = true
13+
}
14+
kapt.arguments {
15+
arg("room.incremental", true)
16+
arg("room.schemaLocation", "$projectDir/schemas")
17+
}
18+
bundle {
19+
language {
20+
enableSplit = false
21+
}
22+
}
23+
buildFeatures {
24+
viewBinding = true
25+
}
26+
namespace = "io.nekohasekai.sagernet"
27+
}
28+
29+
dependencies {
30+
31+
implementation(fileTree("libs"))
32+
33+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.3")
34+
implementation("androidx.core:core-ktx:1.7.0")
35+
implementation("androidx.recyclerview:recyclerview:1.2.1")
36+
implementation("androidx.activity:activity-ktx:1.4.0")
37+
implementation("androidx.fragment:fragment-ktx:1.4.1")
38+
implementation("androidx.browser:browser:1.4.0")
39+
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
40+
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
41+
implementation("androidx.navigation:navigation-fragment-ktx:2.4.2")
42+
implementation("androidx.navigation:navigation-ui-ktx:2.4.2")
43+
implementation("androidx.preference:preference-ktx:1.2.0")
44+
implementation("androidx.appcompat:appcompat:1.4.1")
45+
implementation("androidx.work:work-runtime-ktx:2.7.1")
46+
implementation("androidx.work:work-multiprocess:2.7.1")
47+
48+
implementation(project(":external:preferencex:preferencex"))
49+
implementation(project(":external:preferencex:preferencex-simplemenu"))
50+
51+
implementation("com.google.android.material:material:1.6.0")
52+
implementation("com.google.code.gson:gson:2.8.9")
53+
54+
implementation("com.github.jenly1314:zxing-lite:2.1.1")
55+
implementation("com.afollestad.material-dialogs:core:3.3.0")
56+
implementation("com.afollestad.material-dialogs:input:3.3.0")
57+
58+
implementation("com.squareup.okhttp3:okhttp:5.0.0-alpha.3")
59+
implementation("org.yaml:snakeyaml:1.30")
60+
implementation("com.github.daniel-stoneuk:material-about-library:3.2.0-rc01")
61+
implementation("com.jakewharton:process-phoenix:2.1.2")
62+
implementation("com.esotericsoftware:kryo:5.2.1")
63+
implementation("com.google.guava:guava:31.0.1-android")
64+
implementation("org.ini4j:ini4j:0.5.4")
65+
66+
implementation("com.simplecityapps:recyclerview-fastscroll:2.0.1") {
67+
exclude(group = "androidx.recyclerview")
68+
exclude(group = "androidx.appcompat")
69+
}
70+
implementation("org.smali:dexlib2:2.5.2") {
71+
exclude(group = "com.google.guava", module = "guava")
72+
}
73+
74+
implementation("androidx.room:room-runtime:2.4.2")
75+
kapt("androidx.room:room-compiler:2.4.2")
76+
implementation("androidx.room:room-ktx:2.4.2")
77+
implementation("com.github.MatrixDev.Roomigrant:RoomigrantLib:0.3.4")
78+
kapt("com.github.MatrixDev.Roomigrant:RoomigrantCompiler:0.3.4")
79+
80+
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.1.5")
81+
}

0 commit comments

Comments
 (0)