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
56 changes: 56 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,62 @@ joined this list.)

## Unreleased

### Added

- **Remote Config inspector** ([#6](https://github.com/devconsole-android/DevConsole/issues/6)).
Read-only view of the Remote Config values active on the device, with the attribution that makes
them diagnosable: whether each value came from the server, an in-app default, the SDK's static
fallback, or a local override — plus last fetch time, last fetch status, and minimum fetch
interval. A key serving a default because the fetch was throttled is otherwise indistinguishable
from one you actually published.

Three new modules following the existing push triad: `devconsole-remote-config` (vendor-neutral
model and registry), `devconsole-remote-config-firebase` (reads `FirebaseRemoteConfig` by
reflection, so Firebase stays off the classpath of consumers that do not use it), and
`devconsole-remote-config-firebase-noop` (the protected-build twin, which reports
`disabled-build` rather than pretending config is simply empty). Neither adapter is re-exported by
the `devconsole` umbrella.

Surfaces on both the browser dashboard (a Remote Config page under Data) and the Compose
inspector's Observe screen (a **Config** tab, shown only when a provider is registered, since the
on-device tab row splits its width equally and should not spend a tab on an app with no Remote
Config), and over `GET /api/v1/remote-config`. Gated by the existing
`CaptureCategory.STATE`, alongside state providers and feature flags. Register a provider with
`DevConsoleConfig.withRemoteConfigProviders(...)` or, for a lazily-built client,
`DevConsole.registerRemoteConfigProvider(...)`. Read-only by design: DevConsole does not set
overrides and never triggers `fetch()`/`activate()`. See
[docs/REMOTE_CONFIG.md](docs/REMOTE_CONFIG.md).

A config value is a string of any length, so the tables show a preview and open the full value on
demand: click a key on the dashboard, tap a row on the Config tab. Both default to pretty-printed
JSON and fall back to the raw string with a toggle between them — a value like `on` or `v2` is
never re-quoted to make it parse, since the quotes would be the viewer's invention rather than
something the server sent, and a truncated or redacted value says so rather than failing to parse
for an unexplained reason.

Values are redacted by key name at a single boundary shared by both surfaces — the on-device
inspector reads in-process and never crosses the HTTP boundary, so redacting at the route alone
would have left it exposed. Matching is separator-insensitive here, unlike the raw
`RedactionPolicy`, whose defaults are an HTTP-header list compared by exact name: `api_key` and
`apiKey` now match the policy's `api-key` instead of being displayed in full.

### Fixed

- **State providers no longer race their readers.** `StateRegistry` held a plain `LinkedHashMap`
read without a lock, so a host registering a provider late — through
`DevConsole.registerStateProvider`, which is a documented path — while the dashboard's server
thread or the in-app inspector was iterating could throw `ConcurrentModificationException` into
the app being debugged. Every access is guarded now, and the insertion order surfaces list
providers in is preserved. `RemoteConfigRegistry` had the same shape and got the same fix before
it ever shipped.

- **Re-initializing replaces registered providers instead of silently keeping the old ones.** Both
registries reject a duplicate id, and neither was cleared between `initialize()` calls, so a
`stop()` → `initialize(...)` carrying a replacement provider under the same id had its
registration refused — leaving every surface reading through the torn-down original. Both are now
cleared as part of the same per-init reset, and a duplicate id within one config is ignored rather
than thrown out of `initialize()` (state providers previously threw; Remote Config already did not).

## 1.1.1 — 2026-08-12

A build-and-distribution patch: no SDK code changed, and the public API is byte-for-byte the
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing to DevConsole

Thanks for taking a look. This is a 31-module Android SDK plus two included Gradle builds
Thanks for taking a look. This is a 34-module Android SDK plus two included Gradle builds
(`build-logic` and `gradle-plugin`), which sounds like a lot until you realise you rarely touch more
than one at a time. The quickest way in is to run the same commands CI runs, listed below and in
[Verify](.github/workflows/verify.yml).
Expand Down
62 changes: 61 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ gets you nothing.
| **Crash & ANR capture** | Uncaught exceptions and a main-looper watchdog with bounded all-thread dumps and breadcrumbs. Always delegates to any crash reporter you already have. |
| **Push timeline** | Record FCM (or any) push messages and their lifecycle: received → displayed → opened. The Firebase adapter uses reflection — no compile-time Firebase dependency. |
| **State & feature flags** | Snapshot host-registered state and override feature flags from the browser. |
| **Remote Config inspector** | Every Remote Config value active on the device, and where each one came from — server, in-app default, static fallback, or a local override — plus last fetch time and status. Read-only. The Firebase adapter uses reflection — no compile-time Firebase dependency. |
| **Data inspectors** | Browse SharedPreferences, SQLite (incl. a SQL console), and app files. Read-only by default; every edit surface is opt-in. |
| **Evidence tray & exports** | Flag anything, attach it to a bug report bundle or Markdown/Jira/GitHub clipboard text. Export HAR, Postman Collection, or a full session ZIP. |
| **Background keep-alive** | Opt-in foreground service that keeps the server alive while your app is backgrounded. Manifest-only opt-in, zero SDK-declared permissions. |
Expand Down Expand Up @@ -281,6 +282,63 @@ you can replay it, clone it into the composer, or flag it into a bug report:

<p align="center"><img src="docs/images/dashboard-network.png" width="820" alt="Network inspector in the browser dashboard, showing a captured request and response side by side" /></p>

### Set up Remote Config

Add the adapter — it is not part of the `devconsole` umbrella, so that Firebase never lands on the
classpath of an app that doesn't use it:

```kotlin
debugImplementation("io.github.devconsole-android:devconsole-remote-config-firebase:1.2.0")
releaseImplementation("io.github.devconsole-android:devconsole-remote-config-firebase-noop:1.2.0")
```

> These two artifacts are new: `1.1.1` predates them, and `1.2.0` is the release they first ship in.
> To try them before that lands, take them off the branch through
> [JitPack](#jitpack-for-unreleased-code).

Then hand DevConsole your `FirebaseRemoteConfig` instance at init:

```kotlin
DevConsole.initialize(
application,
DevConsoleConfig(/* … */)
.withRemoteConfigProviders(listOf(FirebaseRemoteConfigAdapter(Firebase.remoteConfig))),
)
```

If the client is built lazily — through DI, or only once a first fetch completes — register it when
you have it. This is safe to call late, unlike feature flags, because values are read on demand
rather than snapshotted at startup:

```kotlin
DevConsole.registerRemoteConfigProvider(FirebaseRemoteConfigAdapter(Firebase.remoteConfig))
```

That's the whole setup. Values then appear on the dashboard's **Remote Config** page and on the
in-app inspector's **Config** tab, each tagged with where it came from:

| Source | Meaning |
|---|---|
| `remote` | Fetched from the server and activated. |
| `default` | An in-app default (`setDefaultsAsync`) — no server value is active for this key. |
| `static` | Set nowhere — the SDK's static fallback for an unknown key. |
| `override` | A local override is masking whatever the provider resolved. |

That last column is the reason this inspector exists. Knowing a flag reads `false` is rarely the
hard part; knowing whether it reads `false` because you published it, or because the last fetch was
throttled and the app quietly fell back to a default, is. Each provider also reports its last fetch
time, last fetch status, and minimum fetch interval — and a provider that has never fetched says
`never`, rather than showing an epoch date.

Not using Firebase? Implement `RemoteConfigProvider` for any other service — the model is
vendor-neutral, and [docs/REMOTE_CONFIG.md](docs/REMOTE_CONFIG.md) has a worked example. The
inspector is read-only: DevConsole never sets overrides and never triggers `fetch()` or `activate()`.

Values are redacted by key name before either surface sees them, matched separator-insensitively so
`api_key` and `apiKey` are caught as well as `api-key`. It is still an allowlist, so a secret under
a name nobody listed is shown in full — extend `RedactionPolicy.sensitiveFieldNames` if you keep
anything sensitive in Remote Config.

## Artifacts

Group `io.github.devconsole-android`, one version for everything. There is deliberately no BOM, and
Expand All @@ -300,6 +358,7 @@ Opt-in add-ons (each `-noop` twin is the matching `releaseImplementation`):
| `devconsole-network-ktor` | *(none)* | Ktor `HttpClient` capture plugin (full request + response body capture, any engine; see [Network adapters](docs/NETWORK_ADAPTERS.md)) |
| `devconsole-socket-paho` | `devconsole-socket-paho-noop` | MQTT capture via Eclipse Paho |
| `devconsole-push-firebase` | `devconsole-push-firebase-noop` | FCM push adapter (reflection-based) |
| `devconsole-remote-config-firebase` | `devconsole-remote-config-firebase-noop` | Firebase Remote Config adapter (reflection-based; see [Remote Config](docs/REMOTE_CONFIG.md)) |

Everything else (`devconsole-core`, `devconsole-storage-room`, and the rest) arrives transitively.
You never name those. Every module publishes sources, javadoc, and a signed POM.
Expand Down Expand Up @@ -332,7 +391,7 @@ A release tag works as the bare tag, as above. Any branch works as `<branch>-SNA
written as `~`, so a `feature/x` branch is `feature~x-SNAPSHOT`. JitPack support starts at
**1.1.1**; earlier tags do not build there. Three things to know before you rely on it:

- **The Gradle plugin is not on JitPack.** Only the 31 library artifacts are, so the
- **The Gradle plugin is not on JitPack.** Only the 34 library artifacts are, so the
`plugins { id("io.github.devconsole-android") … }` block above does not apply. Name the
`debugImplementation` and `releaseImplementation` coordinates yourself. You also give up the
plugin's variant-policy check, which is the thing that keeps the full SDK out of release builds.
Expand Down Expand Up @@ -437,6 +496,7 @@ Full index: [docs/README.md](docs/README.md). Highlights:
[Push](docs/PUSH.md)
- [Data inspectors and exports](docs/DATA_INSPECTORS_AND_EXPORTS.md) ·
[Evidence and bug reports](docs/EVIDENCE_AND_BUG_REPORTS.md)
- [State and feature flags](docs/STATE_AND_FLAGS.md) · [Remote Config](docs/REMOTE_CONFIG.md)
- [Crash and ANR capture](docs/CRASH_AND_ANR.md) ·
[Background keep-alive](docs/BACKGROUND_KEEPALIVE.md)
- [FAQ / troubleshooting](docs/FAQ_TROUBLESHOOTING.md)
Expand Down
4 changes: 2 additions & 2 deletions docs/MAVEN_PUBLISHING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Publishing to Maven Central

All 31 modules under `sdk/` are wired with the
All 34 modules under `sdk/` are wired with the
[Vanniktech Maven Publish plugin](https://github.com/vanniktech/gradle-maven-publish-plugin)
(via the `devconsole.publishing` convention), targeting the Sonatype **Central Portal** under the
group `io.github.devconsole-android`. Artifact IDs follow the mapping in
Expand Down Expand Up @@ -117,6 +117,6 @@ that registers `.asc` artifacts fails there with "artifact file does not exist".
`PublishingConventionPlugin` calls `signAllPublications()` only when a key is configured — the same
condition that lets a contributor run `publishToMavenLocal` without one.

Only the 31 library modules are served; `gradle-plugin` is an `includeBuild` and is not among them,
Only the 34 library modules are served; `gradle-plugin` is an `includeBuild` and is not among them,
so JitPack consumers use plain coordinates rather than the plugin. Check a build at
`https://jitpack.io/api/builds/com.github.devconsole-android/DevConsole`.
9 changes: 9 additions & 0 deletions docs/PROTOCOL_REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,15 @@ accepted since surrounding quotes are trimmed). `FeatureFlagType` has two member
allowed values the declared option set) — see [STATE_AND_FLAGS.md](STATE_AND_FLAGS.md#flags-with-named-options-environment-switching)
for the named-options use case (environment/account-tier switching).

### Remote Config

`GET /api/v1/remote-config` (auth). Read-only; there is no write route. Returns one object per
registered provider: `id`, `fetch` (`lastFetchEpochMs` — **null**, never a sentinel, when no fetch
has completed — plus `status` and `minimumFetchIntervalSeconds`), `unavailableReason`, and `entries`
(`key`, `value`, `source`, `redacted`, `truncated`). `source` is one of `remote`, `default`,
`static`, `override`, `unknown`. Gated by the `state` capture category, the same one that covers
state providers and feature flags. See [REMOTE_CONFIG.md](REMOTE_CONFIG.md).

### Composer

`POST /api/v1/composer/execute` (auth — one-off request; `method` restricted to
Expand Down
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ read one page here, make it the threat model, especially before you put the dash
- [Composer and mocks](COMPOSER_AND_MOCKS.md)
- [Push](PUSH.md)
- [State and feature flags](STATE_AND_FLAGS.md)
- [Remote Config](REMOTE_CONFIG.md)
- [Crash and ANR capture](CRASH_AND_ANR.md) — all-thread dumps, breadcrumbs, `CrashPolicy`, and the
Crashes surface on both web and Android
- [Data inspectors, exports, and the More screen](DATA_INSPECTORS_AND_EXPORTS.md) — preferences,
Expand Down
Loading
Loading