Skip to content

Android: reliable private imports and failure recovery - #10

Draft
willlrock wants to merge 13 commits into
RadratSoftworks:masterfrom
willlrock:feat/onlyfun-android-overhaul
Draft

Android: reliable private imports and failure recovery#10
willlrock wants to merge 13 commits into
RadratSoftworks:masterfrom
willlrock:feat/onlyfun-android-overhaul

Conversation

@willlrock

Copy link
Copy Markdown

What changed

  • open the Android game library on a normal application launch
  • import picker results into persistentDataPath/__Games before parsing
  • use read-only streams and typed import failures, with database rollback and staged-file cleanup
  • stop treating caught load failures as a reason to call Application.Quit()
  • preserve full exceptions in a rotating onlyfun.log
  • recover initialization/runtime failures on the Unity thread and return to the library
  • make VM stop flags visible across the main and worker threads
  • select the exact Honey Cave 2 legacy profile: 101x80, portrait, T310, system 1.30, interpreter, 15 FPS
  • discard only the known stale Honey Cave 2 240x320/system 1.50 setting
  • add an Editor test assembly covering private import, typed empty-file errors, aliases, and an optional developer-owned external fixture
  • add an Android smoke-test checklist

Why

The released Android flow depended on an external intent and a fragile writable content-URI stream. Loader exceptions were discarded and the error dialog's OK action called Application.Quit(), so an ordinary malformed, inaccessible, or unsupported game looked like an application crash. Honey Cave 2 could also inherit the newer 240x320/system 1.50 defaults.

This change keeps external files away from the emulator core, retains actionable diagnostics, and leaves the application usable after failures.

Validation

  • git diff master...HEAD --check
  • static compile/API audit against Unity 2023.3 APIs
  • independent review of stream ownership, error recovery, worker-thread shutdown, and test-assembly references
  • inspected both supplied Honey Cave 2 files outside Git: valid VMGP, metadata title HoneyCave2, version 1.0, and no vInit3D import; the files were not committed
  • ZIP traversal check before extracting the developer-owned fixtures to a temporary directory

Unity tests and an APK build were not run on this machine. Only Unity Hub is installed; the Editor installation failed for lack of disk space. The project pins Unity 2023.3.0a18, and Android Build Support, SDK/NDK, and OpenJDK are not present.

Known limitations / follow-ups

  • ACTION_VIEW, ACTION_SEND, ClipData, and onNewIntent support remain follow-up work
  • diagnostics are written to disk, but Copy/Save/Clear diagnostics UI actions are not included yet
  • parser hardening and the broader runner state-machine refactor remain separate increments
  • the existing CI uses a mismatched Unity version and fork-inaccessible license/keystore secrets; it is not corrected in this PR
  • no copyrighted game files are included

When a game fails to load or crashes at runtime, the error dialog
now shows Yes/No buttons instead of just OK. Pressing Yes opens a
native save-file dialog so the user can export onlyfun.log to any
location.

- NofunRunner: changed both HandleLoadFailure and
  HandleSystemThreadFinished to use ButtonType.YesNo with a log-
  export callback
- FilePicker: added static ExportLog() supporting Editor,
  Standalone (Win/Mac/Linux) and Android targets
- NativeFileDialog: added NFD_SaveDialogU8 P/Invoke binding and
  OpenSaveFileDialog() helper for desktop builds
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