Wiki and Readme update (#1444)

Move build instructions and development notes to wiki
This commit is contained in:
Catfriend1 2025-05-22 22:37:33 +02:00 committed by GitHub
parent f23f4959bc
commit 0e9f68b9ae
3 changed files with 64 additions and 113 deletions

View File

@ -49,75 +49,9 @@ Switching is easier than you may think!
See our document on privacy: [privacy-policy.md](https://github.com/Catfriend1/syncthing-android/blob/main/privacy-policy.md).
## Goal of the forked version
## Building and Development Notes
- Develop and try out enhancements together
- Release the wrapper more frequently to identify and fix bugs together caused by changes in the syncthing submodule
- Make enhancements configurable in the settings UI, e.g. users should be able to turn them on and off
- Let's get ready for newer Android versions that put limits on background syncing tools. We need your bug reports as detailed as possible
## Building
### Build on Debian Linux / WSL - recommended way
A Linux VM, for example running Debian, is recommended to build this.
Build SyncthingNative and the Syncthing-Android wrapper using the following commands:
```bash
#
# Install prerequisites.
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
cd ~/git/syncthing-android
python3 install_minimum_android_sdk_prerequisites.py
./gradlew buildNative
export ANDROID_HOME=~/git/syncthing-android-prereq
echo -e "\norg.gradle.jvmargs=-Xmx4096m" >> gradle.properties
./gradlew lintDebug
./gradlew assembleDebug
```
To clean up all files generated during build, use the following commands:
```bash
./gradlew cleanNative
./gradlew clean
```
### Build on Windows
```bash
::
:: Install prerequisites.
winget install --accept-source-agreements --source winget --exact --id "Git.MinGit" --scope machine
winget install --accept-source-agreements --source winget --exact --id "AdoptOpenJDK.OpenJDK.17" --scope machine
winget install --accept-source-agreements --source winget --exact --id "Python.Python.3.13" --scope machine -h --override "/quiet InstallAllUsers=1 PrependPath=1 Include_test=0"
::
:: Clone repository.
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
```
## Development Notes
The Syncthing native used for this android application provides a web interface by default. It can be accessed via the Settings menu -> 'Web GUI'. It is quite helpful to access this web interface from your development machine. Read android documentation on how to access the network of your emulator. Or use the following command to connect to the single currently running emulator/AVD.
```bash
adb forward tcp:18384 tcp:8384
```
Start Syncthing app on your emulator and access the web interface from you favorite browser of your development machine via [`127.0.0.1:18384`](https://127.0.0.1:18384)
See [detailed info](https://github.com/Catfriend1/syncthing-android/blob/main/wiki/Building-and-Development.md).
## License

View File

@ -1,45 +0,0 @@
# Building
### Prerequisites
- Android SDK
`You can skip this if you are using Android Studio.`
- Android NDK r16b
`$ANDROID_NDK_HOME environment variable should point at the root directory of your NDK. If the variable is not set, build-syncthing.py will automatically try to download and setup the NDK.`
- Go 1.9.7
`Make sure, Go is installed and available on the PATH environment variable. If Go is not found on the PATH environment variable, build-syncthing.py will automatically try to download and setup GO on the PATH.`
- Python 2.7
`Make sure, Python is installed and available on the PATH environment variable.`
- Git (for Linux) or Git for Windows
`Make sure, git (or git.exe) is installed and available on the PATH environment variable. If Git is not found on the PATH environment variable, build-syncthing.py will automatically try to download and setup MinGit 2.19.0-x64 on the PATH.`
### Build instructions
Make sure you clone the project with
`git clone https://github.com/Catfriend1/syncthing-android.git --recursive`.
Alternatively, run `git submodule init && git submodule update` in the project folder.
A Linux VM, for example running Debian, is recommended to build this.
Build Syncthing and the Syncthing-Android wrapper using the following commands:
`./gradlew buildNative`
`./gradlew lint assembleDebug`
You can also use Android Studio to build the apk after you manually ran the `./gradlew buildNative` command in the repository root.
To clean up all files generated during build, use the following commands:
`./gradlew cleanNative`
`./gradlew clean`
### gradle.properties
- Windows: Edit "%userprofile%\.gradle\gradle.properties" to make the build faster.
> org.gradle.jvmargs=-Xmx4096M
> android.enableSeparateAnnotationProcessing=true
> #android.debug.obsoleteApi=true

View File

@ -0,0 +1,62 @@
## Building
### Build on Debian Linux / WSL - recommended way
A Linux VM, for example running Debian, is recommended to build this.
Build SyncthingNative and the Syncthing-Android wrapper using the following commands:
```bash
#
# Install prerequisites.
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
cd ~/git/syncthing-android
python3 install_minimum_android_sdk_prerequisites.py
./gradlew buildNative
export ANDROID_HOME=~/git/syncthing-android-prereq
echo -e "\norg.gradle.jvmargs=-Xmx4096m" >> gradle.properties
./gradlew lintDebug
./gradlew assembleDebug
```
To clean up all files generated during build, use the following commands:
```bash
./gradlew cleanNative
./gradlew clean
```
### Build on Windows
```bash
::
:: Install prerequisites.
winget install --accept-source-agreements --source winget --exact --id "Git.MinGit" --scope machine
winget install --accept-source-agreements --source winget --exact --id "AdoptOpenJDK.OpenJDK.17" --scope machine
winget install --accept-source-agreements --source winget --exact --id "Python.Python.3.13" --scope machine -h --override "/quiet InstallAllUsers=1 PrependPath=1 Include_doc=0 Include_launcher=0 Include_pip=0 Include_tcltk=0 Include_test=0"
::
:: Clone repository.
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
```
## Development Notes
The Syncthing native used for this android application provides a web interface by default. It can be accessed via the Settings menu -> 'Web GUI'. It is quite helpful to access this web interface from your development machine. Read android documentation on how to access the network of your emulator. Or use the following command to connect to the single currently running emulator/AVD.
```bash
adb forward tcp:18384 tcp:8384
```
Start Syncthing app on your emulator and access the web interface from you favorite browser of your development machine via [`127.0.0.1:18384`](https://127.0.0.1:18384)