├── .DS_Store ├── .gitattributes ├── AndroidRestore.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── swiftpm │ │ │ └── Package.resolved │ └── xcuserdata │ │ └── lrdsnow.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── lrdsnow.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ └── xcschememanagement.plist ├── AndroidRestore ├── AndroidRestore.entitlements ├── Assets.xcassets │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json ├── BackupManifest.swift ├── ContentView.swift ├── GooglePlay.swift ├── MiscExtensions.swift ├── Preview Content │ └── Preview Assets.xcassets │ │ └── Contents.json └── notestore.pb.swift └── README.md /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lrdsnow/AndroidRestore/bd766a31028fbc7aff42dff77e44cccf59277a7f/.DS_Store -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /AndroidRestore.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 77; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 65577AE72CA729EF004CB416 /* Gzip in Frameworks */ = {isa = PBXBuildFile; productRef = 65577AE62CA729EF004CB416 /* Gzip */; }; 11 | 6573D0872CA74BA600379E1B /* SwiftProtobuf in Frameworks */ = {isa = PBXBuildFile; productRef = 6573D0862CA74BA600379E1B /* SwiftProtobuf */; }; 12 | 65B41FCD2CA661D60035CEBF /* SQLite in Frameworks */ = {isa = PBXBuildFile; productRef = 65B41FCC2CA661D60035CEBF /* SQLite */; }; 13 | /* End PBXBuildFile section */ 14 | 15 | /* Begin PBXFileReference section */ 16 | 65B41FB92CA65B030035CEBF /* AndroidRestore.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AndroidRestore.app; sourceTree = BUILT_PRODUCTS_DIR; }; 17 | /* End PBXFileReference section */ 18 | 19 | /* Begin PBXFileSystemSynchronizedRootGroup section */ 20 | 65B41FBB2CA65B030035CEBF /* AndroidRestore */ = { 21 | isa = PBXFileSystemSynchronizedRootGroup; 22 | path = AndroidRestore; 23 | sourceTree = ""; 24 | }; 25 | /* End PBXFileSystemSynchronizedRootGroup section */ 26 | 27 | /* Begin PBXFrameworksBuildPhase section */ 28 | 65B41FB62CA65B030035CEBF /* Frameworks */ = { 29 | isa = PBXFrameworksBuildPhase; 30 | buildActionMask = 2147483647; 31 | files = ( 32 | 65577AE72CA729EF004CB416 /* Gzip in Frameworks */, 33 | 65B41FCD2CA661D60035CEBF /* SQLite in Frameworks */, 34 | 6573D0872CA74BA600379E1B /* SwiftProtobuf in Frameworks */, 35 | ); 36 | runOnlyForDeploymentPostprocessing = 0; 37 | }; 38 | /* End PBXFrameworksBuildPhase section */ 39 | 40 | /* Begin PBXGroup section */ 41 | 65B41FB02CA65B030035CEBF = { 42 | isa = PBXGroup; 43 | children = ( 44 | 65B41FBB2CA65B030035CEBF /* AndroidRestore */, 45 | 65B41FBA2CA65B030035CEBF /* Products */, 46 | ); 47 | sourceTree = ""; 48 | }; 49 | 65B41FBA2CA65B030035CEBF /* Products */ = { 50 | isa = PBXGroup; 51 | children = ( 52 | 65B41FB92CA65B030035CEBF /* AndroidRestore.app */, 53 | ); 54 | name = Products; 55 | sourceTree = ""; 56 | }; 57 | /* End PBXGroup section */ 58 | 59 | /* Begin PBXNativeTarget section */ 60 | 65B41FB82CA65B030035CEBF /* AndroidRestore */ = { 61 | isa = PBXNativeTarget; 62 | buildConfigurationList = 65B41FC82CA65B050035CEBF /* Build configuration list for PBXNativeTarget "AndroidRestore" */; 63 | buildPhases = ( 64 | 65B41FB52CA65B030035CEBF /* Sources */, 65 | 65B41FB62CA65B030035CEBF /* Frameworks */, 66 | 65B41FB72CA65B030035CEBF /* Resources */, 67 | ); 68 | buildRules = ( 69 | ); 70 | dependencies = ( 71 | ); 72 | fileSystemSynchronizedGroups = ( 73 | 65B41FBB2CA65B030035CEBF /* AndroidRestore */, 74 | ); 75 | name = AndroidRestore; 76 | packageProductDependencies = ( 77 | 65B41FCC2CA661D60035CEBF /* SQLite */, 78 | 65577AE62CA729EF004CB416 /* Gzip */, 79 | 6573D0862CA74BA600379E1B /* SwiftProtobuf */, 80 | ); 81 | productName = AndroidRestore; 82 | productReference = 65B41FB92CA65B030035CEBF /* AndroidRestore.app */; 83 | productType = "com.apple.product-type.application"; 84 | }; 85 | /* End PBXNativeTarget section */ 86 | 87 | /* Begin PBXProject section */ 88 | 65B41FB12CA65B030035CEBF /* Project object */ = { 89 | isa = PBXProject; 90 | attributes = { 91 | BuildIndependentTargetsInParallel = 1; 92 | LastSwiftUpdateCheck = 1610; 93 | LastUpgradeCheck = 1610; 94 | TargetAttributes = { 95 | 65B41FB82CA65B030035CEBF = { 96 | CreatedOnToolsVersion = 16.1; 97 | }; 98 | }; 99 | }; 100 | buildConfigurationList = 65B41FB42CA65B030035CEBF /* Build configuration list for PBXProject "AndroidRestore" */; 101 | developmentRegion = en; 102 | hasScannedForEncodings = 0; 103 | knownRegions = ( 104 | en, 105 | Base, 106 | ); 107 | mainGroup = 65B41FB02CA65B030035CEBF; 108 | minimizedProjectReferenceProxies = 1; 109 | packageReferences = ( 110 | 65B41FCB2CA661D60035CEBF /* XCRemoteSwiftPackageReference "SQLite.swift" */, 111 | 65577AE52CA729EF004CB416 /* XCRemoteSwiftPackageReference "GzipSwift" */, 112 | 6573D0852CA74BA600379E1B /* XCRemoteSwiftPackageReference "swift-protobuf" */, 113 | ); 114 | preferredProjectObjectVersion = 77; 115 | productRefGroup = 65B41FBA2CA65B030035CEBF /* Products */; 116 | projectDirPath = ""; 117 | projectRoot = ""; 118 | targets = ( 119 | 65B41FB82CA65B030035CEBF /* AndroidRestore */, 120 | ); 121 | }; 122 | /* End PBXProject section */ 123 | 124 | /* Begin PBXResourcesBuildPhase section */ 125 | 65B41FB72CA65B030035CEBF /* Resources */ = { 126 | isa = PBXResourcesBuildPhase; 127 | buildActionMask = 2147483647; 128 | files = ( 129 | ); 130 | runOnlyForDeploymentPostprocessing = 0; 131 | }; 132 | /* End PBXResourcesBuildPhase section */ 133 | 134 | /* Begin PBXSourcesBuildPhase section */ 135 | 65B41FB52CA65B030035CEBF /* Sources */ = { 136 | isa = PBXSourcesBuildPhase; 137 | buildActionMask = 2147483647; 138 | files = ( 139 | ); 140 | runOnlyForDeploymentPostprocessing = 0; 141 | }; 142 | /* End PBXSourcesBuildPhase section */ 143 | 144 | /* Begin XCBuildConfiguration section */ 145 | 65B41FC62CA65B050035CEBF /* Debug */ = { 146 | isa = XCBuildConfiguration; 147 | buildSettings = { 148 | ALWAYS_SEARCH_USER_PATHS = NO; 149 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 150 | CLANG_ANALYZER_NONNULL = YES; 151 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 152 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 153 | CLANG_ENABLE_MODULES = YES; 154 | CLANG_ENABLE_OBJC_ARC = YES; 155 | CLANG_ENABLE_OBJC_WEAK = YES; 156 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 157 | CLANG_WARN_BOOL_CONVERSION = YES; 158 | CLANG_WARN_COMMA = YES; 159 | CLANG_WARN_CONSTANT_CONVERSION = YES; 160 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 161 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 162 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 163 | CLANG_WARN_EMPTY_BODY = YES; 164 | CLANG_WARN_ENUM_CONVERSION = YES; 165 | CLANG_WARN_INFINITE_RECURSION = YES; 166 | CLANG_WARN_INT_CONVERSION = YES; 167 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 168 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 169 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 170 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 171 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 172 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 173 | CLANG_WARN_STRICT_PROTOTYPES = YES; 174 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 175 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 176 | CLANG_WARN_UNREACHABLE_CODE = YES; 177 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 178 | COPY_PHASE_STRIP = NO; 179 | DEBUG_INFORMATION_FORMAT = dwarf; 180 | ENABLE_STRICT_OBJC_MSGSEND = YES; 181 | ENABLE_TESTABILITY = YES; 182 | ENABLE_USER_SCRIPT_SANDBOXING = YES; 183 | GCC_C_LANGUAGE_STANDARD = gnu17; 184 | GCC_DYNAMIC_NO_PIC = NO; 185 | GCC_NO_COMMON_BLOCKS = YES; 186 | GCC_OPTIMIZATION_LEVEL = 0; 187 | GCC_PREPROCESSOR_DEFINITIONS = ( 188 | "DEBUG=1", 189 | "$(inherited)", 190 | ); 191 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 192 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 193 | GCC_WARN_UNDECLARED_SELECTOR = YES; 194 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 195 | GCC_WARN_UNUSED_FUNCTION = YES; 196 | GCC_WARN_UNUSED_VARIABLE = YES; 197 | LOCALIZATION_PREFERS_STRING_CATALOGS = YES; 198 | MACOSX_DEPLOYMENT_TARGET = 15.1; 199 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 200 | MTL_FAST_MATH = YES; 201 | ONLY_ACTIVE_ARCH = YES; 202 | SDKROOT = macosx; 203 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; 204 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 205 | }; 206 | name = Debug; 207 | }; 208 | 65B41FC72CA65B050035CEBF /* Release */ = { 209 | isa = XCBuildConfiguration; 210 | buildSettings = { 211 | ALWAYS_SEARCH_USER_PATHS = NO; 212 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 213 | CLANG_ANALYZER_NONNULL = YES; 214 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 215 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 216 | CLANG_ENABLE_MODULES = YES; 217 | CLANG_ENABLE_OBJC_ARC = YES; 218 | CLANG_ENABLE_OBJC_WEAK = YES; 219 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 220 | CLANG_WARN_BOOL_CONVERSION = YES; 221 | CLANG_WARN_COMMA = YES; 222 | CLANG_WARN_CONSTANT_CONVERSION = YES; 223 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 224 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 225 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 226 | CLANG_WARN_EMPTY_BODY = YES; 227 | CLANG_WARN_ENUM_CONVERSION = YES; 228 | CLANG_WARN_INFINITE_RECURSION = YES; 229 | CLANG_WARN_INT_CONVERSION = YES; 230 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 231 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 232 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 233 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 234 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 235 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 236 | CLANG_WARN_STRICT_PROTOTYPES = YES; 237 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 238 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 239 | CLANG_WARN_UNREACHABLE_CODE = YES; 240 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 241 | COPY_PHASE_STRIP = NO; 242 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 243 | ENABLE_NS_ASSERTIONS = NO; 244 | ENABLE_STRICT_OBJC_MSGSEND = YES; 245 | ENABLE_USER_SCRIPT_SANDBOXING = YES; 246 | GCC_C_LANGUAGE_STANDARD = gnu17; 247 | GCC_NO_COMMON_BLOCKS = YES; 248 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 249 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 250 | GCC_WARN_UNDECLARED_SELECTOR = YES; 251 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 252 | GCC_WARN_UNUSED_FUNCTION = YES; 253 | GCC_WARN_UNUSED_VARIABLE = YES; 254 | LOCALIZATION_PREFERS_STRING_CATALOGS = YES; 255 | MACOSX_DEPLOYMENT_TARGET = 15.1; 256 | MTL_ENABLE_DEBUG_INFO = NO; 257 | MTL_FAST_MATH = YES; 258 | SDKROOT = macosx; 259 | SWIFT_COMPILATION_MODE = wholemodule; 260 | }; 261 | name = Release; 262 | }; 263 | 65B41FC92CA65B050035CEBF /* Debug */ = { 264 | isa = XCBuildConfiguration; 265 | buildSettings = { 266 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 267 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 268 | CODE_SIGN_ENTITLEMENTS = AndroidRestore/AndroidRestore.entitlements; 269 | CODE_SIGN_STYLE = Automatic; 270 | COMBINE_HIDPI_IMAGES = YES; 271 | CURRENT_PROJECT_VERSION = 1; 272 | DEVELOPMENT_ASSET_PATHS = "\"AndroidRestore/Preview Content\""; 273 | DEVELOPMENT_TEAM = 6Q625HQD73; 274 | ENABLE_HARDENED_RUNTIME = YES; 275 | ENABLE_PREVIEWS = YES; 276 | GENERATE_INFOPLIST_FILE = YES; 277 | INFOPLIST_KEY_NSHumanReadableCopyright = ""; 278 | LD_RUNPATH_SEARCH_PATHS = ( 279 | "$(inherited)", 280 | "@executable_path/../Frameworks", 281 | ); 282 | MACOSX_DEPLOYMENT_TARGET = 13.0; 283 | MARKETING_VERSION = 1.0; 284 | PRODUCT_BUNDLE_IDENTIFIER = uwu.lrdsnow.AndroidRestore; 285 | PRODUCT_NAME = "$(TARGET_NAME)"; 286 | SWIFT_EMIT_LOC_STRINGS = YES; 287 | SWIFT_VERSION = 5.0; 288 | }; 289 | name = Debug; 290 | }; 291 | 65B41FCA2CA65B050035CEBF /* Release */ = { 292 | isa = XCBuildConfiguration; 293 | buildSettings = { 294 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 295 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 296 | CODE_SIGN_ENTITLEMENTS = AndroidRestore/AndroidRestore.entitlements; 297 | CODE_SIGN_STYLE = Automatic; 298 | COMBINE_HIDPI_IMAGES = YES; 299 | CURRENT_PROJECT_VERSION = 1; 300 | DEVELOPMENT_ASSET_PATHS = "\"AndroidRestore/Preview Content\""; 301 | DEVELOPMENT_TEAM = 6Q625HQD73; 302 | ENABLE_HARDENED_RUNTIME = YES; 303 | ENABLE_PREVIEWS = YES; 304 | GENERATE_INFOPLIST_FILE = YES; 305 | INFOPLIST_KEY_NSHumanReadableCopyright = ""; 306 | LD_RUNPATH_SEARCH_PATHS = ( 307 | "$(inherited)", 308 | "@executable_path/../Frameworks", 309 | ); 310 | MACOSX_DEPLOYMENT_TARGET = 13.0; 311 | MARKETING_VERSION = 1.0; 312 | PRODUCT_BUNDLE_IDENTIFIER = uwu.lrdsnow.AndroidRestore; 313 | PRODUCT_NAME = "$(TARGET_NAME)"; 314 | SWIFT_EMIT_LOC_STRINGS = YES; 315 | SWIFT_VERSION = 5.0; 316 | }; 317 | name = Release; 318 | }; 319 | /* End XCBuildConfiguration section */ 320 | 321 | /* Begin XCConfigurationList section */ 322 | 65B41FB42CA65B030035CEBF /* Build configuration list for PBXProject "AndroidRestore" */ = { 323 | isa = XCConfigurationList; 324 | buildConfigurations = ( 325 | 65B41FC62CA65B050035CEBF /* Debug */, 326 | 65B41FC72CA65B050035CEBF /* Release */, 327 | ); 328 | defaultConfigurationIsVisible = 0; 329 | defaultConfigurationName = Release; 330 | }; 331 | 65B41FC82CA65B050035CEBF /* Build configuration list for PBXNativeTarget "AndroidRestore" */ = { 332 | isa = XCConfigurationList; 333 | buildConfigurations = ( 334 | 65B41FC92CA65B050035CEBF /* Debug */, 335 | 65B41FCA2CA65B050035CEBF /* Release */, 336 | ); 337 | defaultConfigurationIsVisible = 0; 338 | defaultConfigurationName = Release; 339 | }; 340 | /* End XCConfigurationList section */ 341 | 342 | /* Begin XCRemoteSwiftPackageReference section */ 343 | 65577AE52CA729EF004CB416 /* XCRemoteSwiftPackageReference "GzipSwift" */ = { 344 | isa = XCRemoteSwiftPackageReference; 345 | repositoryURL = "https://github.com/1024jp/GzipSwift.git"; 346 | requirement = { 347 | branch = main; 348 | kind = branch; 349 | }; 350 | }; 351 | 6573D0852CA74BA600379E1B /* XCRemoteSwiftPackageReference "swift-protobuf" */ = { 352 | isa = XCRemoteSwiftPackageReference; 353 | repositoryURL = "https://github.com/apple/swift-protobuf.git"; 354 | requirement = { 355 | kind = upToNextMajorVersion; 356 | minimumVersion = 1.28.1; 357 | }; 358 | }; 359 | 65B41FCB2CA661D60035CEBF /* XCRemoteSwiftPackageReference "SQLite.swift" */ = { 360 | isa = XCRemoteSwiftPackageReference; 361 | repositoryURL = "https://github.com/stephencelis/SQLite.swift.git"; 362 | requirement = { 363 | kind = upToNextMajorVersion; 364 | minimumVersion = 0.15.3; 365 | }; 366 | }; 367 | /* End XCRemoteSwiftPackageReference section */ 368 | 369 | /* Begin XCSwiftPackageProductDependency section */ 370 | 65577AE62CA729EF004CB416 /* Gzip */ = { 371 | isa = XCSwiftPackageProductDependency; 372 | package = 65577AE52CA729EF004CB416 /* XCRemoteSwiftPackageReference "GzipSwift" */; 373 | productName = Gzip; 374 | }; 375 | 6573D0862CA74BA600379E1B /* SwiftProtobuf */ = { 376 | isa = XCSwiftPackageProductDependency; 377 | package = 6573D0852CA74BA600379E1B /* XCRemoteSwiftPackageReference "swift-protobuf" */; 378 | productName = SwiftProtobuf; 379 | }; 380 | 65B41FCC2CA661D60035CEBF /* SQLite */ = { 381 | isa = XCSwiftPackageProductDependency; 382 | package = 65B41FCB2CA661D60035CEBF /* XCRemoteSwiftPackageReference "SQLite.swift" */; 383 | productName = SQLite; 384 | }; 385 | /* End XCSwiftPackageProductDependency section */ 386 | }; 387 | rootObject = 65B41FB12CA65B030035CEBF /* Project object */; 388 | } 389 | -------------------------------------------------------------------------------- /AndroidRestore.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AndroidRestore.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "originHash" : "e43e03a4e918152589da75f1983b7e7b49f0612a579dca3169b74f50a2f12416", 3 | "pins" : [ 4 | { 5 | "identity" : "gzipswift", 6 | "kind" : "remoteSourceControl", 7 | "location" : "https://github.com/1024jp/GzipSwift.git", 8 | "state" : { 9 | "branch" : "main", 10 | "revision" : "e0f41175a8b3fa051fccebc89629e6e1dee42026" 11 | } 12 | }, 13 | { 14 | "identity" : "sqlite.swift", 15 | "kind" : "remoteSourceControl", 16 | "location" : "https://github.com/stephencelis/SQLite.swift.git", 17 | "state" : { 18 | "revision" : "a95fc6df17d108bd99210db5e8a9bac90fe984b8", 19 | "version" : "0.15.3" 20 | } 21 | }, 22 | { 23 | "identity" : "swift-protobuf", 24 | "kind" : "remoteSourceControl", 25 | "location" : "https://github.com/apple/swift-protobuf.git", 26 | "state" : { 27 | "revision" : "edb6ed4919f7756157fe02f2552b7e3850a538e5", 28 | "version" : "1.28.1" 29 | } 30 | } 31 | ], 32 | "version" : 3 33 | } 34 | -------------------------------------------------------------------------------- /AndroidRestore.xcodeproj/project.xcworkspace/xcuserdata/lrdsnow.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lrdsnow/AndroidRestore/bd766a31028fbc7aff42dff77e44cccf59277a7f/AndroidRestore.xcodeproj/project.xcworkspace/xcuserdata/lrdsnow.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /AndroidRestore.xcodeproj/xcuserdata/lrdsnow.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /AndroidRestore.xcodeproj/xcuserdata/lrdsnow.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | AndroidRestore.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /AndroidRestore/AndroidRestore.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.files.user-selected.read-only 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /AndroidRestore/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /AndroidRestore/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "scale" : "1x", 6 | "size" : "16x16" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "scale" : "2x", 11 | "size" : "16x16" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "scale" : "1x", 16 | "size" : "32x32" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "scale" : "2x", 21 | "size" : "32x32" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "scale" : "1x", 26 | "size" : "128x128" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "scale" : "2x", 31 | "size" : "128x128" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "scale" : "1x", 36 | "size" : "256x256" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "scale" : "2x", 41 | "size" : "256x256" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "scale" : "1x", 46 | "size" : "512x512" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "scale" : "2x", 51 | "size" : "512x512" 52 | } 53 | ], 54 | "info" : { 55 | "author" : "xcode", 56 | "version" : 1 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /AndroidRestore/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /AndroidRestore/BackupManifest.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BackupManifest.swift 3 | // AndroidRestore 4 | // 5 | // Created by Lrdsnow on 9/26/24. 6 | // 7 | 8 | import SQLite 9 | import Foundation 10 | import Gzip 11 | import SwiftProtobuf 12 | 13 | typealias Expression = SQLite.Expression 14 | 15 | struct BackupFile: Identifiable { 16 | var id = UUID() 17 | var fileID: String 18 | var domain: String 19 | var relativePath: String 20 | var flags: Int64 21 | } 22 | 23 | func loadManifest(backupPath: String, encryptionKey: String? = nil) -> [BackupFile] { 24 | let manifestPath = "\(backupPath)/Manifest.db" 25 | var backupFiles: [BackupFile] = [] 26 | 27 | do { 28 | // Establish a connection to the database 29 | let db = try Connection(manifestPath) 30 | 31 | // Set the encryption key if provided 32 | if let key = encryptionKey { 33 | try db.run("PRAGMA key = '\(key)';") 34 | } 35 | 36 | let filesTable = Table("Files") 37 | 38 | // Define expressions for each column 39 | let fileID = Expression("fileID") 40 | let domain = Expression("domain") 41 | let relativePath = Expression("relativePath") 42 | let flags = Expression("flags") 43 | 44 | // Query the files table 45 | for file in try db.prepare(filesTable) { 46 | let backupFile = BackupFile( 47 | fileID: try file.get(fileID), 48 | domain: try file.get(domain), 49 | relativePath: try file.get(relativePath), 50 | flags: try file.get(flags) 51 | ) 52 | backupFiles.append(backupFile) 53 | } 54 | } catch { 55 | print("Failed to load Manifest.db: \(error)") 56 | } 57 | return backupFiles 58 | } 59 | 60 | struct _Note: Hashable, Identifiable, Codable { 61 | var id: Int 62 | var title: String 63 | var text: String 64 | var snippet: String 65 | var modifyDate: Double 66 | } 67 | 68 | func loadNotes(notesPath: String) -> [_Note] { 69 | var Notes: [_Note] = [] 70 | var NotesByID: [Int:(String, Double, String)] = [:] 71 | 72 | do { 73 | let db = try Connection(notesPath) 74 | 75 | let icloudSyncTable = Table("ZICCLOUDSYNCINGOBJECT") 76 | let noteDataTable = Table("ZICNOTEDATA") 77 | 78 | // icloud sync 79 | let zNoteData = Expression("ZNOTEDATA") 80 | let zTitle = Expression("ZTITLE1") 81 | let zFolderModificationDate = Expression("ZFOLDERMODIFICATIONDATE") 82 | let zSnippet = Expression("ZSNIPPET") 83 | // note data 84 | let zPK = Expression("Z_PK") 85 | let zData = Expression("ZDATA") 86 | 87 | for _note in try db.prepare(icloudSyncTable) { 88 | let title = (try? _note.get(zTitle)) ?? "" 89 | if !title.isEmpty, 90 | let id = try? _note.get(zNoteData), 91 | let modifyDate = try? _note.get(zFolderModificationDate), 92 | let snippet = try? _note.get(zSnippet) { 93 | NotesByID[id] = (title, modifyDate, snippet) 94 | } 95 | } 96 | for _note in try db.prepare(noteDataTable) { 97 | if let id = try? _note.get(zPK), 98 | let title = NotesByID[id]?.0, 99 | let modifyDate = NotesByID[id]?.1, 100 | let snippet = NotesByID[id]?.2, 101 | let data = try? _note.get(zData), 102 | let decompressedData = try? data.gunzipped(), 103 | let text = getNoteText(data: decompressedData) { 104 | Notes.append(_Note(id: id, title: title, text: text, snippet: snippet, modifyDate: modifyDate)) 105 | } 106 | } 107 | } catch { 108 | print("Failed to load Notes: \(error)") 109 | } 110 | 111 | return Notes 112 | } 113 | 114 | func getNoteText(data: Data) -> String? { 115 | do { 116 | let noteStoreProto = try NoteStoreProto(serializedData: data) 117 | let note = noteStoreProto.document.note 118 | return note.noteText 119 | } catch { 120 | print("Failed to decode protobuf: \(error)") 121 | } 122 | return nil 123 | } 124 | 125 | 126 | struct Backup: Identifiable { 127 | var id = UUID() 128 | var applications: [String:PlaceHolderApp] 129 | var deviceName: String 130 | var displayName: String 131 | var buildVersion: String 132 | var productName: String 133 | var productType: String 134 | var productVersion: String 135 | var serialNumber: String 136 | var lastBackupDate: Date? 137 | var infoDict: [String: Any] 138 | var path: String 139 | } 140 | 141 | struct PlaceHolderApp { 142 | var IsDemotedApp: Bool? = nil 143 | var ApplicationSINF: Data? = nil 144 | var PlaceholderIcon: Data 145 | var iTunesMetadata: [String:Any] 146 | var available: String = "notfound" 147 | var potentialBundleID: String? = nil 148 | var confidentAvailable: Bool = false 149 | var checkedAvailablility: Bool = false 150 | } 151 | -------------------------------------------------------------------------------- /AndroidRestore/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // AndroidRestore 4 | // 5 | // Created by Lrdsnow on 9/26/24. 6 | // 7 | 8 | import SwiftUI 9 | import Foundation 10 | import SwiftProtobuf 11 | 12 | struct AppDomainData: Identifiable { 13 | var id: String { get { return bundleID } set {} } 14 | var bundleID: String // app id 15 | var paths: [String] // path 16 | var fileIDs: [String:String] // id:path 17 | } 18 | 19 | struct ImageDomainData: Identifiable { 20 | var id: String { get { return fileID } set {} } 21 | var fileID: String 22 | var fileName: String 23 | } 24 | 25 | struct ManifestView: View { 26 | var backupPath: String 27 | @State private var appData: [AppDomainData] = [] 28 | @State private var documents: AppDomainData? = nil 29 | @State private var images: [ImageDomainData] = [] 30 | @State private var notes: [_Note] = [] 31 | 32 | var body: some View { 33 | VStack { 34 | if !appData.isEmpty || (documents != nil) || !images.isEmpty { 35 | List { 36 | VStack(alignment: .leading) { 37 | Text("Notes") 38 | .font(.headline) 39 | ForEach(notes, id:\.self) { note in 40 | Text("- \(note.title).txt") 41 | } 42 | } 43 | VStack(alignment: .leading) { 44 | Text("Images") 45 | .font(.headline) 46 | ForEach(images) { image in 47 | Text("- \(image.fileName)") 48 | } 49 | } 50 | if let documents = documents { 51 | VStack(alignment: .leading) { 52 | Text("Documents") 53 | .font(.headline) 54 | ForEach(documents.paths, id:\.self) { path in 55 | Text("- \(path)") 56 | } 57 | } 58 | } 59 | ForEach(appData) { file in 60 | VStack(alignment: .leading) { 61 | Text(file.bundleID) 62 | .font(.headline) 63 | ForEach(file.paths, id:\.self) { path in 64 | Text("- \(path)") 65 | } 66 | } 67 | } 68 | } 69 | } else { 70 | ProgressView() 71 | } 72 | } 73 | .navigationTitle("Manifest.db") 74 | .onAppear(perform: { 75 | Task.detached { 76 | let backupFiles = loadBackupFiles(backupPath: backupPath) 77 | DispatchQueue.main.async { 78 | appData = backupFiles.appData 79 | documents = backupFiles.documents 80 | images = backupFiles.images 81 | notes = backupFiles.notes 82 | } 83 | 84 | } 85 | }) 86 | } 87 | } 88 | 89 | func loadBackupFiles(backupPath: String) -> (appData: [AppDomainData], documents: AppDomainData?, images: [ImageDomainData], notes: [_Note]) { 90 | var appData: [AppDomainData] = [] 91 | var documents: AppDomainData? = nil 92 | var images: [ImageDomainData] = [] 93 | var notes: [_Note] = [] 94 | 95 | let backupFiles = loadManifest(backupPath: backupPath) 96 | for file in backupFiles { 97 | if !file.relativePath.isEmpty { 98 | // Apps 99 | if file.domain.contains("AppDomain-") && !file.domain.contains("apple") && file.relativePath.contains("Documents/") { 100 | let bundleID = file.domain.components(separatedBy: "-").last ?? "unknown" 101 | let path = file.relativePath 102 | .replacingFirstOccurrence(of: "Documents/", with: "") 103 | .replacingFirstOccurrence(of: "File Provider Storage/", with: "") 104 | DispatchQueue.main.async { 105 | if let existingDataIndex = appData.firstIndex(where: { $0.bundleID == bundleID }) { 106 | appData[existingDataIndex].fileIDs[file.fileID] = path 107 | appData[existingDataIndex].paths.append(path) 108 | } else { 109 | appData.append(AppDomainData(bundleID: bundleID, paths: [path], fileIDs: [file.fileID:path])) 110 | } 111 | } 112 | } 113 | // Docs 114 | if file.domain.contains("AppDomainGroup-group.com.apple.FileProvider.LocalStorage") && !file.relativePath.contains(".Trash") && (file.relativePath != "File Provider Storage") { 115 | let bundleID = file.domain.components(separatedBy: "-").last ?? "unknown" 116 | let path = file.relativePath 117 | .replacingFirstOccurrence(of: "File Provider Storage/", with: "") 118 | .replacingFirstOccurrence(of: "Downloads/", with: "Download/") 119 | DispatchQueue.main.async { 120 | if documents != nil { 121 | documents!.fileIDs[file.fileID] = path 122 | documents!.paths.append(path) 123 | } else { 124 | documents = AppDomainData(bundleID: bundleID, paths: [path], fileIDs: [file.fileID:path]) 125 | } 126 | } 127 | } 128 | // Images 129 | if file.domain.contains("CameraRollDomain") && file.relativePath.contains("DCIM") && !file.relativePath.contains("Thumbnails") && 130 | ( 131 | file.relativePath.lowercased().contains(".jpg") || 132 | file.relativePath.lowercased().contains(".png") || 133 | file.relativePath.lowercased().contains(".heic") || 134 | file.relativePath.lowercased().contains(".mov") || 135 | file.relativePath.lowercased().contains(".mp4") 136 | ) { 137 | let fileName = file.relativePath.components(separatedBy: "/").last ?? "unknown.png" 138 | DispatchQueue.main.async { 139 | if !images.contains(where: { $0.fileName == fileName }) { 140 | images.append(ImageDomainData(fileID: file.fileID, fileName: fileName)) 141 | } 142 | } 143 | } 144 | // Notes 145 | if file.relativePath.contains("NoteStore.sqlite") { 146 | notes = loadNotes(notesPath: "\(backupPath)/\(file.fileID.prefix(2))/\(file.fileID)") 147 | } 148 | } 149 | } 150 | 151 | return (appData, documents, images, notes) 152 | } 153 | 154 | struct ApplicationsView: View { 155 | @State var apps: [String: PlaceHolderApp] 156 | 157 | var body: some View { 158 | VStack { 159 | // Sort the apps based on availability 160 | let sortedApps = apps.sorted { lhs, rhs in 161 | let leftAvailability = lhs.value.available 162 | let rightAvailability = rhs.value.available 163 | 164 | // Sorting logic based on availability strings 165 | if leftAvailability == "found" && rightAvailability != "found" { 166 | return true // left is found, right is not 167 | } else if leftAvailability != "found" && rightAvailability == "found" { 168 | return false // right is found, left is not 169 | } else if leftAvailability == "unsure" && rightAvailability != "unsure" { 170 | return true // left is unsure, right is something else 171 | } else if leftAvailability != "unsure" && rightAvailability == "unsure" { 172 | return false // right is unsure, left is something else 173 | } else { 174 | return false // Keep original order for other cases 175 | } 176 | } 177 | 178 | if !sortedApps.isEmpty { 179 | List { 180 | ForEach(sortedApps, id: \.key) { (bundleID, app) in 181 | ApplicationsViewRow(bundleID: bundleID, app: app) 182 | } 183 | } 184 | } else { 185 | ProgressView() 186 | } 187 | } 188 | .onAppear { 189 | loadAppAvailability() 190 | } 191 | } 192 | 193 | private func loadAppAvailability() { 194 | let dispatchGroup = DispatchGroup() // Create a DispatchGroup to track completion 195 | 196 | for (bundleID, app) in apps { 197 | dispatchGroup.enter() // Enter the group for each app 198 | 199 | let searchID = bundleID.replacingOccurrences(of: ".ios.", with: "").replacingOccurrences(of: ".ios", with: "") 200 | checkAppAvailability(bundleId: searchID, appName: (app.iTunesMetadata["itemName"] as? String ?? ""), completion: { available, possible_id, confident in 201 | DispatchQueue.main.async { 202 | apps[bundleID]?.available = available // available is a string 203 | apps[bundleID]?.confidentAvailable = confident 204 | apps[bundleID]?.potentialBundleID = possible_id 205 | apps[bundleID]?.checkedAvailablility = true 206 | 207 | dispatchGroup.leave() // Leave the group once the check is complete 208 | } 209 | }) 210 | } 211 | 212 | dispatchGroup.notify(queue: .main) { 213 | print("All apps have been checked for availability.") 214 | var final_dict = "" 215 | for app in apps { 216 | if let potentialBundleID = app.value.potentialBundleID { 217 | final_dict += "\"\(app.key)\":\"\(potentialBundleID)\",\n" 218 | } 219 | } 220 | print(final_dict) 221 | } 222 | } 223 | } 224 | 225 | struct ApplicationsViewRow: View { 226 | var bundleID: String 227 | var app: PlaceHolderApp 228 | 229 | var body: some View { 230 | HStack { 231 | if let uiImage = NSImage(data: app.PlaceholderIcon) { 232 | Image(nsImage: uiImage) 233 | .resizable() 234 | .aspectRatio(contentMode: .fit) 235 | .frame(width: 60, height: 60) 236 | } 237 | VStack(alignment: .leading) { 238 | if let name = app.iTunesMetadata["itemName"] as? String { 239 | Text(name).fontWeight(.bold) 240 | } 241 | Text(bundleID) 242 | switch app.available { 243 | case "found": 244 | Text("Available on Google Play").foregroundColor(.green) 245 | case "unsure": 246 | if app.confidentAvailable { 247 | Text("Potentially Found (Confident): \(app.potentialBundleID ?? "unknown")").foregroundColor(.green) 248 | } else { 249 | Text("Potentially Found?: \(app.potentialBundleID ?? "unknown")").foregroundColor(.orange) 250 | } 251 | default: 252 | Text("Unavailable on Google Play").foregroundColor(.red) 253 | } 254 | } 255 | } 256 | } 257 | } 258 | 259 | func loadBackups() -> [Backup] { 260 | let fileManager = FileManager.default 261 | let backupDirectory = FileManager.default.homeDirectoryForCurrentUser.appendingPathComponent("Library/Application Support/MobileSync/Backup/") 262 | var backups: [Backup] = [] 263 | 264 | do { 265 | let backupFolders = try fileManager.contentsOfDirectory(atPath: backupDirectory.path) 266 | 267 | for folder in backupFolders { 268 | let backupPath = backupDirectory.appendingPathComponent(folder) 269 | let infoPlistPath = backupPath.appendingPathComponent("Info.plist") 270 | if fileManager.fileExists(atPath: infoPlistPath.path), 271 | let data = try? Data(contentsOf: infoPlistPath), 272 | let plist = try? PropertyListSerialization.propertyList(from: data, options: [], format: nil) as? [String: Any] { 273 | 274 | var applications: [String: PlaceHolderApp] = [:] 275 | if let appsDict = plist["Applications"] as? [String: [String: Any]] { 276 | for (appName, appInfo) in appsDict { 277 | let placeholderApp = PlaceHolderApp( 278 | IsDemotedApp: appInfo["IsDemotedApp"] as? Bool, 279 | ApplicationSINF: appInfo["ApplicationSINF"] as? Data, 280 | PlaceholderIcon: appInfo["PlaceholderIcon"] as? Data ?? Data(), 281 | iTunesMetadata: (try? PropertyListSerialization.propertyList(from: appInfo["iTunesMetadata"] as? Data ?? Data(), options: [], format: nil) as? [String:Any]) ?? [:] 282 | ) 283 | applications[appName] = placeholderApp 284 | } 285 | } 286 | 287 | let backup = Backup( 288 | applications: applications, 289 | deviceName: plist["Device Name"] as? String ?? "Unknown", 290 | displayName: plist["Display Name"] as? String ?? "Unknown", 291 | buildVersion: plist["Build Version"] as? String ?? "Unknown", 292 | productName: plist["Product Name"] as? String ?? "Unknown", 293 | productType: plist["Product Type"] as? String ?? "Unknown", 294 | productVersion: plist["Product Version"] as? String ?? "Unknown", 295 | serialNumber: plist["Serial Number"] as? String ?? "Unknown", 296 | lastBackupDate: plist["Last Backup Date"] as? Date, 297 | infoDict: plist, 298 | path: backupPath.path 299 | ) 300 | 301 | backups.append(backup) 302 | } 303 | } 304 | } catch { 305 | print("Error loading backups: \(error.localizedDescription)") 306 | } 307 | 308 | return backups 309 | } 310 | 311 | struct ContentView: View { 312 | @State private var backups: [Backup] = [] 313 | 314 | var body: some View { 315 | NavigationStack { 316 | List(backups) { backup in 317 | NavigationLink(destination: BackupDetailView(backup: backup)) { 318 | VStack(alignment: .leading) { 319 | Text(backup.deviceName) 320 | .font(.headline) 321 | Text(backup.displayName) 322 | .font(.subheadline) 323 | .foregroundColor(.gray) 324 | } 325 | } 326 | } 327 | .navigationTitle("iOS Backups") 328 | .onAppear(perform: { 329 | backups = loadBackups() 330 | }) 331 | } 332 | } 333 | 334 | 335 | } 336 | 337 | struct BackupDetailView: View { 338 | var backup: Backup 339 | 340 | var body: some View { 341 | List { 342 | Section(header: Text("Device Information")) { 343 | Text("Device Name: \(backup.deviceName)") 344 | Text("Display Name: \(backup.displayName)") 345 | Text("Build Version: \(backup.buildVersion)") 346 | Text("Product Name: \(backup.productName)") 347 | Text("Product Type: \(backup.productType)") 348 | Text("Product Version: \(backup.productVersion)") 349 | Text("Serial Number: \(backup.serialNumber)") 350 | if let lastBackupDate = backup.lastBackupDate { 351 | Text("Last Backup Date: \(lastBackupDate.formatted())") 352 | } 353 | } 354 | 355 | NavigationLink(destination: { 356 | ManifestView(backupPath: backup.path) 357 | }, label: { 358 | Text("Manifest") 359 | }) 360 | 361 | NavigationLink(destination: { 362 | ApplicationsView(apps: backup.applications) 363 | }, label: { 364 | Text("Apps") 365 | }) 366 | 367 | Section(header: Text("Full Info")) { 368 | ForEach(backup.infoDict.keys.sorted(), id: \.self) { key in 369 | if let value = backup.infoDict[key] { 370 | Text("\(key): \(String(describing: value))") 371 | } 372 | } 373 | } 374 | } 375 | .navigationTitle(backup.deviceName) 376 | } 377 | } 378 | 379 | @main 380 | struct BackupReaderApp: App { 381 | var body: some Scene { 382 | WindowGroup { 383 | DeviceListView() 384 | //ContentView() 385 | } 386 | } 387 | } 388 | 389 | struct Device: Identifiable { 390 | let id = UUID() 391 | let name: String 392 | let serial: String 393 | } 394 | 395 | class DeviceViewModel: ObservableObject { 396 | @Published var devices: [Device] = [] 397 | private var timer: Timer? 398 | 399 | init() { 400 | startDeviceDetection() 401 | } 402 | 403 | func startDeviceDetection() { 404 | fetchDevices() 405 | timer = Timer.scheduledTimer(withTimeInterval: 1.0, repeats: true) { _ in 406 | self.fetchDevices() 407 | } 408 | } 409 | 410 | func stopDeviceDetection() { 411 | timer?.invalidate() 412 | } 413 | 414 | private func fetchDevices() { 415 | let process = Process() 416 | let pipe = Pipe() 417 | 418 | process.executableURL = URL(fileURLWithPath: "/usr/local/bin/adb") 419 | process.arguments = ["devices", "-l"] 420 | process.standardOutput = pipe 421 | 422 | do { 423 | try process.run() 424 | //process.waitUntilExit() 425 | 426 | let data = pipe.fileHandleForReading.readDataToEndOfFile() 427 | if let outputString = String(data: data, encoding: .utf8) { 428 | parseDevices(from: outputString) 429 | } 430 | } catch { 431 | print("Error: \(error)") 432 | } 433 | } 434 | 435 | private func parseDevices(from output: String) { 436 | let lines = output.split(separator: "\n") 437 | var newDevices: [Device] = [] 438 | 439 | for line in lines { 440 | let components = line.replacingOccurrences(of: " ", with: " ").split(separator: " ") 441 | if components.count >= 3, components[1] == "device" { 442 | let serial = String(components[0]) 443 | let product = String(components[2]).replacingOccurrences(of: "product:", with: "") 444 | let model = String(components[3]).replacingOccurrences(of: "model:", with: "") 445 | let deviceName = fetchDeviceName(for: serial) 446 | let name = deviceName.isEmpty ? "\(model)" : "\(deviceName)" 447 | newDevices.append(Device(name: name, serial: serial)) 448 | } 449 | } 450 | 451 | DispatchQueue.main.async { 452 | self.devices = newDevices 453 | } 454 | } 455 | 456 | private func fetchDeviceName(for serial: String) -> String { 457 | let process = Process() 458 | let pipe = Pipe() 459 | 460 | process.executableURL = URL(fileURLWithPath: "/usr/local/bin/adb") 461 | process.arguments = ["-s", serial, "shell", "settings", "get", "global", "device_name"] 462 | process.standardOutput = pipe 463 | 464 | do { 465 | try process.run() 466 | //process.waitUntilExit() 467 | 468 | let data = pipe.fileHandleForReading.readDataToEndOfFile() 469 | if let outputString = String(data: data, encoding: .utf8) { 470 | return outputString.trimmingCharacters(in: .whitespacesAndNewlines) 471 | } 472 | } catch { 473 | print("Error fetching device name: \(error)") 474 | } 475 | 476 | return "" 477 | } 478 | 479 | deinit { 480 | stopDeviceDetection() 481 | } 482 | } 483 | 484 | struct DeviceListView: View { 485 | @StateObject private var viewModel = DeviceViewModel() 486 | @State private var selectedDevice = "None" 487 | @State private var backups: [Backup] = [] 488 | @State private var selectedBackup = "None" 489 | // restore options 490 | @State private var restoreImages = true 491 | @State private var restoreNotes = true 492 | @State private var restorePureNotes = false 493 | @State private var restoreAppData = true 494 | @State private var restoreApps = false 495 | @State private var restoreUserFiles = true 496 | 497 | var body: some View { 498 | NavigationStack { 499 | VStack(alignment: .center) { 500 | Picker(selection: $selectedDevice, content: { 501 | Text("None").tag("None") 502 | ForEach(viewModel.devices) { device in 503 | Text("\(device.name) (\(device.serial))").tag(device.serial) 504 | } 505 | }, label: { 506 | Text("Target:") 507 | }) 508 | Picker(selection: $selectedBackup, content: { 509 | Text("None").tag("None") 510 | ForEach(backups) { backup in 511 | Text("\(backup.displayName)").tag(backup.displayName) 512 | } 513 | }, label: { 514 | Text("Backup:") 515 | }) 516 | // 517 | Toggle(isOn: $restoreImages, label: { 518 | Text("Restore Images") 519 | }) 520 | Toggle(isOn: $restoreNotes, label: { 521 | Text("Restore Notes") 522 | }) 523 | Toggle(isOn: $restorePureNotes, label: { 524 | Text("Use PureNotes") 525 | }).disabled(!restoreNotes) 526 | Toggle(isOn: $restoreUserFiles, label: { 527 | Text("Restore User Files") 528 | }) 529 | Toggle(isOn: $restoreAppData, label: { 530 | Text("Restore App Data") 531 | }) 532 | Toggle(isOn: $restoreApps, label: { 533 | Text("Restore Apps") 534 | }).disabled(true) 535 | // 536 | Button(action: { 537 | var restoreOptions: [BackupOptions] = [] 538 | if restoreImages { restoreOptions.append(.images) } 539 | if restoreNotes { if restorePureNotes { restoreOptions.append(.pureNotes) } else { restoreOptions.append(.notes) } } 540 | if restoreUserFiles { restoreOptions.append(.documents) } 541 | if restoreAppData { restoreOptions.append(.appData) } 542 | if restoreApps { restoreOptions.append(.apps) } 543 | Task.detached { 544 | await restoreDevice(serial: selectedDevice, backup: backups.first(where: { $0.displayName == selectedBackup })!, backupOptions: restoreOptions) 545 | } 546 | }, label: { 547 | Text("Restore") 548 | }).disabled(selectedBackup == "None" || selectedDevice == "None") 549 | } 550 | .padding() 551 | .navigationTitle("AndroidRestore") 552 | }.onAppear() { 553 | Task.detached { 554 | let backups = loadBackups() 555 | DispatchQueue.main.async { 556 | self.backups = backups 557 | } 558 | } 559 | } 560 | } 561 | } 562 | 563 | func pushToDevice(serial: String, from sourcePath: String, to destinationPath: String) -> String { 564 | let process = Process() 565 | let pipe = Pipe() 566 | 567 | process.executableURL = URL(fileURLWithPath: "/usr/local/bin/adb") 568 | process.arguments = ["-s", serial, "push", sourcePath, destinationPath] 569 | process.standardOutput = pipe 570 | process.standardError = pipe // Capture both stdout and stderr in case of an error 571 | 572 | do { 573 | try process.run() 574 | //process.waitUntilExit() 575 | 576 | let data = pipe.fileHandleForReading.readDataToEndOfFile() 577 | if let outputString = String(data: data, encoding: .utf8) { 578 | return outputString.trimmingCharacters(in: .whitespacesAndNewlines) 579 | } 580 | } catch { 581 | print("Error: \(error)") 582 | return "Error: \(error.localizedDescription)" 583 | } 584 | 585 | return "Unknown error occurred" 586 | } 587 | 588 | func mkdirAndroid(serial: String, dir destinationPath: String) -> String { 589 | let process = Process() 590 | let pipe = Pipe() 591 | 592 | process.executableURL = URL(fileURLWithPath: "/usr/local/bin/adb") 593 | process.arguments = ["-s", serial, "shell", "mkdir", "-p", destinationPath] 594 | process.standardOutput = pipe 595 | process.standardError = pipe // Capture both stdout and stderr in case of an error 596 | 597 | do { 598 | try process.run() 599 | //process.waitUntilExit() 600 | 601 | let data = pipe.fileHandleForReading.readDataToEndOfFile() 602 | if let outputString = String(data: data, encoding: .utf8) { 603 | return outputString.trimmingCharacters(in: .whitespacesAndNewlines) 604 | } 605 | } catch { 606 | print("Error: \(error)") 607 | return "Error: \(error.localizedDescription)" 608 | } 609 | 610 | return "Unknown error occurred" 611 | } 612 | 613 | enum BackupOptions { 614 | case images 615 | case notes 616 | case pureNotes 617 | case appData 618 | case apps 619 | case documents 620 | } 621 | 622 | func restoreDevice(serial: String, backup: Backup, backupOptions: [BackupOptions] = [.images, .notes]) { 623 | print("Getting Backup Files...") 624 | let backupFiles = loadBackupFiles(backupPath: backup.path) 625 | 626 | Task.detached { 627 | if backupOptions.contains(.images) { 628 | print("Restoring Images...") 629 | for image in backupFiles.images { 630 | let fromPath = "\(backup.path)/\(image.fileID.prefix(2))/\(image.fileID)" 631 | let toPath = "/sdcard/Pictures/\(image.fileName)" 632 | let result = pushToDevice(serial: serial, from: fromPath, to: toPath) 633 | print(result) 634 | } 635 | print("Finished Restoring Images!") 636 | } 637 | } 638 | 639 | Task.detached { 640 | if backupOptions.contains(.documents) { 641 | print("Restoring User Files...") 642 | if let docs = backupFiles.documents { 643 | for fileID in docs.fileIDs.keys { 644 | let fromPath = "\(backup.path)/\(fileID.prefix(2))/\(fileID)" 645 | let toPath = "/sdcard/\(docs.fileIDs[fileID] ?? "unknown.bin")" 646 | mkdirAndroid(serial: serial, dir: URL(fileURLWithPath: toPath).deletingLastPathComponent().path) 647 | if FileManager.default.fileExists(atPath: fromPath) { 648 | pushToDevice(serial: serial, from: fromPath, to: toPath) 649 | } 650 | } 651 | } 652 | print("Finished Restoring User Files!") 653 | } 654 | } 655 | 656 | Task.detached { 657 | let pureNotes = backupOptions.contains(.pureNotes) 658 | if backupOptions.contains(.notes) || pureNotes { 659 | print("Restoring Notes...") 660 | if pureNotes { 661 | let encoder = JSONEncoder() 662 | encoder.outputFormatting = .prettyPrinted 663 | if let data = try? encoder.encode(backupFiles.notes) { 664 | let fromPath = FileManager.default.temporaryDirectory.appendingPathComponent("PureNotes.json") 665 | let toPath = "/sdcard/Documents/PureNotes.json" 666 | do { 667 | try data.write(to: fromPath) 668 | pushToDevice(serial: serial, from: fromPath.path, to: toPath) 669 | } catch {} 670 | } 671 | } else { 672 | mkdirAndroid(serial: serial, dir: "/sdcard/Notes") 673 | for note in backupFiles.notes { 674 | let fromPath = FileManager.default.temporaryDirectory.appendingPathComponent("\(UUID()).txt") 675 | let toPath = "/sdcard/Notes/\("\(note.title.components(separatedBy: CharacterSet(charactersIn: "\\/\"!.?#%^&*()@$|<>:;'[]{}")).joined()).txt")" 676 | do { 677 | try note.text.write(to: fromPath, atomically: true, encoding: .utf8) 678 | pushToDevice(serial: serial, from: fromPath.path, to: toPath) 679 | } catch {} 680 | } 681 | } 682 | print("Finished Restoring Notes!") 683 | } 684 | } 685 | 686 | Task.detached { 687 | if backupOptions.contains(.appData) { 688 | print("Restoring App Data...") 689 | for appData in backupFiles.appData { 690 | if let bundleID = randomAppBundleIDs[appData.bundleID] { 691 | print("Restoring App Data for \(bundleID) (\(appData.bundleID))...") 692 | let baseToPath = "/sdcard/Android/data/\(bundleID)/files" 693 | mkdirAndroid(serial: serial, dir: baseToPath) 694 | for fileID in appData.fileIDs.keys { 695 | let fromPath = "\(backup.path)/\(fileID.prefix(2))/\(fileID)" 696 | let toPath = "\(baseToPath)/\(appData.fileIDs[fileID] ?? "unknown.bin")" 697 | mkdirAndroid(serial: serial, dir: URL(fileURLWithPath: toPath).deletingLastPathComponent().path) 698 | if FileManager.default.fileExists(atPath: fromPath) { 699 | pushToDevice(serial: serial, from: fromPath, to: toPath) 700 | } 701 | } 702 | } 703 | } 704 | } 705 | } 706 | } 707 | -------------------------------------------------------------------------------- /AndroidRestore/GooglePlay.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GooglePlay.swift 3 | // AndroidRestore 4 | // 5 | // Created by Lrdsnow on 9/26/24. 6 | // 7 | 8 | import SwiftUI 9 | 10 | func checkAppAvailability(bundleId: String, appName: String, completion: @escaping (String, String?, Bool) -> Void) { 11 | if let id = randomAppBundleIDs[bundleId] { 12 | completion("found", nil, true) 13 | return 14 | } 15 | 16 | // Construct the initial URL with the inputted bundle ID 17 | guard let initialURL = URL(string: "https://play.google.com/store/apps/details?id=\(bundleId)") else { 18 | completion("notfound", nil, false) 19 | return 20 | } 21 | 22 | // Create a URL request for a HEAD request 23 | var request = URLRequest(url: initialURL) 24 | request.httpMethod = "HEAD" 25 | 26 | // Send the initial request 27 | let task = URLSession.shared.dataTask(with: request) { _, response, error in 28 | // Check for errors 29 | if let error = error { 30 | print("Error: \(error.localizedDescription)") 31 | completion("notfound", nil, false) 32 | return 33 | } 34 | 35 | // Check the response status code 36 | if let httpResponse = response as? HTTPURLResponse { 37 | switch httpResponse.statusCode { 38 | case 200: 39 | completion("found", nil, true) // App is found 40 | default: 41 | // If status is anything other than 404, search for the app name 42 | searchForApp(name: appName, bundleID: bundleId) { result, foundBundleId, confident in 43 | completion(result, foundBundleId, confident) 44 | } 45 | } 46 | } else { 47 | completion("notfound", nil, false) 48 | } 49 | } 50 | 51 | task.resume() 52 | } 53 | 54 | func searchForApp(name: String, bundleID: String, completion: @escaping (String, String?, Bool) -> Void) { 55 | // Construct the search URL 56 | guard let searchURL = URL(string: "https://play.google.com/store/search?q=\(name.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!)") else { 57 | completion("notfound", nil, false) 58 | return 59 | } 60 | 61 | // Send a GET request to search for the app 62 | let task = URLSession.shared.dataTask(with: searchURL) { data, response, error in 63 | if let error = error { 64 | print("Error: \(error.localizedDescription)") 65 | completion("notfound", nil, false) 66 | return 67 | } 68 | 69 | guard let data = data else { 70 | completion("notfound", nil, false) 71 | return 72 | } 73 | 74 | // Parse the HTML response to find the first occurrence of the app's URL 75 | if let htmlString = String(data: data, encoding: .utf8) { 76 | // Use a regular expression to find the first occurrence of /store/apps/details?id= 77 | let pattern = "/store/apps/details\\?id=([\\w\\d.]+)" 78 | let regex = try? NSRegularExpression(pattern: pattern, options: []) 79 | let matches = regex?.matches(in: htmlString, options: [], range: NSRange(location: 0, length: htmlString.utf16.count)) 80 | 81 | if let match = matches?.first, let range = Range(match.range(at: 1), in: htmlString) { 82 | let foundBundleId = String(htmlString[range]) 83 | let confident = foundBundleId.contains(bundleID) 84 | completion("unsure", foundBundleId, confident) // App found but unsure if it's the correct one 85 | return 86 | } 87 | } 88 | 89 | completion("notfound", nil, false) // App not found 90 | } 91 | 92 | task.resume() 93 | } 94 | 95 | var randomAppBundleIDs: [String: String] = [ 96 | "com.amazon.Amazon": "com.amazon.mShop.android.shopping", 97 | "com.facebook.Facebook": "com.facebook.katana", 98 | "com.twitter.twitter": "com.twitter.android", 99 | "com.instagram": "com.instagram.android", 100 | "com.spotify.client": "com.spotify.music", 101 | "com.google.Maps": "com.google.android.apps.maps", 102 | "com.netflix.Netflix": "com.netflix.mediaclient", 103 | "com.snapchat.Snapchat": "com.snapchat.android", 104 | "com.youtube": "com.google.android.youtube", 105 | "org.telegram.telegram": "org.telegram.messenger", 106 | "com.slack.Slack": "com.Slack", 107 | "com.adobe.Adobe-Reader": "com.adobe.reader", 108 | "pinterest": "com.pinterest.android", 109 | "com.linkedin.LinkedIn": "com.linkedin.android", 110 | "com.ebay.iphone": "com.ebay.mobile", 111 | "com.spotify.Remote": "com.spotify.music", 112 | "com.dropbox.Dropbox": "com.getdropbox.android", 113 | "com.soundcloud.SoundCloud": "com.soundcloud.android", 114 | "com.pandora": "com.pandora.android", 115 | "com.yelp.yelp": "com.yelp.android", 116 | "com.foursquare.Foursquare": "com.foursquare.foursquareapp", 117 | "com.canva.canvaeditor":"com.canva.editor", 118 | "com.github.stormbreaker.prod":"com.github.android", 119 | "com.google.GoogleMobile":"com.google.android.googlequicksearchbox", 120 | "com.shazam.Shazam":"com.shazam.android", 121 | "org.ppsspp.ppsspp-free":"org.ppsspp.ppsspp", 122 | "com.google.GVDialer":"com.google.android.apps.googlevoice", 123 | "com.dcdwebdesign.saturn":"com.joinsaturn.android1", 124 | "com.microsoft.Office.Outlook":"com.microsoft.office.outlook", 125 | "net.techet.netanalyzerlite":"net.techet.netanalyzerlite.an", 126 | "com.asus.asusrouter":"com.asus.aihome", 127 | "com.authy":"com.authy.authy", 128 | "ch.protonmail.vpn":"ch.protonvpn.android", 129 | "com.openai.chat":"com.openai.chatgpt", 130 | "com.google.Drive":"com.google.android.apps.docs", 131 | "com.google.Gmail":"com.google.android.gm", 132 | "com.amazon.aiv.AIVApp":"com.amazon.avod.thirdpartyclient", 133 | "com.google.Docs":"com.google.android.apps.docs.editors.docs", 134 | "com.google.youtube":"com.google.android.youtube", 135 | "com.atebits.Tweetie2":"com.twitter.android", 136 | "com.utmapp.UTM-SE":"com.google.android.apps.maps", 137 | "com.cloudflare.1dot1dot1dot1":"com.cloudflare.onedotonedotonedotone", 138 | "com.crystalnix.ServerAuditor":"com.server.auditor.ssh.client", 139 | "com.supercell.soil":"com.supercell.hayday", 140 | "com.burbn.instagram":"com.instagram.android", 141 | "com.nanoleaf.nanoleaf":"me.nanoleaf.nanoleaf", 142 | "com.wireguard":"com.wireguard.android", 143 | "com.amazon.echo":"com.amazon.dee.app", 144 | "com.google.photos":"com.google.android.apps.photos", 145 | "com.edupoint.StudentVUE":"com.FreeLance.StudentVUE", 146 | "com.toyopagroup.picaboo":"com.snapchat.android", 147 | "com.reddit.Reddit":"com.reddit.frontpage", 148 | "com.valvesoftware.Steam":"com.valvesoftware.android.steam.community", 149 | "com.google.youtubemusic":"com.google.android.apps.youtube.music", 150 | ] 151 | -------------------------------------------------------------------------------- /AndroidRestore/MiscExtensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MiscExtensions.swift 3 | // AndroidRestore 4 | // 5 | // Created by Lrdsnow on 9/26/24. 6 | // 7 | 8 | import SwiftUI 9 | 10 | extension String { 11 | func replacingFirstOccurrence(of target: String, with replacement: String) -> String { 12 | var newString = self 13 | if let range = newString.range(of: target) { 14 | newString.replaceSubrange(range, with: replacement) 15 | } 16 | return newString 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /AndroidRestore/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /AndroidRestore/notestore.pb.swift: -------------------------------------------------------------------------------- 1 | // DO NOT EDIT. 2 | // swift-format-ignore-file 3 | // 4 | // Generated by the Swift generator plugin for the protocol buffer compiler. 5 | // Source: notestore.proto 6 | // 7 | // For information on using the generated types, please see the documentation: 8 | // https://github.com/apple/swift-protobuf/ 9 | 10 | import Foundation 11 | import SwiftProtobuf 12 | 13 | // If the compiler emits an error on this type, it is because this file 14 | // was generated by a version of the `protoc` Swift plug-in that is 15 | // incompatible with the version of SwiftProtobuf to which you are linking. 16 | // Please ensure that you are building against the same version of the API 17 | // that was used to generate this file. 18 | fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { 19 | struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} 20 | typealias Version = _2 21 | } 22 | 23 | ///Represents a color 24 | struct ProtoColor: Sendable { 25 | // SwiftProtobuf.Message conformance is added in an extension below. See the 26 | // `Message` and `Message+*Additions` files in the SwiftProtobuf library for 27 | // methods supported on all messages. 28 | 29 | var red: Float { 30 | get {return _red ?? 0} 31 | set {_red = newValue} 32 | } 33 | /// Returns true if `red` has been explicitly set. 34 | var hasRed: Bool {return self._red != nil} 35 | /// Clears the value of `red`. Subsequent reads from it will return its default value. 36 | mutating func clearRed() {self._red = nil} 37 | 38 | var green: Float { 39 | get {return _green ?? 0} 40 | set {_green = newValue} 41 | } 42 | /// Returns true if `green` has been explicitly set. 43 | var hasGreen: Bool {return self._green != nil} 44 | /// Clears the value of `green`. Subsequent reads from it will return its default value. 45 | mutating func clearGreen() {self._green = nil} 46 | 47 | var blue: Float { 48 | get {return _blue ?? 0} 49 | set {_blue = newValue} 50 | } 51 | /// Returns true if `blue` has been explicitly set. 52 | var hasBlue: Bool {return self._blue != nil} 53 | /// Clears the value of `blue`. Subsequent reads from it will return its default value. 54 | mutating func clearBlue() {self._blue = nil} 55 | 56 | var alpha: Float { 57 | get {return _alpha ?? 0} 58 | set {_alpha = newValue} 59 | } 60 | /// Returns true if `alpha` has been explicitly set. 61 | var hasAlpha: Bool {return self._alpha != nil} 62 | /// Clears the value of `alpha`. Subsequent reads from it will return its default value. 63 | mutating func clearAlpha() {self._alpha = nil} 64 | 65 | var unknownFields = SwiftProtobuf.UnknownStorage() 66 | 67 | init() {} 68 | 69 | fileprivate var _red: Float? = nil 70 | fileprivate var _green: Float? = nil 71 | fileprivate var _blue: Float? = nil 72 | fileprivate var _alpha: Float? = nil 73 | } 74 | 75 | /// Represents an attachment (embedded object) 76 | struct AttachmentInfo: Sendable { 77 | // SwiftProtobuf.Message conformance is added in an extension below. See the 78 | // `Message` and `Message+*Additions` files in the SwiftProtobuf library for 79 | // methods supported on all messages. 80 | 81 | var attachmentIdentifier: String { 82 | get {return _attachmentIdentifier ?? String()} 83 | set {_attachmentIdentifier = newValue} 84 | } 85 | /// Returns true if `attachmentIdentifier` has been explicitly set. 86 | var hasAttachmentIdentifier: Bool {return self._attachmentIdentifier != nil} 87 | /// Clears the value of `attachmentIdentifier`. Subsequent reads from it will return its default value. 88 | mutating func clearAttachmentIdentifier() {self._attachmentIdentifier = nil} 89 | 90 | var typeUti: String { 91 | get {return _typeUti ?? String()} 92 | set {_typeUti = newValue} 93 | } 94 | /// Returns true if `typeUti` has been explicitly set. 95 | var hasTypeUti: Bool {return self._typeUti != nil} 96 | /// Clears the value of `typeUti`. Subsequent reads from it will return its default value. 97 | mutating func clearTypeUti() {self._typeUti = nil} 98 | 99 | var unknownFields = SwiftProtobuf.UnknownStorage() 100 | 101 | init() {} 102 | 103 | fileprivate var _attachmentIdentifier: String? = nil 104 | fileprivate var _typeUti: String? = nil 105 | } 106 | 107 | /// Represents a font 108 | struct ProtoFont: Sendable { 109 | // SwiftProtobuf.Message conformance is added in an extension below. See the 110 | // `Message` and `Message+*Additions` files in the SwiftProtobuf library for 111 | // methods supported on all messages. 112 | 113 | var fontName: String { 114 | get {return _fontName ?? String()} 115 | set {_fontName = newValue} 116 | } 117 | /// Returns true if `fontName` has been explicitly set. 118 | var hasFontName: Bool {return self._fontName != nil} 119 | /// Clears the value of `fontName`. Subsequent reads from it will return its default value. 120 | mutating func clearFontName() {self._fontName = nil} 121 | 122 | var pointSize: Float { 123 | get {return _pointSize ?? 0} 124 | set {_pointSize = newValue} 125 | } 126 | /// Returns true if `pointSize` has been explicitly set. 127 | var hasPointSize: Bool {return self._pointSize != nil} 128 | /// Clears the value of `pointSize`. Subsequent reads from it will return its default value. 129 | mutating func clearPointSize() {self._pointSize = nil} 130 | 131 | var fontHints: Int32 { 132 | get {return _fontHints ?? 0} 133 | set {_fontHints = newValue} 134 | } 135 | /// Returns true if `fontHints` has been explicitly set. 136 | var hasFontHints: Bool {return self._fontHints != nil} 137 | /// Clears the value of `fontHints`. Subsequent reads from it will return its default value. 138 | mutating func clearFontHints() {self._fontHints = nil} 139 | 140 | var unknownFields = SwiftProtobuf.UnknownStorage() 141 | 142 | init() {} 143 | 144 | fileprivate var _fontName: String? = nil 145 | fileprivate var _pointSize: Float? = nil 146 | fileprivate var _fontHints: Int32? = nil 147 | } 148 | 149 | /// Styles a "Paragraph" (any run of characters in an AttributeRun) 150 | struct ProtoParagraphStyle: Sendable { 151 | // SwiftProtobuf.Message conformance is added in an extension below. See the 152 | // `Message` and `Message+*Additions` files in the SwiftProtobuf library for 153 | // methods supported on all messages. 154 | 155 | var styleType: Int32 { 156 | get {return _styleType ?? -1} 157 | set {_styleType = newValue} 158 | } 159 | /// Returns true if `styleType` has been explicitly set. 160 | var hasStyleType: Bool {return self._styleType != nil} 161 | /// Clears the value of `styleType`. Subsequent reads from it will return its default value. 162 | mutating func clearStyleType() {self._styleType = nil} 163 | 164 | var alignment: Int32 { 165 | get {return _alignment ?? 0} 166 | set {_alignment = newValue} 167 | } 168 | /// Returns true if `alignment` has been explicitly set. 169 | var hasAlignment: Bool {return self._alignment != nil} 170 | /// Clears the value of `alignment`. Subsequent reads from it will return its default value. 171 | mutating func clearAlignment() {self._alignment = nil} 172 | 173 | var indentAmount: Int32 { 174 | get {return _indentAmount ?? 0} 175 | set {_indentAmount = newValue} 176 | } 177 | /// Returns true if `indentAmount` has been explicitly set. 178 | var hasIndentAmount: Bool {return self._indentAmount != nil} 179 | /// Clears the value of `indentAmount`. Subsequent reads from it will return its default value. 180 | mutating func clearIndentAmount() {self._indentAmount = nil} 181 | 182 | var checklist: ProtoChecklist { 183 | get {return _checklist ?? ProtoChecklist()} 184 | set {_checklist = newValue} 185 | } 186 | /// Returns true if `checklist` has been explicitly set. 187 | var hasChecklist: Bool {return self._checklist != nil} 188 | /// Clears the value of `checklist`. Subsequent reads from it will return its default value. 189 | mutating func clearChecklist() {self._checklist = nil} 190 | 191 | var blockQuote: Int32 { 192 | get {return _blockQuote ?? 0} 193 | set {_blockQuote = newValue} 194 | } 195 | /// Returns true if `blockQuote` has been explicitly set. 196 | var hasBlockQuote: Bool {return self._blockQuote != nil} 197 | /// Clears the value of `blockQuote`. Subsequent reads from it will return its default value. 198 | mutating func clearBlockQuote() {self._blockQuote = nil} 199 | 200 | var unknownFields = SwiftProtobuf.UnknownStorage() 201 | 202 | init() {} 203 | 204 | fileprivate var _styleType: Int32? = nil 205 | fileprivate var _alignment: Int32? = nil 206 | fileprivate var _indentAmount: Int32? = nil 207 | fileprivate var _checklist: ProtoChecklist? = nil 208 | fileprivate var _blockQuote: Int32? = nil 209 | } 210 | 211 | /// Represents a checklist item 212 | struct ProtoChecklist: @unchecked Sendable { 213 | // SwiftProtobuf.Message conformance is added in an extension below. See the 214 | // `Message` and `Message+*Additions` files in the SwiftProtobuf library for 215 | // methods supported on all messages. 216 | 217 | var uuid: Data { 218 | get {return _uuid ?? Data()} 219 | set {_uuid = newValue} 220 | } 221 | /// Returns true if `uuid` has been explicitly set. 222 | var hasUuid: Bool {return self._uuid != nil} 223 | /// Clears the value of `uuid`. Subsequent reads from it will return its default value. 224 | mutating func clearUuid() {self._uuid = nil} 225 | 226 | var done: Int32 { 227 | get {return _done ?? 0} 228 | set {_done = newValue} 229 | } 230 | /// Returns true if `done` has been explicitly set. 231 | var hasDone: Bool {return self._done != nil} 232 | /// Clears the value of `done`. Subsequent reads from it will return its default value. 233 | mutating func clearDone() {self._done = nil} 234 | 235 | var unknownFields = SwiftProtobuf.UnknownStorage() 236 | 237 | init() {} 238 | 239 | fileprivate var _uuid: Data? = nil 240 | fileprivate var _done: Int32? = nil 241 | } 242 | 243 | /// Represents an object that has pointers to a key and a value, asserting 244 | /// somehow that the key object has to do with the value object. 245 | struct ProtoDictionaryElement: Sendable { 246 | // SwiftProtobuf.Message conformance is added in an extension below. See the 247 | // `Message` and `Message+*Additions` files in the SwiftProtobuf library for 248 | // methods supported on all messages. 249 | 250 | var key: ObjectID { 251 | get {return _key ?? ObjectID()} 252 | set {_key = newValue} 253 | } 254 | /// Returns true if `key` has been explicitly set. 255 | var hasKey: Bool {return self._key != nil} 256 | /// Clears the value of `key`. Subsequent reads from it will return its default value. 257 | mutating func clearKey() {self._key = nil} 258 | 259 | var value: ObjectID { 260 | get {return _value ?? ObjectID()} 261 | set {_value = newValue} 262 | } 263 | /// Returns true if `value` has been explicitly set. 264 | var hasValue: Bool {return self._value != nil} 265 | /// Clears the value of `value`. Subsequent reads from it will return its default value. 266 | mutating func clearValue() {self._value = nil} 267 | 268 | var unknownFields = SwiftProtobuf.UnknownStorage() 269 | 270 | init() {} 271 | 272 | fileprivate var _key: ObjectID? = nil 273 | fileprivate var _value: ObjectID? = nil 274 | } 275 | 276 | /// A Dictionary holds many ProtoDictionaryElements 277 | struct ProtoDictionary: Sendable { 278 | // SwiftProtobuf.Message conformance is added in an extension below. See the 279 | // `Message` and `Message+*Additions` files in the SwiftProtobuf library for 280 | // methods supported on all messages. 281 | 282 | var element: [ProtoDictionaryElement] = [] 283 | 284 | var unknownFields = SwiftProtobuf.UnknownStorage() 285 | 286 | init() {} 287 | } 288 | 289 | /// ObjectIDs are used to identify objects within the protobuf, offsets in an arry, or 290 | /// a simple String. 291 | struct ObjectID: Sendable { 292 | // SwiftProtobuf.Message conformance is added in an extension below. See the 293 | // `Message` and `Message+*Additions` files in the SwiftProtobuf library for 294 | // methods supported on all messages. 295 | 296 | var unsignedIntegerValue: UInt64 { 297 | get {return _unsignedIntegerValue ?? 0} 298 | set {_unsignedIntegerValue = newValue} 299 | } 300 | /// Returns true if `unsignedIntegerValue` has been explicitly set. 301 | var hasUnsignedIntegerValue: Bool {return self._unsignedIntegerValue != nil} 302 | /// Clears the value of `unsignedIntegerValue`. Subsequent reads from it will return its default value. 303 | mutating func clearUnsignedIntegerValue() {self._unsignedIntegerValue = nil} 304 | 305 | var stringValue: String { 306 | get {return _stringValue ?? String()} 307 | set {_stringValue = newValue} 308 | } 309 | /// Returns true if `stringValue` has been explicitly set. 310 | var hasStringValue: Bool {return self._stringValue != nil} 311 | /// Clears the value of `stringValue`. Subsequent reads from it will return its default value. 312 | mutating func clearStringValue() {self._stringValue = nil} 313 | 314 | var objectIndex: Int32 { 315 | get {return _objectIndex ?? 0} 316 | set {_objectIndex = newValue} 317 | } 318 | /// Returns true if `objectIndex` has been explicitly set. 319 | var hasObjectIndex: Bool {return self._objectIndex != nil} 320 | /// Clears the value of `objectIndex`. Subsequent reads from it will return its default value. 321 | mutating func clearObjectIndex() {self._objectIndex = nil} 322 | 323 | var unknownFields = SwiftProtobuf.UnknownStorage() 324 | 325 | init() {} 326 | 327 | fileprivate var _unsignedIntegerValue: UInt64? = nil 328 | fileprivate var _stringValue: String? = nil 329 | fileprivate var _objectIndex: Int32? = nil 330 | } 331 | 332 | /// Register Latest is used to identify the most recent version 333 | struct RegisterLatest: Sendable { 334 | // SwiftProtobuf.Message conformance is added in an extension below. See the 335 | // `Message` and `Message+*Additions` files in the SwiftProtobuf library for 336 | // methods supported on all messages. 337 | 338 | var contents: ObjectID { 339 | get {return _contents ?? ObjectID()} 340 | set {_contents = newValue} 341 | } 342 | /// Returns true if `contents` has been explicitly set. 343 | var hasContents: Bool {return self._contents != nil} 344 | /// Clears the value of `contents`. Subsequent reads from it will return its default value. 345 | mutating func clearContents() {self._contents = nil} 346 | 347 | var unknownFields = SwiftProtobuf.UnknownStorage() 348 | 349 | init() {} 350 | 351 | fileprivate var _contents: ObjectID? = nil 352 | } 353 | 354 | /// MapEntries have a key that maps to an array of key items and a value that points to an object. 355 | struct MapEntry: Sendable { 356 | // SwiftProtobuf.Message conformance is added in an extension below. See the 357 | // `Message` and `Message+*Additions` files in the SwiftProtobuf library for 358 | // methods supported on all messages. 359 | 360 | var key: Int32 { 361 | get {return _key ?? 0} 362 | set {_key = newValue} 363 | } 364 | /// Returns true if `key` has been explicitly set. 365 | var hasKey: Bool {return self._key != nil} 366 | /// Clears the value of `key`. Subsequent reads from it will return its default value. 367 | mutating func clearKey() {self._key = nil} 368 | 369 | var value: ObjectID { 370 | get {return _value ?? ObjectID()} 371 | set {_value = newValue} 372 | } 373 | /// Returns true if `value` has been explicitly set. 374 | var hasValue: Bool {return self._value != nil} 375 | /// Clears the value of `value`. Subsequent reads from it will return its default value. 376 | mutating func clearValue() {self._value = nil} 377 | 378 | var unknownFields = SwiftProtobuf.UnknownStorage() 379 | 380 | init() {} 381 | 382 | fileprivate var _key: Int32? = nil 383 | fileprivate var _value: ObjectID? = nil 384 | } 385 | 386 | /// Represents a "run" of characters that need to be styled/displayed/etc 387 | struct AttributeRun: @unchecked Sendable { 388 | // SwiftProtobuf.Message conformance is added in an extension below. See the 389 | // `Message` and `Message+*Additions` files in the SwiftProtobuf library for 390 | // methods supported on all messages. 391 | 392 | var length: Int32 { 393 | get {return _storage._length ?? 0} 394 | set {_uniqueStorage()._length = newValue} 395 | } 396 | /// Returns true if `length` has been explicitly set. 397 | var hasLength: Bool {return _storage._length != nil} 398 | /// Clears the value of `length`. Subsequent reads from it will return its default value. 399 | mutating func clearLength() {_uniqueStorage()._length = nil} 400 | 401 | var paragraphStyle: ProtoParagraphStyle { 402 | get {return _storage._paragraphStyle ?? ProtoParagraphStyle()} 403 | set {_uniqueStorage()._paragraphStyle = newValue} 404 | } 405 | /// Returns true if `paragraphStyle` has been explicitly set. 406 | var hasParagraphStyle: Bool {return _storage._paragraphStyle != nil} 407 | /// Clears the value of `paragraphStyle`. Subsequent reads from it will return its default value. 408 | mutating func clearParagraphStyle() {_uniqueStorage()._paragraphStyle = nil} 409 | 410 | var font: ProtoFont { 411 | get {return _storage._font ?? ProtoFont()} 412 | set {_uniqueStorage()._font = newValue} 413 | } 414 | /// Returns true if `font` has been explicitly set. 415 | var hasFont: Bool {return _storage._font != nil} 416 | /// Clears the value of `font`. Subsequent reads from it will return its default value. 417 | mutating func clearFont() {_uniqueStorage()._font = nil} 418 | 419 | var fontWeight: Int32 { 420 | get {return _storage._fontWeight ?? 0} 421 | set {_uniqueStorage()._fontWeight = newValue} 422 | } 423 | /// Returns true if `fontWeight` has been explicitly set. 424 | var hasFontWeight: Bool {return _storage._fontWeight != nil} 425 | /// Clears the value of `fontWeight`. Subsequent reads from it will return its default value. 426 | mutating func clearFontWeight() {_uniqueStorage()._fontWeight = nil} 427 | 428 | var underlined: Int32 { 429 | get {return _storage._underlined ?? 0} 430 | set {_uniqueStorage()._underlined = newValue} 431 | } 432 | /// Returns true if `underlined` has been explicitly set. 433 | var hasUnderlined: Bool {return _storage._underlined != nil} 434 | /// Clears the value of `underlined`. Subsequent reads from it will return its default value. 435 | mutating func clearUnderlined() {_uniqueStorage()._underlined = nil} 436 | 437 | var strikethrough: Int32 { 438 | get {return _storage._strikethrough ?? 0} 439 | set {_uniqueStorage()._strikethrough = newValue} 440 | } 441 | /// Returns true if `strikethrough` has been explicitly set. 442 | var hasStrikethrough: Bool {return _storage._strikethrough != nil} 443 | /// Clears the value of `strikethrough`. Subsequent reads from it will return its default value. 444 | mutating func clearStrikethrough() {_uniqueStorage()._strikethrough = nil} 445 | 446 | ///Sign indicates super/sub 447 | var superscript: Int32 { 448 | get {return _storage._superscript ?? 0} 449 | set {_uniqueStorage()._superscript = newValue} 450 | } 451 | /// Returns true if `superscript` has been explicitly set. 452 | var hasSuperscript: Bool {return _storage._superscript != nil} 453 | /// Clears the value of `superscript`. Subsequent reads from it will return its default value. 454 | mutating func clearSuperscript() {_uniqueStorage()._superscript = nil} 455 | 456 | var link: String { 457 | get {return _storage._link ?? String()} 458 | set {_uniqueStorage()._link = newValue} 459 | } 460 | /// Returns true if `link` has been explicitly set. 461 | var hasLink: Bool {return _storage._link != nil} 462 | /// Clears the value of `link`. Subsequent reads from it will return its default value. 463 | mutating func clearLink() {_uniqueStorage()._link = nil} 464 | 465 | var color: ProtoColor { 466 | get {return _storage._color ?? ProtoColor()} 467 | set {_uniqueStorage()._color = newValue} 468 | } 469 | /// Returns true if `color` has been explicitly set. 470 | var hasColor: Bool {return _storage._color != nil} 471 | /// Clears the value of `color`. Subsequent reads from it will return its default value. 472 | mutating func clearColor() {_uniqueStorage()._color = nil} 473 | 474 | var attachmentInfo: AttachmentInfo { 475 | get {return _storage._attachmentInfo ?? AttachmentInfo()} 476 | set {_uniqueStorage()._attachmentInfo = newValue} 477 | } 478 | /// Returns true if `attachmentInfo` has been explicitly set. 479 | var hasAttachmentInfo: Bool {return _storage._attachmentInfo != nil} 480 | /// Clears the value of `attachmentInfo`. Subsequent reads from it will return its default value. 481 | mutating func clearAttachmentInfo() {_uniqueStorage()._attachmentInfo = nil} 482 | 483 | var unknownIdentifier: Int32 { 484 | get {return _storage._unknownIdentifier ?? 0} 485 | set {_uniqueStorage()._unknownIdentifier = newValue} 486 | } 487 | /// Returns true if `unknownIdentifier` has been explicitly set. 488 | var hasUnknownIdentifier: Bool {return _storage._unknownIdentifier != nil} 489 | /// Clears the value of `unknownIdentifier`. Subsequent reads from it will return its default value. 490 | mutating func clearUnknownIdentifier() {_uniqueStorage()._unknownIdentifier = nil} 491 | 492 | var emphasisStyle: Int32 { 493 | get {return _storage._emphasisStyle ?? 0} 494 | set {_uniqueStorage()._emphasisStyle = newValue} 495 | } 496 | /// Returns true if `emphasisStyle` has been explicitly set. 497 | var hasEmphasisStyle: Bool {return _storage._emphasisStyle != nil} 498 | /// Clears the value of `emphasisStyle`. Subsequent reads from it will return its default value. 499 | mutating func clearEmphasisStyle() {_uniqueStorage()._emphasisStyle = nil} 500 | 501 | var unknownFields = SwiftProtobuf.UnknownStorage() 502 | 503 | init() {} 504 | 505 | fileprivate var _storage = _StorageClass.defaultInstance 506 | } 507 | 508 | /// Overarching object in a ZNOTEDATA.ZDATA blob 509 | struct NoteStoreProto: Sendable { 510 | // SwiftProtobuf.Message conformance is added in an extension below. See the 511 | // `Message` and `Message+*Additions` files in the SwiftProtobuf library for 512 | // methods supported on all messages. 513 | 514 | var document: Document { 515 | get {return _document ?? Document()} 516 | set {_document = newValue} 517 | } 518 | /// Returns true if `document` has been explicitly set. 519 | var hasDocument: Bool {return self._document != nil} 520 | /// Clears the value of `document`. Subsequent reads from it will return its default value. 521 | mutating func clearDocument() {self._document = nil} 522 | 523 | var unknownFields = SwiftProtobuf.UnknownStorage() 524 | 525 | init() {} 526 | 527 | fileprivate var _document: Document? = nil 528 | } 529 | 530 | /// A Document has a Note within it. 531 | struct Document: Sendable { 532 | // SwiftProtobuf.Message conformance is added in an extension below. See the 533 | // `Message` and `Message+*Additions` files in the SwiftProtobuf library for 534 | // methods supported on all messages. 535 | 536 | var version: Int32 { 537 | get {return _version ?? 0} 538 | set {_version = newValue} 539 | } 540 | /// Returns true if `version` has been explicitly set. 541 | var hasVersion: Bool {return self._version != nil} 542 | /// Clears the value of `version`. Subsequent reads from it will return its default value. 543 | mutating func clearVersion() {self._version = nil} 544 | 545 | var note: Note { 546 | get {return _note ?? Note()} 547 | set {_note = newValue} 548 | } 549 | /// Returns true if `note` has been explicitly set. 550 | var hasNote: Bool {return self._note != nil} 551 | /// Clears the value of `note`. Subsequent reads from it will return its default value. 552 | mutating func clearNote() {self._note = nil} 553 | 554 | var unknownFields = SwiftProtobuf.UnknownStorage() 555 | 556 | init() {} 557 | 558 | fileprivate var _version: Int32? = nil 559 | fileprivate var _note: Note? = nil 560 | } 561 | 562 | /// A Note has both text, and then a lot of formatting entries. 563 | /// Other fields are present and not yet included in this proto. 564 | struct Note: Sendable { 565 | // SwiftProtobuf.Message conformance is added in an extension below. See the 566 | // `Message` and `Message+*Additions` files in the SwiftProtobuf library for 567 | // methods supported on all messages. 568 | 569 | var noteText: String { 570 | get {return _noteText ?? String()} 571 | set {_noteText = newValue} 572 | } 573 | /// Returns true if `noteText` has been explicitly set. 574 | var hasNoteText: Bool {return self._noteText != nil} 575 | /// Clears the value of `noteText`. Subsequent reads from it will return its default value. 576 | mutating func clearNoteText() {self._noteText = nil} 577 | 578 | var attributeRun: [AttributeRun] = [] 579 | 580 | var unknownFields = SwiftProtobuf.UnknownStorage() 581 | 582 | init() {} 583 | 584 | fileprivate var _noteText: String? = nil 585 | } 586 | 587 | /// Represents the top level object in a ZMERGEABLEDATA cell 588 | struct MergableDataProto: Sendable { 589 | // SwiftProtobuf.Message conformance is added in an extension below. See the 590 | // `Message` and `Message+*Additions` files in the SwiftProtobuf library for 591 | // methods supported on all messages. 592 | 593 | var mergableDataObject: MergableDataObject { 594 | get {return _mergableDataObject ?? MergableDataObject()} 595 | set {_mergableDataObject = newValue} 596 | } 597 | /// Returns true if `mergableDataObject` has been explicitly set. 598 | var hasMergableDataObject: Bool {return self._mergableDataObject != nil} 599 | /// Clears the value of `mergableDataObject`. Subsequent reads from it will return its default value. 600 | mutating func clearMergableDataObject() {self._mergableDataObject = nil} 601 | 602 | var unknownFields = SwiftProtobuf.UnknownStorage() 603 | 604 | init() {} 605 | 606 | fileprivate var _mergableDataObject: MergableDataObject? = nil 607 | } 608 | 609 | /// Similar to Document for Notes, this is what holds the mergeable object 610 | struct MergableDataObject: Sendable { 611 | // SwiftProtobuf.Message conformance is added in an extension below. See the 612 | // `Message` and `Message+*Additions` files in the SwiftProtobuf library for 613 | // methods supported on all messages. 614 | 615 | /// Asserted to be version in https://github.com/dunhamsteve/notesutils 616 | var version: Int32 { 617 | get {return _version ?? 0} 618 | set {_version = newValue} 619 | } 620 | /// Returns true if `version` has been explicitly set. 621 | var hasVersion: Bool {return self._version != nil} 622 | /// Clears the value of `version`. Subsequent reads from it will return its default value. 623 | mutating func clearVersion() {self._version = nil} 624 | 625 | var mergeableDataObjectData: MergeableDataObjectData { 626 | get {return _mergeableDataObjectData ?? MergeableDataObjectData()} 627 | set {_mergeableDataObjectData = newValue} 628 | } 629 | /// Returns true if `mergeableDataObjectData` has been explicitly set. 630 | var hasMergeableDataObjectData: Bool {return self._mergeableDataObjectData != nil} 631 | /// Clears the value of `mergeableDataObjectData`. Subsequent reads from it will return its default value. 632 | mutating func clearMergeableDataObjectData() {self._mergeableDataObjectData = nil} 633 | 634 | var unknownFields = SwiftProtobuf.UnknownStorage() 635 | 636 | init() {} 637 | 638 | fileprivate var _version: Int32? = nil 639 | fileprivate var _mergeableDataObjectData: MergeableDataObjectData? = nil 640 | } 641 | 642 | /// This is the mergeable data object itself and has a lot of entries that are the parts of it 643 | /// along with arrays of key, type, and UUID items, depending on type. 644 | struct MergeableDataObjectData: @unchecked Sendable { 645 | // SwiftProtobuf.Message conformance is added in an extension below. See the 646 | // `Message` and `Message+*Additions` files in the SwiftProtobuf library for 647 | // methods supported on all messages. 648 | 649 | var mergeableDataObjectEntry: [MergeableDataObjectEntry] = [] 650 | 651 | var mergeableDataObjectKeyItem: [String] = [] 652 | 653 | var mergeableDataObjectTypeItem: [String] = [] 654 | 655 | var mergeableDataObjectUuidItem: [Data] = [] 656 | 657 | var unknownFields = SwiftProtobuf.UnknownStorage() 658 | 659 | init() {} 660 | } 661 | 662 | /// Each entry is part of the pbject. For example, one entry might be identifying which 663 | /// UUIDs are rows, and another might hold the text of a cell. 664 | struct MergeableDataObjectEntry: Sendable { 665 | // SwiftProtobuf.Message conformance is added in an extension below. See the 666 | // `Message` and `Message+*Additions` files in the SwiftProtobuf library for 667 | // methods supported on all messages. 668 | 669 | var registerLatest: RegisterLatest { 670 | get {return _registerLatest ?? RegisterLatest()} 671 | set {_registerLatest = newValue} 672 | } 673 | /// Returns true if `registerLatest` has been explicitly set. 674 | var hasRegisterLatest: Bool {return self._registerLatest != nil} 675 | /// Clears the value of `registerLatest`. Subsequent reads from it will return its default value. 676 | mutating func clearRegisterLatest() {self._registerLatest = nil} 677 | 678 | var list: ProtoList { 679 | get {return _list ?? ProtoList()} 680 | set {_list = newValue} 681 | } 682 | /// Returns true if `list` has been explicitly set. 683 | var hasList: Bool {return self._list != nil} 684 | /// Clears the value of `list`. Subsequent reads from it will return its default value. 685 | mutating func clearList() {self._list = nil} 686 | 687 | var dictionary: ProtoDictionary { 688 | get {return _dictionary ?? ProtoDictionary()} 689 | set {_dictionary = newValue} 690 | } 691 | /// Returns true if `dictionary` has been explicitly set. 692 | var hasDictionary: Bool {return self._dictionary != nil} 693 | /// Clears the value of `dictionary`. Subsequent reads from it will return its default value. 694 | mutating func clearDictionary() {self._dictionary = nil} 695 | 696 | var unknownMessage: UnknownMergeableDataObjectEntryMessage { 697 | get {return _unknownMessage ?? UnknownMergeableDataObjectEntryMessage()} 698 | set {_unknownMessage = newValue} 699 | } 700 | /// Returns true if `unknownMessage` has been explicitly set. 701 | var hasUnknownMessage: Bool {return self._unknownMessage != nil} 702 | /// Clears the value of `unknownMessage`. Subsequent reads from it will return its default value. 703 | mutating func clearUnknownMessage() {self._unknownMessage = nil} 704 | 705 | var note: Note { 706 | get {return _note ?? Note()} 707 | set {_note = newValue} 708 | } 709 | /// Returns true if `note` has been explicitly set. 710 | var hasNote: Bool {return self._note != nil} 711 | /// Clears the value of `note`. Subsequent reads from it will return its default value. 712 | mutating func clearNote() {self._note = nil} 713 | 714 | var customMap: MergeableDataObjectMap { 715 | get {return _customMap ?? MergeableDataObjectMap()} 716 | set {_customMap = newValue} 717 | } 718 | /// Returns true if `customMap` has been explicitly set. 719 | var hasCustomMap: Bool {return self._customMap != nil} 720 | /// Clears the value of `customMap`. Subsequent reads from it will return its default value. 721 | mutating func clearCustomMap() {self._customMap = nil} 722 | 723 | var orderedSet: OrderedSet { 724 | get {return _orderedSet ?? OrderedSet()} 725 | set {_orderedSet = newValue} 726 | } 727 | /// Returns true if `orderedSet` has been explicitly set. 728 | var hasOrderedSet: Bool {return self._orderedSet != nil} 729 | /// Clears the value of `orderedSet`. Subsequent reads from it will return its default value. 730 | mutating func clearOrderedSet() {self._orderedSet = nil} 731 | 732 | var unknownFields = SwiftProtobuf.UnknownStorage() 733 | 734 | init() {} 735 | 736 | fileprivate var _registerLatest: RegisterLatest? = nil 737 | fileprivate var _list: ProtoList? = nil 738 | fileprivate var _dictionary: ProtoDictionary? = nil 739 | fileprivate var _unknownMessage: UnknownMergeableDataObjectEntryMessage? = nil 740 | fileprivate var _note: Note? = nil 741 | fileprivate var _customMap: MergeableDataObjectMap? = nil 742 | fileprivate var _orderedSet: OrderedSet? = nil 743 | } 744 | 745 | /// This is unknown, it first was noticed in folder order analysis. 746 | struct UnknownMergeableDataObjectEntryMessage: Sendable { 747 | // SwiftProtobuf.Message conformance is added in an extension below. See the 748 | // `Message` and `Message+*Additions` files in the SwiftProtobuf library for 749 | // methods supported on all messages. 750 | 751 | var unknownEntry: UnknownMergeableDataObjectEntryMessageEntry { 752 | get {return _unknownEntry ?? UnknownMergeableDataObjectEntryMessageEntry()} 753 | set {_unknownEntry = newValue} 754 | } 755 | /// Returns true if `unknownEntry` has been explicitly set. 756 | var hasUnknownEntry: Bool {return self._unknownEntry != nil} 757 | /// Clears the value of `unknownEntry`. Subsequent reads from it will return its default value. 758 | mutating func clearUnknownEntry() {self._unknownEntry = nil} 759 | 760 | var unknownFields = SwiftProtobuf.UnknownStorage() 761 | 762 | init() {} 763 | 764 | fileprivate var _unknownEntry: UnknownMergeableDataObjectEntryMessageEntry? = nil 765 | } 766 | 767 | /// This is unknown, it first was noticed in folder order analysis. 768 | /// "unknown_int2" is where the folder order is stored 769 | struct UnknownMergeableDataObjectEntryMessageEntry: Sendable { 770 | // SwiftProtobuf.Message conformance is added in an extension below. See the 771 | // `Message` and `Message+*Additions` files in the SwiftProtobuf library for 772 | // methods supported on all messages. 773 | 774 | var unknownInt1: Int32 { 775 | get {return _unknownInt1 ?? 0} 776 | set {_unknownInt1 = newValue} 777 | } 778 | /// Returns true if `unknownInt1` has been explicitly set. 779 | var hasUnknownInt1: Bool {return self._unknownInt1 != nil} 780 | /// Clears the value of `unknownInt1`. Subsequent reads from it will return its default value. 781 | mutating func clearUnknownInt1() {self._unknownInt1 = nil} 782 | 783 | var unknownInt2: Int64 { 784 | get {return _unknownInt2 ?? 0} 785 | set {_unknownInt2 = newValue} 786 | } 787 | /// Returns true if `unknownInt2` has been explicitly set. 788 | var hasUnknownInt2: Bool {return self._unknownInt2 != nil} 789 | /// Clears the value of `unknownInt2`. Subsequent reads from it will return its default value. 790 | mutating func clearUnknownInt2() {self._unknownInt2 = nil} 791 | 792 | var unknownFields = SwiftProtobuf.UnknownStorage() 793 | 794 | init() {} 795 | 796 | fileprivate var _unknownInt1: Int32? = nil 797 | fileprivate var _unknownInt2: Int64? = nil 798 | } 799 | 800 | /// The Object Map uses its type to identify what you are looking at and 801 | /// then a map entry to do something with that value. 802 | struct MergeableDataObjectMap: Sendable { 803 | // SwiftProtobuf.Message conformance is added in an extension below. See the 804 | // `Message` and `Message+*Additions` files in the SwiftProtobuf library for 805 | // methods supported on all messages. 806 | 807 | var type: Int32 { 808 | get {return _type ?? 0} 809 | set {_type = newValue} 810 | } 811 | /// Returns true if `type` has been explicitly set. 812 | var hasType: Bool {return self._type != nil} 813 | /// Clears the value of `type`. Subsequent reads from it will return its default value. 814 | mutating func clearType() {self._type = nil} 815 | 816 | var mapEntry: [MapEntry] = [] 817 | 818 | var unknownFields = SwiftProtobuf.UnknownStorage() 819 | 820 | init() {} 821 | 822 | fileprivate var _type: Int32? = nil 823 | } 824 | 825 | /// An ordered set is used to hold structural information for embedded tables 826 | struct OrderedSet: Sendable { 827 | // SwiftProtobuf.Message conformance is added in an extension below. See the 828 | // `Message` and `Message+*Additions` files in the SwiftProtobuf library for 829 | // methods supported on all messages. 830 | 831 | var ordering: OrderedSetOrdering { 832 | get {return _ordering ?? OrderedSetOrdering()} 833 | set {_ordering = newValue} 834 | } 835 | /// Returns true if `ordering` has been explicitly set. 836 | var hasOrdering: Bool {return self._ordering != nil} 837 | /// Clears the value of `ordering`. Subsequent reads from it will return its default value. 838 | mutating func clearOrdering() {self._ordering = nil} 839 | 840 | var elements: ProtoDictionary { 841 | get {return _elements ?? ProtoDictionary()} 842 | set {_elements = newValue} 843 | } 844 | /// Returns true if `elements` has been explicitly set. 845 | var hasElements: Bool {return self._elements != nil} 846 | /// Clears the value of `elements`. Subsequent reads from it will return its default value. 847 | mutating func clearElements() {self._elements = nil} 848 | 849 | var unknownFields = SwiftProtobuf.UnknownStorage() 850 | 851 | init() {} 852 | 853 | fileprivate var _ordering: OrderedSetOrdering? = nil 854 | fileprivate var _elements: ProtoDictionary? = nil 855 | } 856 | 857 | /// The ordered set ordering identifies rows and columns in embedded tables, with an array 858 | /// of the objects and contents that map lookup values to originals. 859 | struct OrderedSetOrdering: Sendable { 860 | // SwiftProtobuf.Message conformance is added in an extension below. See the 861 | // `Message` and `Message+*Additions` files in the SwiftProtobuf library for 862 | // methods supported on all messages. 863 | 864 | var array: OrderedSetOrderingArray { 865 | get {return _array ?? OrderedSetOrderingArray()} 866 | set {_array = newValue} 867 | } 868 | /// Returns true if `array` has been explicitly set. 869 | var hasArray: Bool {return self._array != nil} 870 | /// Clears the value of `array`. Subsequent reads from it will return its default value. 871 | mutating func clearArray() {self._array = nil} 872 | 873 | var contents: ProtoDictionary { 874 | get {return _contents ?? ProtoDictionary()} 875 | set {_contents = newValue} 876 | } 877 | /// Returns true if `contents` has been explicitly set. 878 | var hasContents: Bool {return self._contents != nil} 879 | /// Clears the value of `contents`. Subsequent reads from it will return its default value. 880 | mutating func clearContents() {self._contents = nil} 881 | 882 | var unknownFields = SwiftProtobuf.UnknownStorage() 883 | 884 | init() {} 885 | 886 | fileprivate var _array: OrderedSetOrderingArray? = nil 887 | fileprivate var _contents: ProtoDictionary? = nil 888 | } 889 | 890 | /// This array holds both the text to replace and the array of UUIDs to tell what 891 | /// embedded rows and columns are. 892 | struct OrderedSetOrderingArray: Sendable { 893 | // SwiftProtobuf.Message conformance is added in an extension below. See the 894 | // `Message` and `Message+*Additions` files in the SwiftProtobuf library for 895 | // methods supported on all messages. 896 | 897 | var contents: Note { 898 | get {return _contents ?? Note()} 899 | set {_contents = newValue} 900 | } 901 | /// Returns true if `contents` has been explicitly set. 902 | var hasContents: Bool {return self._contents != nil} 903 | /// Clears the value of `contents`. Subsequent reads from it will return its default value. 904 | mutating func clearContents() {self._contents = nil} 905 | 906 | var attachment: [OrderedSetOrderingArrayAttachment] = [] 907 | 908 | var unknownFields = SwiftProtobuf.UnknownStorage() 909 | 910 | init() {} 911 | 912 | fileprivate var _contents: Note? = nil 913 | } 914 | 915 | /// This array identifies the UUIDs that are embedded table rows or columns 916 | struct OrderedSetOrderingArrayAttachment: @unchecked Sendable { 917 | // SwiftProtobuf.Message conformance is added in an extension below. See the 918 | // `Message` and `Message+*Additions` files in the SwiftProtobuf library for 919 | // methods supported on all messages. 920 | 921 | var index: Int32 { 922 | get {return _index ?? 0} 923 | set {_index = newValue} 924 | } 925 | /// Returns true if `index` has been explicitly set. 926 | var hasIndex: Bool {return self._index != nil} 927 | /// Clears the value of `index`. Subsequent reads from it will return its default value. 928 | mutating func clearIndex() {self._index = nil} 929 | 930 | var uuid: Data { 931 | get {return _uuid ?? Data()} 932 | set {_uuid = newValue} 933 | } 934 | /// Returns true if `uuid` has been explicitly set. 935 | var hasUuid: Bool {return self._uuid != nil} 936 | /// Clears the value of `uuid`. Subsequent reads from it will return its default value. 937 | mutating func clearUuid() {self._uuid = nil} 938 | 939 | var unknownFields = SwiftProtobuf.UnknownStorage() 940 | 941 | init() {} 942 | 943 | fileprivate var _index: Int32? = nil 944 | fileprivate var _uuid: Data? = nil 945 | } 946 | 947 | /// A ProtoList holds details about multiple objects 948 | struct ProtoList: Sendable { 949 | // SwiftProtobuf.Message conformance is added in an extension below. See the 950 | // `Message` and `Message+*Additions` files in the SwiftProtobuf library for 951 | // methods supported on all messages. 952 | 953 | var listEntry: [ProtoListEntry] = [] 954 | 955 | var unknownFields = SwiftProtobuf.UnknownStorage() 956 | 957 | init() {} 958 | } 959 | 960 | /// A list Entry holds details about a specific object 961 | struct ProtoListEntry: Sendable { 962 | // SwiftProtobuf.Message conformance is added in an extension below. See the 963 | // `Message` and `Message+*Additions` files in the SwiftProtobuf library for 964 | // methods supported on all messages. 965 | 966 | var id: ObjectID { 967 | get {return _id ?? ObjectID()} 968 | set {_id = newValue} 969 | } 970 | /// Returns true if `id` has been explicitly set. 971 | var hasID: Bool {return self._id != nil} 972 | /// Clears the value of `id`. Subsequent reads from it will return its default value. 973 | mutating func clearID() {self._id = nil} 974 | 975 | /// I dislike this naming, but don't have better information 976 | var details: ProtoListEntryDetails { 977 | get {return _details ?? ProtoListEntryDetails()} 978 | set {_details = newValue} 979 | } 980 | /// Returns true if `details` has been explicitly set. 981 | var hasDetails: Bool {return self._details != nil} 982 | /// Clears the value of `details`. Subsequent reads from it will return its default value. 983 | mutating func clearDetails() {self._details = nil} 984 | 985 | var additionalDetails: ProtoListEntryDetails { 986 | get {return _additionalDetails ?? ProtoListEntryDetails()} 987 | set {_additionalDetails = newValue} 988 | } 989 | /// Returns true if `additionalDetails` has been explicitly set. 990 | var hasAdditionalDetails: Bool {return self._additionalDetails != nil} 991 | /// Clears the value of `additionalDetails`. Subsequent reads from it will return its default value. 992 | mutating func clearAdditionalDetails() {self._additionalDetails = nil} 993 | 994 | var unknownFields = SwiftProtobuf.UnknownStorage() 995 | 996 | init() {} 997 | 998 | fileprivate var _id: ObjectID? = nil 999 | fileprivate var _details: ProtoListEntryDetails? = nil 1000 | fileprivate var _additionalDetails: ProtoListEntryDetails? = nil 1001 | } 1002 | 1003 | /// ProtoList Entry Details hold another object ID and unidentified mapping 1004 | struct ProtoListEntryDetails: Sendable { 1005 | // SwiftProtobuf.Message conformance is added in an extension below. See the 1006 | // `Message` and `Message+*Additions` files in the SwiftProtobuf library for 1007 | // methods supported on all messages. 1008 | 1009 | var listEntryDetailsKey: ProtoListEntryDetailsKey { 1010 | get {return _listEntryDetailsKey ?? ProtoListEntryDetailsKey()} 1011 | set {_listEntryDetailsKey = newValue} 1012 | } 1013 | /// Returns true if `listEntryDetailsKey` has been explicitly set. 1014 | var hasListEntryDetailsKey: Bool {return self._listEntryDetailsKey != nil} 1015 | /// Clears the value of `listEntryDetailsKey`. Subsequent reads from it will return its default value. 1016 | mutating func clearListEntryDetailsKey() {self._listEntryDetailsKey = nil} 1017 | 1018 | var id: ObjectID { 1019 | get {return _id ?? ObjectID()} 1020 | set {_id = newValue} 1021 | } 1022 | /// Returns true if `id` has been explicitly set. 1023 | var hasID: Bool {return self._id != nil} 1024 | /// Clears the value of `id`. Subsequent reads from it will return its default value. 1025 | mutating func clearID() {self._id = nil} 1026 | 1027 | var unknownFields = SwiftProtobuf.UnknownStorage() 1028 | 1029 | init() {} 1030 | 1031 | fileprivate var _listEntryDetailsKey: ProtoListEntryDetailsKey? = nil 1032 | fileprivate var _id: ObjectID? = nil 1033 | } 1034 | 1035 | struct ProtoListEntryDetailsKey: Sendable { 1036 | // SwiftProtobuf.Message conformance is added in an extension below. See the 1037 | // `Message` and `Message+*Additions` files in the SwiftProtobuf library for 1038 | // methods supported on all messages. 1039 | 1040 | var listEntryDetailsTypeIndex: Int32 { 1041 | get {return _listEntryDetailsTypeIndex ?? 0} 1042 | set {_listEntryDetailsTypeIndex = newValue} 1043 | } 1044 | /// Returns true if `listEntryDetailsTypeIndex` has been explicitly set. 1045 | var hasListEntryDetailsTypeIndex: Bool {return self._listEntryDetailsTypeIndex != nil} 1046 | /// Clears the value of `listEntryDetailsTypeIndex`. Subsequent reads from it will return its default value. 1047 | mutating func clearListEntryDetailsTypeIndex() {self._listEntryDetailsTypeIndex = nil} 1048 | 1049 | var listEntryDetailsKey: Int32 { 1050 | get {return _listEntryDetailsKey ?? 0} 1051 | set {_listEntryDetailsKey = newValue} 1052 | } 1053 | /// Returns true if `listEntryDetailsKey` has been explicitly set. 1054 | var hasListEntryDetailsKey: Bool {return self._listEntryDetailsKey != nil} 1055 | /// Clears the value of `listEntryDetailsKey`. Subsequent reads from it will return its default value. 1056 | mutating func clearListEntryDetailsKey() {self._listEntryDetailsKey = nil} 1057 | 1058 | var unknownFields = SwiftProtobuf.UnknownStorage() 1059 | 1060 | init() {} 1061 | 1062 | fileprivate var _listEntryDetailsTypeIndex: Int32? = nil 1063 | fileprivate var _listEntryDetailsKey: Int32? = nil 1064 | } 1065 | 1066 | // MARK: - Code below here is support for the SwiftProtobuf runtime. 1067 | 1068 | extension ProtoColor: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { 1069 | static let protoMessageName: String = "ProtoColor" 1070 | static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1071 | 1: .same(proto: "red"), 1072 | 2: .same(proto: "green"), 1073 | 3: .same(proto: "blue"), 1074 | 4: .same(proto: "alpha"), 1075 | ] 1076 | 1077 | public var isInitialized: Bool { 1078 | if self._red == nil {return false} 1079 | if self._green == nil {return false} 1080 | if self._blue == nil {return false} 1081 | if self._alpha == nil {return false} 1082 | return true 1083 | } 1084 | 1085 | mutating func decodeMessage(decoder: inout D) throws { 1086 | while let fieldNumber = try decoder.nextFieldNumber() { 1087 | // The use of inline closures is to circumvent an issue where the compiler 1088 | // allocates stack space for every case branch when no optimizations are 1089 | // enabled. https://github.com/apple/swift-protobuf/issues/1034 1090 | switch fieldNumber { 1091 | case 1: try { try decoder.decodeSingularFloatField(value: &self._red) }() 1092 | case 2: try { try decoder.decodeSingularFloatField(value: &self._green) }() 1093 | case 3: try { try decoder.decodeSingularFloatField(value: &self._blue) }() 1094 | case 4: try { try decoder.decodeSingularFloatField(value: &self._alpha) }() 1095 | default: break 1096 | } 1097 | } 1098 | } 1099 | 1100 | func traverse(visitor: inout V) throws { 1101 | // The use of inline closures is to circumvent an issue where the compiler 1102 | // allocates stack space for every if/case branch local when no optimizations 1103 | // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and 1104 | // https://github.com/apple/swift-protobuf/issues/1182 1105 | try { if let v = self._red { 1106 | try visitor.visitSingularFloatField(value: v, fieldNumber: 1) 1107 | } }() 1108 | try { if let v = self._green { 1109 | try visitor.visitSingularFloatField(value: v, fieldNumber: 2) 1110 | } }() 1111 | try { if let v = self._blue { 1112 | try visitor.visitSingularFloatField(value: v, fieldNumber: 3) 1113 | } }() 1114 | try { if let v = self._alpha { 1115 | try visitor.visitSingularFloatField(value: v, fieldNumber: 4) 1116 | } }() 1117 | try unknownFields.traverse(visitor: &visitor) 1118 | } 1119 | 1120 | static func ==(lhs: ProtoColor, rhs: ProtoColor) -> Bool { 1121 | if lhs._red != rhs._red {return false} 1122 | if lhs._green != rhs._green {return false} 1123 | if lhs._blue != rhs._blue {return false} 1124 | if lhs._alpha != rhs._alpha {return false} 1125 | if lhs.unknownFields != rhs.unknownFields {return false} 1126 | return true 1127 | } 1128 | } 1129 | 1130 | extension AttachmentInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { 1131 | static let protoMessageName: String = "AttachmentInfo" 1132 | static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1133 | 1: .standard(proto: "attachment_identifier"), 1134 | 2: .standard(proto: "type_uti"), 1135 | ] 1136 | 1137 | mutating func decodeMessage(decoder: inout D) throws { 1138 | while let fieldNumber = try decoder.nextFieldNumber() { 1139 | // The use of inline closures is to circumvent an issue where the compiler 1140 | // allocates stack space for every case branch when no optimizations are 1141 | // enabled. https://github.com/apple/swift-protobuf/issues/1034 1142 | switch fieldNumber { 1143 | case 1: try { try decoder.decodeSingularStringField(value: &self._attachmentIdentifier) }() 1144 | case 2: try { try decoder.decodeSingularStringField(value: &self._typeUti) }() 1145 | default: break 1146 | } 1147 | } 1148 | } 1149 | 1150 | func traverse(visitor: inout V) throws { 1151 | // The use of inline closures is to circumvent an issue where the compiler 1152 | // allocates stack space for every if/case branch local when no optimizations 1153 | // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and 1154 | // https://github.com/apple/swift-protobuf/issues/1182 1155 | try { if let v = self._attachmentIdentifier { 1156 | try visitor.visitSingularStringField(value: v, fieldNumber: 1) 1157 | } }() 1158 | try { if let v = self._typeUti { 1159 | try visitor.visitSingularStringField(value: v, fieldNumber: 2) 1160 | } }() 1161 | try unknownFields.traverse(visitor: &visitor) 1162 | } 1163 | 1164 | static func ==(lhs: AttachmentInfo, rhs: AttachmentInfo) -> Bool { 1165 | if lhs._attachmentIdentifier != rhs._attachmentIdentifier {return false} 1166 | if lhs._typeUti != rhs._typeUti {return false} 1167 | if lhs.unknownFields != rhs.unknownFields {return false} 1168 | return true 1169 | } 1170 | } 1171 | 1172 | extension ProtoFont: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { 1173 | static let protoMessageName: String = "ProtoFont" 1174 | static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1175 | 1: .standard(proto: "font_name"), 1176 | 2: .standard(proto: "point_size"), 1177 | 3: .standard(proto: "font_hints"), 1178 | ] 1179 | 1180 | mutating func decodeMessage(decoder: inout D) throws { 1181 | while let fieldNumber = try decoder.nextFieldNumber() { 1182 | // The use of inline closures is to circumvent an issue where the compiler 1183 | // allocates stack space for every case branch when no optimizations are 1184 | // enabled. https://github.com/apple/swift-protobuf/issues/1034 1185 | switch fieldNumber { 1186 | case 1: try { try decoder.decodeSingularStringField(value: &self._fontName) }() 1187 | case 2: try { try decoder.decodeSingularFloatField(value: &self._pointSize) }() 1188 | case 3: try { try decoder.decodeSingularInt32Field(value: &self._fontHints) }() 1189 | default: break 1190 | } 1191 | } 1192 | } 1193 | 1194 | func traverse(visitor: inout V) throws { 1195 | // The use of inline closures is to circumvent an issue where the compiler 1196 | // allocates stack space for every if/case branch local when no optimizations 1197 | // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and 1198 | // https://github.com/apple/swift-protobuf/issues/1182 1199 | try { if let v = self._fontName { 1200 | try visitor.visitSingularStringField(value: v, fieldNumber: 1) 1201 | } }() 1202 | try { if let v = self._pointSize { 1203 | try visitor.visitSingularFloatField(value: v, fieldNumber: 2) 1204 | } }() 1205 | try { if let v = self._fontHints { 1206 | try visitor.visitSingularInt32Field(value: v, fieldNumber: 3) 1207 | } }() 1208 | try unknownFields.traverse(visitor: &visitor) 1209 | } 1210 | 1211 | static func ==(lhs: ProtoFont, rhs: ProtoFont) -> Bool { 1212 | if lhs._fontName != rhs._fontName {return false} 1213 | if lhs._pointSize != rhs._pointSize {return false} 1214 | if lhs._fontHints != rhs._fontHints {return false} 1215 | if lhs.unknownFields != rhs.unknownFields {return false} 1216 | return true 1217 | } 1218 | } 1219 | 1220 | extension ProtoParagraphStyle: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { 1221 | static let protoMessageName: String = "ProtoParagraphStyle" 1222 | static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1223 | 1: .standard(proto: "style_type"), 1224 | 2: .same(proto: "alignment"), 1225 | 4: .standard(proto: "indent_amount"), 1226 | 5: .same(proto: "checklist"), 1227 | 8: .standard(proto: "block_quote"), 1228 | ] 1229 | 1230 | public var isInitialized: Bool { 1231 | if let v = self._checklist, !v.isInitialized {return false} 1232 | return true 1233 | } 1234 | 1235 | mutating func decodeMessage(decoder: inout D) throws { 1236 | while let fieldNumber = try decoder.nextFieldNumber() { 1237 | // The use of inline closures is to circumvent an issue where the compiler 1238 | // allocates stack space for every case branch when no optimizations are 1239 | // enabled. https://github.com/apple/swift-protobuf/issues/1034 1240 | switch fieldNumber { 1241 | case 1: try { try decoder.decodeSingularInt32Field(value: &self._styleType) }() 1242 | case 2: try { try decoder.decodeSingularInt32Field(value: &self._alignment) }() 1243 | case 4: try { try decoder.decodeSingularInt32Field(value: &self._indentAmount) }() 1244 | case 5: try { try decoder.decodeSingularMessageField(value: &self._checklist) }() 1245 | case 8: try { try decoder.decodeSingularInt32Field(value: &self._blockQuote) }() 1246 | default: break 1247 | } 1248 | } 1249 | } 1250 | 1251 | func traverse(visitor: inout V) throws { 1252 | // The use of inline closures is to circumvent an issue where the compiler 1253 | // allocates stack space for every if/case branch local when no optimizations 1254 | // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and 1255 | // https://github.com/apple/swift-protobuf/issues/1182 1256 | try { if let v = self._styleType { 1257 | try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) 1258 | } }() 1259 | try { if let v = self._alignment { 1260 | try visitor.visitSingularInt32Field(value: v, fieldNumber: 2) 1261 | } }() 1262 | try { if let v = self._indentAmount { 1263 | try visitor.visitSingularInt32Field(value: v, fieldNumber: 4) 1264 | } }() 1265 | try { if let v = self._checklist { 1266 | try visitor.visitSingularMessageField(value: v, fieldNumber: 5) 1267 | } }() 1268 | try { if let v = self._blockQuote { 1269 | try visitor.visitSingularInt32Field(value: v, fieldNumber: 8) 1270 | } }() 1271 | try unknownFields.traverse(visitor: &visitor) 1272 | } 1273 | 1274 | static func ==(lhs: ProtoParagraphStyle, rhs: ProtoParagraphStyle) -> Bool { 1275 | if lhs._styleType != rhs._styleType {return false} 1276 | if lhs._alignment != rhs._alignment {return false} 1277 | if lhs._indentAmount != rhs._indentAmount {return false} 1278 | if lhs._checklist != rhs._checklist {return false} 1279 | if lhs._blockQuote != rhs._blockQuote {return false} 1280 | if lhs.unknownFields != rhs.unknownFields {return false} 1281 | return true 1282 | } 1283 | } 1284 | 1285 | extension ProtoChecklist: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { 1286 | static let protoMessageName: String = "ProtoChecklist" 1287 | static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1288 | 1: .same(proto: "uuid"), 1289 | 2: .same(proto: "done"), 1290 | ] 1291 | 1292 | public var isInitialized: Bool { 1293 | if self._uuid == nil {return false} 1294 | if self._done == nil {return false} 1295 | return true 1296 | } 1297 | 1298 | mutating func decodeMessage(decoder: inout D) throws { 1299 | while let fieldNumber = try decoder.nextFieldNumber() { 1300 | // The use of inline closures is to circumvent an issue where the compiler 1301 | // allocates stack space for every case branch when no optimizations are 1302 | // enabled. https://github.com/apple/swift-protobuf/issues/1034 1303 | switch fieldNumber { 1304 | case 1: try { try decoder.decodeSingularBytesField(value: &self._uuid) }() 1305 | case 2: try { try decoder.decodeSingularInt32Field(value: &self._done) }() 1306 | default: break 1307 | } 1308 | } 1309 | } 1310 | 1311 | func traverse(visitor: inout V) throws { 1312 | // The use of inline closures is to circumvent an issue where the compiler 1313 | // allocates stack space for every if/case branch local when no optimizations 1314 | // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and 1315 | // https://github.com/apple/swift-protobuf/issues/1182 1316 | try { if let v = self._uuid { 1317 | try visitor.visitSingularBytesField(value: v, fieldNumber: 1) 1318 | } }() 1319 | try { if let v = self._done { 1320 | try visitor.visitSingularInt32Field(value: v, fieldNumber: 2) 1321 | } }() 1322 | try unknownFields.traverse(visitor: &visitor) 1323 | } 1324 | 1325 | static func ==(lhs: ProtoChecklist, rhs: ProtoChecklist) -> Bool { 1326 | if lhs._uuid != rhs._uuid {return false} 1327 | if lhs._done != rhs._done {return false} 1328 | if lhs.unknownFields != rhs.unknownFields {return false} 1329 | return true 1330 | } 1331 | } 1332 | 1333 | extension ProtoDictionaryElement: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { 1334 | static let protoMessageName: String = "ProtoDictionaryElement" 1335 | static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1336 | 1: .same(proto: "key"), 1337 | 2: .same(proto: "value"), 1338 | ] 1339 | 1340 | public var isInitialized: Bool { 1341 | if self._key == nil {return false} 1342 | if self._value == nil {return false} 1343 | if let v = self._key, !v.isInitialized {return false} 1344 | if let v = self._value, !v.isInitialized {return false} 1345 | return true 1346 | } 1347 | 1348 | mutating func decodeMessage(decoder: inout D) throws { 1349 | while let fieldNumber = try decoder.nextFieldNumber() { 1350 | // The use of inline closures is to circumvent an issue where the compiler 1351 | // allocates stack space for every case branch when no optimizations are 1352 | // enabled. https://github.com/apple/swift-protobuf/issues/1034 1353 | switch fieldNumber { 1354 | case 1: try { try decoder.decodeSingularMessageField(value: &self._key) }() 1355 | case 2: try { try decoder.decodeSingularMessageField(value: &self._value) }() 1356 | default: break 1357 | } 1358 | } 1359 | } 1360 | 1361 | func traverse(visitor: inout V) throws { 1362 | // The use of inline closures is to circumvent an issue where the compiler 1363 | // allocates stack space for every if/case branch local when no optimizations 1364 | // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and 1365 | // https://github.com/apple/swift-protobuf/issues/1182 1366 | try { if let v = self._key { 1367 | try visitor.visitSingularMessageField(value: v, fieldNumber: 1) 1368 | } }() 1369 | try { if let v = self._value { 1370 | try visitor.visitSingularMessageField(value: v, fieldNumber: 2) 1371 | } }() 1372 | try unknownFields.traverse(visitor: &visitor) 1373 | } 1374 | 1375 | static func ==(lhs: ProtoDictionaryElement, rhs: ProtoDictionaryElement) -> Bool { 1376 | if lhs._key != rhs._key {return false} 1377 | if lhs._value != rhs._value {return false} 1378 | if lhs.unknownFields != rhs.unknownFields {return false} 1379 | return true 1380 | } 1381 | } 1382 | 1383 | extension ProtoDictionary: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { 1384 | static let protoMessageName: String = "ProtoDictionary" 1385 | static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1386 | 1: .same(proto: "element"), 1387 | ] 1388 | 1389 | public var isInitialized: Bool { 1390 | if !SwiftProtobuf.Internal.areAllInitialized(self.element) {return false} 1391 | return true 1392 | } 1393 | 1394 | mutating func decodeMessage(decoder: inout D) throws { 1395 | while let fieldNumber = try decoder.nextFieldNumber() { 1396 | // The use of inline closures is to circumvent an issue where the compiler 1397 | // allocates stack space for every case branch when no optimizations are 1398 | // enabled. https://github.com/apple/swift-protobuf/issues/1034 1399 | switch fieldNumber { 1400 | case 1: try { try decoder.decodeRepeatedMessageField(value: &self.element) }() 1401 | default: break 1402 | } 1403 | } 1404 | } 1405 | 1406 | func traverse(visitor: inout V) throws { 1407 | if !self.element.isEmpty { 1408 | try visitor.visitRepeatedMessageField(value: self.element, fieldNumber: 1) 1409 | } 1410 | try unknownFields.traverse(visitor: &visitor) 1411 | } 1412 | 1413 | static func ==(lhs: ProtoDictionary, rhs: ProtoDictionary) -> Bool { 1414 | if lhs.element != rhs.element {return false} 1415 | if lhs.unknownFields != rhs.unknownFields {return false} 1416 | return true 1417 | } 1418 | } 1419 | 1420 | extension ObjectID: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { 1421 | static let protoMessageName: String = "ObjectID" 1422 | static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1423 | 2: .standard(proto: "unsigned_integer_value"), 1424 | 4: .standard(proto: "string_value"), 1425 | 6: .standard(proto: "object_index"), 1426 | ] 1427 | 1428 | public var isInitialized: Bool { 1429 | if self._unsignedIntegerValue == nil {return false} 1430 | if self._stringValue == nil {return false} 1431 | if self._objectIndex == nil {return false} 1432 | return true 1433 | } 1434 | 1435 | mutating func decodeMessage(decoder: inout D) throws { 1436 | while let fieldNumber = try decoder.nextFieldNumber() { 1437 | // The use of inline closures is to circumvent an issue where the compiler 1438 | // allocates stack space for every case branch when no optimizations are 1439 | // enabled. https://github.com/apple/swift-protobuf/issues/1034 1440 | switch fieldNumber { 1441 | case 2: try { try decoder.decodeSingularUInt64Field(value: &self._unsignedIntegerValue) }() 1442 | case 4: try { try decoder.decodeSingularStringField(value: &self._stringValue) }() 1443 | case 6: try { try decoder.decodeSingularInt32Field(value: &self._objectIndex) }() 1444 | default: break 1445 | } 1446 | } 1447 | } 1448 | 1449 | func traverse(visitor: inout V) throws { 1450 | // The use of inline closures is to circumvent an issue where the compiler 1451 | // allocates stack space for every if/case branch local when no optimizations 1452 | // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and 1453 | // https://github.com/apple/swift-protobuf/issues/1182 1454 | try { if let v = self._unsignedIntegerValue { 1455 | try visitor.visitSingularUInt64Field(value: v, fieldNumber: 2) 1456 | } }() 1457 | try { if let v = self._stringValue { 1458 | try visitor.visitSingularStringField(value: v, fieldNumber: 4) 1459 | } }() 1460 | try { if let v = self._objectIndex { 1461 | try visitor.visitSingularInt32Field(value: v, fieldNumber: 6) 1462 | } }() 1463 | try unknownFields.traverse(visitor: &visitor) 1464 | } 1465 | 1466 | static func ==(lhs: ObjectID, rhs: ObjectID) -> Bool { 1467 | if lhs._unsignedIntegerValue != rhs._unsignedIntegerValue {return false} 1468 | if lhs._stringValue != rhs._stringValue {return false} 1469 | if lhs._objectIndex != rhs._objectIndex {return false} 1470 | if lhs.unknownFields != rhs.unknownFields {return false} 1471 | return true 1472 | } 1473 | } 1474 | 1475 | extension RegisterLatest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { 1476 | static let protoMessageName: String = "RegisterLatest" 1477 | static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1478 | 2: .same(proto: "contents"), 1479 | ] 1480 | 1481 | public var isInitialized: Bool { 1482 | if self._contents == nil {return false} 1483 | if let v = self._contents, !v.isInitialized {return false} 1484 | return true 1485 | } 1486 | 1487 | mutating func decodeMessage(decoder: inout D) throws { 1488 | while let fieldNumber = try decoder.nextFieldNumber() { 1489 | // The use of inline closures is to circumvent an issue where the compiler 1490 | // allocates stack space for every case branch when no optimizations are 1491 | // enabled. https://github.com/apple/swift-protobuf/issues/1034 1492 | switch fieldNumber { 1493 | case 2: try { try decoder.decodeSingularMessageField(value: &self._contents) }() 1494 | default: break 1495 | } 1496 | } 1497 | } 1498 | 1499 | func traverse(visitor: inout V) throws { 1500 | // The use of inline closures is to circumvent an issue where the compiler 1501 | // allocates stack space for every if/case branch local when no optimizations 1502 | // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and 1503 | // https://github.com/apple/swift-protobuf/issues/1182 1504 | try { if let v = self._contents { 1505 | try visitor.visitSingularMessageField(value: v, fieldNumber: 2) 1506 | } }() 1507 | try unknownFields.traverse(visitor: &visitor) 1508 | } 1509 | 1510 | static func ==(lhs: RegisterLatest, rhs: RegisterLatest) -> Bool { 1511 | if lhs._contents != rhs._contents {return false} 1512 | if lhs.unknownFields != rhs.unknownFields {return false} 1513 | return true 1514 | } 1515 | } 1516 | 1517 | extension MapEntry: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { 1518 | static let protoMessageName: String = "MapEntry" 1519 | static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1520 | 1: .same(proto: "key"), 1521 | 2: .same(proto: "value"), 1522 | ] 1523 | 1524 | public var isInitialized: Bool { 1525 | if self._key == nil {return false} 1526 | if self._value == nil {return false} 1527 | if let v = self._value, !v.isInitialized {return false} 1528 | return true 1529 | } 1530 | 1531 | mutating func decodeMessage(decoder: inout D) throws { 1532 | while let fieldNumber = try decoder.nextFieldNumber() { 1533 | // The use of inline closures is to circumvent an issue where the compiler 1534 | // allocates stack space for every case branch when no optimizations are 1535 | // enabled. https://github.com/apple/swift-protobuf/issues/1034 1536 | switch fieldNumber { 1537 | case 1: try { try decoder.decodeSingularInt32Field(value: &self._key) }() 1538 | case 2: try { try decoder.decodeSingularMessageField(value: &self._value) }() 1539 | default: break 1540 | } 1541 | } 1542 | } 1543 | 1544 | func traverse(visitor: inout V) throws { 1545 | // The use of inline closures is to circumvent an issue where the compiler 1546 | // allocates stack space for every if/case branch local when no optimizations 1547 | // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and 1548 | // https://github.com/apple/swift-protobuf/issues/1182 1549 | try { if let v = self._key { 1550 | try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) 1551 | } }() 1552 | try { if let v = self._value { 1553 | try visitor.visitSingularMessageField(value: v, fieldNumber: 2) 1554 | } }() 1555 | try unknownFields.traverse(visitor: &visitor) 1556 | } 1557 | 1558 | static func ==(lhs: MapEntry, rhs: MapEntry) -> Bool { 1559 | if lhs._key != rhs._key {return false} 1560 | if lhs._value != rhs._value {return false} 1561 | if lhs.unknownFields != rhs.unknownFields {return false} 1562 | return true 1563 | } 1564 | } 1565 | 1566 | extension AttributeRun: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { 1567 | static let protoMessageName: String = "AttributeRun" 1568 | static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1569 | 1: .same(proto: "length"), 1570 | 2: .standard(proto: "paragraph_style"), 1571 | 3: .same(proto: "font"), 1572 | 5: .standard(proto: "font_weight"), 1573 | 6: .same(proto: "underlined"), 1574 | 7: .same(proto: "strikethrough"), 1575 | 8: .same(proto: "superscript"), 1576 | 9: .same(proto: "link"), 1577 | 10: .same(proto: "color"), 1578 | 12: .standard(proto: "attachment_info"), 1579 | 13: .standard(proto: "unknown_identifier"), 1580 | 14: .standard(proto: "emphasis_style"), 1581 | ] 1582 | 1583 | fileprivate class _StorageClass { 1584 | var _length: Int32? = nil 1585 | var _paragraphStyle: ProtoParagraphStyle? = nil 1586 | var _font: ProtoFont? = nil 1587 | var _fontWeight: Int32? = nil 1588 | var _underlined: Int32? = nil 1589 | var _strikethrough: Int32? = nil 1590 | var _superscript: Int32? = nil 1591 | var _link: String? = nil 1592 | var _color: ProtoColor? = nil 1593 | var _attachmentInfo: AttachmentInfo? = nil 1594 | var _unknownIdentifier: Int32? = nil 1595 | var _emphasisStyle: Int32? = nil 1596 | 1597 | #if swift(>=5.10) 1598 | // This property is used as the initial default value for new instances of the type. 1599 | // The type itself is protecting the reference to its storage via CoW semantics. 1600 | // This will force a copy to be made of this reference when the first mutation occurs; 1601 | // hence, it is safe to mark this as `nonisolated(unsafe)`. 1602 | static nonisolated(unsafe) let defaultInstance = _StorageClass() 1603 | #else 1604 | static let defaultInstance = _StorageClass() 1605 | #endif 1606 | 1607 | private init() {} 1608 | 1609 | init(copying source: _StorageClass) { 1610 | _length = source._length 1611 | _paragraphStyle = source._paragraphStyle 1612 | _font = source._font 1613 | _fontWeight = source._fontWeight 1614 | _underlined = source._underlined 1615 | _strikethrough = source._strikethrough 1616 | _superscript = source._superscript 1617 | _link = source._link 1618 | _color = source._color 1619 | _attachmentInfo = source._attachmentInfo 1620 | _unknownIdentifier = source._unknownIdentifier 1621 | _emphasisStyle = source._emphasisStyle 1622 | } 1623 | } 1624 | 1625 | fileprivate mutating func _uniqueStorage() -> _StorageClass { 1626 | if !isKnownUniquelyReferenced(&_storage) { 1627 | _storage = _StorageClass(copying: _storage) 1628 | } 1629 | return _storage 1630 | } 1631 | 1632 | public var isInitialized: Bool { 1633 | return withExtendedLifetime(_storage) { (_storage: _StorageClass) in 1634 | if _storage._length == nil {return false} 1635 | if let v = _storage._paragraphStyle, !v.isInitialized {return false} 1636 | if let v = _storage._color, !v.isInitialized {return false} 1637 | return true 1638 | } 1639 | } 1640 | 1641 | mutating func decodeMessage(decoder: inout D) throws { 1642 | _ = _uniqueStorage() 1643 | try withExtendedLifetime(_storage) { (_storage: _StorageClass) in 1644 | while let fieldNumber = try decoder.nextFieldNumber() { 1645 | // The use of inline closures is to circumvent an issue where the compiler 1646 | // allocates stack space for every case branch when no optimizations are 1647 | // enabled. https://github.com/apple/swift-protobuf/issues/1034 1648 | switch fieldNumber { 1649 | case 1: try { try decoder.decodeSingularInt32Field(value: &_storage._length) }() 1650 | case 2: try { try decoder.decodeSingularMessageField(value: &_storage._paragraphStyle) }() 1651 | case 3: try { try decoder.decodeSingularMessageField(value: &_storage._font) }() 1652 | case 5: try { try decoder.decodeSingularInt32Field(value: &_storage._fontWeight) }() 1653 | case 6: try { try decoder.decodeSingularInt32Field(value: &_storage._underlined) }() 1654 | case 7: try { try decoder.decodeSingularInt32Field(value: &_storage._strikethrough) }() 1655 | case 8: try { try decoder.decodeSingularInt32Field(value: &_storage._superscript) }() 1656 | case 9: try { try decoder.decodeSingularStringField(value: &_storage._link) }() 1657 | case 10: try { try decoder.decodeSingularMessageField(value: &_storage._color) }() 1658 | case 12: try { try decoder.decodeSingularMessageField(value: &_storage._attachmentInfo) }() 1659 | case 13: try { try decoder.decodeSingularInt32Field(value: &_storage._unknownIdentifier) }() 1660 | case 14: try { try decoder.decodeSingularInt32Field(value: &_storage._emphasisStyle) }() 1661 | default: break 1662 | } 1663 | } 1664 | } 1665 | } 1666 | 1667 | func traverse(visitor: inout V) throws { 1668 | try withExtendedLifetime(_storage) { (_storage: _StorageClass) in 1669 | // The use of inline closures is to circumvent an issue where the compiler 1670 | // allocates stack space for every if/case branch local when no optimizations 1671 | // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and 1672 | // https://github.com/apple/swift-protobuf/issues/1182 1673 | try { if let v = _storage._length { 1674 | try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) 1675 | } }() 1676 | try { if let v = _storage._paragraphStyle { 1677 | try visitor.visitSingularMessageField(value: v, fieldNumber: 2) 1678 | } }() 1679 | try { if let v = _storage._font { 1680 | try visitor.visitSingularMessageField(value: v, fieldNumber: 3) 1681 | } }() 1682 | try { if let v = _storage._fontWeight { 1683 | try visitor.visitSingularInt32Field(value: v, fieldNumber: 5) 1684 | } }() 1685 | try { if let v = _storage._underlined { 1686 | try visitor.visitSingularInt32Field(value: v, fieldNumber: 6) 1687 | } }() 1688 | try { if let v = _storage._strikethrough { 1689 | try visitor.visitSingularInt32Field(value: v, fieldNumber: 7) 1690 | } }() 1691 | try { if let v = _storage._superscript { 1692 | try visitor.visitSingularInt32Field(value: v, fieldNumber: 8) 1693 | } }() 1694 | try { if let v = _storage._link { 1695 | try visitor.visitSingularStringField(value: v, fieldNumber: 9) 1696 | } }() 1697 | try { if let v = _storage._color { 1698 | try visitor.visitSingularMessageField(value: v, fieldNumber: 10) 1699 | } }() 1700 | try { if let v = _storage._attachmentInfo { 1701 | try visitor.visitSingularMessageField(value: v, fieldNumber: 12) 1702 | } }() 1703 | try { if let v = _storage._unknownIdentifier { 1704 | try visitor.visitSingularInt32Field(value: v, fieldNumber: 13) 1705 | } }() 1706 | try { if let v = _storage._emphasisStyle { 1707 | try visitor.visitSingularInt32Field(value: v, fieldNumber: 14) 1708 | } }() 1709 | } 1710 | try unknownFields.traverse(visitor: &visitor) 1711 | } 1712 | 1713 | static func ==(lhs: AttributeRun, rhs: AttributeRun) -> Bool { 1714 | if lhs._storage !== rhs._storage { 1715 | let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in 1716 | let _storage = _args.0 1717 | let rhs_storage = _args.1 1718 | if _storage._length != rhs_storage._length {return false} 1719 | if _storage._paragraphStyle != rhs_storage._paragraphStyle {return false} 1720 | if _storage._font != rhs_storage._font {return false} 1721 | if _storage._fontWeight != rhs_storage._fontWeight {return false} 1722 | if _storage._underlined != rhs_storage._underlined {return false} 1723 | if _storage._strikethrough != rhs_storage._strikethrough {return false} 1724 | if _storage._superscript != rhs_storage._superscript {return false} 1725 | if _storage._link != rhs_storage._link {return false} 1726 | if _storage._color != rhs_storage._color {return false} 1727 | if _storage._attachmentInfo != rhs_storage._attachmentInfo {return false} 1728 | if _storage._unknownIdentifier != rhs_storage._unknownIdentifier {return false} 1729 | if _storage._emphasisStyle != rhs_storage._emphasisStyle {return false} 1730 | return true 1731 | } 1732 | if !storagesAreEqual {return false} 1733 | } 1734 | if lhs.unknownFields != rhs.unknownFields {return false} 1735 | return true 1736 | } 1737 | } 1738 | 1739 | extension NoteStoreProto: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { 1740 | static let protoMessageName: String = "NoteStoreProto" 1741 | static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1742 | 2: .same(proto: "document"), 1743 | ] 1744 | 1745 | public var isInitialized: Bool { 1746 | if self._document == nil {return false} 1747 | if let v = self._document, !v.isInitialized {return false} 1748 | return true 1749 | } 1750 | 1751 | mutating func decodeMessage(decoder: inout D) throws { 1752 | while let fieldNumber = try decoder.nextFieldNumber() { 1753 | // The use of inline closures is to circumvent an issue where the compiler 1754 | // allocates stack space for every case branch when no optimizations are 1755 | // enabled. https://github.com/apple/swift-protobuf/issues/1034 1756 | switch fieldNumber { 1757 | case 2: try { try decoder.decodeSingularMessageField(value: &self._document) }() 1758 | default: break 1759 | } 1760 | } 1761 | } 1762 | 1763 | func traverse(visitor: inout V) throws { 1764 | // The use of inline closures is to circumvent an issue where the compiler 1765 | // allocates stack space for every if/case branch local when no optimizations 1766 | // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and 1767 | // https://github.com/apple/swift-protobuf/issues/1182 1768 | try { if let v = self._document { 1769 | try visitor.visitSingularMessageField(value: v, fieldNumber: 2) 1770 | } }() 1771 | try unknownFields.traverse(visitor: &visitor) 1772 | } 1773 | 1774 | static func ==(lhs: NoteStoreProto, rhs: NoteStoreProto) -> Bool { 1775 | if lhs._document != rhs._document {return false} 1776 | if lhs.unknownFields != rhs.unknownFields {return false} 1777 | return true 1778 | } 1779 | } 1780 | 1781 | extension Document: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { 1782 | static let protoMessageName: String = "Document" 1783 | static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1784 | 2: .same(proto: "version"), 1785 | 3: .same(proto: "note"), 1786 | ] 1787 | 1788 | public var isInitialized: Bool { 1789 | if self._version == nil {return false} 1790 | if self._note == nil {return false} 1791 | if let v = self._note, !v.isInitialized {return false} 1792 | return true 1793 | } 1794 | 1795 | mutating func decodeMessage(decoder: inout D) throws { 1796 | while let fieldNumber = try decoder.nextFieldNumber() { 1797 | // The use of inline closures is to circumvent an issue where the compiler 1798 | // allocates stack space for every case branch when no optimizations are 1799 | // enabled. https://github.com/apple/swift-protobuf/issues/1034 1800 | switch fieldNumber { 1801 | case 2: try { try decoder.decodeSingularInt32Field(value: &self._version) }() 1802 | case 3: try { try decoder.decodeSingularMessageField(value: &self._note) }() 1803 | default: break 1804 | } 1805 | } 1806 | } 1807 | 1808 | func traverse(visitor: inout V) throws { 1809 | // The use of inline closures is to circumvent an issue where the compiler 1810 | // allocates stack space for every if/case branch local when no optimizations 1811 | // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and 1812 | // https://github.com/apple/swift-protobuf/issues/1182 1813 | try { if let v = self._version { 1814 | try visitor.visitSingularInt32Field(value: v, fieldNumber: 2) 1815 | } }() 1816 | try { if let v = self._note { 1817 | try visitor.visitSingularMessageField(value: v, fieldNumber: 3) 1818 | } }() 1819 | try unknownFields.traverse(visitor: &visitor) 1820 | } 1821 | 1822 | static func ==(lhs: Document, rhs: Document) -> Bool { 1823 | if lhs._version != rhs._version {return false} 1824 | if lhs._note != rhs._note {return false} 1825 | if lhs.unknownFields != rhs.unknownFields {return false} 1826 | return true 1827 | } 1828 | } 1829 | 1830 | extension Note: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { 1831 | static let protoMessageName: String = "Note" 1832 | static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1833 | 2: .standard(proto: "note_text"), 1834 | 5: .standard(proto: "attribute_run"), 1835 | ] 1836 | 1837 | public var isInitialized: Bool { 1838 | if self._noteText == nil {return false} 1839 | if !SwiftProtobuf.Internal.areAllInitialized(self.attributeRun) {return false} 1840 | return true 1841 | } 1842 | 1843 | mutating func decodeMessage(decoder: inout D) throws { 1844 | while let fieldNumber = try decoder.nextFieldNumber() { 1845 | // The use of inline closures is to circumvent an issue where the compiler 1846 | // allocates stack space for every case branch when no optimizations are 1847 | // enabled. https://github.com/apple/swift-protobuf/issues/1034 1848 | switch fieldNumber { 1849 | case 2: try { try decoder.decodeSingularStringField(value: &self._noteText) }() 1850 | case 5: try { try decoder.decodeRepeatedMessageField(value: &self.attributeRun) }() 1851 | default: break 1852 | } 1853 | } 1854 | } 1855 | 1856 | func traverse(visitor: inout V) throws { 1857 | // The use of inline closures is to circumvent an issue where the compiler 1858 | // allocates stack space for every if/case branch local when no optimizations 1859 | // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and 1860 | // https://github.com/apple/swift-protobuf/issues/1182 1861 | try { if let v = self._noteText { 1862 | try visitor.visitSingularStringField(value: v, fieldNumber: 2) 1863 | } }() 1864 | if !self.attributeRun.isEmpty { 1865 | try visitor.visitRepeatedMessageField(value: self.attributeRun, fieldNumber: 5) 1866 | } 1867 | try unknownFields.traverse(visitor: &visitor) 1868 | } 1869 | 1870 | static func ==(lhs: Note, rhs: Note) -> Bool { 1871 | if lhs._noteText != rhs._noteText {return false} 1872 | if lhs.attributeRun != rhs.attributeRun {return false} 1873 | if lhs.unknownFields != rhs.unknownFields {return false} 1874 | return true 1875 | } 1876 | } 1877 | 1878 | extension MergableDataProto: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { 1879 | static let protoMessageName: String = "MergableDataProto" 1880 | static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1881 | 2: .standard(proto: "mergable_data_object"), 1882 | ] 1883 | 1884 | public var isInitialized: Bool { 1885 | if self._mergableDataObject == nil {return false} 1886 | if let v = self._mergableDataObject, !v.isInitialized {return false} 1887 | return true 1888 | } 1889 | 1890 | mutating func decodeMessage(decoder: inout D) throws { 1891 | while let fieldNumber = try decoder.nextFieldNumber() { 1892 | // The use of inline closures is to circumvent an issue where the compiler 1893 | // allocates stack space for every case branch when no optimizations are 1894 | // enabled. https://github.com/apple/swift-protobuf/issues/1034 1895 | switch fieldNumber { 1896 | case 2: try { try decoder.decodeSingularMessageField(value: &self._mergableDataObject) }() 1897 | default: break 1898 | } 1899 | } 1900 | } 1901 | 1902 | func traverse(visitor: inout V) throws { 1903 | // The use of inline closures is to circumvent an issue where the compiler 1904 | // allocates stack space for every if/case branch local when no optimizations 1905 | // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and 1906 | // https://github.com/apple/swift-protobuf/issues/1182 1907 | try { if let v = self._mergableDataObject { 1908 | try visitor.visitSingularMessageField(value: v, fieldNumber: 2) 1909 | } }() 1910 | try unknownFields.traverse(visitor: &visitor) 1911 | } 1912 | 1913 | static func ==(lhs: MergableDataProto, rhs: MergableDataProto) -> Bool { 1914 | if lhs._mergableDataObject != rhs._mergableDataObject {return false} 1915 | if lhs.unknownFields != rhs.unknownFields {return false} 1916 | return true 1917 | } 1918 | } 1919 | 1920 | extension MergableDataObject: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { 1921 | static let protoMessageName: String = "MergableDataObject" 1922 | static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1923 | 2: .same(proto: "version"), 1924 | 3: .standard(proto: "mergeable_data_object_data"), 1925 | ] 1926 | 1927 | public var isInitialized: Bool { 1928 | if self._version == nil {return false} 1929 | if self._mergeableDataObjectData == nil {return false} 1930 | if let v = self._mergeableDataObjectData, !v.isInitialized {return false} 1931 | return true 1932 | } 1933 | 1934 | mutating func decodeMessage(decoder: inout D) throws { 1935 | while let fieldNumber = try decoder.nextFieldNumber() { 1936 | // The use of inline closures is to circumvent an issue where the compiler 1937 | // allocates stack space for every case branch when no optimizations are 1938 | // enabled. https://github.com/apple/swift-protobuf/issues/1034 1939 | switch fieldNumber { 1940 | case 2: try { try decoder.decodeSingularInt32Field(value: &self._version) }() 1941 | case 3: try { try decoder.decodeSingularMessageField(value: &self._mergeableDataObjectData) }() 1942 | default: break 1943 | } 1944 | } 1945 | } 1946 | 1947 | func traverse(visitor: inout V) throws { 1948 | // The use of inline closures is to circumvent an issue where the compiler 1949 | // allocates stack space for every if/case branch local when no optimizations 1950 | // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and 1951 | // https://github.com/apple/swift-protobuf/issues/1182 1952 | try { if let v = self._version { 1953 | try visitor.visitSingularInt32Field(value: v, fieldNumber: 2) 1954 | } }() 1955 | try { if let v = self._mergeableDataObjectData { 1956 | try visitor.visitSingularMessageField(value: v, fieldNumber: 3) 1957 | } }() 1958 | try unknownFields.traverse(visitor: &visitor) 1959 | } 1960 | 1961 | static func ==(lhs: MergableDataObject, rhs: MergableDataObject) -> Bool { 1962 | if lhs._version != rhs._version {return false} 1963 | if lhs._mergeableDataObjectData != rhs._mergeableDataObjectData {return false} 1964 | if lhs.unknownFields != rhs.unknownFields {return false} 1965 | return true 1966 | } 1967 | } 1968 | 1969 | extension MergeableDataObjectData: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { 1970 | static let protoMessageName: String = "MergeableDataObjectData" 1971 | static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1972 | 3: .standard(proto: "mergeable_data_object_entry"), 1973 | 4: .standard(proto: "mergeable_data_object_key_item"), 1974 | 5: .standard(proto: "mergeable_data_object_type_item"), 1975 | 6: .standard(proto: "mergeable_data_object_uuid_item"), 1976 | ] 1977 | 1978 | public var isInitialized: Bool { 1979 | if !SwiftProtobuf.Internal.areAllInitialized(self.mergeableDataObjectEntry) {return false} 1980 | return true 1981 | } 1982 | 1983 | mutating func decodeMessage(decoder: inout D) throws { 1984 | while let fieldNumber = try decoder.nextFieldNumber() { 1985 | // The use of inline closures is to circumvent an issue where the compiler 1986 | // allocates stack space for every case branch when no optimizations are 1987 | // enabled. https://github.com/apple/swift-protobuf/issues/1034 1988 | switch fieldNumber { 1989 | case 3: try { try decoder.decodeRepeatedMessageField(value: &self.mergeableDataObjectEntry) }() 1990 | case 4: try { try decoder.decodeRepeatedStringField(value: &self.mergeableDataObjectKeyItem) }() 1991 | case 5: try { try decoder.decodeRepeatedStringField(value: &self.mergeableDataObjectTypeItem) }() 1992 | case 6: try { try decoder.decodeRepeatedBytesField(value: &self.mergeableDataObjectUuidItem) }() 1993 | default: break 1994 | } 1995 | } 1996 | } 1997 | 1998 | func traverse(visitor: inout V) throws { 1999 | if !self.mergeableDataObjectEntry.isEmpty { 2000 | try visitor.visitRepeatedMessageField(value: self.mergeableDataObjectEntry, fieldNumber: 3) 2001 | } 2002 | if !self.mergeableDataObjectKeyItem.isEmpty { 2003 | try visitor.visitRepeatedStringField(value: self.mergeableDataObjectKeyItem, fieldNumber: 4) 2004 | } 2005 | if !self.mergeableDataObjectTypeItem.isEmpty { 2006 | try visitor.visitRepeatedStringField(value: self.mergeableDataObjectTypeItem, fieldNumber: 5) 2007 | } 2008 | if !self.mergeableDataObjectUuidItem.isEmpty { 2009 | try visitor.visitRepeatedBytesField(value: self.mergeableDataObjectUuidItem, fieldNumber: 6) 2010 | } 2011 | try unknownFields.traverse(visitor: &visitor) 2012 | } 2013 | 2014 | static func ==(lhs: MergeableDataObjectData, rhs: MergeableDataObjectData) -> Bool { 2015 | if lhs.mergeableDataObjectEntry != rhs.mergeableDataObjectEntry {return false} 2016 | if lhs.mergeableDataObjectKeyItem != rhs.mergeableDataObjectKeyItem {return false} 2017 | if lhs.mergeableDataObjectTypeItem != rhs.mergeableDataObjectTypeItem {return false} 2018 | if lhs.mergeableDataObjectUuidItem != rhs.mergeableDataObjectUuidItem {return false} 2019 | if lhs.unknownFields != rhs.unknownFields {return false} 2020 | return true 2021 | } 2022 | } 2023 | 2024 | extension MergeableDataObjectEntry: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { 2025 | static let protoMessageName: String = "MergeableDataObjectEntry" 2026 | static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 2027 | 1: .standard(proto: "register_latest"), 2028 | 5: .same(proto: "list"), 2029 | 6: .same(proto: "dictionary"), 2030 | 9: .standard(proto: "unknown_message"), 2031 | 10: .same(proto: "note"), 2032 | 13: .standard(proto: "custom_map"), 2033 | 16: .standard(proto: "ordered_set"), 2034 | ] 2035 | 2036 | public var isInitialized: Bool { 2037 | if self._registerLatest == nil {return false} 2038 | if let v = self._registerLatest, !v.isInitialized {return false} 2039 | if let v = self._list, !v.isInitialized {return false} 2040 | if let v = self._dictionary, !v.isInitialized {return false} 2041 | if let v = self._note, !v.isInitialized {return false} 2042 | if let v = self._customMap, !v.isInitialized {return false} 2043 | if let v = self._orderedSet, !v.isInitialized {return false} 2044 | return true 2045 | } 2046 | 2047 | mutating func decodeMessage(decoder: inout D) throws { 2048 | while let fieldNumber = try decoder.nextFieldNumber() { 2049 | // The use of inline closures is to circumvent an issue where the compiler 2050 | // allocates stack space for every case branch when no optimizations are 2051 | // enabled. https://github.com/apple/swift-protobuf/issues/1034 2052 | switch fieldNumber { 2053 | case 1: try { try decoder.decodeSingularMessageField(value: &self._registerLatest) }() 2054 | case 5: try { try decoder.decodeSingularMessageField(value: &self._list) }() 2055 | case 6: try { try decoder.decodeSingularMessageField(value: &self._dictionary) }() 2056 | case 9: try { try decoder.decodeSingularMessageField(value: &self._unknownMessage) }() 2057 | case 10: try { try decoder.decodeSingularMessageField(value: &self._note) }() 2058 | case 13: try { try decoder.decodeSingularMessageField(value: &self._customMap) }() 2059 | case 16: try { try decoder.decodeSingularMessageField(value: &self._orderedSet) }() 2060 | default: break 2061 | } 2062 | } 2063 | } 2064 | 2065 | func traverse(visitor: inout V) throws { 2066 | // The use of inline closures is to circumvent an issue where the compiler 2067 | // allocates stack space for every if/case branch local when no optimizations 2068 | // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and 2069 | // https://github.com/apple/swift-protobuf/issues/1182 2070 | try { if let v = self._registerLatest { 2071 | try visitor.visitSingularMessageField(value: v, fieldNumber: 1) 2072 | } }() 2073 | try { if let v = self._list { 2074 | try visitor.visitSingularMessageField(value: v, fieldNumber: 5) 2075 | } }() 2076 | try { if let v = self._dictionary { 2077 | try visitor.visitSingularMessageField(value: v, fieldNumber: 6) 2078 | } }() 2079 | try { if let v = self._unknownMessage { 2080 | try visitor.visitSingularMessageField(value: v, fieldNumber: 9) 2081 | } }() 2082 | try { if let v = self._note { 2083 | try visitor.visitSingularMessageField(value: v, fieldNumber: 10) 2084 | } }() 2085 | try { if let v = self._customMap { 2086 | try visitor.visitSingularMessageField(value: v, fieldNumber: 13) 2087 | } }() 2088 | try { if let v = self._orderedSet { 2089 | try visitor.visitSingularMessageField(value: v, fieldNumber: 16) 2090 | } }() 2091 | try unknownFields.traverse(visitor: &visitor) 2092 | } 2093 | 2094 | static func ==(lhs: MergeableDataObjectEntry, rhs: MergeableDataObjectEntry) -> Bool { 2095 | if lhs._registerLatest != rhs._registerLatest {return false} 2096 | if lhs._list != rhs._list {return false} 2097 | if lhs._dictionary != rhs._dictionary {return false} 2098 | if lhs._unknownMessage != rhs._unknownMessage {return false} 2099 | if lhs._note != rhs._note {return false} 2100 | if lhs._customMap != rhs._customMap {return false} 2101 | if lhs._orderedSet != rhs._orderedSet {return false} 2102 | if lhs.unknownFields != rhs.unknownFields {return false} 2103 | return true 2104 | } 2105 | } 2106 | 2107 | extension UnknownMergeableDataObjectEntryMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { 2108 | static let protoMessageName: String = "UnknownMergeableDataObjectEntryMessage" 2109 | static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 2110 | 1: .standard(proto: "unknown_entry"), 2111 | ] 2112 | 2113 | mutating func decodeMessage(decoder: inout D) throws { 2114 | while let fieldNumber = try decoder.nextFieldNumber() { 2115 | // The use of inline closures is to circumvent an issue where the compiler 2116 | // allocates stack space for every case branch when no optimizations are 2117 | // enabled. https://github.com/apple/swift-protobuf/issues/1034 2118 | switch fieldNumber { 2119 | case 1: try { try decoder.decodeSingularMessageField(value: &self._unknownEntry) }() 2120 | default: break 2121 | } 2122 | } 2123 | } 2124 | 2125 | func traverse(visitor: inout V) throws { 2126 | // The use of inline closures is to circumvent an issue where the compiler 2127 | // allocates stack space for every if/case branch local when no optimizations 2128 | // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and 2129 | // https://github.com/apple/swift-protobuf/issues/1182 2130 | try { if let v = self._unknownEntry { 2131 | try visitor.visitSingularMessageField(value: v, fieldNumber: 1) 2132 | } }() 2133 | try unknownFields.traverse(visitor: &visitor) 2134 | } 2135 | 2136 | static func ==(lhs: UnknownMergeableDataObjectEntryMessage, rhs: UnknownMergeableDataObjectEntryMessage) -> Bool { 2137 | if lhs._unknownEntry != rhs._unknownEntry {return false} 2138 | if lhs.unknownFields != rhs.unknownFields {return false} 2139 | return true 2140 | } 2141 | } 2142 | 2143 | extension UnknownMergeableDataObjectEntryMessageEntry: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { 2144 | static let protoMessageName: String = "UnknownMergeableDataObjectEntryMessageEntry" 2145 | static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 2146 | 1: .standard(proto: "unknown_int1"), 2147 | 2: .standard(proto: "unknown_int2"), 2148 | ] 2149 | 2150 | mutating func decodeMessage(decoder: inout D) throws { 2151 | while let fieldNumber = try decoder.nextFieldNumber() { 2152 | // The use of inline closures is to circumvent an issue where the compiler 2153 | // allocates stack space for every case branch when no optimizations are 2154 | // enabled. https://github.com/apple/swift-protobuf/issues/1034 2155 | switch fieldNumber { 2156 | case 1: try { try decoder.decodeSingularInt32Field(value: &self._unknownInt1) }() 2157 | case 2: try { try decoder.decodeSingularInt64Field(value: &self._unknownInt2) }() 2158 | default: break 2159 | } 2160 | } 2161 | } 2162 | 2163 | func traverse(visitor: inout V) throws { 2164 | // The use of inline closures is to circumvent an issue where the compiler 2165 | // allocates stack space for every if/case branch local when no optimizations 2166 | // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and 2167 | // https://github.com/apple/swift-protobuf/issues/1182 2168 | try { if let v = self._unknownInt1 { 2169 | try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) 2170 | } }() 2171 | try { if let v = self._unknownInt2 { 2172 | try visitor.visitSingularInt64Field(value: v, fieldNumber: 2) 2173 | } }() 2174 | try unknownFields.traverse(visitor: &visitor) 2175 | } 2176 | 2177 | static func ==(lhs: UnknownMergeableDataObjectEntryMessageEntry, rhs: UnknownMergeableDataObjectEntryMessageEntry) -> Bool { 2178 | if lhs._unknownInt1 != rhs._unknownInt1 {return false} 2179 | if lhs._unknownInt2 != rhs._unknownInt2 {return false} 2180 | if lhs.unknownFields != rhs.unknownFields {return false} 2181 | return true 2182 | } 2183 | } 2184 | 2185 | extension MergeableDataObjectMap: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { 2186 | static let protoMessageName: String = "MergeableDataObjectMap" 2187 | static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 2188 | 1: .same(proto: "type"), 2189 | 3: .standard(proto: "map_entry"), 2190 | ] 2191 | 2192 | public var isInitialized: Bool { 2193 | if self._type == nil {return false} 2194 | if !SwiftProtobuf.Internal.areAllInitialized(self.mapEntry) {return false} 2195 | return true 2196 | } 2197 | 2198 | mutating func decodeMessage(decoder: inout D) throws { 2199 | while let fieldNumber = try decoder.nextFieldNumber() { 2200 | // The use of inline closures is to circumvent an issue where the compiler 2201 | // allocates stack space for every case branch when no optimizations are 2202 | // enabled. https://github.com/apple/swift-protobuf/issues/1034 2203 | switch fieldNumber { 2204 | case 1: try { try decoder.decodeSingularInt32Field(value: &self._type) }() 2205 | case 3: try { try decoder.decodeRepeatedMessageField(value: &self.mapEntry) }() 2206 | default: break 2207 | } 2208 | } 2209 | } 2210 | 2211 | func traverse(visitor: inout V) throws { 2212 | // The use of inline closures is to circumvent an issue where the compiler 2213 | // allocates stack space for every if/case branch local when no optimizations 2214 | // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and 2215 | // https://github.com/apple/swift-protobuf/issues/1182 2216 | try { if let v = self._type { 2217 | try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) 2218 | } }() 2219 | if !self.mapEntry.isEmpty { 2220 | try visitor.visitRepeatedMessageField(value: self.mapEntry, fieldNumber: 3) 2221 | } 2222 | try unknownFields.traverse(visitor: &visitor) 2223 | } 2224 | 2225 | static func ==(lhs: MergeableDataObjectMap, rhs: MergeableDataObjectMap) -> Bool { 2226 | if lhs._type != rhs._type {return false} 2227 | if lhs.mapEntry != rhs.mapEntry {return false} 2228 | if lhs.unknownFields != rhs.unknownFields {return false} 2229 | return true 2230 | } 2231 | } 2232 | 2233 | extension OrderedSet: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { 2234 | static let protoMessageName: String = "OrderedSet" 2235 | static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 2236 | 1: .same(proto: "ordering"), 2237 | 2: .same(proto: "elements"), 2238 | ] 2239 | 2240 | public var isInitialized: Bool { 2241 | if self._ordering == nil {return false} 2242 | if self._elements == nil {return false} 2243 | if let v = self._ordering, !v.isInitialized {return false} 2244 | if let v = self._elements, !v.isInitialized {return false} 2245 | return true 2246 | } 2247 | 2248 | mutating func decodeMessage(decoder: inout D) throws { 2249 | while let fieldNumber = try decoder.nextFieldNumber() { 2250 | // The use of inline closures is to circumvent an issue where the compiler 2251 | // allocates stack space for every case branch when no optimizations are 2252 | // enabled. https://github.com/apple/swift-protobuf/issues/1034 2253 | switch fieldNumber { 2254 | case 1: try { try decoder.decodeSingularMessageField(value: &self._ordering) }() 2255 | case 2: try { try decoder.decodeSingularMessageField(value: &self._elements) }() 2256 | default: break 2257 | } 2258 | } 2259 | } 2260 | 2261 | func traverse(visitor: inout V) throws { 2262 | // The use of inline closures is to circumvent an issue where the compiler 2263 | // allocates stack space for every if/case branch local when no optimizations 2264 | // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and 2265 | // https://github.com/apple/swift-protobuf/issues/1182 2266 | try { if let v = self._ordering { 2267 | try visitor.visitSingularMessageField(value: v, fieldNumber: 1) 2268 | } }() 2269 | try { if let v = self._elements { 2270 | try visitor.visitSingularMessageField(value: v, fieldNumber: 2) 2271 | } }() 2272 | try unknownFields.traverse(visitor: &visitor) 2273 | } 2274 | 2275 | static func ==(lhs: OrderedSet, rhs: OrderedSet) -> Bool { 2276 | if lhs._ordering != rhs._ordering {return false} 2277 | if lhs._elements != rhs._elements {return false} 2278 | if lhs.unknownFields != rhs.unknownFields {return false} 2279 | return true 2280 | } 2281 | } 2282 | 2283 | extension OrderedSetOrdering: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { 2284 | static let protoMessageName: String = "OrderedSetOrdering" 2285 | static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 2286 | 1: .same(proto: "array"), 2287 | 2: .same(proto: "contents"), 2288 | ] 2289 | 2290 | public var isInitialized: Bool { 2291 | if self._array == nil {return false} 2292 | if self._contents == nil {return false} 2293 | if let v = self._array, !v.isInitialized {return false} 2294 | if let v = self._contents, !v.isInitialized {return false} 2295 | return true 2296 | } 2297 | 2298 | mutating func decodeMessage(decoder: inout D) throws { 2299 | while let fieldNumber = try decoder.nextFieldNumber() { 2300 | // The use of inline closures is to circumvent an issue where the compiler 2301 | // allocates stack space for every case branch when no optimizations are 2302 | // enabled. https://github.com/apple/swift-protobuf/issues/1034 2303 | switch fieldNumber { 2304 | case 1: try { try decoder.decodeSingularMessageField(value: &self._array) }() 2305 | case 2: try { try decoder.decodeSingularMessageField(value: &self._contents) }() 2306 | default: break 2307 | } 2308 | } 2309 | } 2310 | 2311 | func traverse(visitor: inout V) throws { 2312 | // The use of inline closures is to circumvent an issue where the compiler 2313 | // allocates stack space for every if/case branch local when no optimizations 2314 | // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and 2315 | // https://github.com/apple/swift-protobuf/issues/1182 2316 | try { if let v = self._array { 2317 | try visitor.visitSingularMessageField(value: v, fieldNumber: 1) 2318 | } }() 2319 | try { if let v = self._contents { 2320 | try visitor.visitSingularMessageField(value: v, fieldNumber: 2) 2321 | } }() 2322 | try unknownFields.traverse(visitor: &visitor) 2323 | } 2324 | 2325 | static func ==(lhs: OrderedSetOrdering, rhs: OrderedSetOrdering) -> Bool { 2326 | if lhs._array != rhs._array {return false} 2327 | if lhs._contents != rhs._contents {return false} 2328 | if lhs.unknownFields != rhs.unknownFields {return false} 2329 | return true 2330 | } 2331 | } 2332 | 2333 | extension OrderedSetOrderingArray: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { 2334 | static let protoMessageName: String = "OrderedSetOrderingArray" 2335 | static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 2336 | 1: .same(proto: "contents"), 2337 | 2: .same(proto: "attachment"), 2338 | ] 2339 | 2340 | public var isInitialized: Bool { 2341 | if self._contents == nil {return false} 2342 | if let v = self._contents, !v.isInitialized {return false} 2343 | if !SwiftProtobuf.Internal.areAllInitialized(self.attachment) {return false} 2344 | return true 2345 | } 2346 | 2347 | mutating func decodeMessage(decoder: inout D) throws { 2348 | while let fieldNumber = try decoder.nextFieldNumber() { 2349 | // The use of inline closures is to circumvent an issue where the compiler 2350 | // allocates stack space for every case branch when no optimizations are 2351 | // enabled. https://github.com/apple/swift-protobuf/issues/1034 2352 | switch fieldNumber { 2353 | case 1: try { try decoder.decodeSingularMessageField(value: &self._contents) }() 2354 | case 2: try { try decoder.decodeRepeatedMessageField(value: &self.attachment) }() 2355 | default: break 2356 | } 2357 | } 2358 | } 2359 | 2360 | func traverse(visitor: inout V) throws { 2361 | // The use of inline closures is to circumvent an issue where the compiler 2362 | // allocates stack space for every if/case branch local when no optimizations 2363 | // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and 2364 | // https://github.com/apple/swift-protobuf/issues/1182 2365 | try { if let v = self._contents { 2366 | try visitor.visitSingularMessageField(value: v, fieldNumber: 1) 2367 | } }() 2368 | if !self.attachment.isEmpty { 2369 | try visitor.visitRepeatedMessageField(value: self.attachment, fieldNumber: 2) 2370 | } 2371 | try unknownFields.traverse(visitor: &visitor) 2372 | } 2373 | 2374 | static func ==(lhs: OrderedSetOrderingArray, rhs: OrderedSetOrderingArray) -> Bool { 2375 | if lhs._contents != rhs._contents {return false} 2376 | if lhs.attachment != rhs.attachment {return false} 2377 | if lhs.unknownFields != rhs.unknownFields {return false} 2378 | return true 2379 | } 2380 | } 2381 | 2382 | extension OrderedSetOrderingArrayAttachment: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { 2383 | static let protoMessageName: String = "OrderedSetOrderingArrayAttachment" 2384 | static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 2385 | 1: .same(proto: "index"), 2386 | 2: .same(proto: "uuid"), 2387 | ] 2388 | 2389 | public var isInitialized: Bool { 2390 | if self._index == nil {return false} 2391 | if self._uuid == nil {return false} 2392 | return true 2393 | } 2394 | 2395 | mutating func decodeMessage(decoder: inout D) throws { 2396 | while let fieldNumber = try decoder.nextFieldNumber() { 2397 | // The use of inline closures is to circumvent an issue where the compiler 2398 | // allocates stack space for every case branch when no optimizations are 2399 | // enabled. https://github.com/apple/swift-protobuf/issues/1034 2400 | switch fieldNumber { 2401 | case 1: try { try decoder.decodeSingularInt32Field(value: &self._index) }() 2402 | case 2: try { try decoder.decodeSingularBytesField(value: &self._uuid) }() 2403 | default: break 2404 | } 2405 | } 2406 | } 2407 | 2408 | func traverse(visitor: inout V) throws { 2409 | // The use of inline closures is to circumvent an issue where the compiler 2410 | // allocates stack space for every if/case branch local when no optimizations 2411 | // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and 2412 | // https://github.com/apple/swift-protobuf/issues/1182 2413 | try { if let v = self._index { 2414 | try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) 2415 | } }() 2416 | try { if let v = self._uuid { 2417 | try visitor.visitSingularBytesField(value: v, fieldNumber: 2) 2418 | } }() 2419 | try unknownFields.traverse(visitor: &visitor) 2420 | } 2421 | 2422 | static func ==(lhs: OrderedSetOrderingArrayAttachment, rhs: OrderedSetOrderingArrayAttachment) -> Bool { 2423 | if lhs._index != rhs._index {return false} 2424 | if lhs._uuid != rhs._uuid {return false} 2425 | if lhs.unknownFields != rhs.unknownFields {return false} 2426 | return true 2427 | } 2428 | } 2429 | 2430 | extension ProtoList: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { 2431 | static let protoMessageName: String = "ProtoList" 2432 | static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 2433 | 1: .standard(proto: "list_entry"), 2434 | ] 2435 | 2436 | public var isInitialized: Bool { 2437 | if !SwiftProtobuf.Internal.areAllInitialized(self.listEntry) {return false} 2438 | return true 2439 | } 2440 | 2441 | mutating func decodeMessage(decoder: inout D) throws { 2442 | while let fieldNumber = try decoder.nextFieldNumber() { 2443 | // The use of inline closures is to circumvent an issue where the compiler 2444 | // allocates stack space for every case branch when no optimizations are 2445 | // enabled. https://github.com/apple/swift-protobuf/issues/1034 2446 | switch fieldNumber { 2447 | case 1: try { try decoder.decodeRepeatedMessageField(value: &self.listEntry) }() 2448 | default: break 2449 | } 2450 | } 2451 | } 2452 | 2453 | func traverse(visitor: inout V) throws { 2454 | if !self.listEntry.isEmpty { 2455 | try visitor.visitRepeatedMessageField(value: self.listEntry, fieldNumber: 1) 2456 | } 2457 | try unknownFields.traverse(visitor: &visitor) 2458 | } 2459 | 2460 | static func ==(lhs: ProtoList, rhs: ProtoList) -> Bool { 2461 | if lhs.listEntry != rhs.listEntry {return false} 2462 | if lhs.unknownFields != rhs.unknownFields {return false} 2463 | return true 2464 | } 2465 | } 2466 | 2467 | extension ProtoListEntry: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { 2468 | static let protoMessageName: String = "ProtoListEntry" 2469 | static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 2470 | 2: .same(proto: "id"), 2471 | 3: .same(proto: "details"), 2472 | 4: .standard(proto: "additional_details"), 2473 | ] 2474 | 2475 | public var isInitialized: Bool { 2476 | if self._id == nil {return false} 2477 | if self._additionalDetails == nil {return false} 2478 | if let v = self._id, !v.isInitialized {return false} 2479 | if let v = self._details, !v.isInitialized {return false} 2480 | if let v = self._additionalDetails, !v.isInitialized {return false} 2481 | return true 2482 | } 2483 | 2484 | mutating func decodeMessage(decoder: inout D) throws { 2485 | while let fieldNumber = try decoder.nextFieldNumber() { 2486 | // The use of inline closures is to circumvent an issue where the compiler 2487 | // allocates stack space for every case branch when no optimizations are 2488 | // enabled. https://github.com/apple/swift-protobuf/issues/1034 2489 | switch fieldNumber { 2490 | case 2: try { try decoder.decodeSingularMessageField(value: &self._id) }() 2491 | case 3: try { try decoder.decodeSingularMessageField(value: &self._details) }() 2492 | case 4: try { try decoder.decodeSingularMessageField(value: &self._additionalDetails) }() 2493 | default: break 2494 | } 2495 | } 2496 | } 2497 | 2498 | func traverse(visitor: inout V) throws { 2499 | // The use of inline closures is to circumvent an issue where the compiler 2500 | // allocates stack space for every if/case branch local when no optimizations 2501 | // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and 2502 | // https://github.com/apple/swift-protobuf/issues/1182 2503 | try { if let v = self._id { 2504 | try visitor.visitSingularMessageField(value: v, fieldNumber: 2) 2505 | } }() 2506 | try { if let v = self._details { 2507 | try visitor.visitSingularMessageField(value: v, fieldNumber: 3) 2508 | } }() 2509 | try { if let v = self._additionalDetails { 2510 | try visitor.visitSingularMessageField(value: v, fieldNumber: 4) 2511 | } }() 2512 | try unknownFields.traverse(visitor: &visitor) 2513 | } 2514 | 2515 | static func ==(lhs: ProtoListEntry, rhs: ProtoListEntry) -> Bool { 2516 | if lhs._id != rhs._id {return false} 2517 | if lhs._details != rhs._details {return false} 2518 | if lhs._additionalDetails != rhs._additionalDetails {return false} 2519 | if lhs.unknownFields != rhs.unknownFields {return false} 2520 | return true 2521 | } 2522 | } 2523 | 2524 | extension ProtoListEntryDetails: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { 2525 | static let protoMessageName: String = "ProtoListEntryDetails" 2526 | static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 2527 | 1: .standard(proto: "list_entry_details_key"), 2528 | 2: .same(proto: "id"), 2529 | ] 2530 | 2531 | public var isInitialized: Bool { 2532 | if let v = self._listEntryDetailsKey, !v.isInitialized {return false} 2533 | if let v = self._id, !v.isInitialized {return false} 2534 | return true 2535 | } 2536 | 2537 | mutating func decodeMessage(decoder: inout D) throws { 2538 | while let fieldNumber = try decoder.nextFieldNumber() { 2539 | // The use of inline closures is to circumvent an issue where the compiler 2540 | // allocates stack space for every case branch when no optimizations are 2541 | // enabled. https://github.com/apple/swift-protobuf/issues/1034 2542 | switch fieldNumber { 2543 | case 1: try { try decoder.decodeSingularMessageField(value: &self._listEntryDetailsKey) }() 2544 | case 2: try { try decoder.decodeSingularMessageField(value: &self._id) }() 2545 | default: break 2546 | } 2547 | } 2548 | } 2549 | 2550 | func traverse(visitor: inout V) throws { 2551 | // The use of inline closures is to circumvent an issue where the compiler 2552 | // allocates stack space for every if/case branch local when no optimizations 2553 | // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and 2554 | // https://github.com/apple/swift-protobuf/issues/1182 2555 | try { if let v = self._listEntryDetailsKey { 2556 | try visitor.visitSingularMessageField(value: v, fieldNumber: 1) 2557 | } }() 2558 | try { if let v = self._id { 2559 | try visitor.visitSingularMessageField(value: v, fieldNumber: 2) 2560 | } }() 2561 | try unknownFields.traverse(visitor: &visitor) 2562 | } 2563 | 2564 | static func ==(lhs: ProtoListEntryDetails, rhs: ProtoListEntryDetails) -> Bool { 2565 | if lhs._listEntryDetailsKey != rhs._listEntryDetailsKey {return false} 2566 | if lhs._id != rhs._id {return false} 2567 | if lhs.unknownFields != rhs.unknownFields {return false} 2568 | return true 2569 | } 2570 | } 2571 | 2572 | extension ProtoListEntryDetailsKey: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { 2573 | static let protoMessageName: String = "ProtoListEntryDetailsKey" 2574 | static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 2575 | 1: .standard(proto: "list_entry_details_type_index"), 2576 | 2: .standard(proto: "list_entry_details_key"), 2577 | ] 2578 | 2579 | public var isInitialized: Bool { 2580 | if self._listEntryDetailsTypeIndex == nil {return false} 2581 | if self._listEntryDetailsKey == nil {return false} 2582 | return true 2583 | } 2584 | 2585 | mutating func decodeMessage(decoder: inout D) throws { 2586 | while let fieldNumber = try decoder.nextFieldNumber() { 2587 | // The use of inline closures is to circumvent an issue where the compiler 2588 | // allocates stack space for every case branch when no optimizations are 2589 | // enabled. https://github.com/apple/swift-protobuf/issues/1034 2590 | switch fieldNumber { 2591 | case 1: try { try decoder.decodeSingularInt32Field(value: &self._listEntryDetailsTypeIndex) }() 2592 | case 2: try { try decoder.decodeSingularInt32Field(value: &self._listEntryDetailsKey) }() 2593 | default: break 2594 | } 2595 | } 2596 | } 2597 | 2598 | func traverse(visitor: inout V) throws { 2599 | // The use of inline closures is to circumvent an issue where the compiler 2600 | // allocates stack space for every if/case branch local when no optimizations 2601 | // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and 2602 | // https://github.com/apple/swift-protobuf/issues/1182 2603 | try { if let v = self._listEntryDetailsTypeIndex { 2604 | try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) 2605 | } }() 2606 | try { if let v = self._listEntryDetailsKey { 2607 | try visitor.visitSingularInt32Field(value: v, fieldNumber: 2) 2608 | } }() 2609 | try unknownFields.traverse(visitor: &visitor) 2610 | } 2611 | 2612 | static func ==(lhs: ProtoListEntryDetailsKey, rhs: ProtoListEntryDetailsKey) -> Bool { 2613 | if lhs._listEntryDetailsTypeIndex != rhs._listEntryDetailsTypeIndex {return false} 2614 | if lhs._listEntryDetailsKey != rhs._listEntryDetailsKey {return false} 2615 | if lhs.unknownFields != rhs.unknownFields {return false} 2616 | return true 2617 | } 2618 | } 2619 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AndroidRestore 2 | A very janky way of restoring iOS backups to Android devices 3 | 4 | How to use: 5 | - connect your android with debug mode enabled 6 | - ensure you have adb in /usr/local/bin/adb 7 | - backup your iPhone 8 | - restore & enjoy --------------------------------------------------------------------------------