Skip to content

Fix Flutter Android build and login error handling - #102

Closed
wospruvot-Pixel wants to merge 4 commits into
m5stack:mainfrom
wospruvot-Pixel:fix/samsung-login-rsa
Closed

wospruvot-Pixel wants to merge 4 commits into
m5stack:mainfrom
wospruvot-Pixel:fix/samsung-login-rsa

Conversation

@wospruvot-Pixel

Copy link
Copy Markdown

Summary

This pull request fixes several issues preventing the Flutter app from building and using the login form correctly on newer Android devices, including Samsung phones.

Changes

Login form and keyboard

  • Fixes software keyboard and text input behavior on Samsung Android devices.
  • Removes an unsafe FocusScope.of(context) call from dispose().
  • Ensures the loading state is always reset with try/catch/finally.
  • Adds controlled handling for connection errors.

RSA handling

  • Prevents parsing empty or placeholder RSA keys.
  • Uses lazy RSA encrypter initialization.
  • Separates Bluetooth key validation from HTTP RSA validation.
  • Prevents FormatException: Unable to parse key, invalid format.

Android build

  • Configures the tflite_flutter Kotlin compilation target to JVM 11.
  • Limits the workaround to the affected plugin.
  • Removes obsolete localhost proxy configuration.

Three.js compatibility

  • Uses Dart Uint8List directly for texture image data.
  • Fixes compatibility with the current three_js_core API.

Missing backend configuration

  • Detects the placeholder backend address:
    00.000.000.000:0000/
  • Prevents login credentials from being sent when the backend is not configured.
  • Shows:
    Backend server is not configured.

Testing

Tested on a physical Samsung Galaxy S21 Ultra.

  • dart format passed.
  • flutter analyze reported no compilation errors.
  • flutter build apk --debug succeeded.
  • APK installed and launched successfully.
  • Software keyboard opens and text fields accept input.
  • No RSA parsing crash.
  • No dispose-related crash.
  • No endless loading spinner.
  • Placeholder backend is detected before an HTTP client is created.
  • Automated login-form guard test passed.

Notes

The repository still contains a placeholder backend address and does not provide a supported production backend configuration for source builds.

This pull request does not add private keys, tokens, production URLs, credentials, or server secrets.

@yuanzhihong1

Copy link
Copy Markdown
Contributor

Hi @wospruvot-Pixel,

Thank you for taking the time to diagnose and fix these Samsung login and build issues, and for including such detailed testing notes — this is genuinely helpful feedback for StackChan.

After re-checking against the current main branch, this PR has unfortunately drifted significantly: the app and Android build setup have changed substantially since July, several affected files now conflict, and parts of the fix have already been superseded by newer changes. To avoid keeping a stale and unreviewable branch open, we're going to close this PR for now rather than ask you to carry the full rebase burden.

The underlying issues you identified are still valuable, especially the login/form lifecycle and RSA initialization paths. If these problems remain on the latest main, we would be very happy to receive a smaller follow-up PR based on current main. We'll help review it and make sure your contribution is properly credited.

Thanks again for your time and for helping improve StackChan.

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.

2 participants