8000 Automate tun2socks AAR building process by erfansn · Pull Request #372 · bepass-org/oblivion · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Automate tun2socks AAR building process #372

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 4 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
<a href="https://play.google.com/store/apps/details?id=org.bepass.oblivion">
<img alt="Get it on Google Play" src="https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png" width="165" height="64" />
</a>
<a href="https://play.google.com/store/apps/details?id=org.bepass.oblivion">
<img alt="Get it on Google Play" src="https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png" width="165" height="64" />
</a>

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.
Expand Down
18 changes: 18 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
0