Skip to content

Commit

Permalink
fix: privacy manifest 适配 macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
YoloMao committed Sep 19, 2023
1 parent d232dd0 commit 7b9ee62
Show file tree
Hide file tree
Showing 51 changed files with 79 additions and 48 deletions.
2 changes: 1 addition & 1 deletion GrowingTrackerCore/Core/GrowingAnnotationCore.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#import "GrowingTrackerCore/include/GrowingAnnotationCore.h"
#import "GrowingTrackerCore/Public/GrowingAnnotationCore.h"
#include <dlfcn.h>
#include <mach-o/dyld.h>
#include <mach-o/getsect.h>
Expand Down
6 changes: 3 additions & 3 deletions GrowingTrackerCore/Core/GrowingModuleManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#import "GrowingTrackerCore/include/GrowingModuleManager.h"
#import "GrowingTrackerCore/Public/GrowingModuleManager.h"
#import <objc/message.h>
#import <objc/runtime.h>
#import "GrowingTrackerCore/Core/GrowingContext.h"
#import "GrowingTrackerCore/Thirdparty/Logger/GrowingLogger.h"
#import "GrowingTrackerCore/include/GrowingAnnotationCore.h"
#import "GrowingTrackerCore/include/GrowingModuleProtocol.h"
#import "GrowingTrackerCore/Public/GrowingAnnotationCore.h"
#import "GrowingTrackerCore/Public/GrowingModuleProtocol.h"

static NSString *kInitSelector = @"growingModInit:";
static NSString *kSetDataCollectionEnabledSelector = @"growingModSetDataCollectionEnabled:";
Expand Down
6 changes: 3 additions & 3 deletions GrowingTrackerCore/Core/GrowingServiceManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#import "GrowingTrackerCore/include/GrowingServiceManager.h"
#import "GrowingTrackerCore/Public/GrowingServiceManager.h"
#import <objc/message.h>
#import "GrowingTrackerCore/Thirdparty/Logger/GrowingLogger.h"
#import "GrowingTrackerCore/include/GrowingAnnotationCore.h"
#import "GrowingTrackerCore/include/GrowingBaseService.h"
#import "GrowingTrackerCore/Public/GrowingAnnotationCore.h"
#import "GrowingTrackerCore/Public/GrowingBaseService.h"

@interface GrowingServiceManager ()

Expand Down
2 changes: 1 addition & 1 deletion GrowingTrackerCore/Database/GrowingEventDatabase.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#import "GrowingTrackerCore/Database/GrowingEventDatabase.h"
#import "GrowingTrackerCore/Thirdparty/Logger/GrowingLogger.h"
#import "GrowingTrackerCore/Utils/GrowingInternalMacros.h"
#import "GrowingTrackerCore/include/GrowingServiceManager.h"
#import "GrowingTrackerCore/Public/GrowingServiceManager.h"

long long const GrowingEventDatabaseExpirationTime = 86400000 * 7;
NSString *const GrowingEventDatabaseErrorDomain = @"com.growing.event.database.error";
Expand Down
2 changes: 1 addition & 1 deletion GrowingTrackerCore/Event/Base/GrowingAttributesBuilder.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#import "GrowingTrackerCore/include/GrowingAttributesBuilder.h"
#import "GrowingTrackerCore/Public/GrowingAttributesBuilder.h"
#import "GrowingTrackerCore/Thirdparty/Logger/GrowingLogger.h"

@interface GrowingAttributesBuilder ()
Expand Down
4 changes: 2 additions & 2 deletions GrowingTrackerCore/Event/Base/GrowingBaseEvent.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#import "GrowingTrackerCore/include/GrowingBaseEvent.h"
#import "GrowingTrackerCore/Public/GrowingBaseEvent.h"
#import "GrowingTrackerCore/Event/Tools/GrowingPersistenceDataProvider.h"
#import "GrowingTrackerCore/GrowingRealTracker.h"
#import "GrowingTrackerCore/Manager/GrowingConfigurationManager.h"
#import "GrowingTrackerCore/Manager/GrowingSession.h"
#import "GrowingTrackerCore/Network/GrowingNetworkInterfaceManager.h"
#import "GrowingTrackerCore/Utils/GrowingDeviceInfo.h"
#import "GrowingTrackerCore/include/GrowingFieldsIgnore.h"
#import "GrowingTrackerCore/Public/GrowingFieldsIgnore.h"
#import "GrowingULTimeUtil.h"

@implementation GrowingBaseEvent
Expand Down
2 changes: 1 addition & 1 deletion GrowingTrackerCore/Event/GrowingEventFilter.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#import "GrowingTrackerCore/include/GrowingEventFilter.h"
#import "GrowingTrackerCore/Public/GrowingEventFilter.h"
#import "GrowingTrackerCore/Manager/GrowingConfigurationManager.h"

NSUInteger const GrowingFilterClickChange = (GrowingFilterEventViewClick | GrowingFilterEventViewChange);
Expand Down
10 changes: 5 additions & 5 deletions GrowingTrackerCore/Event/GrowingEventManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
#import "GrowingTrackerCore/Thirdparty/Logger/GrowingLogger.h"
#import "GrowingTrackerCore/Thread/GrowingDispatchManager.h"
#import "GrowingTrackerCore/Utils/GrowingDeviceInfo.h"
#import "GrowingTrackerCore/include/GrowingBaseEvent.h"
#import "GrowingTrackerCore/include/GrowingEventFilter.h"
#import "GrowingTrackerCore/include/GrowingEventNetworkService.h"
#import "GrowingTrackerCore/include/GrowingServiceManager.h"
#import "GrowingTrackerCore/include/GrowingTrackConfiguration.h"
#import "GrowingTrackerCore/Public/GrowingBaseEvent.h"
#import "GrowingTrackerCore/Public/GrowingEventFilter.h"
#import "GrowingTrackerCore/Public/GrowingEventNetworkService.h"
#import "GrowingTrackerCore/Public/GrowingServiceManager.h"
#import "GrowingTrackerCore/Public/GrowingTrackConfiguration.h"

static const NSUInteger kGrowingMaxDBCacheSize = 100; // default: write to DB as soon as there are 100 events
static const NSUInteger kGrowingMaxBatchSize = 500; // default: send no more than 500 events in every batch
Expand Down
2 changes: 1 addition & 1 deletion GrowingTrackerCore/Event/GrowingFieldsIgnore.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#import "GrowingTrackerCore/include/GrowingFieldsIgnore.h"
#import "GrowingTrackerCore/Public/GrowingFieldsIgnore.h"
#import "GrowingTrackerCore/Manager/GrowingConfigurationManager.h"

// 忽略当前所有可设置的属性掩码值
Expand Down
2 changes: 1 addition & 1 deletion GrowingTrackerCore/FileStorage/GrowingFileStorage.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#import "GrowingTrackerCore/Helpers/GrowingHelpers.h"
#import "GrowingTrackerCore/Thirdparty/Logger/GrowingLogger.h"
#import "GrowingTrackerCore/Utils/GrowingDeviceInfo.h"
#import "GrowingTrackerCore/include/GrowingServiceManager.h"
#import "GrowingTrackerCore/Public/GrowingServiceManager.h"

NSString *const kGrowingResidentDirName = @"com.growingio.core";
NSString *const kGrowingDirCommonPrefix = @"com.growingio.";
Expand Down
8 changes: 4 additions & 4 deletions GrowingTrackerCore/GrowingRealTracker.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
#import "GrowingTrackerCore/Timer/GrowingEventTimer.h"
#import "GrowingTrackerCore/Utils/GrowingArgumentChecker.h"
#import "GrowingTrackerCore/Utils/GrowingDeviceInfo.h"
#import "GrowingTrackerCore/include/GrowingAttributesBuilder.h"
#import "GrowingTrackerCore/include/GrowingModuleManager.h"
#import "GrowingTrackerCore/include/GrowingServiceManager.h"
#import "GrowingTrackerCore/include/GrowingTrackConfiguration.h"
#import "GrowingTrackerCore/Public/GrowingAttributesBuilder.h"
#import "GrowingTrackerCore/Public/GrowingModuleManager.h"
#import "GrowingTrackerCore/Public/GrowingServiceManager.h"
#import "GrowingTrackerCore/Public/GrowingTrackConfiguration.h"
#import "GrowingULAppLifecycle.h"

NSString *const GrowingTrackerVersionName = @"4.0.0";
Expand Down
2 changes: 1 addition & 1 deletion GrowingTrackerCore/GrowingTrackConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#import "GrowingTrackerCore/include/GrowingTrackConfiguration.h"
#import "GrowingTrackerCore/Public/GrowingTrackConfiguration.h"
#import "GrowingTrackerCore/Manager/GrowingSession.h"

NSString *const kGrowingDefaultDataCollectionServerHost = @"https://napi.growingio.com";
Expand Down
6 changes: 3 additions & 3 deletions GrowingTrackerCore/Helpers/Foundation/NSData+GrowingHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
#import "GrowingTrackerCore/Helpers/Foundation/NSData+GrowingHelper.h"
#import "GrowingTrackerCore/Helpers/Foundation/NSString+GrowingHelper.h"
#import "GrowingTrackerCore/Thirdparty/Logger/GrowingLogger.h"
#import "GrowingTrackerCore/include/GrowingCompressService.h"
#import "GrowingTrackerCore/include/GrowingEncryptionService.h"
#import "GrowingTrackerCore/include/GrowingServiceManager.h"
#import "GrowingTrackerCore/Public/GrowingCompressService.h"
#import "GrowingTrackerCore/Public/GrowingEncryptionService.h"
#import "GrowingTrackerCore/Public/GrowingServiceManager.h"

#import <CommonCrypto/CommonCrypto.h>

Expand Down
2 changes: 1 addition & 1 deletion GrowingTrackerCore/Manager/GrowingConfigurationManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// limitations under the License.

#import "GrowingTrackerCore/Manager/GrowingConfigurationManager.h"
#import "GrowingTrackerCore/include/GrowingTrackConfiguration.h"
#import "GrowingTrackerCore/Public/GrowingTrackConfiguration.h"

@implementation GrowingConfigurationManager

Expand Down
2 changes: 1 addition & 1 deletion GrowingTrackerCore/Manager/GrowingSession.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#import "GrowingTrackerCore/Thread/GrowingDispatchManager.h"
#import "GrowingTrackerCore/Timer/GrowingEventTimer.h"
#import "GrowingTrackerCore/Utils/GrowingInternalMacros.h"
#import "GrowingTrackerCore/include/GrowingTrackConfiguration.h"
#import "GrowingTrackerCore/Public/GrowingTrackConfiguration.h"
#import "GrowingULAppLifecycle.h"
#import "GrowingULTimeUtil.h"

Expand Down
2 changes: 1 addition & 1 deletion GrowingTrackerCore/Utils/GrowingDynamicProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#import "GrowingTrackerCore/include/GrowingDynamicProxy.h"
#import "GrowingTrackerCore/Public/GrowingDynamicProxy.h"
#import "GrowingTrackerCore/Thirdparty/Logger/GrowingLogMacros.h"
#import "GrowingTrackerCore/Thirdparty/Logger/GrowingLogger.h"

Expand Down
4 changes: 2 additions & 2 deletions Modules/Advert/GrowingAdvertising.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
#import "GrowingTrackerCore/Thirdparty/Logger/GrowingLogger.h"
#import "GrowingTrackerCore/Thread/GrowingDispatchManager.h"
#import "GrowingTrackerCore/Utils/GrowingDeviceInfo.h"
#import "GrowingTrackerCore/include/GrowingEventNetworkService.h"
#import "GrowingTrackerCore/include/GrowingServiceManager.h"
#import "GrowingTrackerCore/Public/GrowingEventNetworkService.h"
#import "GrowingTrackerCore/Public/GrowingServiceManager.h"
#import "GrowingULAppLifecycle.h"

#import <WebKit/WebKit.h>
Expand Down
2 changes: 1 addition & 1 deletion Modules/Flutter/GrowingFlutterPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#import "GrowingTrackerCore/Event/Autotrack/GrowingViewElementEvent.h"
#import "GrowingTrackerCore/Event/GrowingEventManager.h"
#import "GrowingTrackerCore/Thread/GrowingDispatchManager.h"
#import "GrowingTrackerCore/include/GrowingAttributesBuilder.h"
#import "GrowingTrackerCore/Public/GrowingAttributesBuilder.h"
#import "GrowingULAppLifecycle.h"

GrowingMod(GrowingFlutterPlugin)
Expand Down
4 changes: 2 additions & 2 deletions Modules/Hybrid/GrowingHybridBridgeProvider.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#import "GrowingTrackerCore/Manager/GrowingSession.h"
#import "GrowingTrackerCore/Thirdparty/Logger/GrowingLogger.h"
#import "GrowingTrackerCore/Utils/GrowingDeviceInfo.h"
#import "GrowingTrackerCore/include/GrowingAnnotationCore.h"
#import "GrowingTrackerCore/include/GrowingBaseEvent.h"
#import "GrowingTrackerCore/Public/GrowingAnnotationCore.h"
#import "GrowingTrackerCore/Public/GrowingBaseEvent.h"
#import "GrowingULTimeUtil.h"
#import "Modules/Hybrid/Events/GrowingHybridCustomEvent.h"
#import "Modules/Hybrid/Events/GrowingHybridEventType.h"
Expand Down
2 changes: 1 addition & 1 deletion Modules/Hybrid/GrowingWKWebViewJavascriptBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#import "GrowingTrackerCore/Thirdparty/Logger/GrowingLogMacros.h"
#import "GrowingTrackerCore/Thirdparty/Logger/GrowingLogger.h"
#import "GrowingTrackerCore/Utils/GrowingDeviceInfo.h"
#import "GrowingTrackerCore/include/GrowingTrackConfiguration.h"
#import "GrowingTrackerCore/Public/GrowingTrackConfiguration.h"
#import "Modules/Hybrid/GrowingHybridBridgeProvider.h"
#import "Modules/Hybrid/GrowingWKWebViewJavascriptBridge_JS.h"
#import "Modules/Hybrid/GrowingWebViewJavascriptBridgeConfiguration.h"
Expand Down
8 changes: 4 additions & 4 deletions Modules/MobileDebugger/GrowingMobileDebugger.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
#import "GrowingTrackerCore/Thread/GrowingDispatchManager.h"
#import "GrowingTrackerCore/Utils/GrowingDeviceInfo.h"
#import "GrowingTrackerCore/Utils/GrowingInternalMacros.h"
#import "GrowingTrackerCore/include/GrowingAnnotationCore.h"
#import "GrowingTrackerCore/include/GrowingScreenshotService.h"
#import "GrowingTrackerCore/include/GrowingServiceManager.h"
#import "GrowingTrackerCore/include/GrowingWebSocketService.h"
#import "GrowingTrackerCore/Public/GrowingAnnotationCore.h"
#import "GrowingTrackerCore/Public/GrowingScreenshotService.h"
#import "GrowingTrackerCore/Public/GrowingServiceManager.h"
#import "GrowingTrackerCore/Public/GrowingWebSocketService.h"
#import "GrowingULTimeUtil.h"
#import "Modules/MobileDebugger/GrowingDebuggerEventQueue.h"

Expand Down
8 changes: 4 additions & 4 deletions Modules/WebCircle/GrowingWebCircle.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
#import "GrowingTrackerCore/Thirdparty/Logger/GrowingLogger.h"
#import "GrowingTrackerCore/Thread/GrowingDispatchManager.h"
#import "GrowingTrackerCore/Utils/GrowingDeviceInfo.h"
#import "GrowingTrackerCore/include/GrowingFlutterService.h"
#import "GrowingTrackerCore/include/GrowingScreenshotService.h"
#import "GrowingTrackerCore/include/GrowingServiceManager.h"
#import "GrowingTrackerCore/include/GrowingWebSocketService.h"
#import "GrowingTrackerCore/Public/GrowingFlutterService.h"
#import "GrowingTrackerCore/Public/GrowingScreenshotService.h"
#import "GrowingTrackerCore/Public/GrowingServiceManager.h"
#import "GrowingTrackerCore/Public/GrowingWebSocketService.h"
#import "Modules/WebCircle/GrowingWebCircleElement.h"
#import "Modules/WebCircle/GrowingWebCircleStatusView.h"

Expand Down
35 changes: 33 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ let package = Package(
.autotracker,
.tracker,

// MARK: - Resources
.Resources.privacy,
.Resources.privacy_macos,

// MARK: - Core

.Core.trackerCore,
Expand Down Expand Up @@ -130,6 +134,16 @@ extension Target {
publicHeadersPath: ".",
cSettings: [.hspFor(.Path.tracker_objc)])

enum Resources {
static let privacy = target(name: .privacy,
path: .Path.privacy,
resources: [.copy("Resources/PrivacyInfo.xcprivacy")])

static let privacy_macos = target(name: .privacy_macos,
path: .Path.privacy_macos,
resources: [.copy("Resources/PrivacyInfo.xcprivacy")])
}

enum Core {
static let autotrackerCore = target(name: .autotrackerCore,
dependencies: [
Expand All @@ -141,9 +155,13 @@ extension Target {
cSettings: [.hspFor(.Path.autotrackerCore)])

static let trackerCore = target(name: .trackerCore,
dependencies: [.trackerUtils],
dependencies: [
.trackerUtils,
.Resources.privacy,
.Resources.privacy_macos,
],
path: .Path.trackerCore,
resources: [.copy("Resources/PrivacyInfo.xcprivacy")],
publicHeadersPath: .Path.publicHeaders,
cSettings: [.hspFor(.Path.trackerCore)],
linkerSettings: [
.cPlusPlusLibrary,
Expand Down Expand Up @@ -275,6 +293,11 @@ extension Target.Dependency {
static let apm = product(name: "GrowingAPM", package: "growingio-sdk-ios-performance-ext")
static let protobuf = product(name: "SwiftProtobuf", package: "swift-protobuf")

enum Resources {
static let privacy = byName(name: .privacy, condition: .when(platforms: [.iOS, .macCatalyst]))
static let privacy_macos = byName(name: .privacy_macos, condition: .when(platforms: [.macOS]))
}

enum Core {
static let autotrackerCore = byName(name: .autotrackerCore, condition: .when(platforms: [.iOS, .macCatalyst]))
static let trackerCore = byName(name: .trackerCore)
Expand Down Expand Up @@ -319,6 +342,10 @@ extension String {
static let autotracker_objc = "GrowingAutotracker_Objc"
static let tracker_objc = "GrowingTracker_Objc"

// Resources
static let privacy = "GrowingPrivacy"
static let privacy_macos = "GrowingPrivacy_macOS"

// Core
static let autotrackerCore = "GrowingAutotrackerCore"
static let trackerCore = "GrowingTrackerCore"
Expand Down Expand Up @@ -350,6 +377,10 @@ extension String {
static let autotracker_objc = "GrowingAutotracker"
static let tracker_objc = "GrowingTracker"

// Resources
static let privacy = "SwiftPM-Wrap/GrowingPrivacy-Wrapper"
static let privacy_macos = "SwiftPM-Wrap/GrowingPrivacy-macOS-Wrapper"

// Core
static let autotrackerCore = "GrowingAutotrackerCore"
static let trackerCore = "GrowingTrackerCore"
Expand Down
2 changes: 1 addition & 1 deletion Services/Database/GrowingEventFMDatabase.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#import "Services/Database/GrowingEventFMDatabase.h"
#import "GrowingTrackerCore/FileStorage/GrowingFileStorage.h"
#import "GrowingTrackerCore/include/GrowingEventPersistenceProtocol.h"
#import "GrowingTrackerCore/Public/GrowingEventPersistenceProtocol.h"
#import "GrowingULTimeUtil.h"
#import "Services/Database/FMDB/GrowingFMDB.h"

Expand Down
2 changes: 1 addition & 1 deletion Services/Network/GrowingNetworkManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#import "Services/Network/GrowingNetworkManager.h"
#import "GrowingTrackerCore/Thirdparty/Logger/GrowingLogger.h"
#import "GrowingTrackerCore/include/GrowingAnnotationCore.h"
#import "GrowingTrackerCore/Public/GrowingAnnotationCore.h"
#import "Services/Network/NSURLSession+GrowingURLSessionHelper.h"

GrowingService(GrowingEventNetworkService, GrowingNetworkManager)
Expand Down
File renamed without changes.

0 comments on commit 7b9ee62

Please sign in to comment.