Skip to content

Commit

Permalink
upload code
Browse files Browse the repository at this point in the history
  • Loading branch information
arm64v8a committed Mar 15, 2023
0 parents commit 7d9798c
Show file tree
Hide file tree
Showing 513 changed files with 46,925 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report-zh_cn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Bug Report zh_CN
about: 问题反馈,在提出问题前请先自行排除服务器端问题和升级到最新客户端。
title: ''
labels: ''
assignees: ''

---

**描述问题**

预期行为:

实际行为:

**如何复现**

提供有帮助的截图,录像,文字说明,订阅链接等。

**日志**

如果有日志,请上传。请在文档内查看导出日志的详细步骤。
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request-zh_cn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Feature Request zh_CN
about: 功能请求,提出建议。
title: ''
labels: ''
assignees: ''

---

**描述建议**

**建议的必要性**
171 changes: 171 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
name: Release Build
on:
workflow_dispatch:
inputs:
tag:
description: 'Release Tag'
required: true
upload:
description: 'Upload: If want ignore'
required: false
publish:
description: 'Publish: If want ignore'
required: false
play:
description: 'Play: If want ignore'
required: false
jobs:
libcore:
name: Native Build (LibCore)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Golang Status
run: find buildScript libcore/*.sh | xargs cat | sha1sum > golang_status
- name: Libcore Status
run: git ls-files libcore | xargs cat | sha1sum > libcore_status
- name: LibCore Cache
id: cache
uses: actions/cache@v3
with:
path: |
app/libs/libcore.aar
key: ${{ hashFiles('.github/workflows/*', 'golang_status', 'libcore_status') }}
- name: Golang Cache
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/cache@v3
with:
path: build/golang
key: go-${{ hashFiles('.github/workflows/*', 'golang_status') }}
- name: Native Build
if: steps.cache.outputs.cache-hit != 'true'
run: ./run init action go && ./run lib core
build:
name: Build OSS APK
runs-on: ubuntu-latest
needs:
- libcore
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Golang Status
run: find buildScript libcore/*.sh | xargs cat | sha1sum > golang_status
- name: Libcore Status
run: git ls-files libcore | xargs cat | sha1sum > libcore_status
- name: LibCore Cache
uses: actions/cache@v3
with:
path: |
app/libs/libcore.aar
key: ${{ hashFiles('.github/workflows/*', 'golang_status', 'libcore_status') }}
- name: Gradle cache
uses: actions/cache@v3
with:
path: ~/.gradle
key: gradle-oss-${{ hashFiles('**/*.gradle.kts') }}
- name: Gradle Build
env:
BUILD_PLUGIN: none
run: |
echo "sdk.dir=${ANDROID_HOME}" > local.properties
echo "ndk.dir=${ANDROID_HOME}/ndk/25.0.8775105" >> local.properties
export LOCAL_PROPERTIES="${{ secrets.LOCAL_PROPERTIES }}"
./run init action gradle
./gradlew app:assembleOssRelease
APK=$(find app/build/outputs/apk -name '*arm64-v8a*.apk')
APK=$(dirname $APK)
echo "APK=$APK" >> $GITHUB_ENV
- uses: actions/upload-artifact@v3
with:
name: APKs
path: ${{ env.APK }}
publish:
name: Publish Release
if: github.event.inputs.publish != 'y'
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Donwload Artifacts
uses: actions/download-artifact@v3
with:
name: APKs
path: artifacts
- name: Release
run: |
wget -O ghr.tar.gz https://github.com/tcnksm/ghr/releases/download/v0.13.0/ghr_v0.13.0_linux_amd64.tar.gz
tar -xvf ghr.tar.gz
mv ghr*linux_amd64/ghr .
mkdir apks
find artifacts -name "*.apk" -exec cp {} apks \;
./ghr -delete -t "${{ github.token }}" -n "${{ github.event.inputs.tag }}" "${{ github.event.inputs.tag }}" apks
upload:
name: Upload Release
if: github.event.inputs.upload != 'y'
runs-on: ubuntu-latest
needs: build
steps:
- name: Donwload Artifacts
uses: actions/download-artifact@v3
with:
name: APKs
path: artifacts
- name: Release
run: |
mkdir apks
find artifacts -name "*.apk" -exec cp {} apks \;
function upload() {
for apk in $@; do
echo ">> Uploading $apk"
curl https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN }}/sendDocument \
-X POST \
-F chat_id="${{ secrets.TELEGRAM_CHANNEL }}" \
-F document="@$apk" \
--silent --show-error --fail >/dev/null &
done
for job in $(jobs -p); do
wait $job || exit 1
done
}
upload apks/*
play:
name: Build Play Bundle
if: github.event.inputs.play != 'y'
runs-on: ubuntu-latest
needs:
- libcore
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Golang Status
run: find buildScript libcore/*.sh | xargs cat | sha1sum > golang_status
- name: Libcore Status
run: git ls-files libcore | xargs cat | sha1sum > libcore_status
- name: LibCore Cache
uses: actions/cache@v3
with:
path: |
app/libs/libcore.aar
key: ${{ hashFiles('.github/workflows/*', 'golang_status', 'libcore_status') }}
- name: Gradle cache
uses: actions/cache@v3
with:
path: ~/.gradle
key: gradle-play-${{ hashFiles('**/*.gradle.kts') }}
- name: Checkout Library
run: |
git submodule update --init 'app/*'
- name: Gradle Build
run: |
echo "sdk.dir=${ANDROID_HOME}" > local.properties
echo "ndk.dir=${ANDROID_HOME}/ndk/25.0.8775105" >> local.properties
export LOCAL_PROPERTIES="${{ secrets.LOCAL_PROPERTIES }}"
./run init action gradle
./gradlew bundlePlayRelease
- uses: actions/upload-artifact@v3
with:
name: AAB
path: app/build/outputs/bundle/playRelease/app-play-release.aab
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
*.iml
.gradle
.idea
.vscode
.DS_Store
build/
/captures
.externalNativeBuild
.cxx
local.properties
/app/libs/
/app/src/main/assets/sing-box
/service_account_credentials.json
jniLibs/
/library/libcore_build/
.idea/deploymentTargetDropDown.xml
/nkmr

# submodules
/external
8 changes: 8 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
SagerNet was originally created in late 2021, by
nekohasekai <[email protected]>.

Here is an inevitably incomplete list of MUCH-APPRECIATED CONTRIBUTORS --
people who have submitted patches, fixed bugs, added translations, and
generally made SagerNet that much better:

https://github.com/SagerNet/SagerNet/graphs/contributors
14 changes: 14 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Copyright (C) 2021 by nekohasekai <[email protected]>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
60 changes: 60 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# NekoBox for Android

[![API](https://img.shields.io/badge/API-21%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=21)
[![Releases](https://img.shields.io/github/v/release/MatsuriDayo/NekoBoxForAndroid)](https://github.com/MatsuriDayo/NekoBoxForAndroid/releases)
[![License: GPL-3.0](https://img.shields.io/badge/license-GPL--3.0-orange.svg)](https://www.gnu.org/licenses/gpl-3.0)

sing-box / universal proxy toolchain for Android.

## 下载 / Downloads

### GitHub Releases

[![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)

[下载](https://github.com/Matsuridayo/NekoBoxForAndroid/releases)

## 更改记录 & 发布频道 / Changelog & Telegram channel

https://t.me/Matsuridayo

## 项目主页 & 文档 / Homepage & Documents

https://matsuridayo.github.io

## 代理 / Proxy

* SOCKS (4/4a/5)
* HTTP(S)
* SSH
* Shadowsocks
* VMess
* VLESS
* WireGuard
* Trojan
* Trojan-Go ( trojan-go-plugin )
* NaïveProxy ( naive-plugin )
* Hysteria ( hysteria-plugin )

请到项目主页下载插件。

Please go to the project homepage to download plugins.

### 订阅 / Subscription

* Raw: some widely used formats (like shadowsocks, clash and v2rayN)
* 原始格式:一些广泛使用的格式(如 shadowsocks、clash 和 v2rayN)
* [Open Online Config](https://github.com/Shadowsocks-NET/OpenOnlineConfig)
* [Shadowsocks SIP008](https://shadowsocks.org/guide/sip008.html)

### 捐助 / Donate

欢迎捐赠以支持项目开发。

USDT TRC20

`TRhnA7SXE5Sap5gSG3ijxRmdYFiD4KRhPs`

XMR

`49bwESYQjoRL3xmvTcjZKHEKaiGywjLYVQJMUv79bXonGiyDCs8AzE3KiGW2ytTybBCpWJUvov8SjZZEGg66a4e59GXa6k5`
2 changes: 2 additions & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/build
/schemas
81 changes: 81 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
plugins {
id("com.android.application")
id("kotlin-android")
id("kotlin-kapt")
id("kotlin-parcelize")
}

setupApp()

android {
compileOptions {
isCoreLibraryDesugaringEnabled = true
}
kapt.arguments {
arg("room.incremental", true)
arg("room.schemaLocation", "$projectDir/schemas")
}
bundle {
language {
enableSplit = false
}
}
buildFeatures {
viewBinding = true
}
namespace = "io.nekohasekai.sagernet"
}

dependencies {

implementation(fileTree("libs"))

implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.3")
implementation("androidx.core:core-ktx:1.7.0")
implementation("androidx.recyclerview:recyclerview:1.2.1")
implementation("androidx.activity:activity-ktx:1.4.0")
implementation("androidx.fragment:fragment-ktx:1.4.1")
implementation("androidx.browser:browser:1.4.0")
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("androidx.navigation:navigation-fragment-ktx:2.4.2")
implementation("androidx.navigation:navigation-ui-ktx:2.4.2")
implementation("androidx.preference:preference-ktx:1.2.0")
implementation("androidx.appcompat:appcompat:1.4.1")
implementation("androidx.work:work-runtime-ktx:2.7.1")
implementation("androidx.work:work-multiprocess:2.7.1")

implementation(project(":external:preferencex:preferencex"))
implementation(project(":external:preferencex:preferencex-simplemenu"))

implementation("com.google.android.material:material:1.6.0")
implementation("com.google.code.gson:gson:2.8.9")

implementation("com.github.jenly1314:zxing-lite:2.1.1")
implementation("com.afollestad.material-dialogs:core:3.3.0")
implementation("com.afollestad.material-dialogs:input:3.3.0")

implementation("com.squareup.okhttp3:okhttp:5.0.0-alpha.3")
implementation("org.yaml:snakeyaml:1.30")
implementation("com.github.daniel-stoneuk:material-about-library:3.2.0-rc01")
implementation("com.jakewharton:process-phoenix:2.1.2")
implementation("com.esotericsoftware:kryo:5.2.1")
implementation("com.google.guava:guava:31.0.1-android")
implementation("org.ini4j:ini4j:0.5.4")

implementation("com.simplecityapps:recyclerview-fastscroll:2.0.1") {
exclude(group = "androidx.recyclerview")
exclude(group = "androidx.appcompat")
}
implementation("org.smali:dexlib2:2.5.2") {
exclude(group = "com.google.guava", module = "guava")
}

implementation("androidx.room:room-runtime:2.4.2")
kapt("androidx.room:room-compiler:2.4.2")
implementation("androidx.room:room-ktx:2.4.2")
implementation("com.github.MatrixDev.Roomigrant:RoomigrantLib:0.3.4")
kapt("com.github.MatrixDev.Roomigrant:RoomigrantCompiler:0.3.4")

coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.1.5")
}
Loading

0 comments on commit 7d9798c

Please sign in to comment.