Skip to content

Commit

Permalink
v2.5.0
Browse files Browse the repository at this point in the history
New icon (mahalo Zabriskije) #520
Improved manual rule creation
Added preference to allow all DNS traffic
Improved block list filtering (via macOS 11+ remoteHostname)
  • Loading branch information
objective-see committed May 19, 2023
1 parent 7d8bf18 commit 097fed7
Show file tree
Hide file tree
Showing 31 changed files with 440 additions and 250 deletions.
4 changes: 2 additions & 2 deletions LuLu/App/AddRule.xib
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21225" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21225"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
Expand Down
2 changes: 1 addition & 1 deletion LuLu/App/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ -(void)applicationDidFinishLaunching:(NSNotification *)aNotification

//don't relaunch
[NSApp disableRelaunchOnLogin];

//CHECK 0x1:
// must be run from /Applications as LuLu.app
if(YES != [NSBundle.mainBundle.bundlePath isEqualToString:[@"/Applications" stringByAppendingPathComponent:APP_NAME]])
Expand Down
65 changes: 33 additions & 32 deletions LuLu/App/Assets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
@@ -1,67 +1,68 @@
{
"images" : [
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "icon_16x16.png",
"scale" : "1x"
"idiom" : "mac",
"scale" : "1x",
"size" : "16x16"
},
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "[email protected]",
"scale" : "2x"
"idiom" : "mac",
"scale" : "2x",
"size" : "16x16"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "icon_32x32.png",
"scale" : "1x"
"idiom" : "mac",
"scale" : "1x",
"size" : "32x32"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "[email protected]",
"scale" : "2x"
"idiom" : "mac",
"scale" : "2x",
"size" : "32x32"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "icon_128x128.png",
"scale" : "1x"
"idiom" : "mac",
"scale" : "1x",
"size" : "128x128"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "[email protected]",
"scale" : "2x"
"idiom" : "mac",
"scale" : "2x",
"size" : "128x128"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "icon_256x256.png",
"scale" : "1x"
"idiom" : "mac",
"scale" : "1x",
"size" : "256x256"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "[email protected]",
"scale" : "2x"
"idiom" : "mac",
"scale" : "2x",
"size" : "256x256"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "icon_512x512.png",
"scale" : "1x"
"idiom" : "mac",
"scale" : "1x",
"size" : "512x512"
},
{
"filename" : "[email protected]",
"idiom" : "mac",
"size" : "512x512",
"scale" : "2x"
"scale" : "2x",
"size" : "512x512"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}
Binary file modified LuLu/App/Assets.xcassets/AppIcon.appiconset/icon_128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified LuLu/App/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified LuLu/App/Assets.xcassets/AppIcon.appiconset/icon_16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified LuLu/App/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified LuLu/App/Assets.xcassets/AppIcon.appiconset/icon_256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified LuLu/App/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified LuLu/App/Assets.xcassets/AppIcon.appiconset/icon_32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified LuLu/App/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified LuLu/App/Assets.xcassets/AppIcon.appiconset/icon_512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 0 additions & 35 deletions LuLu/App/Assets.xcassets/FriendsFleet.imageset/Contents.json

This file was deleted.

Binary file not shown.
Binary file not shown.
143 changes: 79 additions & 64 deletions LuLu/App/Preferences.xib

Large diffs are not rendered by default.

53 changes: 39 additions & 14 deletions LuLu/App/PrefsWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,29 @@ @implementation PrefsWindowController
//'allow installed' button
#define BUTTON_ALLOW_INSTALLED 2

//'allow dns' button
#define BUTTON_ALLOW_DNS 3

//'allow iOS simulator apps' mode button
#define BUTTON_ALLOW_SIMULATOR 3
#define BUTTON_ALLOW_SIMULATOR 4

//'use blocklist' button
#define BUTTON_USE_BLOCK_LIST 4
#define BUTTON_USE_BLOCK_LIST 5

//'passive mode' button
#define BUTTON_PASSIVE_MODE 5
#define BUTTON_PASSIVE_MODE 6

//'block mode' button
#define BUTTON_BLOCK_MODE 6
#define BUTTON_BLOCK_MODE 7

//'no-icon mode' button
#define BUTTON_NO_ICON_MODE 7
#define BUTTON_NO_ICON_MODE 8

//'no-icon mode' button
#define BUTTON_NO_ERROR_REPORTING_MODE 8
#define BUTTON_NO_ERROR_REPORTING_MODE 9

//'update mode' button
#define BUTTON_NO_UPDATE_MODE 9
#define BUTTON_NO_UPDATE_MODE 10

//init 'general' view
// add it, and make it selected
Expand Down Expand Up @@ -105,6 +108,9 @@ -(IBAction)toolbarButtonHandler:(id)sender
//set 'installed allowed' button state
((NSButton*)[view viewWithTag:BUTTON_ALLOW_INSTALLED]).state = [self.preferences[PREF_ALLOW_INSTALLED] boolValue];

//set 'allow dns' button state
((NSButton*)[view viewWithTag:BUTTON_ALLOW_DNS]).state = [self.preferences[PREF_ALLOW_DNS] boolValue];

//set 'allow simulator apps' button
((NSButton*)[view viewWithTag:BUTTON_ALLOW_SIMULATOR]).state = [self.preferences[PREF_ALLOW_SIMULATOR] boolValue];

Expand Down Expand Up @@ -163,12 +169,13 @@ -(IBAction)toolbarButtonHandler:(id)sender
goto bail;
}

//set frame rect
view.frame = CGRectMake(0, 75, self.window.contentView.frame.size.width, self.window.contentView.frame.size.height-75);
//set window size to match each pref's view
[self.window setFrame:NSMakeRect(self.window.frame.origin.x, NSMaxY(self.window.frame) - view.frame.size.height, view.frame.size.width, view.frame.size.height) display:YES];

//add to window
[self.window.contentView addSubview:view];


bail:

return;
Expand Down Expand Up @@ -202,6 +209,11 @@ -(IBAction)togglePreference:(id)sender
case BUTTON_ALLOW_INSTALLED:
updatedPreferences[PREF_ALLOW_INSTALLED] = state;
break;

//allow dns traffic
case BUTTON_ALLOW_DNS:
updatedPreferences[PREF_ALLOW_DNS] = state;
break;

//allow simulator apps
case BUTTON_ALLOW_SIMULATOR:
Expand All @@ -212,12 +224,23 @@ -(IBAction)togglePreference:(id)sender
case BUTTON_USE_BLOCK_LIST:
updatedPreferences[PREF_USE_BLOCK_LIST] = state;

//set 'browse' button state
self.selectBlockListButton.enabled = (NSControlStateValueOn == state.longValue);
//disable?
// remove list too
if(NSControlStateValueOff == state.longValue)
{
//unset
updatedPreferences[PREF_BLOCK_LIST] = @"";

//clear
self.blockList.stringValue = @"";
}

//set block list input state
self.blockList.enabled = (NSControlStateValueOn == state.longValue);

//set 'browse' button state
self.selectBlockListButton.enabled = (NSControlStateValueOn == state.longValue);

break;

//passive mode
Expand All @@ -236,7 +259,6 @@ -(IBAction)togglePreference:(id)sender
//show alert
showAlert(@"Outgoing traffic will now be blocked.", @"Note however:\r\n▪ Existing connections will not be impacted.\r\n▪ OS traffic (not routed thru LuLu) will not be blocked.");
}


break;

Expand Down Expand Up @@ -470,17 +492,20 @@ -(void)windowWillClose:(NSNotification *)notification
//disable 'browse' button
self.selectBlockListButton.enabled = NSControlStateValueOff;

//clear block list
self.blockList.stringValue = @"";

//disable block list input
self.blockList.enabled = NSControlStateValueOff;

//send XPC msg to daemon to update prefs
// returns (all/latest) prefs, which is what we want
self.preferences = [xpcDaemonClient updatePreferences:@{PREF_USE_BLOCK_LIST:@0}];
self.preferences = [xpcDaemonClient updatePreferences:@{PREF_USE_BLOCK_LIST:@0, PREF_BLOCK_LIST:@""}];
}

//block list changed? capture!
// this logic is needed, as window can be closed when text field still has focus and 'end edit' won't have fired
if(YES != [self.preferences[PREF_BLOCK_LIST] isEqualToString:self.blockList.stringValue])
else if(YES != [self.preferences[PREF_BLOCK_LIST] isEqualToString:self.blockList.stringValue])
{
//send XPC msg to daemon to update prefs
// returns (all/latest) prefs, which is what we want
Expand Down
8 changes: 4 additions & 4 deletions LuLu/App/Rules.xib
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21225" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21225"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
Expand All @@ -25,7 +25,7 @@
<window identifier="Rules" title="LuLu Rules" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="F0z-JX-Cv5">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<rect key="contentRect" x="913" y="419" width="1015" height="574"/>
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="875"/>
<rect key="screenRect" x="0.0" y="0.0" width="3440" height="1415"/>
<value key="minSize" type="size" width="1020" height="550"/>
<view key="contentView" wantsLayer="YES" id="se5-gp-TjO">
<rect key="frame" x="0.0" y="0.0" width="1015" height="574"/>
Expand Down Expand Up @@ -349,7 +349,7 @@
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" utility="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="272" y="172" width="276" height="378"/>
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="875"/>
<rect key="screenRect" x="0.0" y="0.0" width="3440" height="1415"/>
<view key="contentView" id="cna-Y1-PEc">
<rect key="frame" x="0.0" y="0.0" width="276" height="378"/>
<autoresizingMask key="autoresizingMask"/>
Expand Down
Loading

0 comments on commit 097fed7

Please sign in to comment.