Skip to content

fix: replace objc_getClassList with objc_copyClassNamesForImage to av… - #221

Merged
e271828- merged 1 commit into
masterfrom
bugfix/fix-objc-runtime-crash-ios16
May 7, 2026
Merged

fix: replace objc_getClassList with objc_copyClassNamesForImage to av…#221
e271828- merged 1 commit into
masterfrom
bugfix/fix-objc-runtime-crash-ios16

Conversation

@CAMOBAP

@CAMOBAP CAMOBAP commented Apr 15, 2026

Copy link
Copy Markdown
Collaborator

…oid class realization

objc_getClassList forces the ObjC runtime to realize every registered class, which crashes on iOS 16 when the host app contains @observable classes guarded by @available(iOS 17, *). objc_copyClassNamesForImage reads class name strings from Mach-O metadata without realizing any class, avoiding the crash.

Fixes #220

@CAMOBAP CAMOBAP self-assigned this Apr 15, 2026
@CAMOBAP
CAMOBAP marked this pull request as ready for review April 15, 2026 13:35
@github-actions

Copy link
Copy Markdown

Cocoapods size report:

OLD: 0 bytes
NEW: 163440 bytes

DIFF: 163440 bytes

faris-imi
faris-imi previously approved these changes Apr 15, 2026
@CAMOBAP
CAMOBAP force-pushed the bugfix/fix-objc-runtime-crash-ios16 branch from a121295 to 13dbf08 Compare April 15, 2026 14:52

@antoinelamy antoinelamy left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick fix 👍🏻

Comment thread HCaptcha/Classes/HCaptchaDebugInfo.swift Outdated
…oid class realization

objc_getClassList forces the ObjC runtime to realize every registered class,
which crashes on iOS 16 when the host app contains @observable classes guarded
by @available(iOS 17, *). objc_copyClassNamesForImage reads class name strings
from Mach-O metadata without realizing any class, avoiding the crash.

Fixes #220
@CAMOBAP
CAMOBAP force-pushed the bugfix/fix-objc-runtime-crash-ios16 branch from 13dbf08 to 2cd0ec9 Compare April 19, 2026 19:36
@antoinelamy

Copy link
Copy Markdown

Any news on this?

@e271828-
e271828- merged commit 380ab62 into master May 7, 2026
10 checks passed
@e271828-

e271828- commented May 7, 2026

Copy link
Copy Markdown
Contributor

Any news on this?

This should be released later today.

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.

Runtime crash caused by unsafe ObjC runtime API

4 participants