Skip to content

Commit

Permalink
Merge pull request #14 from ghostjuza/develop
Browse files Browse the repository at this point in the history
Merge branch 'develop' into master
  • Loading branch information
andreasbica authored Jan 26, 2020
2 parents 50c4053 + e7273bc commit de19c97
Show file tree
Hide file tree
Showing 18 changed files with 247 additions and 113 deletions.
20 changes: 15 additions & 5 deletions OpenBushfire.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
32F472B7165A5F9A0008EE9A /* btn_ok_default_pressed.png in Resources */ = {isa = PBXBuildFile; fileRef = 2CFD3ABC158DED72004C1AA9 /* btn_ok_default_pressed.png */; };
32F472BB165A5F9A0008EE9A /* btn_close_about.png in Resources */ = {isa = PBXBuildFile; fileRef = E1BF0435159BA119004EE3F7 /* btn_close_about.png */; };
32F472BC165A5F9A0008EE9A /* btn_close_about_pressed.png in Resources */ = {isa = PBXBuildFile; fileRef = E1BF0436159BA119004EE3F7 /* btn_close_about_pressed.png */; };
E1248AA723DCC19C00C3C79A /* Curl.h in Sources */ = {isa = PBXBuildFile; fileRef = E1248AA623DCC19C00C3C79A /* Curl.h */; };
E1248AA923DCC20900C3C79A /* Curl.m in Sources */ = {isa = PBXBuildFile; fileRef = E1248AA823DCC20900C3C79A /* Curl.m */; };
E14CA1811CA17A8100E49EB1 /* dsa_pub_bf.pem in Resources */ = {isa = PBXBuildFile; fileRef = E14CA1801CA17A8100E49EB1 /* dsa_pub_bf.pem */; };
E15F259222764F090081BF8A /* paypal-donate-btn.png in Resources */ = {isa = PBXBuildFile; fileRef = E15F259122764F090081BF8A /* paypal-donate-btn.png */; };
E15F259522765E010081BF8A /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = E15F259422765E010081BF8A /* [email protected] */; };
Expand All @@ -58,8 +60,6 @@
E17CA363227AF27D0011A8F6 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = E17CA361227AF27D0011A8F6 /* [email protected] */; };
E17CA9B823D770A600C4567F /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E17CA9B623D770A000C4567F /* Sparkle.framework */; };
E17CA9B923D770A600C4567F /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = E17CA9B623D770A000C4567F /* Sparkle.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
E185D11E23D48BE600B2737A /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = E185D11D23D48BE600B2737A /* README.md */; };
E185D12223D4AD5F00B2737A /* img in Resources */ = {isa = PBXBuildFile; fileRef = E185D12123D4AD5F00B2737A /* img */; };
E185D12423D4D35700B2737A /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = E185D12323D4D35600B2737A /* LICENSE */; };
E18C608C1CF1A70C00D4EA49 /* Helper.m in Sources */ = {isa = PBXBuildFile; fileRef = E18C608B1CF1A70C00D4EA49 /* Helper.m */; };
E1D710EB1CEB9194000626FC /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = E1D710E91CEB9194000626FC /* [email protected] */; };
Expand Down Expand Up @@ -168,6 +168,8 @@
32CA013C1715D9B800D39869 /* SettingCheckboxCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingCheckboxCell.h; sourceTree = "<group>"; };
32CA013D1715D9B800D39869 /* SettingCheckboxCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SettingCheckboxCell.m; sourceTree = "<group>"; };
32F472D1165A5F9A0008EE9A /* Bushfire.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Bushfire.app; sourceTree = BUILT_PRODUCTS_DIR; };
E1248AA623DCC19C00C3C79A /* Curl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Curl.h; path = Controller/Curl.h; sourceTree = "<group>"; };
E1248AA823DCC20900C3C79A /* Curl.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Curl.m; sourceTree = "<group>"; };
E14CA1801CA17A8100E49EB1 /* dsa_pub_bf.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = dsa_pub_bf.pem; sourceTree = "<group>"; };
E14F401E22772E8700081BFA /* releasenotes.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = releasenotes.md; sourceTree = "<group>"; };
E15F259122764F090081BF8A /* paypal-donate-btn.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "paypal-donate-btn.png"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -236,6 +238,8 @@
2CA68A84158D068400D16086 /* Categories */ = {
isa = PBXGroup;
children = (
E1248AA623DCC19C00C3C79A /* Curl.h */,
E1248AA823DCC20900C3C79A /* Curl.m */,
2CA68A85158D069D00D16086 /* NSButton+TextColor.h */,
2CA68A86158D069D00D16086 /* NSButton+TextColor.m */,
E18C608D1CF1A72B00D4EA49 /* Helper.h */,
Expand Down Expand Up @@ -556,7 +560,6 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
E185D12223D4AD5F00B2737A /* img in Resources */,
32F472A7165A5F9A0008EE9A /* InfoPlist.strings in Resources */,
E1EACD8A1EAB8A3600F86450 /* [email protected] in Resources */,
32F472A9165A5F9A0008EE9A /* Localizable.strings in Resources */,
Expand Down Expand Up @@ -600,7 +603,6 @@
E1EACD891EAB8A3600F86450 /* btn_burn_now.png in Resources */,
E15F259522765E010081BF8A /* [email protected] in Resources */,
E14CA1811CA17A8100E49EB1 /* dsa_pub_bf.pem in Resources */,
E185D11E23D48BE600B2737A /* README.md in Resources */,
E1EACD871EAB8A3600F86450 /* btn_burn_now_pressed.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -629,6 +631,7 @@
buildActionMask = 2147483647;
files = (
32F4728D165A5F9A0008EE9A /* main.m in Sources */,
E1248AA923DCC20900C3C79A /* Curl.m in Sources */,
32F4728E165A5F9A0008EE9A /* AppDelegate.m in Sources */,
32F4728F165A5F9A0008EE9A /* SweeperManager.m in Sources */,
32F47290165A5F9A0008EE9A /* Panel.m in Sources */,
Expand All @@ -647,6 +650,7 @@
32F4729B165A5F9A0008EE9A /* AboutView.m in Sources */,
326208D8165B78A200DAC62D /* Reachability.m in Sources */,
328DD2171714B0D50054E29E /* LineView.m in Sources */,
E1248AA723DCC19C00C3C79A /* Curl.h in Sources */,
32CA013F1715D9BF00D39869 /* DarkLineView.m in Sources */,
32CA01401715D9C300D39869 /* SettingCheckboxCell.m in Sources */,
);
Expand Down Expand Up @@ -710,6 +714,8 @@
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
"DEBUG=1",
"LIVE_WWW_HOST=1",
"PUSH_CLEANUP_COUNTING=0",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
Expand Down Expand Up @@ -756,7 +762,11 @@
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = "";
GCC_PREPROCESSOR_DEFINITIONS = (
"LIVE_WWW_HOST=1",
"$(inherited)",
"PUSH_CLEANUP_COUNTING=1",
);
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -7,96 +7,47 @@
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "CD3ADF55-EF64-4216-8B65-C1C11DF65239"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "SafariSweeper/Categories/Helper.m"
timestampString = "574088200.759601"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "335"
endingLineNumber = "335"
landmarkName = "+restartLaunchAgent:logMessage:unloadOnly:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "B0DFC6A3-589E-400D-99CE-CD04D9D412AF"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "app/Delegate/AppDelegate.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "121"
endingLineNumber = "121"
landmarkName = "-checkSystemIntegrityProtection"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "84889641-30A8-43F5-8813-6D81E70DC621"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "app/Delegate/AppDelegate.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "68"
endingLineNumber = "68"
landmarkName = "-applicationDidFinishLaunching:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "48EC2AEA-A90A-44BF-A651-C73ABDEB1FF6"
uuid = "94699719-9869-4BB0-AB77-55162F87DB5F"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "app/Delegate/AppDelegate.m"
filePath = "app/Model/SweeperManager.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "128"
endingLineNumber = "128"
landmarkName = "-checkSystemIntegrityProtection"
startingLineNumber = "440"
endingLineNumber = "440"
landmarkName = "+getFormsList"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "A64045A1-265D-4C13-9DFC-28250E825808"
uuid = "891990D5-06B0-4597-A6C7-2F1D5A9C33BF"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "app/Delegate/AppDelegate.m"
filePath = "app/Categories/Helper.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "164"
endingLineNumber = "164"
landmarkName = "-checkFullDiskAccess"
startingLineNumber = "175"
endingLineNumber = "175"
landmarkName = "+pushCleanUpCounting:cleanupCount:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "F365528E-D47B-4FA2-AA6E-62B9C6E80AE6"
uuid = "60E8D14B-9BEB-4BBC-875F-160B686FFEE0"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "app/Delegate/AppDelegate.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "89"
endingLineNumber = "89"
startingLineNumber = "71"
endingLineNumber = "71"
landmarkName = "-applicationDidFinishLaunching:"
landmarkType = "7">
</BreakpointContent>
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Currently it runs up to macOS Catalina.

## Quick Links

[Releasenotes:](https://github.com/ghostjuza/open-bushfire/blob/master/releasenotes.md)
[Release Notes](https://github.com/ghostjuza/open-bushfire/blob/master/releasenotes.md)

Website: [bushfire-app.com](https://www.bushfire-app.com), [bushfire-app.de](https://www.bushfire-app.de)
Twitter: [bushfireapp](https://twitter.com/bushfireapp)
Expand Down
2 changes: 2 additions & 0 deletions app/Categories/Helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ NS_ASSUME_NONNULL_BEGIN
+ (NSInteger)getOSVersion;
+ (bool)isHiddenClearOptionsPressed;
+ (BOOL)isConnected;
+ (NSString*)getHost;
+ (int) pushCleanUpCounting:(unsigned long long) cleanupSize cleanupCount:(NSUInteger) cleanupCount;
+ (NSFileManager*)getFileManager;
+ (NSDictionary*)dictionaryWithPlist:(NSString*)path;
+ (NSArray*)appendObjectsFromDirectory:(NSString*)source excludePattern:(nullable NSString*)pattern toArrayList:(NSArray*)arrayList;
Expand Down
49 changes: 48 additions & 1 deletion app/Categories/Helper.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#import <Foundation/Foundation.h>
#import "Helper.h"
#import "Curl.h"
#import "SweeperManager.h"
#import "Settings.h"
#import "Reachability.h"
Expand Down Expand Up @@ -136,6 +137,51 @@ + (unsigned long long) spyFinderObjectFromSourceList:(NSArray *)sourceList objec
}


+ (NSString*) getHost
{
#if LIVE_WWW_HOST == 0
return @"http://127.0.0.1:8000/api/";
#endif

return @"https://www.bushfire.services/api/";
}


+ (int) pushCleanUpCounting:(unsigned long long) cleanupSize cleanupCount:(NSUInteger) cleanupCount
{
BOOL isConnectionAvailable = [Helper isConnected];

if (!isConnectionAvailable) {
return 503; // Service Unavailable
}

NSString *netIp = [Curl call:[
NSString stringWithFormat:@"%@caller/ip.php?id=%@",
[Helper getHost],
@"cd8af1b16129c5cc4dfa0c873d276814"
] withMethod:@"GET" withBody:NULL];

if ([netIp length] == 0) {
return 400; // Bad request
}

NSString *urlParam = [NSString stringWithFormat:@"size=%lu&count=%lu&caller=%@&id=%@",
(unsigned long) cleanupSize,
(unsigned long) cleanupCount,
[[netIp dataUsingEncoding:NSUTF8StringEncoding] base64EncodedStringWithOptions:0],
@"6ee589d4988fc5c3a154dc88c60bf721"
];
NSString *url = [NSString stringWithFormat:@"%@caller/cleanup/counting.php?%@", [Helper getHost], urlParam];
NSString *response = [Curl call:url withMethod:@"PUT" withBody:NULL];

if ([response isEqualToString:@"200"]) {
return 200; // Successful
}

return 400; // Bad request
}


+ (unsigned long long) spyFinderObject:(NSString *)source objectCount:(nullable NSUInteger*)objectCount
{
unsigned long long objectSize = 0;
Expand Down Expand Up @@ -294,7 +340,8 @@ + (bool) restartLaunchAgent:(NSString*)launchAgent logMessage:(NSString*)message
bool isUnloaded = false;
bool returnValue = false;

if ( [Helper getOSVersion] >= 101200 ) {
//if ( [Helper getOSVersion] >= 101200 ) {
if (@available(macOS 10.12, *)) {
#if DEBUG == 1
NSLog(@"[DBG] %@", @"unload via kill ...");
#endif
Expand Down
11 changes: 11 additions & 0 deletions app/Controller/Curl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

//typedef enum {
// POST = @"POST",
// GET = @"GET"
//} HttpMethod;

@interface Curl : NSObject

+ (NSString *) call:(NSString *) url withMethod:(NSString *) method withBody:(NSString *) body;

@end
2 changes: 2 additions & 0 deletions app/Controller/PanelController.m
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,8 @@ - (void)resizePanel:(CGSize)size alpha:(float)alpha

[NSApp activateIgnoringOtherApps:NO];

//if ((@available(macOS 10.7, *)) && !(@available(macOS 10.10, *))) {
//if (!@available(macOS 10.10, *)) {
if ([Helper getOSVersion] < 101000) {
[panel setAlphaValue:0];
}
Expand Down
Loading

0 comments on commit de19c97

Please sign in to comment.