Skip to content

Ghost Mode 0.2.0: exact restore, reboot handling, new UI - #4

Merged
Foxlape merged 6 commits into
mainfrom
release/0.2.0
Sep 27, 2026
Merged

Foxlape merged 6 commits into
mainfrom
release/0.2.0

Conversation

@Foxlape

@Foxlape Foxlape commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner

Summary

Reworks the core so that turning Ghost Mode off always returns the phone to exactly the state it was in before, fixes the bugs found in a full code review, and replaces the UI. Prepares the repository for F-Droid / IzzyOnDroid (#3).

Full list: CHANGELOG.md.

Most important fixes

  • Turn-off used the preset / SIM selected at that moment; switching them while on ran the wrong restore commands. Turn-on now records a snapshot (preset, slots, original settings values, packages it disabled, boot count) and turn-off reverts exactly that.
  • Universal preset left VoLTE broken: it disabled the detected IMS service (e.g. com.shannon.imsservice on Pixel) and never re-enabled it. Disabled packages are tracked and re-enabled; diagnostics can repair packages left disabled by older versions.
  • preferred_network_mode* was restored as 0 (GSM/WCDMA, no LTE) by the Samsung and Android 9–11 presets; all settings put keys are now restored to their original values.
  • After a reboot the app claimed "off" although mask, settings and disabled packages persist. Now it re-applies (root / Sui) or shows a notification.
  • Schedule, timer, widget, tile and shortcuts failed silently with Shizuku on a cold process; separate Shizuku connections killed each other's user service; Shizuku restarts required an app restart; root command timeout was not enforced.
  • Update check never worked (no INTERNET permission) — now opt-in; English UI showed Russian preset texts; stale version in About; fake "mobile data active" in diagnostics; timer not cancelled on manual turn-off; shortcuts replayed on rotation.

UI

Home / Presets / Settings tabs, animated main switch, per-SIM diagnostics, full-screen log, 7-day statistics, new icon and widget. Screenshots: fastlane/metadata/android/*/images/phoneScreenshots/.

Repository

README (en/ru) rewritten, CHANGELOG, fastlane metadata, issue templates, CI (tests + lint), release workflow that refuses to publish without the signing key, checks the certificate and builds notes from the changelog.

Testing

  • 52 unit tests (./gradlew testDebugUnitTest), lint, debug and release builds
  • Release APK signed with the official key (FB:2A:E9:…:B0:50)
  • UI rendered with Robolectric (screenshots in fastlane metadata)
  • On a real device: turn on/off with Universal and vendor preset, VoLTE returns after turn-off, reboot while on, schedule, timer, tile, widget, upgrade over 0.1.16 while the mode is ON

🤖 Generated with Claude Code

Foxlape and others added 6 commits September 27, 2026 19:43
Core
- Record an AppliedSnapshot on turn-on (preset, off commands, SIM slots,
  original `settings` values, packages disabled by us, boot count) and use it
  for turn-off. Restores exactly what was changed even if the preset or SIM
  mode was switched meanwhile; legacy 0.1.x ON state is migrated.
- Restore original values of every `settings put` key (or delete keys that
  did not exist). Previously preferred_network_mode* was written back as 0
  (GSM/WCDMA only) and Samsung VoLTE switches were always forced on.
- Track packages disabled with `pm disable-user` and re-enable them on OFF.
  The Universal preset disabled the detected IMS service (e.g.
  com.shannon.imsservice on Pixel) and never re-enabled it. Diagnostics offer
  a repair action for packages left disabled by older versions.
- Capture the network mask on every activation, never trust an LTE-only
  reading, and parse network-type-name output instead of falling back.
- Detect reboots via Settings.Global.BOOT_COUNT: re-apply automatically when
  root/Sui is available, otherwise show a notification (re-apply / turn off)
  instead of silently marking the mode as off.
- One process-wide AppGraph: a single Shizuku connection, shell executor and
  controller (one lock) shared by activity, tile, widget and receivers.
  Separate instances used to kill each other's user service.
- Callers woken by alarms, tile, widget or shortcuts wait for the Shizuku
  binder instead of failing silently on a cold process.
- Shizuku: reconnect after server restart, fix bind race (10 s timeouts).
- Root: enforce the command timeout (stdout was read before waiting);
  cache negative probes so denied root does not re-prompt on every resume.
- Turn-off cancels the auto turn-off timer; timer retries if the backend is
  temporarily unavailable.
- Shell sequences run in the application scope, so leaving the screen can no
  longer cut a sequence in half; shortcuts are not replayed on recreation.
- Partial failures are reported (Success / Partial / Failure outcomes).

UI
- New Compose UI: Home / Presets / Settings tabs, animated main switch,
  live status chips, timer card, quick tiles, contextual alert cards.
- Presets show their commands; editor documents placeholders; import shows
  every command and asks for confirmation.
- Per-SIM diagnostics with a real mobile-data check, full-screen command log,
  statistics with a 7-day chart, About screen with the signing fingerprint.
- Built-in preset texts, durations and log notes are localized (they were
  hard-coded Russian); new launcher icon, widget and tile states; dynamic
  colors; no white flash in dark theme; language persisted on Android <= 12.

Other
- Update check is opt-in (INTERNET permission was missing, so it never
  worked). Preset/SIM changes are locked while the mode is on. QS tile asks
  to unlock on a secure lock screen. No dependency-info block in the APK;
  app data excluded from backup/transfer.
- versionCode 200 (major*10000 + minor*100 + patch), versionName 0.2.0.
- Unit tests for controller, repositories, masks, schedule, stats, update
  checker; Robolectric/Roborazzi screenshot suite (-Pscreenshots).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fastlane metadata (en-US, ru-RU): title, short and full descriptions,
changelog for versionCode 200, 512 px icon and six phone screenshots
rendered by ScreenshotTest. Part of #3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… guides

- README (en/ru): what the app does, install and verification, quick start,
  how presets work, placeholders, limitations, building.
- CHANGELOG.md in Keep a Changelog format covering 0.1.0-0.2.0 with factual
  notes instead of marketing copy.
- CONTRIBUTING: presets, code rules (restorable commands, tests, strings),
  release procedure. SECURITY: supported versions and scope.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- CI runs unit tests, lint and a debug build, uploads reports.
- Release workflow: fails if the signing secret is missing (it used to
  publish a debug-signed APK), checks that the tag matches versionName,
  verifies the signing certificate, and builds release notes from
  CHANGELOG.md plus the Russian fastlane changelog.
- Issue templates ask for version, carrier, diagnostics and the log; the
  broken Discussions link is replaced.
- .gitattributes / .editorconfig, executable gradlew.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The "Get Shizuku" button opened a market:// link. Google Play is missing
or disabled on many phones this app targets, so the button now opens the
latest release on github.com/RikkaApps/Shizuku (falling back to
shizuku.rikka.app). README mentions the maintained thedjchi fork, which
can start itself after a reboot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- "Both SIMs" on a single-SIM phone ran slot-specific commands against the
  empty slot, so turning on/off always reported "some commands failed".
  Slots without a ready SIM (TelephonyManager.getSimState, no permission
  needed) are now skipped; if the state is unknown the selection is kept.
- The "Add Quick Settings tile" callback was ignored, so nothing visible
  happened when the tile was already added or the firmware rejected the
  request. The result is now shown, with manual steps as a fallback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Foxlape
Foxlape merged commit 33d96f1 into main Sep 27, 2026
@Foxlape
Foxlape deleted the release/0.2.0 branch September 27, 2026 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant