Bind library

This commit is contained in:
Trevor Slocum 2020-11-22 18:38:45 -08:00
parent 83ea8b8473
commit 1a3054c02e
17 changed files with 74 additions and 6 deletions

2
.gitignore vendored
View file

@ -2,11 +2,13 @@
/app/build
/app/go
/app/libs
/app/release
/build
/captures
/local.properties
*.iml
*.sh
!/app/bind.sh
.DS_Store
.cxx
.externalNativeBuild

2
CHANGELOG Normal file
View file

@ -0,0 +1,2 @@
0.1.0:
- Initial release

View file

@ -1,9 +1,24 @@
# Xenia
[![CI status](https://gitlab.com/tslocum/xenia/badges/master/pipeline.svg)](https://gitlab.com/tslocum/xenia/commits/master)
[![Donate](https://img.shields.io/liberapay/receives/rocketnine.space.svg?logo=liberapay)](https://liberapay.com/rocketnine.space)
[Gemini](https://gemini.circumlunar.space) browser for Android
[Gemini](https://gemini.circumlunar.space) proxy for Android
## Features
- Use your web browser to browse Gemini
## Screenshots
<a href="https://gitlab.com/tslocum/xenia/-/raw/master/metadata/en-US/images/phoneScreenshots/1.png"><img width="108" height="216" alt="Screenshot" border="0" src="https://gitlab.com/tslocum/xenia/-/raw/master/metadata/en-US/images/phoneScreenshots/thumbnails/1.png"></a>
&nbsp; <a href="https://gitlab.com/tslocum/xenia/-/raw/master/metadata/en-US/images/phoneScreenshots/2.png"><img width="108" height="216" alt="Screenshot" border="0" src="https://gitlab.com/tslocum/xenia/-/raw/master/metadata/en-US/images/phoneScreenshots/thumbnails/2.png"></a>
&nbsp; <a href="https://gitlab.com/tslocum/xenia/-/raw/master/metadata/en-US/images/phoneScreenshots/3.png"><img width="108" height="216" alt="Screenshot" border="0" src="https://gitlab.com/tslocum/xenia/-/raw/master/metadata/en-US/images/phoneScreenshots/thumbnails/3.png"></a>
&nbsp; <a href="https://gitlab.com/tslocum/xenia/-/raw/master/metadata/en-US/images/phoneScreenshots/4.png"><img width="108" height="216" alt="Screenshot" border="0" src="https://gitlab.com/tslocum/xenia/-/raw/master/metadata/en-US/images/phoneScreenshots/thumbnails/4.png"></a>
&nbsp; <a href="https://gitlab.com/tslocum/xenia/-/raw/master/metadata/en-US/images/phoneScreenshots/5.png"><img width="108" height="216" alt="Screenshot" border="0" src="https://gitlab.com/tslocum/xenia/-/raw/master/metadata/en-US/images/phoneScreenshots/thumbnails/5.png"></a>
## Support
Please share issues and suggestions [here](https://gitlab.com/tslocum/xenia/issues).
## Dependencies
- [gmitohtml](https://gitlab.com/tslocum/gmitohtml)

33
app/bind.sh Executable file
View file

@ -0,0 +1,33 @@
#!/bin/bash
export PROJECTPATH=$PWD
export GOPATH="$PROJECTPATH/go"
export GO111MODULE=off
if [ -z "$1" ]; then
echo "Usage: ./bind.sh <gmitohtml commit hash>"
exit 1
fi
echo "Downloading gomobile..."
GOPATH="$PROJECTPATH/go" go get -u golang.org/x/mobile/cmd/...
echo "Downloading gmitohtml $1..."
mkdir -p $GOPATH/src/gitlab.com/tslocum
if [ ! -d "$GOPATH/src/gitlab.com/tslocum/gmitohtml" ]; then
git clone https://gitlab.com/tslocum/gmitohtml $GOPATH/src/gitlab.com/tslocum/gmitohtml
fi
cd $GOPATH/src/gitlab.com/tslocum/gmitohtml && git fetch origin && git reset --hard `printf %q "$1"` && cd $PROJECTPATH
#echo "Downloading dependencies..."
#cd $GOPATH/src/gitlab.com/tslocum/gmitohtml
#go mod vendor
#cd $PROJECTPATH
echo "Binding library..."
mkdir -p libs
PATH="$PROJECTPATH/go/bin:$PATH"
$GOPATH/bin/gomobile bind -javapkg space.rocketnine -o libs/gmitohtml.aar -target=android -androidapi=16 $GOPATH/src/gitlab.com/tslocum/gmitohtml/pkg/gmitohtml
echo "Finished."

View file

@ -8,7 +8,7 @@ android {
defaultConfig {
applicationId "space.rocketnine.xenia"
minSdkVersion 23
minSdkVersion 16
targetSdkVersion 30
versionCode 10
versionName "0.1.0"
@ -29,6 +29,22 @@ android {
}
}
ext {
// https://gitlab.com/tslocum/gmitohtml
gmitohtmlVersion = "72c8172ab88880a02fbc50fb15773b30959ccae8"
}
task bindLibrary(type: Exec) {
workingDir "$projectDir"
commandLine 'sh', '-c', './bind.sh ' + project.ext.gmitohtmlVersion
}
afterEvaluate {
android.applicationVariants.all { variant ->
variant.javaCompiler.dependsOn(bindLibrary)
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
}
}

View file

@ -22,7 +22,7 @@ public class App extends Application {
try {
Thread.sleep(1000);
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://127.0.0.1:1967/gemini/twins.rocketnine.space/"));
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://127.0.0.1:1967"));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
} catch (Exception e) {

View file

@ -21,7 +21,7 @@ public class MainActivity extends Activity {
}
public void openBrowser(View view) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://127.0.0.1:1967/gemini/twins.rocketnine.space/"));
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://127.0.0.1:1967"));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB