Share
Embed
Transcript
18 slides
-
if let radius = UIScreen.main.value(forKey: "_displayCornerRadius") as? CGFloat { print("display
corner radius:", radius) } 1SJWBUF"1*ͷݺͼग़͠ํ -[NSObject valueForKey:]/-[NSObject setValue:forKey:] -
Optional(Swift.Unmanaged<Swift.AnyObject>(_value: <UIScreen: 0x1057080a0>: in UIScreen: Class Methods: + (void) _performSwiftUITestingOverrides;
(0x1d8712a84) + (id) fallback_debugHierarchyPropertyDescriptions; (0x257fd057c) + (id) fallback_debugHierarchyValueForPropertyWithName:(id)arg1 onObject:(id)arg2 outOptions:(id*)arg3 outError:(id*)arg4; (0x257fd0c20) + (void) initialize; (0x185e00198) + (struct CGRect) convertRect:(struct CGRect)arg1 fromView:(id)arg2; (0x185e0a180) ... Properties: @property (readonly) unsigned long screenSizeCategory; @property (readonly, nonatomic, getter=isUserInterfaceIdiomPad) BOOL userInterfaceIdiomPad; @property (readonly, nonatomic, getter=_bn_portraitPeripheryInsets) struct UIEdgeInsets bn_portraitPeripheryInsets; @property (readonly) unsigned long hash; @property (readonly) Class superclass; ... Instance Methods: - (id) _mapkit_display; (0x197840328) - (BOOL) isUserInterfaceIdiomPad; (0x1a15472c8) - (unsigned long) screenSizeCategory; (0x1a154703c) - (id) traitCollectionForImageLoader:(id)arg1; (0x1a2a4bb9c) - (double) _SwiftUITesting_currentScreenScale; (0x1d8712ad4) - (BOOL) _SwiftUITesting_wantsWideContentMargins; (0x1d8712adc) ... 1SJWBUF"1*ͷ୳͠ํ ࣮ߦ࣌ʹ୳͢ -
guard let `class` = NSClassFromString("LSApplicationWorkspace") as? AnyObject else { return
} let workspace = `class` .perform(NSSelectorFromString("defaultWorkspace")) .takeUnretainedValue() workspace.perform("openApplicationWithBundleID:", with: "com.apple.Fitness") 1SJWBUF"1*ͷݺͼग़͠ํ -[NSObject performSelector:] -
guard let `class` = NSClassFromString("LSApplicationWorkspace") as? AnyObject else { return
} let selector = NSSelectorFromString("defaultWorkspace") guard `class`.responds(to: selector) else { return } let implementation = `class`.method(for: selector) let function = unsafeBitCast(implementation, to: (@convention(c) (AnyObject, Selector) -> AnyObject).self) let workspace = function(`class`, selector) 1SJWBUF"1*ͷݺͼग़͠ํ *.1ΛݺͿʢؔϙΠϯλݺͼग़͠ʣ -
let target: AnyObject = workspace let selector = NSSelectorFromString("openApplicationWithBundleID:") guard
target.responds(to: selector) else { return } let implementation = target.method(for: selector) let function = unsafeBitCast(implementation, to: (@convention(c) (AnyObject, Selector, String) -> Void).self) function(target, selector, "com.apple.Fitness") 1SJWBUF"1*ͷݺͼग़͠ํ *.1ΛݺͿʢؔϙΠϯλݺͼग़͠ʣ -
let target = view.window! let selector = NSSelectorFromString("_setRotatableViewOrientation:updateStatusBar:duration:force:") guard target.responds(to:
selector) else { return } let implementation = target.method(for: selector) let function = unsafeBitCast( implementation, to: (@convention(c) (AnyObject, Selector, UInt64, Bool, Double, Bool) -> Void).self ) function(target, selector, 4, true, 0.5, true) 1SJWBUF"1*ͷݺͼग़͠ํ *.1ΛݺͿʢؔϙΠϯλݺͼग़͠ʣ -
let path = "/System/Library/PrivateFrameworks/CoreSVG.framework/CoreSVG" guard let handler = dlopen(path, RTLD_NOW)
else { fatalError(String(cString: dlerror())) } 1SJWBUF"1*ͷݺͼग़͠ํ ϑϨʔϜϫʔΫΛಈతʹಡΈࠐΉ -
@objc class CGSVGDocument: NSObject {} typealias CreateFn = @convention(c) (CFData?,
CFDictionary?) -> Unmanaged<CGSVGDocument>? guard let p = dlsym(handler, "CGSVGDocumentCreateFromData") else { fatalError(String(cString: dlerror())) } let CGSVGDocumentCreateFromData = unsafeBitCast(p, to: CreateFn.self) ؔͷγϯϘϧΛऔಘ͢Δ 1SJWBUF"1*ͷݺͼग़͠ํ -
let document = CGSVGDocumentCreateFromData(data as CFData, nil)?.takeUnretainedValue() guard let document
else { return } 1SJWBUF"1*ͷݺͼग़͠ํ ؔΛݺͼग़͢ -
let path = URL(fileURLWithPath: "/System/Library/PrivateFrameworks/CoreSVG.framework") guard let cf = CFBundleCreate(kCFAllocatorDefault,
path as CFURL) else { return } guard CFBundleLoadExecutable(cf) else { return } EMPQFOEMTZN#VOEMF"1* 1SJWBUF"1*ͷݺͼग़͠ํ -
@objc class CGSVGDocument: NSObject {} typealias CreateFn = @convention(c) (CFData?,
CFDictionary?) -> Unmanaged<CGSVGDocument>? let p = CFBundleGetFunctionPointerForName(cf, "CGSVGDocumentCreateFromData" as CFString) guard let p else { return } let CGSVGDocumentCreateFromData: CreateFn = unsafeBitCast(p, to: CreateFn.self) EMPQFOEMTZN#VOEMF"1* 1SJWBUF"1*ͷݺͼग़͠ํ -
let transition = CATransition() transition.type = .init(rawValue: "cube") transition.subtype =
.fromLeft transition.duration = 0.6 view.window?.layer.add(transition, forKey: "") ެ։͞Εͯͳ͍&OVNఆͷΛࢦఆ͢Δ 1SJWBUF"1*ͷݺͼग़͠ํ