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(), fail('Unsupported python platform %s. Supported platforms: %s', platform.system(),
', '.join(SUPPORTED_PYTHON_PLATFORMS)) ', '.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. # Check if "sdk-manager" of sdk-tools package is available.
sdk_manager_bin = which("sdkmanager") sdk_manager_bin = which("sdkmanager")

View File

@ -14,20 +14,39 @@ apt-get -y install gcc git openjdk-17-jdk python3 unzip
# Clone repository. # Clone repository.
mkdir -p ~/git && cd ~/git mkdir -p ~/git && cd ~/git
git clone https://github.com/Catfriend1/syncthing-android.git --recursive 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 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 python3 scripts/install_minimum_android_sdk_prerequisites.py
./gradlew buildNative #
# Build.
export ANDROID_HOME=~/git/syncthing-android-prereq export ANDROID_HOME=~/git/syncthing-android-prereq
./gradlew buildNative
#
# Flavor: debug
./gradlew lintDebug ./gradlew lintDebug
./gradlew assembleDebug ./gradlew assembleDebug
``` #
# Flavor: release
To clean up all files generated during build, use the following commands: ## Remember to setup signing first
## or remove the section "signingConfigs" from "app/build.gradle.kts" for an unsigned build.
```bash ### 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 cleanNative
./gradlew clean ./gradlew clean
``` ```
@ -55,8 +74,8 @@ git clone https://github.com/Catfriend1/syncthing-android.git --recursive
:: ::
:: Build :: Build
cd /d "YOUR_CLONED_GIT_ROOT" cd /d "YOUR_CLONED_GIT_ROOT"
SyncthingNative_update_and_build scripts\SyncthingNative_update_and_build
App_build_and_release scripts\App_build_and_release
``` ```
## Development Notes ## Development Notes