-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
490 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: android build | ||
|
||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: [self-hosted, nzbget-android] | ||
|
||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Build | ||
run: | | ||
BUILD_PARAMS="android bin installer" | ||
if [ "$GITHUB_REF_NAME" == "develop" ] || [ "$GITHUB_REF_NAME" == "main" ]; then | ||
BUILD_PARAMS="$BUILD_PARAMS debug release" | ||
else | ||
BUILD_PARAMS="$BUILD_PARAMS release" | ||
fi | ||
if [ "$GITHUB_REF_NAME" != "main" ]; then | ||
BUILD_PARAMS="$BUILD_PARAMS testing" | ||
fi | ||
bash linux/build-nzbget.sh $BUILD_PARAMS | ||
|
||
- name: Rename build artifacts | ||
if: github.ref_name != 'main' && github.ref_name != 'develop' | ||
run: | | ||
cd build | ||
SUFFIX="-${GITHUB_REF_NAME/\//-}-bin-android.run" | ||
for FILE in *.run; do | ||
[ -f $FILE ] || continue | ||
NEW_FILE=${FILE/-bin-android.run/$SUFFIX} | ||
mv $FILE $NEW_FILE | ||
done | ||
|
||
- name: Upload build artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: nzbget-android-installers | ||
path: build/*.run | ||
retention-days: 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Installation on Android | ||
|
||
## Installation | ||
All steps to perform on your Android device: | ||
- using web-browser download NZBGet installer app https://github.com/nzbgetcom/android/releases | ||
|
||
**NOTE**: this app is only a frontend to NZBGet downloader background process, which | ||
the app installs and launches. The app isn't updated often but it always installs the latest version of nzbget by downloading it from NZBGet download page. | ||
|
||
**NOTE**: the installer app requires Android 5 or later. | ||
|
||
- install downloaded **apk-file**. You may need to enable a setting allowing installation of apps outside of Play store | ||
- launch NZBGet app | ||
- click **INSTALL DAEMON** | ||
- choose version to install | ||
- the installer app downloads the Android installer package of NZBGet and performs the installation | ||
- the success of installation is confirmed with message "NZBGet daemon has been successfully installed" | ||
|
||
## Usage | ||
- to start downloader process launch NZBGet app and choose **START DAEMON**. You get a confirmation about successful start. | ||
- in NZBGet app choose **Show web-interface**; that opens a web-browser. Alternatively open a web-browser manually and navigate to **http://localhost:6789**. Alternatively open a web-browser on your PC or any other device on the same network and navigate to **http://ip-of-android-device:6789**. | ||
- at this point you can close NZBGet app, the daemon process remains running in background; | ||
- use web-interface to control NZBGet daemon. | ||
|
||
## Accessing downloaded files | ||
|
||
On the external storage, Android apps are only allowed to write into the app specific folder (e. g. '/storage/XXXX-XXXX/Android/data/net.nzbget.nzbget'). | ||
|
||
To work around this, you may choose any path on the external storage using the **CHOOSE PATHS** button in installer app. Downloads will be moved to these paths after they have finished successfully. All downloads will be moved to the default path unless a path for the category of a specific download is chosen, in which case it will be moved there instead. | ||
|
||
**NOTE**: This feature will only move finished downloads from the DestDir you chose in the NZBGet Settings, so don't remove your DestDir in the web interface. | ||
|
||
## Post-processing scripts | ||
Most scripts are written in Python. Unfortunately there is no Python for Android. That means most scripts will not work. Bash scripts may work but you may need to install BusyBox from Play store. You also must configure option **ScriptDir** to system partition (scripts cannot be launched from sdcard). Post-processing scripts do not work properly due to OS limitations. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
#!/bin/bash | ||
# | ||
# This file is part of nzbget. See <http://nzbget.net>. | ||
# | ||
# Copyright (C) 2018 Andrey Prygunkov <hugbug@users.sourceforge.net> | ||
# Copyright (C) 2024 phnzb <pavel@nzbget.com> | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; either version 2 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
|
||
# This script builds cross-compiling toolchain, which can compile NZBGet for Android. | ||
# The toolchain itself runs on Linux. | ||
|
||
# Setup strict bash error handling | ||
set -e | ||
|
||
# Android API level | ||
APILEVEL=21 | ||
|
||
# Architecture | ||
ARCH=$1 | ||
case "$ARCH" in | ||
i686) | ||
NDK_ARCH="x86" | ||
NDK_TARGET="i686-linux-android" | ||
;; | ||
x86_64) | ||
NDK_ARCH="x86_64" | ||
NDK_TARGET="x86_64-linux-android" | ||
;; | ||
armhf) | ||
NDK_ARCH="arm" | ||
NDK_TARGET="arm-linux-androideabi" | ||
;; | ||
aarch64) | ||
NDK_ARCH="arm64" | ||
NDK_TARGET="aarch64-linux-android" | ||
;; | ||
*) | ||
echo "Usage: $0 (i686|x86_64|armhf|aarch64)" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
echo "Creating toolchain for $ARCH" | ||
|
||
# Android NDK | ||
NDK_VERSION="r19c" | ||
NDK_DIRNAME="android-ndk-$NDK_VERSION" | ||
NDK_ARCHIVE="$NDK_DIRNAME-linux-x86_64.zip" | ||
NDK_URL="https://dl.google.com/android/repository/$NDK_ARCHIVE" | ||
|
||
### START OF THE SCRIPT | ||
|
||
ROOTDIR="/build/android" | ||
ROOTDIR="$ROOTDIR/$ARCH-ndk" | ||
|
||
rm -rf $ROOTDIR | ||
mkdir -p $ROOTDIR | ||
|
||
# Download all required tools and libraries | ||
cd .. | ||
SRCDIR=/build/source | ||
mkdir -p $SRCDIR | ||
cd $SRCDIR | ||
if [ ! -d android-ndk -a ! -f $NDK_ARCHIVE ]; then | ||
wget $NDK_URL | ||
fi | ||
cd $ROOTDIR | ||
cd .. | ||
|
||
# Unpack NDK | ||
if [ ! -d android-ndk ]; then | ||
echo "Unpacking NDK" | ||
unzip $SRCDIR/$NDK_ARCHIVE | ||
mv $NDK_DIRNAME android-ndk | ||
fi | ||
|
||
# Create toolchain for target | ||
echo "Preparing standalone NDK toolchain" | ||
python3 android-ndk/build/tools/make_standalone_toolchain.py --arch $NDK_ARCH --api $APILEVEL --install-dir $ROOTDIR/output/host/usr | ||
cd $ROOTDIR | ||
ln -s host/usr/sysroot output/staging | ||
echo "Toolchain creation completed for $ARCH" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.