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
40 changes: 40 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Android CI

on:
push:
branches:
- main
pull_request:

permissions:
contents: read

jobs:
verify:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4

- name: Verify library and sample
run: ./gradlew test lint assembleRelease

- name: Upload build reports
if: always()
uses: actions/upload-artifact@v4
with:
name: android-build-reports
path: |
**/build/reports/**
**/build/outputs/lint-results-*.html
if-no-files-found: ignore
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish Release

on:
push:
tags:
- "v*"

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4

- name: Verify and build release artifacts
run: ./gradlew test lint :keepalive-core:assembleRelease :app:assembleDebug

- name: Prepare release artifacts
run: |
VERSION="${GITHUB_REF_NAME#v}"
mkdir -p dist
cp keepalive-core/build/outputs/aar/keepalive-core-release.aar "dist/legitkeepalive-${VERSION}.aar"
cp app/build/outputs/apk/debug/app-debug.apk "dist/legitkeepalive-sample-${VERSION}.apk"
cd dist
sha256sum *.aar *.apk > SHA256SUMS.txt

- name: Publish GitHub release
env:
GH_TOKEN: ${{ github.token }}
run: gh release create "$GITHUB_REF_NAME" dist/* --notes-file "docs/releases/${GITHUB_REF_NAME}.md" --title "LegitKeepAlive $GITHUB_REF_NAME"
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ local.properties

# Log/OS Files
*.log
.DS_Store

# Android Studio generated files and folders
captures/
Expand All @@ -30,4 +31,4 @@ render.experimental.xml
google-services.json

# Android Profiling
*.hprof
*.hprof
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.1.0] - 2026-06-04

### Added

- Reusable `keepalive-core` Android Library.
- Public `LegitKeepAlive` API for recommendations, status checks, intent creation, and settings navigation.
- Configuration validation and ROM-specific rule resolution.
- Generic Android, Xiaomi MIUI 12, and Honor MagicOS 9.x bundled rules.
- Unit and Robolectric test coverage for core behavior.
- Maven publication, JitPack configuration, CI, and automated GitHub Releases.
- Sample app that consumes only the public library API.

[Unreleased]: https://github.com/ityulong/LegitKeepAlive/compare/v0.1.0...HEAD
[0.1.0]: https://github.com/ityulong/LegitKeepAlive/releases/tag/v0.1.0
47 changes: 47 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Contributing

Contributions that improve real-device compatibility, correctness, tests, or documentation are welcome.

## Before Opening An Issue

Include:

- device manufacturer and model
- Android version and OEM ROM version
- the affected recommendation
- whether navigation, status detection, or both failed
- screenshots and relevant logs when available

Do not include private user data or propose techniques that bypass Android platform policy.

## Development

1. Create a focused branch.
2. Add or update tests for behavioral changes.
3. Update `docs/oem-support-matrix.md` when OEM coverage changes.
4. Run:

```bash
./gradlew clean test lint assembleRelease
```

## OEM Rule Changes

OEM rules live in `keepalive-core/src/main/assets/legitkeepalive/`.

- Prefer configuration changes over new OEM-specific code.
- Preserve the generic fallback behavior.
- Confirm settings components on real hardware where possible.
- Mark a recommendation as checkable only when its state can be determined reliably.
- Explain the validation device and ROM version in the pull request.

## Pull Requests

Keep pull requests focused and describe:

- the problem and affected devices
- the chosen implementation
- verification performed
- compatibility or API impact

By contributing, you agree that your contribution is licensed under the Apache License 2.0.
Loading
Loading