This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Process: Twitter [45863] | |
Path: /Applications/Twitter.app/Contents/MacOS/Twitter | |
Identifier: Twitter | |
Version: 8.19 (8.19.1) | |
App Item ID: 1482454543 | |
App External ID: 835910359 | |
Code Type: X86-64 (Native) | |
Parent Process: ??? [1] | |
Responsible: Twitter [45863] | |
User ID: 501 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run any SwiftUI view as a Mac app. | |
import Cocoa | |
import SwiftUI | |
public func run<V: View>(view: V) { | |
let delegate = AppDelegate(view) | |
let app = NSApplication.shared | |
NSApp.setActivationPolicy(.regular) | |
app.mainMenu = app.customMenu |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Need to run with csrutil disable or recovery | |
sudo nvram boot-args="debug=0x104c44” | |
0x104c44 = 1 0000 0100 1100 0100 0100 | |
DB_NMI 0x4 // changes the power-button to create a non-maskable interrupt? | |
DB_ARP 0x40 // allows debugging across subnets via ARP? | |
DB_KERN_DUMP_ON_PANIC 0x400 // Trigger core dump on panic |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FirebaseCoordinator { | |
static let shared = FirebaseCoordinator() | |
static let initialize: Void = { | |
/// We modify Google Firebase (and eventually Analytics) to load the mac-specific plist at runtime. | |
/// Google enforces that we have a file named "GoogleService-Info.plist" in the app resources. | |
/// This is unfortunate since we need two different files based on iOS and Mac version | |
/// One solution is a custom build step that copies in the correct file: | |
/// https://stackoverflow.com/questions/37615405/use-different-googleservice-info-plist-for-different-build-schemes | |
/// However, this is basically impossible since Catalyst doesn't set any custom build variables, so detection is extremely difficult. | |
/// We swizzle to modify the loading times. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Copyright © 2020 PSPDFKit GmbH, Peter Steinberger. MIT Licensed. | |
// | |
import Foundation | |
extension String { | |
fileprivate init?(maybeCString: UnsafePointer<CChar>?) { | |
guard let cString = maybeCString else { return nil } | |
self.init(cString: cString) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Copyright © 2020 PSPDFKit GmbH. All rights reserved. | |
// | |
// THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW | |
// AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT. | |
// UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES. | |
// This notice may not be removed from this file. | |
// | |
#import <Foundation/Foundation.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Process: Twitter [12485] | |
Path: /Applications/Twitter.app/Contents/MacOS/Twitter | |
Identifier: maccatalyst.com.atebits.Tweetie2 | |
Version: 8.9 (8.9) | |
App Item ID: 1482454543 | |
App External ID: 834769122 | |
Code Type: X86-64 (Native) | |
Parent Process: ??? [1] | |
Responsible: Twitter [12485] | |
User ID: 501 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation UIImage (ResourceProxyHack) | |
+ (UIImage *)_iconForResourceProxy:(id)proxy format:(int)format { | |
// HACK: proxy seems garbage so we always show PDF for now. | |
let cgImage = [_bridge imageForFileType:@"pdf"]; | |
// HACK: We use mainScreen here but could have multiple screens. | |
let image = [UIImage imageWithCGImage:cgImage scale:UIScreen.mainScreen.scale orientation:UIImageOrientationUp]; | |
return image; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation UIImage (ResourceProxyHack) | |
+ (UIImage *)_iconForResourceProxy:(id)proxy format:(int)format { | |
// HACK: proxy seems garbage so we always show PDF for now. | |
let cgImage = [_bridge imageForFileType:@"pdf"]; | |
// HACK: We use mainScreen here but could have multiple screens. | |
let image = [UIImage imageWithCGImage:cgImage scale:UIScreen.mainScreen.scale orientation:UIImageOrientationUp]; | |
return image; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(lldb) po UIScreen.mainScreen | |
<UIScreen: 0x119905f10; bounds = {{0, 0}, {960, 540}}; mode = <UIScreenMode: 0x600000290300; size = 1920.000000 x 1080.000000>> | |
Display: 15,4-inch (2880 x 1800) | |
Scaling set to max, so effectively 1920x1200 (virtual screen of 3840x2400) | |
What I would expect: <UIScreen bounds = {{0, 0}, {1920, 1200}}; mode = <UIScreenMode: 0x600000290300; size = 3840.000000 x 2400.000000>> | |
------ |