- [Working without a nib, Part 1][1]
- [Working without a nib, Part 2: Also Also Wik][2]
- [Working without a nib, Part 5: No, 3!][3]
- [Working without a nib, Part 4: setAppleMenu][4]
- [Working without a nib, Part 5: Open Recent menu][5]
- [Working without a nib, Part 6: Working without a xib][6]
- [Working without a nib, Part 7: The empire strikes back][7]
- [Working without a nib, Part 8: The nib awakens][8]
- [Working without a nib, Part 9: Shipping without a nib][9]
- [Working without a nib, Part 10: Mac Main Menu][10]
This file contains 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
// | |
// LinkPresentation | |
// Copyright © 2015-2020 Apple Inc. All rights reserved. | |
// | |
// FIXME: Twitter equivalents? | |
(function () { | |
var MetadataExtractor = { |
This file contains 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 of the view using AppKit. | |
#if os(macOS) | |
import AppKit | |
import SwiftUI | |
final class AppKitTextView: NSView { | |
let textView: NSTextView = { | |
let this = NSTextView() | |
this.translatesAutoresizingMaskIntoConstraints = false | |
return this |
This file contains 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
import Combine | |
extension Publisher { | |
var stream: AsyncThrowingStream<Output> { | |
AsyncThrowingStream(Output.self) { continuation in | |
let cancellable = sink { completion in | |
switch completion { | |
case .finished: continuation.finish() | |
case .failure(let error): continuation.finish(throwing: error) | |
} |
This file contains 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
(I used hopper disassembler) | |
1) Open the Safari binary from iOS 13.7 [binary 1] and also open a Safari binary from iOS 14+ [binary 2] which has the selector you are interested in converted to direct method. | |
2) Search in the processes tab of the [binary 1] for the selector you are interested in. | |
3) Open it and have a look at the code inside it by using the 'pseudo-code mode'. | |
4) We now arrive to the 1st way to find a direct method: |
This file contains 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 ViewController: UIViewController { | |
@IBAction func onSearch(_ sender: Any) { | |
let fakeWindow = UIWindow(windowScene: view.window!.windowScene!) | |
let fakeTextField = UITextField() | |
fakeTextField.autocorrectionType = .no | |
fakeWindow.addSubview(fakeTextField) | |
fakeWindow.makeKeyAndVisible() | |
fakeTextField.becomeFirstResponder() |
This file contains 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
Java.perform(function() { | |
console.log('\n[.] Cert Pinning Bypass'); | |
// Create a TrustManager that trusts everything | |
console.log('[+] Creating a TrustyTrustManager that trusts everything...'); | |
var X509TrustManager = Java.use('javax.net.ssl.X509TrustManager'); | |
var TrustyTrustManager = Java.registerClass({ | |
name: 'com.example.TrustyTrustManager', | |
implements: [X509TrustManager], | |
methods: { |
This file contains 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
$ xcrun simctl status_bar booted override --time "9:41" --batteryState charged --batteryLevel 100 --cellularMode active |
This file contains 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
#!/bin/sh | |
# Set the macOS installer path as a variable | |
MACOS_INSTALLER="/Applications/$(ls /Applications | grep "Install macOS")" | |
MOUNT_POINT="$MACOS_INSTALLER/Contents/SharedSupport" | |
echo "macOS installer is \"$MACOS_INSTALLER\"" | |
# Set the target disk as a variable | |
TARGET=$(diskutil info "$(bless --info --getBoot)" | awk -F':' '/Volume Name/ { print $2 }' | sed -e 's/^[[:space:]]*//') | |
echo "Target disk is \"$TARGET\"" |
Cycript is a tool I find very helpful. It's an effective REPL for Objective-C. When I updated to macOS Mojave, I found that cycript no longer worked because it was linked against an old version of Ruby. After attempting to compile from source, I tried another solution. install_name_tool
is an open source tool for modifying the names of linked shared libraries in a Mach-O.
$ install_name_tool -change /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/libruby.2.0.0.dylib /System/Library/Frameworks/Ruby.framework/Versions/Current/usr/lib/libruby.dylib Cycript.lib/cycript-apl
$ install_name_tool -change /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/libruby.2.0.0.dylib /System/Library/Frameworks/Ruby.framework/Versions/Current/usr/lib/libruby.dylib Cycript.lib/libcycript.dylib
NewerOlder