Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
136 changes: 82 additions & 54 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Build & Release

# Pull requests: unit tests + debug build + R8 release build of the stable flavor (debug-signed).
# Pushes to main (and v* tags): the same checks, both flavors, signed with the release key, published.

on:
push:
branches: [main, beta]
Expand All @@ -23,12 +26,18 @@ on:
- 'LICENSE'
workflow_dispatch:

permissions:
contents: write
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 40
permissions:
contents: write
env:
IS_RELEASE: ${{ github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') }}
steps:
- uses: actions/checkout@v4

Expand All @@ -37,59 +46,91 @@ jobs:
distribution: temurin
java-version: 17

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: ${{ github.ref != 'refs/heads/main' }}

- name: Setup Android SDK
uses: android-actions/setup-android@v3
with:
packages: 'platform-tools platforms;android-35 build-tools;35.0.0'

- name: Accept licenses
run: yes | sdkmanager --licenses || true
- name: Make gradlew executable
run: chmod +x gradlew


- name: Decode release keystore (optional)
id: keystore
# Official repo: signing secrets are mandatory (never publish a debug-signed APK).
# Forks and contributors have no secrets: they get a debug-signed build, as before.
- name: Decode release keystore
id: keys
if: env.IS_RELEASE == 'true'
env:
RELEASE_KEYSTORE_BASE64: ${{ secrets.RELEASE_KEYSTORE_BASE64 }}
RELEASE_STORE_PASSWORD: ${{ secrets.RELEASE_STORE_PASSWORD }}
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }}
RELEASE_KEY_ALIAS: ${{ secrets.RELEASE_KEY_ALIAS }}
run: |
if [ -n "${RELEASE_KEYSTORE_BASE64:-}" ] && [ -n "${RELEASE_STORE_PASSWORD:-}" ] \
&& [ -n "${RELEASE_KEY_PASSWORD:-}" ] && [ -n "${RELEASE_KEY_ALIAS:-}" ]; then
echo "$RELEASE_KEYSTORE_BASE64" | base64 -d > "$GITHUB_WORKSPACE/release.jks"
echo "path=$GITHUB_WORKSPACE/release.jks" >> "$GITHUB_OUTPUT"
echo "present=true" >> "$GITHUB_OUTPUT"
echo "Release keystore decoded."
else
echo "present=false" >> "$GITHUB_OUTPUT"
echo "Release key secrets not set — release APK will use debug signing (skip)."
if [ -z "${RELEASE_KEYSTORE_BASE64:-}" ] || [ -z "${RELEASE_STORE_PASSWORD:-}" ] \
|| [ -z "${RELEASE_KEY_PASSWORD:-}" ] || [ -z "${RELEASE_KEY_ALIAS:-}" ]; then
if [ "$GITHUB_REPOSITORY" = "wized2/Fern" ]; then
echo "::error::Release signing secrets are missing. Refusing to publish a debug-signed APK."
exit 1
fi
echo "::warning::No signing secrets in this fork: building with the debug key."
echo "signed=false" >> "$GITHUB_OUTPUT"
exit 0
fi
echo "$RELEASE_KEYSTORE_BASE64" | base64 -d > "$RUNNER_TEMP/release.jks"
echo "Keystore OK: $(wc -c < "$RUNNER_TEMP/release.jks") bytes"
echo "signed=true" >> "$GITHUB_OUTPUT"

- name: Build debug + release APKs
- name: Unit tests and debug build
run: ./gradlew testStableDebugUnitTest assembleStableDebug --stacktrace

- name: Build release (pull request, stable only)
if: env.IS_RELEASE != 'true'
run: ./gradlew assembleStableRelease --stacktrace

- name: Build release (stable and beta, signed)
if: env.IS_RELEASE == 'true'
env:
RELEASE_STORE_FILE: ${{ steps.keystore.outputs.present == 'true' && format('{0}/release.jks', github.workspace) || '' }}
# Blank when there is no key (forks): Gradle then falls back to the debug key.
RELEASE_STORE_FILE: ${{ steps.keys.outputs.signed == 'true' && format('{0}/release.jks', runner.temp) || '' }}
RELEASE_STORE_PASSWORD: ${{ secrets.RELEASE_STORE_PASSWORD }}
RELEASE_KEY_ALIAS: ${{ secrets.RELEASE_KEY_ALIAS }}
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }}
run: ./gradlew assembleStableRelease assembleBetaRelease --stacktrace

- name: Verify release signature
if: env.IS_RELEASE == 'true' && steps.keys.outputs.signed == 'true'
run: |
chmod +x gradlew
if [ "${{ steps.keystore.outputs.present }}" = "true" ]; then
export RELEASE_STORE_FILE="$GITHUB_WORKSPACE/release.jks"
echo "Signing release with uploaded keystore"
else
unset RELEASE_STORE_FILE || true
echo "No release keystore — Gradle falls back to debug signing"
fi
./gradlew assembleStableDebug assembleBetaDebug testStableDebugUnitTest assembleStableRelease assembleBetaRelease --no-daemon --stacktrace
set -euo pipefail
BT=$(ls -d "$ANDROID_HOME"/build-tools/* | sort -V | tail -1)
for apk in app/build/outputs/apk/stable/release/*.apk app/build/outputs/apk/beta/release/*.apk; do
"$BT/apksigner" verify --verbose --print-certs "$apk" | tee /tmp/verify.txt
grep -q 'Verified using v2 scheme.*true' /tmp/verify.txt
if grep -qi 'CN=Android Debug' /tmp/verify.txt; then
echo "::error::$apk is signed with the Android debug key"
exit 1
fi
done

- name: Upload test reports
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-reports
path: app/build/reports/tests
if-no-files-found: ignore
retention-days: 7

- name: Upload debug APK
uses: actions/upload-artifact@v4
with:
name: Fern-debug
path: |
app/build/outputs/apk/stable/debug/*.apk
app/build/outputs/apk/beta/debug/*.apk
path: app/build/outputs/apk/stable/debug/*.apk
if-no-files-found: error
retention-days: 14

- name: Upload release APK
uses: actions/upload-artifact@v4
Expand All @@ -100,8 +141,16 @@ jobs:
app/build/outputs/apk/beta/release/*.apk
if-no-files-found: error

- name: Keep R8 mapping files
if: env.IS_RELEASE == 'true'
uses: actions/upload-artifact@v4
with:
name: r8-mapping
path: app/build/outputs/mapping/*Release/mapping.txt
if-no-files-found: warn

- name: Read versionName
if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
if: env.IS_RELEASE == 'true'
id: ver
run: |
VN=$(grep -E 'versionName\s*=' app/build.gradle.kts | head -1 | sed -E 's/.*"([^"]+)".*/\1/')
Expand All @@ -110,34 +159,13 @@ jobs:
echo "Version $VN"

- name: Prepare release assets
if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
if: env.IS_RELEASE == 'true'
run: |
mkdir -p release-assets
cp app/build/outputs/apk/stable/release/*.apk release-assets/Fern-release.apk
cp app/build/outputs/apk/beta/release/*.apk release-assets/Fern-beta.apk || true
# debug APK stays as workflow artifact only (smaller GitHub Releases; avoids large upload timeouts)
cp app/build/outputs/apk/beta/release/*.apk release-assets/Fern-beta.apk
ls -la release-assets/

- name: Load release notes
if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
id: notes
run: |
if [ -f RELEASE_NOTES.md ]; then
{
echo "body<<FERN_NOTES_EOF"
cat RELEASE_NOTES.md
echo "FERN_NOTES_EOF"
} >> "$GITHUB_OUTPUT"
else
{
echo "body<<FERN_NOTES_EOF"
echo "## Fern ${{ steps.ver.outputs.name }}"
echo ""
echo "See CHANGELOG.md"
echo "FERN_NOTES_EOF"
} >> "$GITHUB_OUTPUT"
fi

- name: Create GitHub Release (tag push)
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
Expand Down
Binary file removed .gradle/8.11/checksums/checksums.lock
Binary file not shown.
Binary file removed .gradle/8.11/checksums/md5-checksums.bin
Binary file not shown.
Binary file removed .gradle/8.11/checksums/sha1-checksums.bin
Binary file not shown.
Binary file removed .gradle/8.11/fileChanges/last-build.bin
Binary file not shown.
Binary file removed .gradle/8.11/fileHashes/fileHashes.lock
Binary file not shown.
Empty file removed .gradle/8.11/gc.properties
Empty file.
Binary file removed .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
2 changes: 0 additions & 2 deletions .gradle/buildOutputCleanup/cache.properties

This file was deleted.

Empty file removed .gradle/vcs-1/gc.properties
Empty file.
51 changes: 33 additions & 18 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,50 @@
## 1.11.0
# Changelog

* **Advanced mode performance**: phased shell work (Lite/Balanced/Full), 3–15s interval, probe cache, mutex — stops lag from stacking dumpsys
* Manual Refresh still runs a full heavy sample when you need immediate per-app data
* Active Apps search; RAM alert threshold; ZRAM + process count on elevated snapshot
* Core MHz sysfs cached 3s; shorter elevated CPU dwell
* CI: paths-ignore for site/docs-only changes; release body from `RELEASE_NOTES.md`
* Website primary: https://get-fern.vercel.app
All notable changes to Fern are listed here. Versions follow the Android `versionName`.

## 1.10.1
## 1.12.0

* Fix CI: AppSort enum must not carry @Composable; ActiveApps is @Composable again
* Primary website: https://get-fern.vercel.app
**Security**
* Force-stop and clear-cache now validate the package name against a strict Android package-name pattern before it reaches the Shizuku/root shell. Previously a name containing `;`, `|`, `$()` or a newline could have injected commands.

# Changelog
**Performance and battery**
* Preferences are written with `apply()` instead of a synchronous `commit()` on the UI thread
* UI state is collected with `collectAsStateWithLifecycle`, so nothing recomposes while the app is in the background
* One sysfs pass per refresh for CPU frequencies (was three); static device info (kernel, security patch, CPU topology, max MHz, sensor count) is read once
* `/proc/stat` and `/proc/loadavg` are skipped for 60 s after repeated failures, and the `cat` subprocess fallback (blocked by the same SELinux policy) is removed
* Overlay pill reads only battery temperature and RAM instead of a full capture on the main thread, pauses while the screen is off, and repositions on rotation

## Unreleased
**UI**
* Status and navigation bar icons follow the selected theme (dark-on-dark in dark mode before)

**Build and release**
* Pull requests build the stable flavor only; beta and signed builds run on `main` and tags
* On the official repository a release fails if the signing secrets are missing, and the APK signature is verified (not the debug key) before publishing. Forks without secrets still build debug-signed APKs
* Gradle build cache directory is no longer tracked; R8 mapping files are kept as a CI artifact

## 1.11.3
- Active apps: clearer empty state with Advanced mode guidance
- Settings: TalkBack labels on key switches
- Details: copy snapshot to clipboard
- Tests: more MetricsParse / HistoryExport edge cases
- Docs: first contribution in 15 minutes


## Unreleased
- Details: share plain text, **Markdown snapshot**, and **session history CSV**
- Richer bottom navigation content descriptions (accessibility)
- HistoryExport helpers + unit tests for CSV/Markdown

## 1.11.0

* **Advanced mode performance**: phased shell work (Lite/Balanced/Full), 3–15s interval, probe cache, mutex — stops lag from stacking dumpsys
* Manual Refresh still runs a full heavy sample when you need immediate per-app data
* Active Apps search; RAM alert threshold; ZRAM + process count on elevated snapshot
* Core MHz sysfs cached 3s; shorter elevated CPU dwell
* CI: paths-ignore for site/docs-only changes; release body from `RELEASE_NOTES.md`
* Website primary: https://get-fern.vercel.app

## 1.10.1

* Fix CI: AppSort enum must not carry @Composable; ActiveApps is @Composable again
* Primary website: https://get-fern.vercel.app

## 1.10.0

Expand Down Expand Up @@ -128,9 +146,6 @@
- UI: refined top bar + status bar contrast, roomier metric spacing
- Theme: OLED-friendlier dark surfaces, consistent corner radii

# Changelog

All notable changes to Fern are listed here.

## 1.5.22 — 2026-09-17

Expand Down
20 changes: 14 additions & 6 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# Fern 1.11.3
# Fern 1.12.0

Docs & discoverability polish.
Faster, lighter and safer. No new screens; everything you already use got cheaper to run.

- README badges fixed (workflow path + shields for release / stars)
- Issue templates + funding metadata
- Cross-links to Latch / Subcord
**Security**
- App names are now strictly validated before Force stop / Clear cache reach the Shizuku or root shell (closes a command-injection path).

App logic unchanged from 1.11.2; re-release for store/listing consistency.
**Speed and battery**
- Settings save in the background instead of blocking the screen.
- Nothing redraws while Fern is not visible.
- Far fewer system file reads per refresh; device info that cannot change is read once.
- The floating pill reads only what it shows and sleeps while the screen is off.

**Fixes**
- Status bar and navigation bar icons are readable in dark theme.

Fern still asks for no internet permission and sends nothing anywhere.
17 changes: 16 additions & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Security fixes are applied to the latest release on the `main` branch.

Please report security issues privately:

- **Email:** acartoon7668@gmail.com
- **Email:** acartoon7668@gmail.com
- Or use GitHub **Private vulnerability reporting** on this repository if enabled.

Please include steps to reproduce, affected version/commit, and impact.
Expand All @@ -19,3 +19,18 @@ Reports related to optional **Shizuku / root** Advanced mode are especially welc
## Coordinated disclosure

We aim to acknowledge reports promptly and ship fixes for confirmed high-impact issues in a timely release.

## Threat model

What Fern is designed to guarantee, and where the boundaries are.

| Area | Design |
| --- | --- |
| Network | The app declares no `INTERNET` permission. It cannot send data off the device. |
| Data at rest | Only preferences (theme, thresholds, overlay layout) are stored. `allowBackup` is off. Metrics history lives in memory and is cleared on exit. |
| Permissions | Usage access (Active Apps) and Display over other apps (overlay) are optional and user-granted. Nothing is requested at install time. |
| Elevated mode | Off by default. Needs Shizuku or root that the user has already set up and explicitly granted to Fern. |
| Shell input | The only commands built from variable data are `am force-stop` and `pm clear --cache-only`. The package name must match `^[A-Za-z][A-Za-z0-9_]*(\.[A-Za-z0-9_]+)+$` (max 255 chars) before it is used; anything else is refused. |
| Release integrity | On the official repository CI refuses to publish an APK without the release key and verifies the signature with `apksigner` before upload. Forks have no secrets and build debug-signed APKs. |

Out of scope: a device that is already rooted by malware, or a compromised Shizuku service.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ android {
applicationId = "com.endroid.fern"
minSdk = 26
targetSdk = 35
versionCode = 75
versionName = "1.11.3"
versionCode = 76
versionName = "1.12.0"
resourceConfigurations += listOf("en", "es", "de")
ndk {
abiFilters += listOf("arm64-v8a", "armeabi-v7a")
Expand Down
Loading
Loading