refactor(android): replace Gson with org.json in SQLHTTPServer

Merged
RI
3d ago
+592-74

What

  • Parse /execute and /batch HTTP request bodies with org.json instead of Gson in SQLHTTPServer.
  • Centralize SQL param conversion in HttpRequestJsonParams (null, bool, string, number truncation, nested objects).
  • Remove com.google.code.gson:gson from android/build.gradle.
  • Add JVM unit tests for param parsing semantics.
  • Pin all GitHub Actions uses: references to latest major tags (no SHAs or patch versions).

Why

  • Drop an extra dependency; Android already ships org.json.
  • Keep HTTP SQL param behavior unchanged for existing clients.
  • Align CI workflows with repository action pinning policy.

How

  • JSONObject / JSONArray for request parsing (malformed JSON still surfaces as request errors via existing exception handling).
  • Number params use Gson-compatible getAsLong logic (parse as long, else truncate via double) with getAsDouble fallback on NumberFormatException.
  • Object params still coerce field values with getAsString-equivalent semantics.
  • Workflow updates: actions/checkout@v7, actions/setup-node@v7, actions/setup-java@v6, softprops/action-gh-release@v3, patch/SHA pins removed.

Testing

  • HttpRequestJsonParamsTest (null, bool, string, int, decimal truncation, object fields, skipped arrays, malformed JSON).
  • CI: bun run verify (Android Gradle build/test, iOS, web).

Not Tested

  • Live device HTTP integration against a running SQLHTTPServer instance (covered indirectly by existing plugin flows).
Open in Web Open in Cursor 

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Bug Fixes
    • Android HTTP requests handle JSON parameters—including nulls, booleans, strings, numbers, and flat object values—with more consistent results. Decimal numbers retain compatible conversion behavior; unsupported nested values remain unavailable as request parameters.
  • Chores
    • Updated the tooling used for automated builds, tests, releases, publishing, and deployments. Workflow triggers, build steps, and configured Node.js versions remain unchanged.