From ced8b411add5f4d660fdfea5d5e7246ca35a1333 Mon Sep 17 00:00:00 2001 From: tiaga <10153548+tiaga@users.noreply.github.com> Date: Wed, 1 Oct 2025 20:46:02 +0000 Subject: [PATCH 1/2] docs: add README.MD --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..c8bde10 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# libcore + +## Build + +``` +cd ./scripts/ && bash -x ./build.sh +``` From c65784af3efd5e2703ed5eca4e045c197633a94a Mon Sep 17 00:00:00 2001 From: tiaga <10153548+tiaga@users.noreply.github.com> Date: Wed, 1 Oct 2025 20:46:32 +0000 Subject: [PATCH 2/2] build: use the official golang.org/x/mobile version --- scripts/build.sh | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index 84a1486..73dfec6 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -11,25 +11,21 @@ if [ -z "$GOPATH" ]; then fi PATH="$PATH:$GOPATH/bin" - +GOMOBILE_VERSION="v0.0.0-20231127183840-76ac6878050a" # Install gomobile -if [ ! -f "$GOPATH/bin/gomobile-matsuri" ]; then - git clone https://github.com/MatsuriDayo/gomobile ../gomobile - cd ../gomobile - go install -v ./cmd/gomobile/ - cd - &>/dev/null && rm -rf ../gomobile - mv -v "$GOPATH/bin/gomobile" "$GOPATH/bin/gomobile-matsuri" +if [ ! -f "$GOPATH/bin/gomobile" ]; then + go get -v "golang.org/x/mobile@$GOMOBILE_VERSION" + go install -v "$GOPATH/pkg/mod/golang.org/x/mobile@$GOMOBILE_VERSION/cmd/gomobile" fi -gomobile-matsuri init +gomobile init cd .. -go get -v golang.org/x/mobile@v0.0.0-20231108233038-35478a0c49da -gomobile-matsuri bind -v \ - -androidapi 21 \ - -trimpath \ - -ldflags='-s -w' \ - -tags='with_conntrack,with_gvisor,with_quic,with_wireguard,with_utls,with_clash_api,with_ech' . +gomobile bind -v \ + -androidapi 21 \ + -trimpath \ + -ldflags='-s -w' \ + -tags='with_conntrack,with_gvisor,with_quic,with_wireguard,with_utls,with_clash_api,with_ech' . -rm -v "$GOPATH/bin/gomobile-matsuri" "$GOPATH/bin/gobind" libcore-sources.jar +rm -v "$GOPATH/bin/gomobile" "$GOPATH/bin/gobind" libcore-sources.jar