Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
4baeba6
chore: add 'sh' to README.md
0xbrayo Jul 18, 2024
7503d15
docs: update deprecated magick command
0xbrayo Jul 18, 2024
45ec429
refactor: refactored to improve accuracy of the timeline
0xbrayo Aug 19, 2025
050a8e1
feat:use device name as hostname
0xbrayo Oct 3, 2025
5bfaa03
chore: gradle version bump and misc
0xbrayo Oct 8, 2025
70edb5b
feat(android): add SyncInterface.kt with JNI bindings for aw-sync
0xbrayo Oct 16, 2025
6095ed3
feat(android): implement automatic background sync
0xbrayo Oct 16, 2025
94faca4
build(deps): updated project dependencies, jvm target to 11, gradle t…
konrad-krol-incubly Sep 26, 2025
2f00811
feat: implemented generic web watcher with support of multiple web br…
konrad-krol-incubly Sep 26, 2025
e0af0b6
feat: always active in the background
0xbrayo Nov 24, 2025
5d420e9
chore: minimum api target bump
0xbrayo Nov 26, 2025
b2780c8
feat: experimental parsing of events in background
0xbrayo Dec 11, 2025
00b7720
fix: fix launch on boot not working
0xbrayo Dec 11, 2025
010db47
build: update makefile to package aw-sync.so
0xbrayo Dec 22, 2025
172d208
fix: fix single-instance errors on android
0xbrayo Dec 23, 2025
5f2b2ef
fix: fix doNotStrip property not working
0xbrayo Jan 2, 2026
8b6e2f0
Update mobile/src/main/java/net/activitywatch/android/watcher/WebWatc…
0xbrayo Jan 2, 2026
add577c
style: fix linting warrnings
0xbrayo Jan 11, 2026
290ac3d
chore: replace the default android.jks.age
0xbrayo Sep 4, 2024
211ed65
ci: create build-only action for testing in forks
0xbrayo Nov 4, 2025
25f6218
temp: switch to custom aw-webui
0xbrayo Jan 13, 2026
812ec6c
wip
0xbrayo Jan 30, 2026
ef6cfcd
checkpoint
0xbrayo Jan 31, 2026
4116098
checkpoint 2
0xbrayo Jan 31, 2026
8cda775
checkpoint widget
0xbrayo Jan 31, 2026
a1a3d28
checkpoint widget 2
0xbrayo Feb 1, 2026
3a46c7e
checkpoint widget stacked
0xbrayo Feb 8, 2026
08a1986
4x1 checkpoint
0xbrayo Feb 9, 2026
d5a0797
animation + reparsing
0xbrayo Feb 9, 2026
58cc860
savepoint
0xbrayo Feb 12, 2026
d239b02
fix: use upstream aw-server-rust commit (dc70318) to avoid broken aw-…
0xbrayo Feb 17, 2026
dcbb537
fix: restore aw-server-rust to babea6c (working version)
0xbrayo Feb 18, 2026
ee5ff77
TEMP: ci fix, adds release
0xbrayo Feb 18, 2026
445a416
update aw-server-rust to latest
0xbrayo Feb 18, 2026
ffec537
temp: use fix-webui-ref-rebase branch from fork to test CI fix
0xbrayo Feb 19, 2026
186c8b2
feat: media watcher
0xbrayo Feb 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
249 changes: 249 additions & 0 deletions .github/workflows/build-only.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,249 @@
name: "Build only"

on:
push:
branches: [master]
tags:
- v*
pull_request:
branches: [master]

env:
NDK_VERSION: "25.2.9519653"
NODE_VERSION: "16"
JAVA_VERSION: "17"

jobs:
build-rust:
name: Build aw-server-rust
# runs-on: ubuntu-latest
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Set RELEASE
run: |
echo "RELEASE=${{ startsWith(github.ref_name, 'v') }}" >> $GITHUB_ENV

- name: Get aw-server-rust submodule commit
id: submodule-commit
run: |
echo "commit=$(git rev-parse HEAD:aw-server-rust)" >> $GITHUB_OUTPUT

- name: Cache JNI libs
uses: actions/cache@v3
id: cache-jniLibs
env:
cache-name: jniLibs
with:
path: mobile/src/main/jniLibs/
key: ${{ env.cache-name }}-release-${{ env.RELEASE }}-ndk-${{ env.NDK_VERSION }}-${{ steps.submodule-commit.outputs.commit }}

- name: Display structure of downloaded files
if: steps.cache-jniLibs.outputs.cache-hit == 'true'
run: |
pushd mobile/src/main/jniLibs && ls -R && popd

# Android SDK & NDK
- name: Set up Android SDK
if: steps.cache-jniLibs.outputs.cache-hit != 'true'
uses: android-actions/setup-android@v2
- name: Set up Android NDK
if: steps.cache-jniLibs.outputs.cache-hit != 'true'
run: |
sdkmanager "ndk;${{ env.NDK_VERSION }}"
ANDROID_NDK_HOME="$ANDROID_SDK_ROOT/ndk/${{ env.NDK_VERSION }}"
ls $ANDROID_NDK_HOME
echo "ANDROID_NDK_HOME=$ANDROID_NDK_HOME" >> $GITHUB_ENV

# Rust
- name: Set up Rust
id: toolchain
uses: dtolnay/rust-toolchain@stable
if: steps.cache-jniLibs.outputs.cache-hit != 'true'

- name: Set up Rust toolchain for Android NDK
if: steps.cache-jniLibs.outputs.cache-hit != 'true'
run: |
./aw-server-rust/install-ndk.sh

- name: Cache cargo build
uses: actions/cache@v3
if: steps.cache-jniLibs.outputs.cache-hit != 'true'
env:
cache-name: cargo-build-target
with:
path: aw-server-rust/target
# key needs to contain cachekey due to https://github.com/ActivityWatch/aw-server-rust/issues/180
key: ${{ env.cache-name }}-${{ runner.os }}-release-${{ env.RELEASE }}-${{ steps.toolchain.outputs.cachekey }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ env.cache-name }}-${{ runner.os }}-release-${{ env.RELEASE }}-${{ steps.toolchain.outputs.cachekey }}-

- name: Build aw-server-rust
if: steps.cache-jniLibs.outputs.cache-hit != 'true'
run: |
make aw-server-rust

- name: Check that jniLibs present
run: |
test -e mobile/src/main/jniLibs/x86_64/libaw_server.so

# This needs to be a seperate job since fastlane update_version,
# fails if run concurrently (such as in build apk/aab matrix),
# thus we need to run it once and and reuse the results.
# https://github.com/fastlane/fastlane/issues/13689#issuecomment-439217502
get-versionCode:
name: Get latest versionCode
runs-on: ubuntu-latest
outputs:
versionCode: ${{ steps.versionCode.outputs.versionCode }}

steps:
- uses: actions/checkout@v2
with:
submodules: "recursive"

- name: Output versionCode
id: versionCode
run: |
cat mobile/build.gradle | grep versionCode | sed 's/.*\s\([0-9]*\)$/versionCode=\1/' >> "$GITHUB_OUTPUT"

build-apk:
name: Build ${{ matrix.type }}
runs-on: ubuntu-latest
needs: [build-rust, get-versionCode]
strategy:
fail-fast: true
matrix:
type: ["apk", "aab"]

steps:
- uses: actions/checkout@v2
with:
submodules: "recursive"

- uses: ActivityWatch/check-version-format-action@v2
id: version
with:
prefix: "v"

- name: Echo version
run: |
echo "${{ steps.version.outputs.full }} (stable: ${{ steps.version.outputs.is_stable }})"

- name: Set RELEASE
run: |
# Build in release mode if on a tag/release (longer build times)
echo "RELEASE=${{ startsWith(github.ref_name, 'v') }}" >> $GITHUB_ENV

- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: ${{ env.JAVA_VERSION }}

# Android SDK & NDK
- name: Set up Android SDK
uses: android-actions/setup-android@v2
- name: Set up Android NDK
run: |
sdkmanager "ndk;${{ env.NDK_VERSION }}"
ANDROID_NDK_HOME="$ANDROID_SDK_ROOT/ndk/${{ env.NDK_VERSION }}"
ls $ANDROID_NDK_HOME
echo "ANDROID_NDK_HOME=$ANDROID_NDK_HOME" >> $GITHUB_ENV

- name: Get aw-server-rust submodule commit
id: submodule-commit
run: |
echo "commit=$(git rev-parse HEAD:aw-server-rust)" >> $GITHUB_OUTPUT

# Restores jniLibs from cache
# `actions/cache/restore` only restores, without saving back in a post-hook
- uses: actions/cache/restore@v3
id: cache-jniLibs
env:
cache-name: jniLibs
with:
path: mobile/src/main/jniLibs/
key: ${{ env.cache-name }}-release-${{ env.RELEASE }}-ndk-${{ env.NDK_VERSION }}-${{ steps.submodule-commit.outputs.commit }}
fail-on-cache-miss: true

- name: Check that jniLibs present
run: |
test -e mobile/src/main/jniLibs/x86_64/libaw_server.so

- name: Set versionName
if: startsWith(github.ref, 'refs/tags/v') # only on runs triggered from tag
run: |
# Sets versionName, tail used to skip "v" at start of tag name
SHORT_VERSION=$(echo "${{ github.ref_name }}" | tail -c +2 -)
sed -i "s/versionName \".*\"/versionName \"$SHORT_VERSION\"/g" \
mobile/build.gradle

- name: Set versionCode
run: |
# Sets versionCode
sed -i "s/versionCode .*/versionCode ${{needs.get-versionCode.outputs.versionCode}}/" \
mobile/build.gradle

- uses: adnsio/setup-age-action@v1.2.0
- name: Load Android secrets
if: env.KEY_ANDROID_JKS != null
env:
KEY_ANDROID_JKS: ${{ secrets.KEY_ANDROID_JKS }}
run: |
printf "$KEY_ANDROID_JKS" > android.jks.key
cat android.jks.age | age -d -i android.jks.key -o android.jks
rm android.jks.key

- name: Assemble
env:
JKS_STOREPASS: ${{ secrets.KEY_ANDROID_JKS_STOREPASS }}
JKS_KEYPASS: ${{ secrets.KEY_ANDROID_JKS_KEYPASS }}
run: |
make dist/aw-android.${{ matrix.type }}

- name: Upload
uses: actions/upload-artifact@v4
with:
name: aw-android.${{ matrix.type }}
path: dist/aw-android*.${{ matrix.type }}

release-gh:
needs: [build-apk]
if: startsWith(github.ref, 'refs/tags/v') # only on runs triggered from tag
runs-on: ubuntu-latest
steps:

- name: Download release APK
uses: actions/download-artifact@v4
with:
name: aw-android.apk
path: dist

- name: Download release AAB
uses: actions/download-artifact@v4
with:
name: aw-android.aab
path: dist

- name: Display structure of downloaded files
working-directory: dist
run: ls -R

# detect if version tag is stable/beta
- uses: nowsprinting/check-version-format-action@v2
id: version
with:
prefix: 'v'

# create a release
- name: Release
uses: softprops/action-gh-release@v1
with:
draft: true
prerelease: ${{ !(steps.version.outputs.is_stable == 'true') }} # must compare to true, since boolean outputs are actually just strings, and "false" is truthy since it's not empty: https://github.com/actions/runner/issues/1483#issuecomment-994986996
files: |
dist/*.apk
dist/*.aab
# body_path: dist/release_notes/release_notes.md
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 28 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ export ON_ANDROID := -- --android
aw-server-rust: $(JNILIBS)

.PHONY: $(JNILIBS)
$(JNILIBS): $(JNI_arm7)/libaw_server.so $(JNI_arm8)/libaw_server.so $(JNI_x86)/libaw_server.so $(JNI_x64)/libaw_server.so
$(JNILIBS): $(JNI_arm7)/libaw_server.so $(JNI_arm8)/libaw_server.so $(JNI_x86)/libaw_server.so $(JNI_x64)/libaw_server.so \
$(JNI_arm7)/libaw_sync.so $(JNI_arm8)/libaw_sync.so $(JNI_x86)/libaw_sync.so $(JNI_x64)/libaw_sync.so
@ls -lL $@/*/* # Check that symlinks are valid

# There must be a better way to do this without repeating almost the same rule over and over?
Expand All @@ -170,6 +171,20 @@ $(JNI_x64)/libaw_server.so: $(TARGETDIR_x64)/$(RELEASE_TYPE)/libaw_server.so
mkdir -p $$(dirname $@)
if [ -z "$(TARGET)" ] || [ "$(TARGET)" == "x86_64" ]; then ln -fnv $$(pwd)/$^ $@; fi

$(JNI_arm7)/libaw_sync.so: $(TARGETDIR_arm7)/$(RELEASE_TYPE)/libaw_sync.so
mkdir -p $$(dirname $@)
# if target is empty, then create symlink
if [ -z "$(TARGET)" ] || [ "$(TARGET)" == "arm" ]; then ln -fnv $$(pwd)/$^ $@; fi
$(JNI_arm8)/libaw_sync.so: $(TARGETDIR_arm8)/$(RELEASE_TYPE)/libaw_sync.so
mkdir -p $$(dirname $@)
if [ -z "$(TARGET)" ] || [ "$(TARGET)" == "arm64" ]; then ln -fnv $$(pwd)/$^ $@; fi
$(JNI_x86)/libaw_sync.so: $(TARGETDIR_x86)/$(RELEASE_TYPE)/libaw_sync.so
mkdir -p $$(dirname $@)
if [ -z "$(TARGET)" ] || [ "$(TARGET)" == "x86" ]; then ln -fnv $$(pwd)/$^ $@; fi
$(JNI_x64)/libaw_sync.so: $(TARGETDIR_x64)/$(RELEASE_TYPE)/libaw_sync.so
mkdir -p $$(dirname $@)
if [ -z "$(TARGET)" ] || [ "$(TARGET)" == "x86_64" ]; then ln -fnv $$(pwd)/$^ $@; fi

RUSTFLAGS_ANDROID="-C debuginfo=2 -Awarnings"
# Explanation of RUSTFLAGS:
# `-Awarnings` allows all warnings, for cleaner output (warnings should be detected in aw-server-rust CI anyway)
Expand All @@ -192,6 +207,17 @@ $(RS_SRCDIR)/target/%/$(RELEASE_TYPE)/libaw_server.so: $(RS_SOURCES) $(WEBUI_DIS
env RUSTFLAGS=$(RUSTFLAGS_ANDROID) make -C aw-server-rust android; \
fi

# Same rule for libaw_sync.so (but without webui dependency)
$(RS_SRCDIR)/target/%/$(RELEASE_TYPE)/libaw_sync.so: $(RS_SOURCES)
@echo $@
@echo "Release type: $(RELEASE_TYPE)"
@if [ "$$USE_PREBUILT" == "true" ] && [ -f $@ ]; then \
echo "Using prebuilt libaw_sync.so"; \
else \
echo "Building libaw_sync.so from aw-server-rust repo"; \
env RUSTFLAGS=$(RUSTFLAGS_ANDROID) make -C aw-server-rust android; \
fi

# aw-webui
.PHONY: $(WEBUI_DISTDIR)
$(WEBUI_DISTDIR):
Expand All @@ -210,4 +236,4 @@ clean:

.PHONY: fastlane/metadata/android/en-US/images/icon.png
fastlane/metadata/android/en-US/images/icon.png: aw-server-rust/aw-webui/media/logo/logo.png
convert $< -resize 75% -gravity center -background white -extent 512x512 $@
magick $< -resize 75% -gravity center -background white -extent 512x512 $@
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ If you haven't already, initialize the submodules with: `git submodule update --

To build aw-server-rust you need to have Rust nightly installed (with rustup). Then you can build it with:

```
```sh
export ANDROID_NDK_HOME=`pwd`/aw-server-rust/NDK # The path to your NDK
pushd aw-server-rust && ./install-ndk.sh; popd # This configures the NDK for use with Rust, and installs the NDK if missing
env RELEASE=false make aw-server-rust # Set RELEASE=true to build in release mode (slower build, harder to debug)
Expand Down
Binary file modified android.jks.age
Binary file not shown.
Loading
Loading