diff options
author | toolonely <lonely_@tutanota.com> | 2021-01-15 16:32:10 +0000 |
---|---|---|
committer | Dave Woodfall <dave@slackbuilds.org> | 2021-01-15 16:32:10 +0000 |
commit | f680e7e79672e004f41294bee63850cb293de01f (patch) | |
tree | 49cfdfbb4deb19df137e374e8f4b688d312fa3dc | |
parent | e703fc2061f2ed65cb5496b7c3da30dc98ef30f8 (diff) |
network/gnirehtet-bin: Added (reverse tethering for Android)
Signed-off-by: Dave Woodfall <dave@slackbuilds.org>
-rw-r--r-- | network/gnirehtet-bin/README | 44 | ||||
-rw-r--r-- | network/gnirehtet-bin/gnirehtet-bin.SlackBuild | 74 | ||||
-rw-r--r-- | network/gnirehtet-bin/gnirehtet-bin.info | 10 | ||||
-rw-r--r-- | network/gnirehtet-bin/slack-desc | 19 |
4 files changed, 147 insertions, 0 deletions
diff --git a/network/gnirehtet-bin/README b/network/gnirehtet-bin/README new file mode 100644 index 0000000000000..5d0faab4244fc --- /dev/null +++ b/network/gnirehtet-bin/README @@ -0,0 +1,44 @@ +gnirehtet is a tool that provides reverse tethering for Android + +This is a repackage of the 64 bit binary supplied by upstream, +the version written in Rust. + +gnirehtet requires adb as runtime dependency. adb is part of the +package android-tools on slackbuilds.org . adb must be in PATH, +so if it's not installed through the aforementioned package, +either alter PATH or drop it into the current working directory, +so gnirehtet finds it. + +gnirehtet requires the Android device to be switched to +Developer Mode and have the following options switched on +(tested on a Redmi 9C NFC phone): + +- USB debugging +- Install via USB +- USB debugging (Security settings) + +`gnirehtet install` requires gnirehtet.apk in current directory +(I am not sure about it?) +gnirehtet.apk is packaged into /usr/share/gnirehtet/. Copy or symlink it +from there into current directory +When running `gnirehtet install`, despite having the "Install via USB" +option enabled, if adb fails, just copy `gnirehtet.apk` to the phone +and install it directly from the phone + +gnirehtet-2.5 has two problems: + +1. Sometimes the client (the phone) randomly disconnects. gnirehtet +prints a log message to stdout, but keeps working. The simplest +(but sometimes inconvenient) fix is to restart gnirehtet on the +desktop. This is true for both `gnirehtet run` and `gnirehtet autorun` +commands. A workaround that automates the restart of gnirehtet in +such situations is described in comments here: + +https://github.com/Genymobile/gnirehtet/issues/352 + +2. When hitting the square soft key in Android to kill all apps that +run in background, gnirehtet gets killed too, the phone disconnects +from the server running the desktop and the problem is reduced to 1. +the workaround described there fixes 2. as well + +This binary was compiled on Aug 16, 2020. diff --git a/network/gnirehtet-bin/gnirehtet-bin.SlackBuild b/network/gnirehtet-bin/gnirehtet-bin.SlackBuild new file mode 100644 index 0000000000000..a91abb63167fd --- /dev/null +++ b/network/gnirehtet-bin/gnirehtet-bin.SlackBuild @@ -0,0 +1,74 @@ +#!/bin/sh + +# Slackware build script for gnirehtet-bin +# Copyright 2021 FlinchX <FlinchX@protonmail.com> +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=gnirehtet-bin +BINNAM=gnirehtet +VERSION=${VERSION:-2.5} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" != "x86_64" ]; then + echo "$ARCH is not supported." + exit 1 +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $BINNAM-rust-linux64 +unzip $CWD/$BINNAM-rust-linux64-v$VERSION.zip +cd $BINNAM-rust-linux64 +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +install -D -m 0755 $BINNAM $PKG/usr/bin/$BINNAM + +install -D -m 0644 $BINNAM.apk $PKG/usr/share/$BINNAM/$BINNAM.apk + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/network/gnirehtet-bin/gnirehtet-bin.info b/network/gnirehtet-bin/gnirehtet-bin.info new file mode 100644 index 0000000000000..4f36f3d041eb4 --- /dev/null +++ b/network/gnirehtet-bin/gnirehtet-bin.info @@ -0,0 +1,10 @@ +PRGNAM="gnirehtet-bin" +VERSION="2.5" +HOMEPAGE="https://github.com/Genymobile/gnirehtet" +DOWNLOAD="UNSUPPORTED" +MD5SUM="" +DOWNLOAD_x86_64="https://github.com/Genymobile/gnirehtet/releases/download/v2.5/gnirehtet-rust-linux64-v2.5.zip" +MD5SUM_x86_64="48d29d23691d6a1daebca68573684d4a" +REQUIRES="" +MAINTAINER="toolonely" +EMAIL="lonely_@tutanota.com" diff --git a/network/gnirehtet-bin/slack-desc b/network/gnirehtet-bin/slack-desc new file mode 100644 index 0000000000000..af18b2e0712c4 --- /dev/null +++ b/network/gnirehtet-bin/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +gnirehtet-bin: gnirehtet-bin (reverse tethering for Android) +gnirehtet-bin: +gnirehtet-bin: gnirehtet is a tool that provides reverse tethering for Android +gnirehtet-bin: +gnirehtet-bin: This is a repackage of the 64 bit binary supplied by upstream, +gnirehtet-bin: the version written in Rust. +gnirehtet-bin: +gnirehtet-bin: https://github.com/Genymobile/gnirehtet +gnirehtet-bin: +gnirehtet-bin: +gnirehtet-bin: |