From fe0dcaaa69b3a1b9dc5804a34528f585ed350629 Mon Sep 17 00:00:00 2001 From: Erfan Sn <50053121+ErfanSn@users.noreply.github.com> Date: Mon, 5 Aug 2024 15:11:03 +0330 Subject: [PATCH 1/3] Move tun2socks files to root dir from /app/libs --- {app/libs => tun2socks}/README.md | 0 {app/libs => tun2socks}/go.mod | 0 {app/libs => tun2socks}/go.sum | 0 {app/libs => tun2socks}/lwip/lwip.go | 0 {app/libs => tun2socks}/tools.go | 0 {app/libs => tun2socks}/tun2socks.go | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename {app/libs => tun2socks}/README.md (100%) rename {app/libs => tun2socks}/go.mod (100%) rename {app/libs => tun2socks}/go.sum (100%) rename {app/libs => tun2socks}/lwip/lwip.go (100%) rename {app/libs => tun2socks}/tools.go (100%) rename {app/libs => tun2socks}/tun2socks.go (100%) diff --git a/app/libs/README.md b/tun2socks/README.md similarity index 100% rename from app/libs/README.md rename to tun2socks/README.md diff --git a/app/libs/go.mod b/tun2socks/go.mod similarity index 100% rename from app/libs/go.mod rename to tun2socks/go.mod diff --git a/app/libs/go.sum b/tun2socks/go.sum similarity index 100% rename from app/libs/go.sum rename to tun2socks/go.sum diff --git a/app/libs/lwip/lwip.go b/tun2socks/lwip/lwip.go similarity index 100% rename from app/libs/lwip/lwip.go rename to tun2socks/lwip/lwip.go diff --git a/app/libs/tools.go b/tun2socks/tools.go similarity index 100% rename from app/libs/tools.go rename to tun2socks/tools.go diff --git a/app/libs/tun2socks.go b/tun2socks/tun2socks.go similarity index 100% rename from app/libs/tun2socks.go rename to tun2socks/tun2socks.go From 6ad2c36bf72189079400a6e9c5deef1dbe29ea16 Mon Sep 17 00:00:00 2001 From: Erfan Sn <50053121+ErfanSn@users.noreply.github.com> Date: Mon, 5 Aug 2024 15:22:53 +0330 Subject: [PATCH 2/3] Introduce gradle task to automate building the tun2socks artifact --- app/build.gradle | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/app/build.gradle b/app/build.gradle index 33e780cc..7dc19403 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -65,3 +65,21 @@ dependencies { implementation 'com.github.erfansn:locale-config-x:1.0.1' implementation fileTree(dir: 'libs', include: ['*.aar', '*.jar']) } + +tasks.register("preBuildTun2SocksAar", Exec) { + workingDir "../tun2socks" + commandLine "go", "run", "golang.org/x/mobile/cmd/gomobile", "init" +} +tasks.register("buildTun2SocksAar", Exec) { + doFirst { + File myDir = new File("$projectDir/libs") + if (!myDir.exists()) { + myDir.mkdirs() + } + } + + workingDir "../tun2socks" + commandLine "go", "run", "golang.org/x/mobile/cmd/gomobile", "bind", "-ldflags=-w -s", "-target=android", "-androidapi=$android.defaultConfig.minSdk", "-o=$projectDir/libs/tun2socks.aar", "." + dependsOn(preBuildTun2SocksAar) +} +preBuild.dependsOn(buildTun2SocksAar) From dcf8dd7e941ea281d9684a092485a201d22be18f Mon Sep 17 00:00:00 2001 From: Erfan Sn <50053121+ErfanSn@users.noreply.github.com> Date: Mon, 5 Aug 2024 15:34:54 +0330 Subject: [PATCH 3/3] Update README.md --- README.md | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 7578f26d..2601fb61 100644 --- a/README.md +++ b/README.md @@ -17,34 +17,19 @@ It's leveraging `bepass-sdk` and a custom Go implementation of WireGuard, it's d ## Quick Start 1. **Download**: Grab the APK from our [Releases](https://github.com/bepass-org/oblivion/releases) page or [Google play store](https://play.google.com/store/apps/details?id=org.bepass.oblivion) and install it. - -Get it on Google Play - + + Get it on Google Play + 2. **Connect**: Launch Oblivion and hit the switch button. ## Building the Project ### Prerequisites -- Java 17 -- Gradle 8 -- Android Gradle Plugin (AGP) 8.1.2 - NDK r26b (26.1.10909125) - Go 1.22 -Follow the steps below to build the Oblivion: - -### Building Go libraries -Open the Terminal tab at the bottom of Android Studio. - -Navigate to the libs directory: - -```bash -cd app/libs -go run golang.org/x/mobile/cmd/gomobile init -go run golang.org/x/mobile/cmd/gomobile bind -ldflags="-w -s" -target=android -androidapi=21 -o=tun2socks.aar . -``` -### Generate Signed Bundle/APK: +### Follow the steps below to build the Oblivion: - In Android Studio, navigate to "Build" in the menu bar. - Select "Generate Signed Bundle/APK..." - Choose "APK" and proceed.