Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
arm64v8a committed Aug 10, 2023
1 parent cb5221e commit 3f4aac0
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 34 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/io/nekohasekai/sagernet/Constants.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -507,7 +507,6 @@ object RawUpdater : GroupUpdater() {
val alpn = (opt.value as? (List<String>))
bean.alpn = alpn?.joinToString("\n") ?: "h3"
}

}
}
if (hopPorts.isNotBlank()) {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/xml/global_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 0 additions & 2 deletions buildScript/fdroid/prebuild.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash

# Setup go & external library
buildScript/init/action/go.sh
buildScript/init/action/gradle.sh

# Build libcore
Expand Down
15 changes: 0 additions & 15 deletions buildScript/init/action/go.sh

This file was deleted.

6 changes: 0 additions & 6 deletions buildScript/init/env.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 4 additions & 2 deletions libcore/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"errors"
"fmt"
"io"
"io/ioutil"
"net"
"net/http"
"net/url"
Expand Down Expand Up @@ -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)
}

Expand All @@ -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
}
Expand Down

0 comments on commit 3f4aac0

Please sign in to comment.