diff --git a/Blockzilla-Bridging-Header.h b/Blockzilla-Bridging-Header.h index ce8fb867e2..1b5e00cc0a 100644 --- a/Blockzilla-Bridging-Header.h +++ b/Blockzilla-Bridging-Header.h @@ -1,2 +1,3 @@ -#import "SCSiriWaveformView/SCSiriWaveformView/SCSiriWaveformView.h" \ No newline at end of file +#import "SCSiriWaveformView/SCSiriWaveformView/SCSiriWaveformView.h" +#import diff --git a/Blockzilla.xcodeproj/project.pbxproj b/Blockzilla.xcodeproj/project.pbxproj index 53ca501a97..2187ed7a8e 100644 --- a/Blockzilla.xcodeproj/project.pbxproj +++ b/Blockzilla.xcodeproj/project.pbxproj @@ -7,7 +7,16 @@ objects = { /* Begin PBXBuildFile section */ + 2825C3665AB14081B262F767 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D051AC1857A0EEEBB833D15 /* SystemConfiguration.framework */; }; + 2916D1F85A9DE2CF4997BA3B /* BuddyBuildSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885AD5B8AB73EB0DA9702536 /* BuddyBuildSDK.framework */; }; + 2B36326E97D2E67E9C684B4B /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 80D9AA926EFBD788739486EB /* CoreTelephony.framework */; }; + 2F2F84BCF076B21DE42D1F29 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C652A61E213D254A86DF5736 /* CoreMedia.framework */; }; + 34056D10515852F370C83A01 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AAB8E622E994545108473554 /* QuartzCore.framework */; }; + 4285B8E0671F40DA543A2E58 /* AssetsLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 29B90C056305836CB297FF79 /* AssetsLibrary.framework */; }; + 58BD00527359D003DADE601E /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC16C41C8D4A74C79A493D42 /* CoreVideo.framework */; }; + 5AFDBB0CF3A9FBA175D2B693 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 427B752EF11959F9C38B12D6 /* AVFoundation.framework */; }; 6616A36F1BD17EFA00C7E493 /* style.css in Resources */ = {isa = PBXBuildFile; fileRef = 6616A36E1BD17EFA00C7E493 /* style.css */; }; + A57245250F88CCA4993E55B2 /* CoreText.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F4C4943B406FCA9B74B4E186 /* CoreText.framework */; }; D30179071BC6CB19009AD388 /* BlockerEnabledDetector.swift in Sources */ = {isa = PBXBuildFile; fileRef = D30179061BC6CB19009AD388 /* BlockerEnabledDetector.swift */; }; D30179C31BCC6F65009AD388 /* AboutViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D30179C21BCC6F65009AD388 /* AboutViewController.swift */; }; D30179C81BCD78E2009AD388 /* SCSiriWaveformView.m in Sources */ = {isa = PBXBuildFile; fileRef = D30179C71BCD78E2009AD388 /* SCSiriWaveformView.m */; }; @@ -103,7 +112,15 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 1D051AC1857A0EEEBB833D15 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; + 29B90C056305836CB297FF79 /* AssetsLibrary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AssetsLibrary.framework; path = System/Library/Frameworks/AssetsLibrary.framework; sourceTree = SDKROOT; }; + 427B752EF11959F9C38B12D6 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; 6616A36E1BD17EFA00C7E493 /* style.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = style.css; sourceTree = ""; }; + 80D9AA926EFBD788739486EB /* CoreTelephony.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = System/Library/Frameworks/CoreTelephony.framework; sourceTree = SDKROOT; }; + 885AD5B8AB73EB0DA9702536 /* BuddyBuildSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = BuddyBuildSDK.framework; sourceTree = ""; }; + AAB8E622E994545108473554 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + BC16C41C8D4A74C79A493D42 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = System/Library/Frameworks/CoreVideo.framework; sourceTree = SDKROOT; }; + C652A61E213D254A86DF5736 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; D30179061BC6CB19009AD388 /* BlockerEnabledDetector.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BlockerEnabledDetector.swift; sourceTree = ""; }; D30179C21BCC6F65009AD388 /* AboutViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AboutViewController.swift; sourceTree = ""; }; D30179C51BCD78E1009AD388 /* Blockzilla-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Blockzilla-Bridging-Header.h"; sourceTree = SOURCE_ROOT; }; @@ -161,6 +178,7 @@ E4BF2DF21BACE92400DA9D68 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; E4BF2E101BAD8AC500DA9D68 /* Settings.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Settings.swift; path = Shared/Settings.swift; sourceTree = SOURCE_ROOT; }; E4BF2E131BAE324400DA9D68 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = ""; }; + F4C4943B406FCA9B74B4E186 /* CoreText.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreText.framework; path = System/Library/Frameworks/CoreText.framework; sourceTree = SDKROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -170,6 +188,15 @@ files = ( D38D693D1C471A98003EF211 /* GCDWebServers.framework in Frameworks */, D38D693E1C471A98003EF211 /* SnapKit.framework in Frameworks */, + 2916D1F85A9DE2CF4997BA3B /* BuddyBuildSDK.framework in Frameworks */, + 4285B8E0671F40DA543A2E58 /* AssetsLibrary.framework in Frameworks */, + A57245250F88CCA4993E55B2 /* CoreText.framework in Frameworks */, + 2B36326E97D2E67E9C684B4B /* CoreTelephony.framework in Frameworks */, + 2825C3665AB14081B262F767 /* SystemConfiguration.framework in Frameworks */, + 34056D10515852F370C83A01 /* QuartzCore.framework in Frameworks */, + 5AFDBB0CF3A9FBA175D2B693 /* AVFoundation.framework in Frameworks */, + 2F2F84BCF076B21DE42D1F29 /* CoreMedia.framework in Frameworks */, + 58BD00527359D003DADE601E /* CoreVideo.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -235,6 +262,22 @@ name = Blocklists; sourceTree = ""; }; + D77FE464056F274978E025ED /* Frameworks */ = { + isa = PBXGroup; + children = ( + 885AD5B8AB73EB0DA9702536 /* BuddyBuildSDK.framework */, + 29B90C056305836CB297FF79 /* AssetsLibrary.framework */, + F4C4943B406FCA9B74B4E186 /* CoreText.framework */, + 80D9AA926EFBD788739486EB /* CoreTelephony.framework */, + 1D051AC1857A0EEEBB833D15 /* SystemConfiguration.framework */, + AAB8E622E994545108473554 /* QuartzCore.framework */, + 427B752EF11959F9C38B12D6 /* AVFoundation.framework */, + C652A61E213D254A86DF5736 /* CoreMedia.framework */, + BC16C41C8D4A74C79A493D42 /* CoreVideo.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; E4BF2DCA1BACE8CA00DA9D68 = { isa = PBXGroup; children = ( @@ -248,6 +291,7 @@ E4BF2DD41BACE8CA00DA9D68 /* Products */, D33A1A391BC476D40003D929 /* Shared */, D30179D31BCDA5EE009AD388 /* ThirdParty */, + D77FE464056F274978E025ED /* Frameworks */, ); sourceTree = ""; }; @@ -585,6 +629,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS", + "$(PROJECT_DIR)", ); INFOPLIST_FILE = Blockzilla/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -667,6 +712,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS", + "$(PROJECT_DIR)", ); INFOPLIST_FILE = Blockzilla/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -743,6 +789,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS", + "$(PROJECT_DIR)", ); INFOPLIST_FILE = Blockzilla/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -868,6 +915,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS", + "$(PROJECT_DIR)", ); INFOPLIST_FILE = Blockzilla/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -888,6 +936,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS", + "$(PROJECT_DIR)", ); INFOPLIST_FILE = Blockzilla/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; diff --git a/Blockzilla/AppDelegate.swift b/Blockzilla/AppDelegate.swift index ac3fa5ca6d..14f54d553c 100644 --- a/Blockzilla/AppDelegate.swift +++ b/Blockzilla/AppDelegate.swift @@ -9,6 +9,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + BuddyBuildSDK.setup() + // Re-register the blocking lists at startup in case they've changed. Utils.reloadSafariContentBlocker() diff --git a/BuddyBuildSDK.framework/BuddyBuildSDK b/BuddyBuildSDK.framework/BuddyBuildSDK new file mode 100644 index 0000000000..f8a850dbc2 Binary files /dev/null and b/BuddyBuildSDK.framework/BuddyBuildSDK differ diff --git a/BuddyBuildSDK.framework/Headers/BuddyBuildSDK.h b/BuddyBuildSDK.framework/Headers/BuddyBuildSDK.h new file mode 100644 index 0000000000..5a407ee13e --- /dev/null +++ b/BuddyBuildSDK.framework/Headers/BuddyBuildSDK.h @@ -0,0 +1,147 @@ +// Copyright (c) 2015 Doe Pics Hit, Inc. All rights reserved. + +#import +#import + +typedef NSString*(^BBReturnNSStringCallback)(); +typedef BOOL (^BBReturnBooleanCallback)(); +typedef void (^BBCallback)(); + +@interface BuddyBuildSDK : NSObject + +// Deprecated ++ (void)setup:(id)bbAppDelegate; + +/** + * Initialize the SDK + * + * This should be called at (or near) the start of the appdelegate + */ ++ (void)setup; + +/* + * Associate arbitrary key/value pairs with your crash reports + * which will be visible from the buddybuild dashboard + */ ++ (void) setCrashMetadataObject:(id)object forKey:(NSString*)key; + +/* + * Programatically trigger the screenshot feedback UI without pressing the screenshot buttons + * If you have screenshot feedback disabled through the buddybuild setting, + * you can still trigger it by calling this method + */ + ++ (void)takeScreenshotAndShowFeedbackScreen; + +/* + * If you distribute a build to someone with their email address, buddybuild can + * figure out who they are and attach their info to feedback and crash reports. + * + * However, if you send out a build to a mailing list, or through TestFlight or + * the App Store we are unable to infer who they are. If you see 'Unknown User' + * this is likely the cause. + + * Often you'll know the identity of your user, for example, after they've + * logged in. You can provide buddybuild a callback to identify the current user. + */ + ++ (void)setUserDisplayNameCallback:(BBReturnNSStringCallback)bbCallback; + +/* + * You might have API keys and other secrets that your app needs to consume. + * However, you may not want to check these secrets into the source code. + * + * You can provide your secrets to buddybuild. Buddybuild can then expose them + * to you at build time through environment variables. These secrets can also be + * configured to be included into built app. We obfuscate the device keys to + * prevent unauthorized access. + */ ++ (NSString*)valueForDeviceKey:(NSString*)bbKey; + +/* + * To temporarily disable screenshot interception you can provide a callback + * here. + * + * When screenshotting is turned on through a buddybuild setting, and no + * callback is provided then screenshotting is by default on. + * + * If screenshotting is disabled through the buddybuild setting, then this + * callback has no effect + * + */ ++ (void)setScreenshotAllowedCallback:(BBReturnBooleanCallback)bbCallback; + +/* + * Once a piece of feedback is sent this callback will be called + * so you can take additional actions if necessary + */ ++ (void)setScreenshotFeedbackSentCallback:(BBCallback)bbCallback; + +/* + * Once a crash report is sent this callback will be called + * so you can take additional actions if necessary + */ ++ (void)setCrashReportSentCallback:(BBCallback)bbCallback; + +/* + * Buddybuild Build Number + */ ++ (NSString*)buildNumber; + +/* + * Scheme + */ ++ (NSString*)scheme; + +/* + * App ID + */ ++ (NSString*)appID; + +/* + * Build ID + */ ++ (NSString*)buildID; + +/* + * Build Configuration + */ + ++ (NSString*)buildConfiguration; + +/* + * Branch name for this build + */ + ++ (NSString*)branchName; + +/* + * Returns the user's email or more specifically, the email that was used to download and deploy the build. + * Returns "Unknown User" in cases where buddybuild is unable to identify the user. + * This is the same email seen in crash instances and feedbacks in the dashboard + * NOTE: To be called after [BuddyBuildSDK setup] + * this is different than the one returned in the user display name callback. +*/ ++ (NSString*)userEmail; + +/* Manually invoke the screenshot tutorial + * If you don't want it to appear on app launch, disable it in the + * dashboard by going to settings -> buddybuildSDK -> Feature Settings and turning off the screenshot tutorial + * You will be able to show it at any time from anywhere in your app + */ ++ (void) showScreenshotTutorial; + + ++(void) crash; + +@end + +@interface UIView (BuddyBuildSDK) + +// Certain features of buddybuild involve capturing the screen (either through a static screenshot, or as a video for instant replays in crash reporting or video feedback. +// Your app may contain certain sensitive customer information that you do not want to be included in the video. +// If you set this property to be true, this view will be redacted from the screen capture and blacked out + +@property (nonatomic, assign) BOOL buddybuildViewIsPrivate; + +@end diff --git a/BuddyBuildSDK.framework/build.num b/BuddyBuildSDK.framework/build.num new file mode 100644 index 0000000000..6e4f7dfb64 --- /dev/null +++ b/BuddyBuildSDK.framework/build.num @@ -0,0 +1 @@ +d1039cf