shinydevelopment / SimulatorStatusMagic

Clean up your status bar for taking screenshots on the iOS simulator.
MIT License
2.35k stars 140 forks source link

Add support for iOS 16 #104

Closed chrisvasselli closed 2 years ago

chrisvasselli commented 2 years ago

This is based on trial and error to figure out the size of the new structs, because dsdump is still crashing on the iOS 16 UIKitCore binary, so I have not figured out a way to see what the struct actually looks like.

It seems clear that one new item has been added to the overrides struct, which I have called "extra1". I have not figured out any way to determine definitively the size of the data it is expecting in StatusBarRawData, but I don't think it should matter. The new item seems to correspond to this new icon in the status bar.

I would love a second opinion on this, but I think that because we are getting this struct from a call to [UIStatusBarServer getStatusBarOverrideData], modifying it, and then passing it back via [UIStatusBarServer postStatusBarOverrideData:overrides], I don't think the fact that our StatusBarRawData struct is probably the wrong size should matter. It is at the tail end of the struct, and we are not modifying that part of the struct anyway. The only thing I can imagine causing problems would be if for some reason the difference in the shape of the end of the struct would cause the compiler to store the data at the beginning of the struct in a different way. If that were the case, perhaps our modifications to other parts of the struct could place data in the wrong place. But it seems like this is unlikely, and in practice it seems that things are working fine.