Skip to content

Commit

Permalink
Unrecognized Items now have their own window
Browse files Browse the repository at this point in the history
Also: #8
Shortcut support (+w, etc)
  • Loading branch information
objective-see committed Jan 3, 2025
1 parent 0b92757 commit 1b5da4f
Show file tree
Hide file tree
Showing 15 changed files with 690 additions and 262 deletions.
2 changes: 1 addition & 1 deletion Consts.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ enum Signer{None, Apple, AppStore, DevID, AdHoc};
#define VT_HTTP_RESPONSE @"http_response"

//output file
#define OUTPUT_FILE @"kkResults.txt"
#define OUTPUT_FILE @"kkResults.json"

//support us button tag
#define BUTTON_SUPPORT_US 100
Expand Down
23 changes: 21 additions & 2 deletions KnockKnock.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
CD6FD7C62C7AB299001C59F2 /* VTInfoWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = CD6FD7C52C7AB299001C59F2 /* VTInfoWindow.xib */; };
CD6FD7CA2C7AB29F001C59F2 /* ExtensionInfoWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = CD6FD7C92C7AB29F001C59F2 /* ExtensionInfoWindow.xib */; };
CD6FD7CE2C7AB2A3001C59F2 /* FileInfoWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = CD6FD7CD2C7AB2A3001C59F2 /* FileInfoWindow.xib */; };
CD792FB92D252FE600167649 /* UnknownItems.xib in Resources */ = {isa = PBXBuildFile; fileRef = CD792FB72D252FE600167649 /* UnknownItems.xib */; };
CD792FBC2D2530A800167649 /* UnknownItemsWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = CD792FBB2D2530A800167649 /* UnknownItemsWindowController.m */; };
CD7B9F4D1ACB959200DF3C71 /* logoAppleOver.png in Resources */ = {isa = PBXBuildFile; fileRef = CD7B9F4C1ACB959200DF3C71 /* logoAppleOver.png */; };
CD7B9F531ACBAE2900DF3C71 /* SpotlightImporters.m in Sources */ = {isa = PBXBuildFile; fileRef = CD7B9F521ACBAE2900DF3C71 /* SpotlightImporters.m */; };
CD7B9FA41ACBCFAD00DF3C71 /* spotlightIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = CD7B9FA31ACBCFAD00DF3C71 /* spotlightIcon.png */; };
Expand Down Expand Up @@ -226,6 +228,9 @@
CD6FD7CB2C7AB29F001C59F2 /* mul */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; name = mul; path = mul.lproj/ExtensionInfoWindow.xcstrings; sourceTree = "<group>"; };
CD6FD7CC2C7AB2A3001C59F2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/FileInfoWindow.xib; sourceTree = "<group>"; };
CD6FD7CF2C7AB2A3001C59F2 /* mul */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; name = mul; path = mul.lproj/FileInfoWindow.xcstrings; sourceTree = "<group>"; };
CD792FB82D252FE600167649 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/UnknownItems.xib; sourceTree = "<group>"; };
CD792FBA2D2530A800167649 /* UnknownItemsWindowController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UnknownItemsWindowController.h; sourceTree = "<group>"; };
CD792FBB2D2530A800167649 /* UnknownItemsWindowController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UnknownItemsWindowController.m; sourceTree = "<group>"; };
CD7B9F4C1ACB959200DF3C71 /* logoAppleOver.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = logoAppleOver.png; path = images/logoAppleOver.png; sourceTree = SOURCE_ROOT; };
CD7B9F511ACBAE2900DF3C71 /* SpotlightImporters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SpotlightImporters.h; path = Plugins/SpotlightImporters.h; sourceTree = "<group>"; };
CD7B9F521ACBAE2900DF3C71 /* SpotlightImporters.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SpotlightImporters.m; path = Plugins/SpotlightImporters.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -431,14 +436,14 @@
CDA81D451A95B492009790E2 /* AppDelegate.m */,
CD585493219FE61D00A438B0 /* Assets.xcassets */,
CDA81D481A95B492009790E2 /* Consts.h */,
CDE241A92C8556A40099F82B /* DiffWindowController.h */,
CDE241AA2C8556A40099F82B /* DiffWindowController.m */,
CD6095501A8329FA00E091CD /* images */,
CD6FD7AB2C7AAD87001C59F2 /* MainMenu.xib */,
CD5854D621A60B2000A438B0 /* PlistWindowController.h */,
CD5854D721A60B2000A438B0 /* PlistWindowController.m */,
CDF08CC71AC4C678009B3423 /* PrefsWindowController.h */,
CDF08CC81AC4C678009B3423 /* PrefsWindowController.m */,
CDE241A92C8556A40099F82B /* DiffWindowController.h */,
CDE241AA2C8556A40099F82B /* DiffWindowController.m */,
CD24F076219DF3DB0081B0E5 /* Signing.h */,
CD24F075219DF3DA0081B0E5 /* Signing.m */,
1D21BC55172AF43D009D1CFD /* Supporting Files */,
Expand Down Expand Up @@ -541,6 +546,8 @@
CD2F21A321A8A7E300F67A83 /* UpdateWindowController.m */,
CDF08CDC1AC886F2009B3423 /* VTInfoWindowController.h */,
CDF08CDD1AC886F2009B3423 /* VTInfoWindowController.m */,
CD792FBA2D2530A800167649 /* UnknownItemsWindowController.h */,
CD792FBB2D2530A800167649 /* UnknownItemsWindowController.m */,
);
name = UIControllers;
sourceTree = "<group>";
Expand Down Expand Up @@ -621,6 +628,7 @@
CDA81E621AA020E8009790E2 /* UI */ = {
isa = PBXGroup;
children = (
CD792FB72D252FE600167649 /* UnknownItems.xib */,
CD6FD7BD2C7AB291001C59F2 /* AboutWindow.xib */,
CD19A7EC2CA4236B00F17FF3 /* DiffWindow.xib */,
CD6FD7C92C7AB29F001C59F2 /* ExtensionInfoWindow.xib */,
Expand Down Expand Up @@ -771,6 +779,7 @@
CD7B9F4D1ACB959200DF3C71 /* logoAppleOver.png in Resources */,
CDA81DCB1A9960A3009790E2 /* virusTotal.png in Resources */,
CDA81DF41A99B8C2009790E2 /* whitelistedExtensions.json in Resources */,
CD792FB92D252FE600167649 /* UnknownItems.xib in Resources */,
CD585494219FE61D00A438B0 /* Assets.xcassets in Resources */,
CDA81DD41A9970A0009790E2 /* unsigned.png in Resources */,
CD2B61442067656200BF72E9 /* eventRulesIcon.png in Resources */,
Expand Down Expand Up @@ -862,6 +871,7 @@
CDF08CC61AC46E75009B3423 /* VTButton.m in Sources */,
CDBE491D1B5B44BB0031FC22 /* LogInOutHooks.m in Sources */,
CDE2D3A72AC6E20500261224 /* DockTiles.m in Sources */,
CD792FBC2D2530A800167649 /* UnknownItemsWindowController.m in Sources */,
CDA81D8F1A96F557009790E2 /* PluginBase.m in Sources */,
CDAB989C1AEAC95500C75B4B /* ItemEnumerator.m in Sources */,
CDA81D771A95B7C1009790E2 /* CategoryTableController.m in Sources */,
Expand Down Expand Up @@ -974,6 +984,15 @@
path = UI;
sourceTree = "<group>";
};
CD792FB72D252FE600167649 /* UnknownItems.xib */ = {
isa = PBXVariantGroup;
children = (
CD792FB82D252FE600167649 /* Base */,
);
name = UnknownItems.xib;
path = UI;
sourceTree = "<group>";
};
CD8641252CA05D6B00803551 /* KnockKnock-InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
Expand Down
9 changes: 6 additions & 3 deletions Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -546,9 +546,6 @@
}
}
},
"Submissions complete, though errors were encountered.\r\n(HTTP response(s): %@)" : {
"comment" : "Submissions complete, though errors were encountered.\r\n(HTTP response(s): %@)"
},
"Submissions complete, though errors were encountered.\r\n(HTTP response(s): %@)." : {
"comment" : "Submissions complete, though errors were encountered.\r\n(HTTP response(s): %@).",
"extractionState" : "stale",
Expand All @@ -563,6 +560,7 @@
},
"Submissions complete. (In subsequent scans item's VT detection ratios will now be displayed)." : {
"comment" : "Submissions complete. (In subsequent scans item's VT detection ratios will now be displayed).",
"extractionState" : "stale",
"localizations" : {
"es" : {
"stringUnit" : {
Expand Down Expand Up @@ -607,6 +605,7 @@
},
"Submitting %lu item(s) to VirusTotal..." : {
"comment" : "Submitting %lu item(s) to VirusTotal...",
"extractionState" : "stale",
"localizations" : {
"es" : {
"stringUnit" : {
Expand Down Expand Up @@ -673,6 +672,7 @@
},
"VirusTotal Results: Disabled" : {
"comment" : "VirusTotal Results: Disabled",
"extractionState" : "stale",
"localizations" : {
"es" : {
"stringUnit" : {
Expand All @@ -682,6 +682,9 @@
}
}
},
"VirusTotal Results: N/A (Disabled)" : {
"comment" : "VirusTotal Results: N/A (Disabled)"
},
"VirusTotal:\r\n %lu flagged item(s)\r\n %lu unknown item(s)" : {
"comment" : "VirusTotal:\r\n %lu flagged item(s)\r\n %lu unknown item(s)",
"localizations" : {
Expand Down
26 changes: 26 additions & 0 deletions NSApplicationKeyEvents.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,32 @@ -(void) sendEvent:(NSEvent *)event {
if ([self sendAction:@selector(selectAll:) to:nil from:self])
return;
}

//+h (hide window)
else if([event.charactersIgnoringModifiers isEqualToString:@"h"])
{
//hide
if(YES == [self sendAction:@selector(hide:) to:nil from:self])
{
return;
}
}

//+m (minimize window)
else if([event.charactersIgnoringModifiers isEqualToString:@"m"])
{
//minimize
[NSApplication.sharedApplication.keyWindow miniaturize:nil];
return;
}

//+w (close window)
else if([event.charactersIgnoringModifiers isEqualToString:@"w"])
{
//close
[NSApplication.sharedApplication.keyWindow close];
return;
}
}
}
[super sendEvent:event];
Expand Down
18 changes: 3 additions & 15 deletions ResultsWindowController.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#import <Cocoa/Cocoa.h>
#import "UnknownItemsWindowController.h"

@interface ResultsWindowController : NSWindowController <NSWindowDelegate>
{
Expand All @@ -33,22 +34,9 @@
//submit to VT button
@property (weak) IBOutlet NSButton *submitToVT;

//activity indicator
@property (weak) IBOutlet NSProgressIndicator *submissionActivityIndicator;

//submission status
@property (weak) IBOutlet NSTextField *submissionStatus;


//'close' button
@property (weak) IBOutlet NSButton* closeButton;
//window controller for unknown items
@property(nonatomic, strong)UnknownItemsWindowController* unknownItemsWindowController;

/* METHODS */

//close
-(IBAction)close:(id)sender;

//submit (unknown) items to VT
-(IBAction)submitToVT:(id)sender;

@end
Loading

0 comments on commit 1b5da4f

Please sign in to comment.