Fix install_minimum_android_sdk_prerequisites.py (#1513)

This commit is contained in:
Catfriend1
2025-06-27 23:22:50 +02:00
committed by GitHub
parent 7ae8928c37
commit 7ec039498a
2 changed files with 30 additions and 11 deletions

View File

@ -147,7 +147,7 @@ if platform.system() not in SUPPORTED_PYTHON_PLATFORMS:
fail('Unsupported python platform %s. Supported platforms: %s', platform.system(),
', '.join(SUPPORTED_PYTHON_PLATFORMS))
prerequisite_tools_dir = os.path.dirname(os.path.realpath(__file__)) + os.path.sep + ".." + os.path.sep + "syncthing-android-prereq"
prerequisite_tools_dir = os.path.dirname(os.path.realpath(__file__)) + os.path.sep + ".." + os.path.sep + ".." + os.path.sep + "syncthing-android-prereq"
# Check if "sdk-manager" of sdk-tools package is available.
sdk_manager_bin = which("sdkmanager")

View File

@ -14,20 +14,39 @@ apt-get -y install gcc git openjdk-17-jdk python3 unzip
# Clone repository.
mkdir -p ~/git && cd ~/git
git clone https://github.com/Catfriend1/syncthing-android.git --recursive
## git stash && git pull origin Catfriend1-patch-1 && git checkout Catfriend1-patch-1
#
# Build
# Install prerequisites.
cd ~/git/syncthing-android
## git stash && git pull origin Catfriend1-patch-1 && git checkout Catfriend1-patch-1
python3 scripts/install_minimum_android_sdk_prerequisites.py
./gradlew buildNative
#
# Build.
export ANDROID_HOME=~/git/syncthing-android-prereq
./gradlew buildNative
#
# Flavor: debug
./gradlew lintDebug
./gradlew assembleDebug
```
To clean up all files generated during build, use the following commands:
```bash
#
# Flavor: release
## Remember to setup signing first
## or remove the section "signingConfigs" from "app/build.gradle.kts" for an unsigned build.
### sed -i -e '/signingConfig/,+2d' "app/build.gradle.kts"
./gradlew lintRelease
./gradlew assembleRelease
#
# Artifacts: Grab output APK.
## Flavor: debug
cp "app/build/outputs/apk/debug/app-debug.apk" "/mnt/x/app-debug.apk"
##
## Flavor: release
cp "app/build/outputs/apk/release/app-release.apk" "/mnt/x/app-release.apk"
##
## Flavor: release-unsigned
cp "app/build/outputs/apk/release/app-release-unsigned.apk" "/mnt/x/app-release-unsigned.apk"
#
# Cleanup.
## To clean up all files generated during build, use the following commands.
./gradlew cleanNative
./gradlew clean
```
@ -55,8 +74,8 @@ git clone https://github.com/Catfriend1/syncthing-android.git --recursive
::
:: Build
cd /d "YOUR_CLONED_GIT_ROOT"
SyncthingNative_update_and_build
App_build_and_release
scripts\SyncthingNative_update_and_build
scripts\App_build_and_release
```
## Development Notes