Initial commit

From 2021-11-14 - woah
This commit is contained in:
Spotlight 2023-06-10 20:10:10 -05:00
commit 8eb5200d8f
Signed by: spotlight
GPG key ID: 874AA355B3209BDC
18 changed files with 907 additions and 0 deletions

26
.gitignore vendored Normal file
View file

@ -0,0 +1,26 @@
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## User settings
xcuserdata/
## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
*.xcscmblueprint
*.xccheckout
## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
build/
DerivedData/
*.moved-aside
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
## Gcc Patch
/*.gcno

View file

@ -0,0 +1,375 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 55;
objects = {
/* Begin PBXBuildFile section */
42B1C89E2741E27C00145D63 /* ScreenShredderApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42B1C89D2741E27C00145D63 /* ScreenShredderApp.swift */; };
42B1C8A02741E27C00145D63 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42B1C89F2741E27C00145D63 /* ContentView.swift */; };
42B1C8A22741E27D00145D63 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 42B1C8A12741E27D00145D63 /* Assets.xcassets */; };
42B1C8A52741E27D00145D63 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 42B1C8A42741E27D00145D63 /* Preview Assets.xcassets */; };
42B1C8B12741F9F900145D63 /* ShredAroundAndFindOut.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42B1C8B02741F9F900145D63 /* ShredAroundAndFindOut.swift */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
425DEEDA2742B2C9006B685B /* CAStateControllerDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CAStateControllerDelegate.h; path = Headers/CAStateControllerDelegate.h; sourceTree = "<group>"; };
42B1C89A2741E27C00145D63 /* ScreenShredder.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ScreenShredder.app; sourceTree = BUILT_PRODUCTS_DIR; };
42B1C89D2741E27C00145D63 /* ScreenShredderApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScreenShredderApp.swift; sourceTree = "<group>"; };
42B1C89F2741E27C00145D63 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
42B1C8A12741E27D00145D63 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
42B1C8A42741E27D00145D63 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
42B1C8A62741E27D00145D63 /* ScreenShredder.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = ScreenShredder.entitlements; sourceTree = "<group>"; };
42B1C8B02741F9F900145D63 /* ShredAroundAndFindOut.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShredAroundAndFindOut.swift; sourceTree = "<group>"; };
42B1C8B32741FBF500145D63 /* ScreenShredder-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ScreenShredder-Bridging-Header.h"; sourceTree = "<group>"; };
42B1C8B42741FBF600145D63 /* CAPackage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CAPackage.h; path = Headers/CAPackage.h; sourceTree = "<group>"; };
42B1C8B72741FC0700145D63 /* CAStateController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CAStateController.h; path = Headers/CAStateController.h; sourceTree = "<group>"; };
42B1C8BC2742483F00145D63 /* CAState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CAState.h; path = Headers/CAState.h; sourceTree = "<group>"; };
42B1C8BD2742483F00145D63 /* CALayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CALayer.h; path = Headers/CALayer.h; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
42B1C8972741E27C00145D63 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
42B1C8912741E27C00145D63 = {
isa = PBXGroup;
children = (
42B1C89C2741E27C00145D63 /* ScreenShredder */,
42B1C89B2741E27C00145D63 /* Products */,
);
sourceTree = "<group>";
};
42B1C89B2741E27C00145D63 /* Products */ = {
isa = PBXGroup;
children = (
42B1C89A2741E27C00145D63 /* ScreenShredder.app */,
);
name = Products;
sourceTree = "<group>";
};
42B1C89C2741E27C00145D63 /* ScreenShredder */ = {
isa = PBXGroup;
children = (
42B1C8B22741FBCA00145D63 /* Headers */,
42B1C89D2741E27C00145D63 /* ScreenShredderApp.swift */,
42B1C89F2741E27C00145D63 /* ContentView.swift */,
42B1C8A12741E27D00145D63 /* Assets.xcassets */,
42B1C8A62741E27D00145D63 /* ScreenShredder.entitlements */,
42B1C8A32741E27D00145D63 /* Preview Content */,
42B1C8B02741F9F900145D63 /* ShredAroundAndFindOut.swift */,
);
path = ScreenShredder;
sourceTree = "<group>";
};
42B1C8A32741E27D00145D63 /* Preview Content */ = {
isa = PBXGroup;
children = (
42B1C8A42741E27D00145D63 /* Preview Assets.xcassets */,
);
path = "Preview Content";
sourceTree = "<group>";
};
42B1C8B22741FBCA00145D63 /* Headers */ = {
isa = PBXGroup;
children = (
42B1C8B32741FBF500145D63 /* ScreenShredder-Bridging-Header.h */,
42B1C8B42741FBF600145D63 /* CAPackage.h */,
42B1C8B72741FC0700145D63 /* CAStateController.h */,
425DEEDA2742B2C9006B685B /* CAStateControllerDelegate.h */,
42B1C8BD2742483F00145D63 /* CALayer.h */,
42B1C8BC2742483F00145D63 /* CAState.h */,
);
name = Headers;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
42B1C8992741E27C00145D63 /* ScreenShredder */ = {
isa = PBXNativeTarget;
buildConfigurationList = 42B1C8A92741E27D00145D63 /* Build configuration list for PBXNativeTarget "ScreenShredder" */;
buildPhases = (
42B1C8962741E27C00145D63 /* Sources */,
42B1C8972741E27C00145D63 /* Frameworks */,
42B1C8982741E27C00145D63 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = ScreenShredder;
productName = ScreenShredder;
productReference = 42B1C89A2741E27C00145D63 /* ScreenShredder.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
42B1C8922741E27C00145D63 /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1320;
LastUpgradeCheck = 1320;
TargetAttributes = {
42B1C8992741E27C00145D63 = {
CreatedOnToolsVersion = 13.2;
LastSwiftMigration = 1320;
};
};
};
buildConfigurationList = 42B1C8952741E27C00145D63 /* Build configuration list for PBXProject "ScreenShredder" */;
compatibilityVersion = "Xcode 13.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 42B1C8912741E27C00145D63;
productRefGroup = 42B1C89B2741E27C00145D63 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
42B1C8992741E27C00145D63 /* ScreenShredder */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
42B1C8982741E27C00145D63 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
42B1C8A52741E27D00145D63 /* Preview Assets.xcassets in Resources */,
42B1C8A22741E27D00145D63 /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
42B1C8962741E27C00145D63 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
42B1C8A02741E27C00145D63 /* ContentView.swift in Sources */,
42B1C89E2741E27C00145D63 /* ScreenShredderApp.swift in Sources */,
42B1C8B12741F9F900145D63 /* ShredAroundAndFindOut.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
42B1C8A72741E27D00145D63 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
42B1C8A82741E27D00145D63 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
};
name = Release;
};
42B1C8AA2741E27D00145D63 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = ScreenShredder/ScreenShredder.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"ScreenShredder/Preview Content\"";
DEVELOPMENT_TEAM = NP873NYDVX;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = space.joscomputing.ScreenShredder;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OBJC_BRIDGING_HEADER = "ScreenShredder/ScreenShredder-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
};
name = Debug;
};
42B1C8AB2741E27D00145D63 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = ScreenShredder/ScreenShredder.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"ScreenShredder/Preview Content\"";
DEVELOPMENT_TEAM = NP873NYDVX;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = space.joscomputing.ScreenShredder;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OBJC_BRIDGING_HEADER = "ScreenShredder/ScreenShredder-Bridging-Header.h";
SWIFT_VERSION = 5.0;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
42B1C8952741E27C00145D63 /* Build configuration list for PBXProject "ScreenShredder" */ = {
isa = XCConfigurationList;
buildConfigurations = (
42B1C8A72741E27D00145D63 /* Debug */,
42B1C8A82741E27D00145D63 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
42B1C8A92741E27D00145D63 /* Build configuration list for PBXNativeTarget "ScreenShredder" */ = {
isa = XCConfigurationList;
buildConfigurations = (
42B1C8AA2741E27D00145D63 /* Debug */,
42B1C8AB2741E27D00145D63 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 42B1C8922741E27C00145D63 /* Project object */;
}

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View file

@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -0,0 +1,58 @@
{
"images" : [
{
"idiom" : "mac",
"scale" : "1x",
"size" : "16x16"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "16x16"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "32x32"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "32x32"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "128x128"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "128x128"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "256x256"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "256x256"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "512x512"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "512x512"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -0,0 +1,112 @@
//
// ContentView.swift
// ScreenShredder
//
// Created by Spotlight Deveaux on 2021-11-14.
//
import SwiftUI
struct Message: Hashable {
var sender: String
var title: String
var contents: String
var timestamp: String
}
struct ContentView: View {
let shredder = ShredIt()
@State var messages = [
Message(
sender: "poor-user@somecompromised.biz",
title: "H̷o̴t̶ ̸i̶n̵ ̴y̶o̶u̵r̶ ̶a̴r̶e̶a̸",
contents: "stevens__jackson, There are HOT HOT WOMEN in the Chicago area waiting for YOU!!! Click here --> https://youtube.com/",
timestamp: "17:52"
),
Message(
sender: "Sierra Kingsley",
title: "RE: [URGENT] Server down",
contents: "Oh nvm it seems Justin fixed it sorry to bug you. Sent from my iPhone On Monday, September 13, 2021 at 7:39 A.M., Sierra",
timestamp: "13:47"
),
Message(
sender: "Sierra Kingsley",
title: "[URGENT] Server down",
contents: "Jackson, While I know it's bad management to name anyone, Justin took down our servers yesterday while performing",
timestamp: "06:39"
),
Message(
sender: "Spotlight",
title: "[spotlightishere/ScreenShredder] Do not destroy Mac",
contents: "@spotlightishere pushed 1 commit. d1cebabe Remove user files deletion feature — You are receiving this because you are subscribed to this thread.",
timestamp: "23:18"
),
]
var body: some View {
NavigationView {
List {
ForEach(messages, id: \.self) { message in
NavigationLink(destination: MessageContents(sender: message.sender)) {
MessageItem(currentMessage: message)
}
}
.onDelete { indexSet in
withAnimation {
shredder.shredIt()
messages.remove(atOffsets: indexSet)
}
}
}
.frame(minWidth: 400.0)
}.onAppear(perform: {
Task {
shredder.shredIt()
}
})
}
}
// Is this cursed? Yes.
// Is this primarily hardcoded and probably breaks
// on other screen sizes? Probably, yes.
// Does it work? Yes.
struct MessageItem: View {
let currentMessage: Message
var body: some View {
HStack(alignment: .top) {
VStack(alignment: .leading) {
Text(currentMessage.sender)
.font(.headline)
Text(currentMessage.title)
.font(.callout)
.lineLimit(1)
Text(currentMessage.contents)
.foregroundColor(Color.gray)
.font(.subheadline)
.lineLimit(2)
}
Spacer()
Text(currentMessage.timestamp)
.foregroundColor(Color.gray)
.font(.subheadline)
}.padding(.bottom, 2.0)
.padding(.leading, 20.0)
}
}
struct MessageContents: View {
let sender: String
var body: some View {
Text("Hello, world!")
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}

View file

@ -0,0 +1,18 @@
//
// CALayer.h
// ScreenShredder
//
// Created by Spotlight Deveaux on 2021-11-14.
//
#ifndef CALayer_h
#define CALayer_h
@import QuartzCore;
#import "CAState.h"
@interface CALayer (PrivateDefinitions)
@property(readonly) NSArray<CAState *> *_Nonnull states;
@end
#endif /* CALayer_h */

View file

@ -0,0 +1,31 @@
//
// CAPackage.h
// ScreenShredder
//
// Created by Spotlight Deveaux on 2021-11-14.
//
#ifndef CAPackage_h
#define CAPackage_h
@import QuartzCore;
extern NSString *_Nonnull kCAPackageTypeArchive;
@interface CAPackage : NSObject
+ (CAPackage *_Nullable)packageWithContentsOfURL:(NSURL *_Nonnull)url
type:(NSString *_Nonnull)type
options:(NSDictionary *_Nullable)opts
error:(NSError *_Nullable *_Nullable)
outError;
- (NSArray<NSString *> *_Nonnull)publishedObjectNames;
- (CALayer *_Nullable)publishedObjectWithName:(NSString *_Nonnull)name;
@property(readonly, getter=isGeometryFlipped) BOOL geometryFlipped;
@property(readonly) CALayer *_Nonnull rootLayer;
@end
#endif /* CAPackage_h */

View file

@ -0,0 +1,21 @@
//
// CAState.h
// ScreenShredder
//
// Created by Spotlight Deveaux on 2021-11-14.
//
#ifndef CAState_h
#define CAState_h
@import QuartzCore;
@interface CAState : NSObject
// We most likely don't need to define its methods, as we use none directly.
// Instead, we define this solely for type checking.
// (I apologize if you were looking for them here.)
@end
#endif /* CAState_h */

View file

@ -0,0 +1,44 @@
//
// CAStateController.h
// ScreenShredder
//
// Created by Spotlight Deveaux on 2021-11-14.
//
#ifndef CAStateController_h
#define CAStateController_h
@import QuartzCore;
#import "CAState.h"
#import "CAStateControllerDelegate.h"
@interface CAStateController : NSObject
// Delegate handling
@property(nonatomic, weak) id<CAStateControllerDelegate> delegate;
- (void)setDelegate:(id<CAStateControllerDelegate>)delegate;
- (CALayer *_Nullable)layer;
- (void)_removeTransition:(id _Nonnull)arg1 layer:(CALayer *_Nonnull)arg2;
- (CAStateController *_Nonnull)initWithLayer:(CALayer *_Nonnull)layer;
- (CAState *_Nonnull)stateOfLayer:(CALayer *_Nonnull)arg1;
- (void)setState:(CAState *_Nonnull)state
ofLayer:(CALayer *_Nonnull)layer
transitionSpeed:(float)speed;
- (void)setState:(CAState *_Nonnull)state ofLayer:(CALayer *_Nonnull)layer;
- (void)setInitialStatesOfLayer:(CALayer *_Nonnull)layer
transitionSpeed:(float)speed;
- (void)setInitialStatesOfLayer:(CALayer *_Nonnull)layer;
// TODO: What type is id in the beneath here?
- (id _Nonnull)removeAllStateChanges;
- (void)restoreStateChanges:(id _Nonnull)arg1;
- (void)cancelTimers;
- (void)_nextStateTimer:(id _Nonnull)arg1;
- (void)_addAnimation:(id _Nonnull)arg1
forKey:(id _Nonnull)arg2
target:(id _Nonnull)arg3
undo:(id _Nonnull)arg4;
@end
#endif /* CAStateController_h */

View file

@ -0,0 +1,25 @@
//
// CAStateControllerDelegate.h
// ScreenShredder
//
// Created by Spotlight Deveaux on 2021-11-15.
//
#ifndef CAStateControllerDelegate_h
#define CAStateControllerDelegate_h
@class CAStateController;
@protocol CAStateControllerDelegate
@optional
- (void)stateController:(CAStateController *_Nonnull)controller
didSetStateOfLayer:(CALayer *_Nonnull)layer;
- (void)stateController:(CAStateController *_Nonnull)controller
transitionDidStart:(id)arg2
speed:(float)speed;
- (void)stateController:(CAStateController *_Nonnull)controller
transitionDidStop:(id)arg2
completed:(BOOL)completion;
@end
#endif /* CAStateControllerDelegate_h */

View file

@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -0,0 +1,5 @@
#import "CALayer.h"
#import "CAPackage.h"
#import "CAState.h"
#import "CAStateController.h"
#import "CAStateControllerDelegate.h"

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.downloads.read-only</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
</dict>
</plist>

View file

@ -0,0 +1,19 @@
//
// ScreenShredderApp.swift
// ScreenShredder
//
// Created by Spotlight Deveaux on 2021-11-14.
//
import SwiftUI
@main
struct ScreenShredderApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
.windowToolbarStyle(UnifiedCompactWindowToolbarStyle())
.windowStyle(HiddenTitleBarWindowStyle())
}
}

View file

@ -0,0 +1,123 @@
//
// ShredAroundAndFindOut.swift
// ScreenShredder
//
// Created by Spotlight Deveaux on 2021-11-14.
//
import Cocoa
import Foundation
class ShredIt: CAStateControllerDelegate {
func shredIt() {
let keyWindow = NSApplication.shared.keyWindow!
let pdfData = keyWindow.dataWithPDF(inside: keyWindow.frame)
let windowImage = NSImage(data: pdfData)!
let shreddedImage = windowImage.cgImage(forProposedRect: nil, context: nil, hints: nil)
let shreddedImageFlipped = flipHorizontally(windowImage).cgImage(forProposedRect: nil, context: nil, hints: nil)
let view = keyWindow.contentView!
// Here we, uh, go. I think.
// Oh no...
let caarPath = getBundleBase().appendingPathComponent("ShredderSheet.caar")
do {
// Load package
let package = try CAPackage(contentsOf: caarPath, type: kCAPackageTypeArchive, options: nil)
// It seems we need to add the root layer as provided by the package to us.
let rootLayer = package.rootLayer
let rootLayerFrame = getHorizontalCenter(view)
// We can create a view with this layer.
let layerView = NSView(frame: rootLayerFrame)
layerView.layer = CALayer()
layerView.layer?.addSublayer(rootLayer)
view.addSubview(layerView)
package.publishedObject(withName: "Root")!.frame = rootLayerFrame
// Apparently allows us to control states within the animation.
let stateController = CAStateController(layer: rootLayer)
stateController.delegate = self
// TODO: How do these differ?
// These names are derived from PKPassShredderSheet's getter/setters.
// let offscreenState = rootLayer.states[0]
// let upOnBackState = rootLayer.states[1]
let shreddingState = rootLayer.states[2]
// The following names are guesses.
// let hangingShreddingState = rootLayer.states[3]
// let hangingShreddingShorterState = rootLayer.states[4]
// let blankState = rootLayer.states[5]
stateController.setInitialStatesOf(rootLayer, transitionSpeed: 1.0)
stateController.setState(shreddingState, of: rootLayer, transitionSpeed: 1.0)
// For debugging purposes
print(package.publishedObjectNames())
// Ensure we don't have some weird black background.
package.publishedObject(withName: "Root")!.backgroundColor = NSColor.clear.cgColor
// We never use the states (offscreenState/onBackState) where these are present.
// We'll set them to a clear color, just in case.
package.publishedObject(withName: "cancelButton")!.contents = NSColor.clear.cgColor
package.publishedObject(withName: "deleteButton")!.contents = NSColor.clear.cgColor
package.publishedObject(withName: "shredderPrompt")!.backgroundColor = NSColor.clear.cgColor
// Have our wonderful, extremely 2011/2012-esque metal design.
package.publishedObject(withName: "shredderFront")!.contents = getImage(named: "ShredderMetal")
package.publishedObject(withName: "shredderBack")!.contents = getImage(named: "ShredderMetal")
// Set what we're shredding.
package.publishedObject(withName: "cardFrontUnshredded")!.contents = shreddedImage
package.publishedObject(withName: "cardFrontShredded")!.contents = shreddedImage
package.publishedObject(withName: "cardBackUnshredded")!.contents = shreddedImageFlipped
// Passbook appears to obtain the least emitter cell and recolor to match the pass's color.
// TODO: implement this
// let lastEmitterCell = (package.publishedObject(withName: "shardEmitterLayer") as! CAEmitterLayer).emitterCells!.last
// print(package.publishedObject(withName: "cardFrontShredded"))
// package.publishedObject(withName: "cardBackShredded")!.contents = shreddedImageFlipped
} catch {
// Not my fault, this code is heavily tested
print(error)
}
}
func getBundleBase() -> URL {
URL(fileURLWithPath: "/Users/spot/Downloads/PassKit.framework")
}
func getImage(named name: String) -> CGImage {
let imagePath = getBundleBase().appendingPathComponent("\(name)@2x.png")
let image = NSImage(contentsOf: imagePath)!
return image.cgImage(forProposedRect: nil, context: nil, hints: nil)!
}
func getHorizontalCenter(_ view: NSView) -> NSRect {
let frame = view.frame
return NSRect(x: frame.midX / 4, y: frame.midY / 4, width: frame.width, height: frame.height)
}
// Shamelessly stolen from https://gist.github.com/rishigesh/fc66a2cb35372b2aa011a7a69f606d40
// I'm too tired to think
public func flipHorizontally(_ existingImage: NSImage) -> NSImage {
let existingSize = existingImage.size
let newSize = NSMakeSize(existingSize.width, existingSize.height)
let flipedImage = NSImage(size: newSize)
flipedImage.lockFocus()
let t = NSAffineTransform()
t.translateX(by: existingSize.width, yBy: 0.0)
t.scaleX(by: -1.0, yBy: 1.0)
t.concat()
let rect = NSRect(x: 0, y: 0, width: newSize.width, height: newSize.height)
existingImage.draw(at: .zero, from: rect, operation: .sourceOver, fraction: 1.0)
flipedImage.unlockFocus()
return flipedImage
}
}