diff --git a/src/private-frameworks/CMakeLists.txt b/src/private-frameworks/CMakeLists.txt index 678aff6e8..8d8edef6f 100644 --- a/src/private-frameworks/CMakeLists.txt +++ b/src/private-frameworks/CMakeLists.txt @@ -7,6 +7,7 @@ add_subdirectory(AppleSauce) add_subdirectory(AuthKit) add_subdirectory(CrashReporterSupport) add_subdirectory(ConfigurationProfiles) +add_subdirectory(CoreAnalytics) add_subdirectory(CoreSymbolication) add_subdirectory(CoreUI) add_subdirectory(DataDetectors) diff --git a/src/private-frameworks/CoreAnalytics/CMakeLists.txt b/src/private-frameworks/CoreAnalytics/CMakeLists.txt new file mode 100644 index 000000000..82ca2f5bf --- /dev/null +++ b/src/private-frameworks/CoreAnalytics/CMakeLists.txt @@ -0,0 +1,27 @@ +project(CoreAnalytics) + +set(DYLIB_COMPAT_VERSION "1.0.0") +set(DYLIB_CURRENT_VERSION "1.0.0") + +include_directories(BEFORE ${CMAKE_SOURCE_DIR}/src/external/libcxx/include) + +add_compile_options(-Wno-error=stdlibcxx-not-found) + +add_framework(CoreAnalytics + FAT + CURRENT_VERSION + PRIVATE + VERSION "A" + + SOURCES + src/CoreAnalytics.mm + src/AnalyticsEventObserver.m + src/AnalyticsConfigurationObserver.m + + DEPENDENCIES + system + objc + Foundation + cxx + AppleSauce +) diff --git a/src/private-frameworks/CoreAnalytics/include/CoreAnalytics/AnalyticsConfigurationObserver.h b/src/private-frameworks/CoreAnalytics/include/CoreAnalytics/AnalyticsConfigurationObserver.h new file mode 100644 index 000000000..24fe438c6 --- /dev/null +++ b/src/private-frameworks/CoreAnalytics/include/CoreAnalytics/AnalyticsConfigurationObserver.h @@ -0,0 +1,24 @@ +/* + This file is part of Darling. + + Copyright (C) 2020 Lubos Dolezel + + Darling is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Darling is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Darling. If not, see . +*/ + +#include + +@interface AnalyticsConfigurationObserver : NSObject + +@end diff --git a/src/private-frameworks/CoreAnalytics/include/CoreAnalytics/AnalyticsEventObserver.h b/src/private-frameworks/CoreAnalytics/include/CoreAnalytics/AnalyticsEventObserver.h new file mode 100644 index 000000000..32428f563 --- /dev/null +++ b/src/private-frameworks/CoreAnalytics/include/CoreAnalytics/AnalyticsEventObserver.h @@ -0,0 +1,24 @@ +/* + This file is part of Darling. + + Copyright (C) 2020 Lubos Dolezel + + Darling is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Darling is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Darling. If not, see . +*/ + +#include + +@interface AnalyticsEventObserver : NSObject + +@end diff --git a/src/private-frameworks/CoreAnalytics/include/CoreAnalytics/CoreAnalytics.h b/src/private-frameworks/CoreAnalytics/include/CoreAnalytics/CoreAnalytics.h new file mode 100644 index 000000000..872ce76a5 --- /dev/null +++ b/src/private-frameworks/CoreAnalytics/include/CoreAnalytics/CoreAnalytics.h @@ -0,0 +1,153 @@ +/* + This file is part of Darling. + + Copyright (C) 2020 Lubos Dolezel + + Darling is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Darling is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Darling. If not, see . +*/ + +#ifndef _CoreAnalytics_H_ +#define _CoreAnalytics_H_ + +#include +#include +#include +#include +#include +#include +#include + +#import + +#import +#import + +/** + * NOTE(@facekapow): + * these method signatures are pretty much guesses. + * good guesses, but guesses nonetheless + * + * unlike the guesses in AppleSauce, these guesses are + * less reliable + */ + +#ifdef __cplusplus +extern "C" { +#endif + +bool AnalyticsIsEventUsed(void*); +void AnalyticsSendEvent(void*, void*); +bool AnalyticsSendEventLazy(void*); +void AnalyticsSetCallbackForQueriedEvent(void*, void(^)()); +void AnalyticsSetCallbackForQueriedEventWithQueue(void*, int, void(^)()); + +#ifdef __cplusplus +}; +#endif + +#ifdef __cplusplus + +std::string analytics_tool_dump(std::string); +void analytics_tool_save(std::string); +void analytics_tool_commit(); +void analytics_tool_rollover(); +bool analytics_tool_has_config(); +std::string analytics_tool_config_dump(); +std::string analytics_tool_config_info(); +std::string analytics_tool_config_list(); +void analytics_tool_send_barrier(); +void analytics_tool_config_reload(); +std::string analytics_tool_get_cache_list(); +std::string analytics_tool_transform_info(std::string); +bool analytics_tool_transform_evict(std::string); +bool analytics_tool_transform_persist(std::string); +void analytics_tool_config_set_tasking(std::string); +std::string analytics_tool_get_queried_events(); +bool analytics_tool_is_event_used_check_db(std::string); +void analytics_tool_config_set_tasking_ndjson(applesauce::xpc::object); + +namespace CoreAnalytics { + class EventObserver { + public: + ~EventObserver(); + }; + class ConfigurationObserver { + public: + ~ConfigurationObserver(); + }; + class Client { + public: + void barrierSync(); + void sendAwdMetric(unsigned int, void const*, unsigned long); + void sendAwdTrigger(char const*, unsigned int, unsigned int, unsigned int, void const*, unsigned long); + void sendEventAlways(char const*, applesauce::xpc::object const&); + dispatch_queue_t getCallbackQueue(); + void sendEventWithTag(char const*, applesauce::xpc::object const&, applesauce::xpc::object); + void updateDaemonState(int); + void registerStateHandler(std::string const&, applesauce::dispatch::v1::queue, std::function); + void sendAwdMetricWithTag(char const*, unsigned int, applesauce::xpc::object, void const*, unsigned long); + void addAwdQueriableMetric(unsigned int); + void handleQueryState_sync(applesauce::xpc::dict const&); + void registerEventObserver(std::weak_ptr); + void sendAwdTriggerWithTag(char const*, unsigned int, unsigned int, applesauce::xpc::object, void const*, unsigned long); + void sendManagementCommand(char const*); + void sendManagementCommand(char const*, applesauce::xpc::dict); + void registerAwdQueryHandler(std::function); + void sendCheckinMessage_sync(); + void handleServerMessage_sync(applesauce::xpc::dict); + void handleQueryAwdMetric_sync(applesauce::xpc::dict const&); + xpc_object_t sendManagementCommandSync(char const*); + xpc_object_t sendManagementCommandSync(char const*, applesauce::xpc::dict); + void handleSinkMessageEmit_sync(applesauce::xpc::dict const&); + void sendStateHandlersList_sync(); + void registerConfigurationObserver(std::weak_ptr); + void handleConfigurationChange_sync(applesauce::xpc::dict const&); + void sendAwdQueriableMetricsList_sync(); + static Client* get(); + void init(); + Client(); + ~Client(); + void sendXpcMessage(applesauce::xpc::dict) const; + bool isEventWhitelisted(std::string_view) const; + bool isAwdMetricWhitelisted(unsigned int) const; + bool hasConfig() const; + }; +}; + +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +void analytics_cancel_queried_awd_metric(char const*, xpc_object_t); +bool analytics_is_awd_metric_enabled(unsigned int); +bool analytics_is_event_used(char const*); +void analytics_mark_awd_queriable(unsigned int); +void analytics_send_awd_metric(unsigned int, void const*, unsigned long); +void analytics_send_awd_trigger(char const*, unsigned int, unsigned int, unsigned int, void const*, unsigned long); +void analytics_send_event(char const*, xpc_object_t); +void analytics_send_event_lazy(char const*, xpc_object_t); +void analytics_send_queried_awd_metric(char const*, unsigned int, xpc_object_t, void const*, unsigned long); +void analytics_send_queried_awd_trigger(char const*, unsigned int, unsigned int, xpc_object_t, void const*, unsigned long); +void analytics_set_awd_query_callback(void(^)(unsigned int, char const*, void*)); +void analytics_set_callback_for_queried_event(char const*, void(^)()); +void analytics_set_callback_for_queried_event_with_queue(char const*, void*, void(^)()); +void report_locale_prefs_to_analyticsd(); + +#ifdef __cplusplus +}; +#endif + +#endif diff --git a/src/private-frameworks/CoreAnalytics/src/AnalyticsConfigurationObserver.m b/src/private-frameworks/CoreAnalytics/src/AnalyticsConfigurationObserver.m new file mode 100644 index 000000000..e7f924c8a --- /dev/null +++ b/src/private-frameworks/CoreAnalytics/src/AnalyticsConfigurationObserver.m @@ -0,0 +1,34 @@ +/* + This file is part of Darling. + + Copyright (C) 2020 Lubos Dolezel + + Darling is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Darling is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Darling. If not, see . +*/ + +#import + +@implementation AnalyticsConfigurationObserver + +- (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector +{ + return [NSMethodSignature signatureWithObjCTypes: "v@:"]; +} + +- (void)forwardInvocation:(NSInvocation *)anInvocation +{ + NSLog(@"Stub called: %@ in %@", NSStringFromSelector([anInvocation selector]), [self class]); +} + +@end diff --git a/src/private-frameworks/CoreAnalytics/src/AnalyticsEventObserver.m b/src/private-frameworks/CoreAnalytics/src/AnalyticsEventObserver.m new file mode 100644 index 000000000..70648e109 --- /dev/null +++ b/src/private-frameworks/CoreAnalytics/src/AnalyticsEventObserver.m @@ -0,0 +1,34 @@ +/* + This file is part of Darling. + + Copyright (C) 2020 Lubos Dolezel + + Darling is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Darling is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Darling. If not, see . +*/ + +#import + +@implementation AnalyticsEventObserver + +- (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector +{ + return [NSMethodSignature signatureWithObjCTypes: "v@:"]; +} + +- (void)forwardInvocation:(NSInvocation *)anInvocation +{ + NSLog(@"Stub called: %@ in %@", NSStringFromSelector([anInvocation selector]), [self class]); +} + +@end diff --git a/src/private-frameworks/CoreAnalytics/src/CoreAnalytics.mm b/src/private-frameworks/CoreAnalytics/src/CoreAnalytics.mm new file mode 100644 index 000000000..7a2c26bf0 --- /dev/null +++ b/src/private-frameworks/CoreAnalytics/src/CoreAnalytics.mm @@ -0,0 +1,423 @@ +/* + This file is part of Darling. + + Copyright (C) 2020 Lubos Dolezel + + Darling is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Darling is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Darling. If not, see . +*/ + +#include +#include + +static bool verbose = false; + +__attribute__((constructor)) +static void initme() { + verbose = getenv("STUB_VERBOSE") != NULL; +}; + +extern "C" { + +bool AnalyticsIsEventUsed(void*) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; + return false; +}; + +void AnalyticsSendEvent(void*, void*) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +bool AnalyticsSendEventLazy(void*) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; + return false; +}; + +void AnalyticsSetCallbackForQueriedEvent(void*, void(^)()) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void AnalyticsSetCallbackForQueriedEventWithQueue(void*, int, void(^)()) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +}; + +std::string analytics_tool_dump(std::string) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; + return std::string(); +}; + +void analytics_tool_save(std::string) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void analytics_tool_commit() { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void analytics_tool_rollover() { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +bool analytics_tool_has_config() { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; + return false; +}; + +std::string analytics_tool_config_dump() { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; + return std::string(); +}; + +std::string analytics_tool_config_info() { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; + return std::string(); +}; + +std::string analytics_tool_config_list() { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; + return std::string(); +}; + +void analytics_tool_send_barrier() { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void analytics_tool_config_reload() { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +std::string analytics_tool_get_cache_list() { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; + return std::string(); +}; + +std::string analytics_tool_transform_info(std::string) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; + return std::string(); +}; + +bool analytics_tool_transform_evict(std::string) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; + return false; +}; + +bool analytics_tool_transform_persist(std::string) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; + return false; +}; + +void analytics_tool_config_set_tasking(std::string) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +std::string analytics_tool_get_queried_events() { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; + return std::string(); +}; + +bool analytics_tool_is_event_used_check_db(std::string) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; + return false; +}; + +void analytics_tool_config_set_tasking_ndjson(applesauce::xpc::object) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +CoreAnalytics::EventObserver::~EventObserver() { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +CoreAnalytics::ConfigurationObserver::~ConfigurationObserver() { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void CoreAnalytics::Client::barrierSync() { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void CoreAnalytics::Client::sendAwdMetric(unsigned int, void const*, unsigned long) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void CoreAnalytics::Client::sendAwdTrigger(char const*, unsigned int, unsigned int, unsigned int, void const*, unsigned long) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void CoreAnalytics::Client::sendEventAlways(char const*, applesauce::xpc::object const&) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +dispatch_queue_t CoreAnalytics::Client::getCallbackQueue() { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; + return NULL; +}; + +void CoreAnalytics::Client::sendEventWithTag(char const*, applesauce::xpc::object const&, applesauce::xpc::object) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void CoreAnalytics::Client::updateDaemonState(int) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void CoreAnalytics::Client::registerStateHandler(std::string const&, applesauce::dispatch::v1::queue, std::function) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void CoreAnalytics::Client::sendAwdMetricWithTag(char const*, unsigned int, applesauce::xpc::object, void const*, unsigned long) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void CoreAnalytics::Client::addAwdQueriableMetric(unsigned int) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void CoreAnalytics::Client::handleQueryState_sync(applesauce::xpc::dict const&) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void CoreAnalytics::Client::registerEventObserver(std::weak_ptr) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void CoreAnalytics::Client::sendAwdTriggerWithTag(char const*, unsigned int, unsigned int, applesauce::xpc::object, void const*, unsigned long) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void CoreAnalytics::Client::sendManagementCommand(char const*) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void CoreAnalytics::Client::sendManagementCommand(char const*, applesauce::xpc::dict) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void CoreAnalytics::Client::registerAwdQueryHandler(std::function) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void CoreAnalytics::Client::sendCheckinMessage_sync() { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void CoreAnalytics::Client::handleServerMessage_sync(applesauce::xpc::dict) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void CoreAnalytics::Client::handleQueryAwdMetric_sync(applesauce::xpc::dict const&) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +xpc_object_t CoreAnalytics::Client::sendManagementCommandSync(char const*) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; + return NULL; +}; + +xpc_object_t CoreAnalytics::Client::sendManagementCommandSync(char const*, applesauce::xpc::dict) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; + return NULL; +}; + +void CoreAnalytics::Client::handleSinkMessageEmit_sync(applesauce::xpc::dict const&) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void CoreAnalytics::Client::sendStateHandlersList_sync() { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void CoreAnalytics::Client::registerConfigurationObserver(std::weak_ptr) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void CoreAnalytics::Client::handleConfigurationChange_sync(applesauce::xpc::dict const&) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void CoreAnalytics::Client::sendAwdQueriableMetricsList_sync() { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +CoreAnalytics::Client* CoreAnalytics::Client::get() { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; + return NULL; +}; + +void CoreAnalytics::Client::init() { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +CoreAnalytics::Client::Client() { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +CoreAnalytics::Client::~Client() { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void CoreAnalytics::Client::sendXpcMessage(applesauce::xpc::dict) const { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +bool CoreAnalytics::Client::isEventWhitelisted(std::string_view) const { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; + return false; +}; + +bool CoreAnalytics::Client::isAwdMetricWhitelisted(unsigned int) const { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; + return false; +}; + +bool CoreAnalytics::Client::hasConfig() const { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; + return false; +}; + +extern "C" { + +void analytics_cancel_queried_awd_metric(char const*, xpc_object_t) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +bool analytics_is_awd_metric_enabled(unsigned int) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; + return false; +}; + +bool analytics_is_event_used(char const*) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; + return false; +}; + +void analytics_mark_awd_queriable(unsigned int) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void analytics_send_awd_metric(unsigned int, void const*, unsigned long) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void analytics_send_awd_trigger(char const*, unsigned int, unsigned int, unsigned int, void const*, unsigned long) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void analytics_send_event(char const*, xpc_object_t) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void analytics_send_event_lazy(char const*, xpc_object_t) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void analytics_send_queried_awd_metric(char const*, unsigned int, xpc_object_t, void const*, unsigned long) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void analytics_send_queried_awd_trigger(char const*, unsigned int, unsigned int, xpc_object_t, void const*, unsigned long) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void analytics_set_awd_query_callback(void(^)(unsigned int, char const*, void*)) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void analytics_set_callback_for_queried_event(char const*, void(^)()) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void analytics_set_callback_for_queried_event_with_queue(char const*, void*, void(^)()) { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +void report_locale_prefs_to_analyticsd() { + if (verbose) + std::cerr << "STUB: " << __PRETTY_FUNCTION__ << " called" << std::endl; +}; + +}; diff --git a/src/private-frameworks/include/CoreAnalytics b/src/private-frameworks/include/CoreAnalytics new file mode 120000 index 000000000..687decf18 --- /dev/null +++ b/src/private-frameworks/include/CoreAnalytics @@ -0,0 +1 @@ +../CoreAnalytics/include/CoreAnalytics \ No newline at end of file