mirror of
https://github.com/MatsuriDayo/NekoBoxForAndroid.git
synced 2025-12-18 22:20:06 +08:00
update
This commit is contained in:
parent
cb5221edbc
commit
3f4aac0bc9
9
.github/workflows/release.yml
vendored
9
.github/workflows/release.yml
vendored
@ -32,15 +32,14 @@ jobs:
|
||||
path: |
|
||||
app/libs/libcore.aar
|
||||
key: ${{ hashFiles('.github/workflows/*', 'golang_status', 'libcore_status') }}
|
||||
- name: Golang Cache
|
||||
- name: Install Golang
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
uses: actions/cache@v3
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
path: build/golang
|
||||
key: go-${{ hashFiles('.github/workflows/*', 'golang_status') }}
|
||||
go-version: ^1.20
|
||||
- name: Native Build
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: ./run init action go && ./run lib core
|
||||
run: ./run lib core
|
||||
build:
|
||||
name: Build OSS APK
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@ -157,7 +157,7 @@ object Key {
|
||||
object TunImplementation {
|
||||
const val GVISOR = 0
|
||||
const val SYSTEM = 1
|
||||
const val MIXED = 1
|
||||
const val MIXED = 2
|
||||
}
|
||||
|
||||
object IPv6Mode {
|
||||
|
||||
@ -471,7 +471,7 @@ object RawUpdater : GroupUpdater() {
|
||||
when (opt.key.replace("_", "-")) {
|
||||
"name" -> bean.name = opt.value.toString()
|
||||
"server" -> bean.serverAddress = opt.value as String
|
||||
"port" -> bean.serverPort = opt.value.toString().toInt()
|
||||
"port" -> bean.serverPorts = opt.value.toString()
|
||||
"ports" -> hopPorts = opt.value.toString()
|
||||
|
||||
"obfs" -> bean.obfuscation = opt.value.toString()
|
||||
@ -507,7 +507,6 @@ object RawUpdater : GroupUpdater() {
|
||||
val alpn = (opt.value as? (List<String>))
|
||||
bean.alpn = alpn?.joinToString("\n") ?: "h3"
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (hopPorts.isNotBlank()) {
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
<moe.matsuri.nb4a.ui.SimpleMenuPreference
|
||||
app:defaultValue="2"
|
||||
app:entries="@array/tun_implementation"
|
||||
app:entryValues="@array/int_array_2"
|
||||
app:entryValues="@array/int_array_3"
|
||||
app:icon="@drawable/ic_baseline_flip_camera_android_24"
|
||||
app:key="tunImplementation"
|
||||
app:title="@string/tun_implementation"
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Setup go & external library
|
||||
buildScript/init/action/go.sh
|
||||
buildScript/init/action/gradle.sh
|
||||
|
||||
# Build libcore
|
||||
|
||||
@ -1,15 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
source buildScript/init/env.sh
|
||||
mkdir -p $GOPATH
|
||||
cd $golang
|
||||
|
||||
if [ ! -f "go/bin/go" ]; then
|
||||
curl -Lso go.tar.gz https://go.dev/dl/go1.20.7.linux-amd64.tar.gz
|
||||
echo "f0a87f1bcae91c4b69f8dc2bc6d7e6bfcd7524fceec130af525058c0c17b1b44 go.tar.gz" | sha256sum -c -
|
||||
tar xzf go.tar.gz
|
||||
fi
|
||||
|
||||
go version
|
||||
go env
|
||||
@ -1,11 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# For CI build, use downloaded golang
|
||||
export golang=$PWD/build/golang
|
||||
export GOPATH=$golang/gopath
|
||||
export GOROOT=$golang/go
|
||||
export PATH=$golang/go/bin:$GOPATH/bin:$PATH
|
||||
|
||||
source buildScript/init/env_ndk.sh
|
||||
|
||||
if [[ "$OSTYPE" =~ ^darwin ]]; then
|
||||
|
||||
@ -10,7 +10,6 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/url"
|
||||
@ -204,6 +203,9 @@ func (h *httpResponse) errorString() string {
|
||||
if err != nil {
|
||||
return fmt.Sprint("HTTP ", h.Status)
|
||||
}
|
||||
if len(content) > 100 {
|
||||
content = content[:100] + " ..."
|
||||
}
|
||||
return fmt.Sprint("HTTP ", h.Status, ": ", content)
|
||||
}
|
||||
|
||||
@ -214,7 +216,7 @@ func (h *httpResponse) GetHeader(key string) string {
|
||||
func (h *httpResponse) GetContent() ([]byte, error) {
|
||||
h.getContentOnce.Do(func() {
|
||||
defer h.Body.Close()
|
||||
h.content, h.contentError = ioutil.ReadAll(h.Body)
|
||||
h.content, h.contentError = io.ReadAll(h.Body)
|
||||
})
|
||||
return h.content, h.contentError
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user