Skip to content

Keep mbassador intact under R8 and commit config writes synchronously - #128

Merged
in-jun merged 1 commit into
mainfrom
fix/r8-mbassador
Sep 8, 2026
Merged

Keep mbassador intact under R8 and commit config writes synchronously#128
in-jun merged 1 commit into
mainfrom
fix/r8-mbassador

Conversation

@in-jun

@in-jun in-jun commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Installing the v0.1.0 release on a Galaxy S26 (Android 16) and saving the first pair crashed the app immediately:

The provided handler invocation did not specify the necessary constructor gj1(SubscriptionContext)
  at com.hierynomus.smbj.event.SMBEventBus.subscribe
Caused by: java.lang.NoSuchMethodException: gj1.<init> [class qz1]
  • R8 rules — smbj's event bus is mbassador, which instantiates its handler-invocation classes by reflection with a (SubscriptionContext) constructor and reads @Handler annotations. The existing keep rule only covered com.hierynomus.**. net.engio.mbassy.** is now kept and RuntimeVisibleAnnotations retained.
  • Synchronous config writes — the crash landed a few ms after Save and raced SharedPreferences.apply(), so the pair the user had just entered was gone on relaunch. SecurePreferences.edit now uses commit(); writes are rare, hold credentials, and already run on Dispatchers.IO.

Verified on the device with this build (0.1.1): pair saved, first pass synced 4 files, real-time mode pushes a new local file to the NAS, a file created on the NAS arrives on the phone in about 10 s, and local deletes propagate. No crash.

The v0.1.0 release crashed on the first SMB connection: R8 renamed
mbassador's handler-invocation classes, which smbj's event bus looks up
by reflection ((SubscriptionContext) constructor). Keep net.engio.mbassy
and runtime annotations. The crash also raced SharedPreferences.apply()
and lost the pair that had just been saved, so SecurePreferences now
commits synchronously; its callers already run on Dispatchers.IO.
@in-jun
in-jun merged commit 67fea54 into main Sep 8, 2026
1 check passed
@in-jun
in-jun deleted the fix/r8-mbassador branch September 8, 2026 08:10
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