@@ -262,11 +262,9 @@ Thanks to:
262
262
}
263
263
264
264
func bindingForAppleIntelligence( ) -> Binding < Bool > {
265
- guard let cacheVersion = mobileGestalt [ " CacheVersion " ] else {
265
+ guard let cacheExtra = mobileGestalt [ " CacheExtra " ] as? NSMutableDictionary else {
266
266
return State ( initialValue: false ) . projectedValue
267
267
}
268
-
269
- let cacheExtra = mobileGestalt [ " CacheExtra " ] as! NSMutableDictionary
270
268
let key = " A62OafQ85EJAiiqKn4agtg "
271
269
return Binding (
272
270
get: {
@@ -291,7 +289,9 @@ Thanks to:
291
289
}
292
290
293
291
func bindingForRegionRestriction( ) -> Binding < Bool > {
294
- let cacheExtra = mobileGestalt [ " CacheExtra " ] as! NSMutableDictionary
292
+ guard let cacheExtra = mobileGestalt [ " CacheExtra " ] as? NSMutableDictionary else {
293
+ return State ( initialValue: false ) . projectedValue
294
+ }
295
295
return Binding < Bool > (
296
296
get: {
297
297
return cacheExtra [ " h63QSdBCiT/z0WU6rdQv6Q " ] as? String == " US " &&
@@ -310,16 +310,14 @@ Thanks to:
310
310
}
311
311
312
312
func bindingForTrollPad( ) -> Binding < Bool > {
313
- guard let cacheVersion = mobileGestalt [ " CacheVersion " ] else {
313
+ // We're going to overwrite DeviceClassNumber but we can't do it via CacheExtra, so we need to do it via CacheData instead
314
+ guard let cacheData = mobileGestalt [ " CacheData " ] as? NSMutableData ,
315
+ let cacheExtra = mobileGestalt [ " CacheExtra " ] as? NSMutableDictionary else {
314
316
return State ( initialValue: false ) . projectedValue
315
317
}
316
-
317
- // We're going to overwrite DeviceClassNumber but we can't do it via CacheExtra, so we need to do it via CacheData instead
318
318
let valueOffset = UserDefaults . standard. integer ( forKey: " MGCacheDataDeviceClassNumberOffset " )
319
- let cacheData = mobileGestalt [ " CacheData " ] as! NSMutableData
320
319
//print("Read value from \(cacheData.mutableBytes.load(fromByteOffset: valueOffset, as: Int.self))")
321
320
322
- let cacheExtra = mobileGestalt [ " CacheExtra " ] as! NSMutableDictionary
323
321
let keys = [
324
322
" uKc7FPnEO++lVhHWHFlGbQ " , // ipad
325
323
" mG0AnH/Vy1veoqoLRAIgTA " , // MedusaFloatingLiveAppCapability
@@ -350,11 +348,9 @@ Thanks to:
350
348
}
351
349
352
350
func bindingForMGKeys< T: Equatable > ( _ keys: [ String ] , type: T . Type = Int . self, defaultValue: T ? = 0 , enableValue: T ? = 1 ) -> Binding < Bool > {
353
- guard let cacheVersion = mobileGestalt [ " CacheVersion " ] else {
351
+ guard let cacheExtra = mobileGestalt [ " CacheExtra " ] as? NSMutableDictionary else {
354
352
return State ( initialValue: false ) . projectedValue
355
353
}
356
-
357
- let cacheExtra = mobileGestalt [ " CacheExtra " ] as! NSMutableDictionary
358
354
return Binding (
359
355
get: {
360
356
if let value = cacheExtra [ keys. first!] as? T ? , let enableValue {
0 commit comments