Closed ls-philippe-casgrain closed 11 months ago
We were using version 4.1.1 and we can still reproduce the issue with version 4.3.4.
we can confirm that just having the SumUp SDK linked we get a crash exactly like this... additional info: single page works, multiple pages crash - reproducible ... is there a way to swizzle the methods in questions so that it does not crash?
we will use a workaround:
import Foundation
import UIKit
private var swizzleCounter = 0
private let swizzleQueue = DispatchQueue(label: "de.tillhub.SumUpFix.swizzleQueue", qos: .utility)
public extension UIImage {
@objc static func checkmarkFixed() -> UIImage {
return UIImage.strokedCheckmark
}
static func fixCheckmarkMethod() {
swizzleQueue.sync {
swizzleCounter += 1
if (swizzleCounter == 1) {
let className = NSStringFromClass(UIImage.self)
let originalSelector: Selector = #selector(getter: UIImage.checkmark)
let swizzledSelector: Selector = #selector(UIImage.checkmarkFixed)
guard
let myClass: AnyClass = objc_getMetaClass(className) as? AnyClass,
let originalMethod = class_getClassMethod(myClass, originalSelector),
let swizzledMethod = class_getClassMethod(myClass, swizzledSelector)
else {
return
}
method_exchangeImplementations(originalMethod, swizzledMethod)
}
}
}
}
Please fix this ASAP, as this is creating many crashes for our customers in places which are not even related to SumUp.
By the way, @alghanor 's solution works as a temporary fix.
We also are observing this issue starting from iOS 17. Reproducible both on SumUp SDK 4.3.1 and 4.3.4. Could you, please, share any updates on this?
We have a feature where users can re-print a receipt using AirPrint, which brings up an OS dialog allowing you to change paper size and orientation. However, tapping either of those buttons causes a crash on iOS 17, which is very strange:
Somehow, a system UIImage is not loading.
However, before the crash we have this in our logs:
So I set a breakpoint on
[SDSStyleSheet styleSheetFromURL:]
and this is happening before the crash:I suspect that the SumUp SDK is swizzling
[UIColor colorForStyle:]
in a way that doesn't work with iOS 17.If I remove the SumUp SDK, the crash goes away.