Skip to content

Commit

Permalink
UI tweaks / improved error checking
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Wardle committed Mar 4, 2021
1 parent bcccfe2 commit 7fb16ac
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 20 deletions.
2 changes: 1 addition & 1 deletion AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ -(void)scan
dispatch_sync(dispatch_get_main_queue(), ^{

//update
[self.statusText setStringValue:[NSString stringWithFormat:@"awaiting VirusTotal results"]];
[self.statusText setStringValue:[NSString stringWithFormat:@"Awaiting VirusTotal results"]];

});

Expand Down
28 changes: 14 additions & 14 deletions KnockKnock.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -339,28 +339,28 @@
1D21BC42172AF43D009D1CFD = {
isa = PBXGroup;
children = (
CD6BBBEE1B52032D00506D0D /* NSApplicationKeyEvents.h */,
CD6BBBEF1B52032D00506D0D /* NSApplicationKeyEvents.m */,
CDAB989A1AEAC95500C75B4B /* ItemEnumerator.h */,
CDAB989B1AEAC95500C75B4B /* ItemEnumerator.m */,
CDF08CE31AC89FD4009B3423 /* 3rdParty */,
CD5854D921A6103A00A438B0 /* ClickableTextField.h */,
CD5854DA21A6103A00A438B0 /* ClickableTextField.m */,
CDA81DEC1A99B5F8009790E2 /* Filter.h */,
CDA81DED1A99B5F8009790E2 /* Filter.m */,
1D21BC4D172AF43D009D1CFD /* Frameworks */,
CDAB989A1AEAC95500C75B4B /* ItemEnumerator.h */,
CDAB989B1AEAC95500C75B4B /* ItemEnumerator.m */,
CD7B9FA91AD08FA100DF3C71 /* KKRow.h */,
CD7B9FAA1AD08FA100DF3C71 /* KKRow.m */,
CDF08CE31AC89FD4009B3423 /* 3rdParty */,
1D21BC54172AF43D009D1CFD /* KnockKnock */,
CDF08CD81AC881F9009B3423 /* MachOParser */,
CD83887D1AACCEDF000EB098 /* VirusTotal.h */,
CD83887E1AACCEDF000EB098 /* VirusTotal.m */,
CDA81E621AA020E8009790E2 /* UI */,
CDA81DEF1A99B8B2009790E2 /* WhiteList */,
CDA81DEC1A99B5F8009790E2 /* Filter.h */,
CDA81DED1A99B5F8009790E2 /* Filter.m */,
CD6BBBEE1B52032D00506D0D /* NSApplicationKeyEvents.h */,
CD6BBBEF1B52032D00506D0D /* NSApplicationKeyEvents.m */,
CDA81D861A96F429009790E2 /* Plugins */,
1D21BC4C172AF43D009D1CFD /* Products */,
CDA81D7C1A96EFFF009790E2 /* Results */,
CDA81E621AA020E8009790E2 /* UI */,
CDA81D781A95B939009790E2 /* UIControllers */,
1D21BC54172AF43D009D1CFD /* KnockKnock */,
1D21BC4D172AF43D009D1CFD /* Frameworks */,
1D21BC4C172AF43D009D1CFD /* Products */,
CD83887D1AACCEDF000EB098 /* VirusTotal.h */,
CD83887E1AACCEDF000EB098 /* VirusTotal.m */,
CDA81DEF1A99B8B2009790E2 /* WhiteList */,
);
sourceTree = "<group>";
};
Expand Down
8 changes: 6 additions & 2 deletions Plugins/BrowserExtensions.m
Original file line number Diff line number Diff line change
Expand Up @@ -348,11 +348,13 @@ -(void)scanExtensionsChrome:(NSString*)browserPath

//get their home directory
userDirectory = NSHomeDirectoryForUser(currentUser);

//save
if( (0 != currentUser.length) &&
(0 != userDirectory.length) )
{
//current
users[currentUser] = @{USER_NAME:currentUser, USER_DIRECTORY:NSHomeDirectoryForUser(userDirectory)};
users[currentUser] = @{USER_NAME:currentUser, USER_DIRECTORY:userDirectory};
}
}

Expand Down Expand Up @@ -582,11 +584,13 @@ -(void)scanExtensionsFirefox:(NSString*)browserPath

//get their home directory
userDirectory = NSHomeDirectoryForUser(currentUser);

//save
if( (0 != currentUser.length) &&
(0 != userDirectory.length) )
{
//current
users[currentUser] = @{USER_NAME:currentUser, USER_DIRECTORY:NSHomeDirectoryForUser(userDirectory)};
users[currentUser] = @{USER_NAME:currentUser, USER_DIRECTORY:userDirectory};
}
}

Expand Down
13 changes: 11 additions & 2 deletions Plugins/Extensions.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ -(NSMutableArray*)enumExtensions
//console user
NSString* currentUser = nil;

//home directory for user
NSString* userDirectory = nil;

//all extensions
NSMutableArray* extensions = nil;

Expand All @@ -74,14 +77,20 @@ -(NSMutableArray*)enumExtensions

//get current/console user
currentUser = getConsoleUser();
if(0 == currentUser.length)

//get their home directory
userDirectory = NSHomeDirectoryForUser(currentUser);

//sanity check(s)
if( (0 == currentUser.length) ||
(0 == userDirectory.length) )
{
//bail
goto bail;
}

//load finder syncs from plist
finderSyncs = [NSDictionary dictionaryWithContentsOfFile:[NSHomeDirectoryForUser(currentUser) stringByAppendingPathComponent:[FINDER_SYNCS substringFromIndex:1]]];
finderSyncs = [NSDictionary dictionaryWithContentsOfFile:[userDirectory stringByAppendingPathComponent:[FINDER_SYNCS substringFromIndex:1]]];
if( (nil == finderSyncs) ||
(nil == finderSyncs[@"displayOrder"]) )
{
Expand Down
2 changes: 1 addition & 1 deletion en.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<window title="KnockKnock" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="371" userLabel="Main Window">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<rect key="contentRect" x="0.0" y="0.0" width="1295" height="671"/>
<rect key="screenRect" x="0.0" y="0.0" width="3440" height="1415"/>
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1055"/>
<value key="minSize" type="size" width="1000" height="597"/>
<value key="maxSize" type="size" width="2500" height="1000"/>
<view key="contentView" id="372">
Expand Down

0 comments on commit 7fb16ac

Please sign in to comment.