@@ -228,23 +228,21 @@ void init_bypassDyldLibValidation() {
228228
229229 NSDebugLog (@" [DyldLVBypass] init" );
230230
231- switch (( int ) DeviceGetJITFlags ( YES )) {
232- case JIT_FLAG_FORCE_MIRRORED | JIT_FLAG_HAS_TXM :
231+ if (@ available (iOS 26.0 , * )) {
232+ if ( DeviceHasJITFlags ( JIT_FLAG_FORCE_MIRRORED | JIT_FLAG_HAS_TXM )) {
233233 NSDebugLog (@" [DyldLVBypass] Using redirectFunctionMirrored" );
234234 redirectFunction = redirectFunctionMirrored;
235- break ;
236- case JIT_FLAG_FORCE_MIRRORED :
237- // Special special case for non-TXM iOS 26+
238- // We can JIT without script, but we cannot modify existing code in dsc without it.
239- // Therefore, we choose a hook method that avoids patching code in dsc completely, using hardware breakpoint.
240- // The function only stashes the original function pointers, and the breakpoint handler will redirect to our hook
235+ } else if (DeviceHasJITFlags (JIT_FLAG_FORCE_MIRRORED )) {
236+ // Non-TXM iOS 26+: avoid patching code in dsc, use hardware breakpoint instead
241237 NSDebugLog (@" [DyldLVBypass] Using redirectFunctionHWBreakpoint" );
242238 redirectFunction = redirectFunctionHWBreakpoint;
243- break ;
244- default :
239+ } else {
245240 NSDebugLog (@" [DyldLVBypass] Using redirectFunctionDirect" );
246241 redirectFunction = redirectFunctionDirect;
247- break ;
242+ }
243+ } else {
244+ NSDebugLog (@" [DyldLVBypass] Using redirectFunctionDirect" );
245+ redirectFunction = redirectFunctionDirect;
248246 }
249247
250248 // Modifying exec page during execution may cause SIGBUS, so ignore it now
0 commit comments