From 43af8c18e39e41c45964eb08220ae2e697605fa5 Mon Sep 17 00:00:00 2001 From: Frederic Jacobs Date: Wed, 19 Nov 2014 21:17:53 +0100 Subject: [PATCH] Merging UI code with some basic TextSecureKit code. --- Libraries/ProtocolBuffers/AbstractMessage.h | 27 - Libraries/ProtocolBuffers/AbstractMessage.m | 74 - .../ProtocolBuffers/AbstractMessage_Builder.h | 25 - .../ProtocolBuffers/AbstractMessage_Builder.m | 119 -- Libraries/ProtocolBuffers/Bootstrap.h | 27 - Libraries/ProtocolBuffers/CodedInputStream.h | 184 -- Libraries/ProtocolBuffers/CodedInputStream.m | 790 -------- Libraries/ProtocolBuffers/CodedOutputStream.h | 216 -- Libraries/ProtocolBuffers/CodedOutputStream.m | 974 --------- .../ProtocolBuffers/ConcreteExtensionField.h | 62 - .../ProtocolBuffers/ConcreteExtensionField.m | 543 ----- Libraries/ProtocolBuffers/ExtendableMessage.h | 77 - Libraries/ProtocolBuffers/ExtendableMessage.m | 106 - .../ExtendableMessage_Builder.h | 75 - .../ExtendableMessage_Builder.m | 173 -- Libraries/ProtocolBuffers/ExtensionField.h | 36 - Libraries/ProtocolBuffers/ExtensionRegistry.h | 83 - Libraries/ProtocolBuffers/ExtensionRegistry.m | 62 - Libraries/ProtocolBuffers/Field.h | 42 - Libraries/ProtocolBuffers/Field.m | 143 -- .../ProtocolBuffers/ForwardDeclarations.h | 32 - Libraries/ProtocolBuffers/GeneratedMessage.h | 33 - Libraries/ProtocolBuffers/GeneratedMessage.m | 42 - .../GeneratedMessage_Builder.h | 30 - .../GeneratedMessage_Builder.m | 92 - Libraries/ProtocolBuffers/Message.h | 70 - Libraries/ProtocolBuffers/Message_Builder.h | 134 -- .../MutableExtensionRegistry.h | 26 - .../MutableExtensionRegistry.m | 65 - Libraries/ProtocolBuffers/MutableField.h | 33 - Libraries/ProtocolBuffers/MutableField.m | 138 -- Libraries/ProtocolBuffers/ProtocolBuffers.h | 36 - Libraries/ProtocolBuffers/TextFormat.h | 26 - Libraries/ProtocolBuffers/TextFormat.m | 238 --- Libraries/ProtocolBuffers/UnknownFieldSet.h | 45 - Libraries/ProtocolBuffers/UnknownFieldSet.m | 161 -- .../ProtocolBuffers/UnknownFieldSet_Builder.h | 51 - .../ProtocolBuffers/UnknownFieldSet_Builder.m | 237 --- Libraries/ProtocolBuffers/Utilities.h | 26 - Libraries/ProtocolBuffers/Utilities.m | 79 - Libraries/ProtocolBuffers/WireFormat.h | 38 - Libraries/ProtocolBuffers/WireFormat.m | 31 - Podfile | 9 +- Podfile.lock | 102 +- Signal.xcodeproj/project.pbxproj | 1739 +++++++++-------- Signal/{ => Images}/archive@2x.png | Bin Signal/{ => Images}/blue-archive@2x.png | Bin Signal/{ => Images}/call@2x.png | Bin Signal/{ => Images}/call_dark@2x.png | Bin Signal/{ => Images}/checkmark.png | Bin Signal/{ => Images}/contacts.png | Bin Signal/{ => Images}/contacts@2x.png | Bin Signal/{ => Images}/contacts_tab@2x.png | Bin Signal/{ => Images}/delete@2x.png | Bin Signal/{ => Images}/delete_history@2x.png | Bin Signal/{ => Images}/endcall@2x.png | Bin Signal/{ => Images}/favourite.png | Bin Signal/{ => Images}/info@2x.png | Bin Signal/{ => Images}/keypad@2x.png | Bin Signal/{ => Images}/lock@2x.png | Bin Signal/{ => Images}/lock_white@2x.png | Bin Signal/{ => Images}/logo_intro@2x.png | Bin Signal/{ => Images}/missed.png | Bin Signal/{ => Images}/mute_off@2x.png | Bin Signal/{ => Images}/mute_on@2x.png | Bin Signal/{ => Images}/photo@2x.png | Bin Signal/{ => Images}/quit@2x.png | Bin Signal/{ => Images}/received.png | Bin Signal/{ => Images}/red-delete@2x.png | Bin Signal/{ => Images}/reply.png | Bin Signal/{ => Images}/savephoto@2x.png | Bin Signal/{ => Images}/settings.png | Bin Signal/{ => Images}/settings_dark@2x.png | Bin Signal/{ => Images}/share@2x.png | Bin Signal/{ => Images}/shred@2x.png | Bin Signal/{ => Images}/signal@2x.png | Bin Signal/{ => Images}/signals.png | Bin Signal/{ => Images}/speaker_off@2x.png | Bin Signal/{ => Images}/speaker_on@2x.png | Bin Signal/Signal-Info.plist | 2 - Signal/src/AppDelegate.m | 33 +- Signal/src/Storyboard/Storyboard.storyboard | 369 ++-- Signal/src/environment/PreferencesUtil.h | 1 - Signal/src/network/PushManager.m | 57 +- .../network/http/RPServerRequestsManager.m | 2 +- .../src/phone/signaling/InitiateSignal.pb.h | 79 +- .../src/phone/signaling/InitiateSignal.pb.m | 190 +- .../signaling/ResponderSessionDescriptor.m | 4 +- .../src/textsecure/Account/TSAccountManager.h | 71 + .../src/textsecure/Account/TSAccountManager.m | 124 ++ .../src/textsecure/Account/TSNumberVerifier.h | 39 + .../src/textsecure/Account/TSNumberVerifier.m | 149 ++ .../src/textsecure/Account/TSPreKeyManager.h | 17 + .../src/textsecure/Account/TSPreKeyManager.m | 50 + Signal/src/textsecure/Contacts/TSContact.h | 42 + Signal/src/textsecure/Contacts/TSContact.m | 31 + Signal/src/textsecure/Contacts/TSGroup.h | 27 + Signal/src/textsecure/Contacts/TSGroup.m | 17 + Signal/src/textsecure/Contacts/TSRecipient.h | 31 + Signal/src/textsecure/Contacts/TSRecipient.m | 84 + Signal/src/textsecure/Contacts/TSThread.h | 31 + Signal/src/textsecure/Contacts/TSThread.m | 35 + .../Contacts/Threads/TSContactThread.h | 20 + .../Contacts/Threads/TSContactThread.m | 54 + .../Contacts/Threads/TSGroupThread.h | 17 + .../Contacts/Threads/TSGroupThread.m | 53 + .../Messages/IncomingPushMessageSignal.pb.h | 387 ++++ .../Messages/IncomingPushMessageSignal.pb.m | 1580 +++++++++++++++ .../src/textsecure/Messages/TSAttachement.h | 27 + .../src/textsecure/Messages/TSAttachement.m | 13 + Signal/src/textsecure/Messages/TSCall.h | 31 + Signal/src/textsecure/Messages/TSCall.m | 27 + .../src/textsecure/Messages/TSErrorMessage.h | 40 + .../src/textsecure/Messages/TSErrorMessage.m | 13 + .../Messages/TSGroupMessageManager.h | 17 + .../Messages/TSGroupMessageManager.m | 88 + .../textsecure/Messages/TSIncomingMessage.h | 50 + .../textsecure/Messages/TSIncomingMessage.m | 44 + .../src/textsecure/Messages/TSInfoMessage.h | 22 + .../src/textsecure/Messages/TSInfoMessage.m | 13 + .../src/textsecure/Messages/TSInteraction.h | 38 + .../src/textsecure/Messages/TSInteraction.mm | 82 + Signal/src/textsecure/Messages/TSMessage.h | 28 + Signal/src/textsecure/Messages/TSMessage.m | 33 + .../Messages/TSMessagesManager+sendMessages.h | 15 + .../Messages/TSMessagesManager+sendMessages.m | 150 ++ .../textsecure/Messages/TSMessagesManager.h | 24 + .../textsecure/Messages/TSMessagesManager.m | 252 +++ .../textsecure/Messages/TSOutgoingMessage.h | 22 + .../textsecure/Messages/TSOutgoingMessage.m | 28 + .../src/textsecure/Messages/TSServerMessage.h | 18 + .../src/textsecure/Messages/TSServerMessage.m | 46 + .../Requests/TSContactsIntersectionRequest.h | 15 + .../Requests/TSContactsIntersectionRequest.m | 26 + .../Requests/TSDeregisterAccountRequest.h | 13 + .../Requests/TSDeregisterAccountRequest.m | 22 + .../Requests/TSRecipientPrekeyRequest.h | 13 + .../Requests/TSRecipientPrekeyRequest.m | 24 + .../Requests/TSRegisterForPushRequest.h | 13 + .../Requests/TSRegisterForPushRequest.m | 25 + .../Requests/TSRegisterPrekeysRequest.h | 18 + .../Requests/TSRegisterPrekeysRequest.m | 51 + .../Requests/TSRegisterWithTokenRequest.h | 15 + .../Requests/TSRegisterWithTokenRequest.m | 27 + .../textsecure/Network/Requests/TSRequest.h | 17 + .../textsecure/Network/Requests/TSRequest.m | 42 + .../Network/Requests/TSRequestAttachment.h | 13 + .../Network/Requests/TSRequestAttachment.m | 20 + .../Network/Requests/TSRequestAttachmentId.h | 13 + .../Network/Requests/TSRequestAttachmentId.m | 20 + .../TSRequestVerificationCodeRequest.h | 16 + .../TSRequestVerificationCodeRequest.m | 25 + .../TSServerCodeVerificationRequest.h | 18 + .../TSServerCodeVerificationRequest.m | 27 + .../Network/Requests/TSSubmitMessageRequest.h | 19 + .../Network/Requests/TSSubmitMessageRequest.m | 34 + .../Network/Requests/TSUploadAttachment.h | 15 + .../Network/Requests/TSUploadAttachment.m | 33 + .../src/textsecure/Network/TSNetworkManager.h | 23 + .../src/textsecure/Network/TSNetworkManager.m | 98 + .../src/textsecure/Network/TSSocketManager.h | 17 + .../src/textsecure/Network/TSSocketManager.m | 125 ++ .../src/textsecure/Security/SecurityUtils.h | 15 + .../src/textsecure/Security/SecurityUtils.m | 24 + .../TSStorageManager+IdentityKeyStore.h | 17 + .../TSStorageManager+IdentityKeyStore.m | 52 + .../TSStorageManager+PreKeyStore.h | 18 + .../TSStorageManager+PreKeyStore.m | 89 + .../TSStorageManager+SessionStore.h | 14 + .../TSStorageManager+SessionStore.m | 89 + .../TSStorageManager+SignedPreKeyStore.h | 16 + .../TSStorageManager+SignedPreKeyStore.m | 68 + .../TSStorageManager+keyFromIntLong.h | 15 + .../TSStorageManager+keyFromIntLong.m | 17 + .../src/textsecure/Storage/TSDatabaseView.h | 13 + .../src/textsecure/Storage/TSDatabaseView.m | 100 + Signal/src/textsecure/Storage/TSStorageKeys.h | 40 + .../Storage/TSStorageManager+keyingMaterial.h | 33 + .../Storage/TSStorageManager+keyingMaterial.m | 34 + .../src/textsecure/Storage/TSStorageManager.h | 41 + .../src/textsecure/Storage/TSStorageManager.m | 221 +++ .../textsecure/Storage/TSYapDatabaseObject.h | 73 + .../textsecure/Storage/TSYapDatabaseObject.m | 72 + Signal/src/textsecure/TSConstants.h | 57 + Signal/src/textsecure/Util/Cryptography.h | 37 + Signal/src/textsecure/Util/Cryptography.m | 255 +++ Signal/src/textsecure/Util/NSData+Base64.h | 9 + Signal/src/textsecure/Util/NSData+Base64.m | 35 + Signal/src/textsecure/Util/NSData+hexString.h | 15 + Signal/src/textsecure/Util/NSData+hexString.m | 28 + .../textsecure/Util/NSData+messagePadding.h | 15 + .../textsecure/Util/NSData+messagePadding.m | 32 + Signal/src/textsecure/Util/NSString+escape.h | 13 + Signal/src/textsecure/Util/NSString+escape.m | 18 + .../Util/NSURLSessionDataTask+StatusCode.h | 15 + .../Util/NSURLSessionDataTask+StatusCode.m | 18 + .../view controllers/CallLogViewController.h | 12 - .../view controllers/CallLogViewController.m | 178 -- .../ContactBrowseViewController.h | 21 - .../ContactBrowseViewController.m | 268 --- .../view controllers/DialerViewController.m | 5 +- .../FavouritesViewController.h | 16 - .../FavouritesViewController.m | 180 -- .../InboxFeedViewController.h | 26 - .../InboxFeedViewController.m | 425 ---- .../view controllers/InitialViewController.h | 13 + .../view controllers/InitialViewController.m | 37 + .../src/view controllers/InviteContactModal.h | 10 - .../src/view controllers/InviteContactModal.m | 44 - .../InviteContactsViewController.h | 15 - .../InviteContactsViewController.m | 265 --- .../InviteContactsViewController.xib | 154 -- .../LeftSideMenuViewController.h | 25 - .../LeftSideMenuViewController.m | 201 -- .../PreferenceListViewController.xib | 5 +- .../view controllers/SettingsViewController.h | 54 - .../view controllers/SettingsViewController.m | 319 --- .../TabBarParentViewController.h | 37 - .../TabBarParentViewController.m | 210 -- .../TabBarParentViewController.xib | 163 -- .../xibs/CallLogViewController.xib | 110 -- .../xibs/ContactBrowseViewController.xib | 153 -- .../xibs/ContactDetailTableViewCell.xib | 3 +- .../xibs/ContactDetailViewController.xib | 3 +- .../xibs/FavouritesViewController.xib | 116 -- .../xibs/InboxFeedViewController.xib | 136 -- .../xibs/LeftSideMenuViewController.xib | 63 - .../xibs/RegisterViewController.xib | 2 +- .../xibs/SettingsViewController.xib | 477 ----- Signal/src/views/CallLogTableViewCell.h | 36 - Signal/src/views/CallLogTableViewCell.m | 98 - Signal/src/views/InboxFeedFooterCell.h | 15 - Signal/src/views/InboxFeedFooterCell.m | 31 - Signal/src/views/InboxFeedFooterCell.xib | 61 - Signal/src/views/InboxFeedTableViewCell.h | 41 - Signal/src/views/InboxFeedTableViewCell.m | 171 -- Signal/src/views/SearchBarTitleView.m | 1 - .../src/views/xibs/CallLogTableViewCell.xib | 99 - .../src/views/xibs/InboxFeedTableViewCell.xib | 123 -- Signal/test/fr.lproj/InfoPlist.strings | 2 - Signal/test/textsecure/CryptographyTests.mm | 59 + .../test/textsecure/TSMessageStorageTests.m | 108 + .../TSStorageIdentityKeyStoreTests.m | 67 + .../textsecure/TSStoragePreKeyStoreTests.m | 65 + .../textsecure/TSStorageSignedPreKeyStore.m | 29 + Signal/test/textsecure/TextSecureKitTests.m | 29 + 246 files changed, 8249 insertions(+), 11045 deletions(-) delete mode 100644 Libraries/ProtocolBuffers/AbstractMessage.h delete mode 100644 Libraries/ProtocolBuffers/AbstractMessage.m delete mode 100644 Libraries/ProtocolBuffers/AbstractMessage_Builder.h delete mode 100644 Libraries/ProtocolBuffers/AbstractMessage_Builder.m delete mode 100644 Libraries/ProtocolBuffers/Bootstrap.h delete mode 100644 Libraries/ProtocolBuffers/CodedInputStream.h delete mode 100644 Libraries/ProtocolBuffers/CodedInputStream.m delete mode 100644 Libraries/ProtocolBuffers/CodedOutputStream.h delete mode 100644 Libraries/ProtocolBuffers/CodedOutputStream.m delete mode 100644 Libraries/ProtocolBuffers/ConcreteExtensionField.h delete mode 100644 Libraries/ProtocolBuffers/ConcreteExtensionField.m delete mode 100644 Libraries/ProtocolBuffers/ExtendableMessage.h delete mode 100644 Libraries/ProtocolBuffers/ExtendableMessage.m delete mode 100644 Libraries/ProtocolBuffers/ExtendableMessage_Builder.h delete mode 100644 Libraries/ProtocolBuffers/ExtendableMessage_Builder.m delete mode 100644 Libraries/ProtocolBuffers/ExtensionField.h delete mode 100644 Libraries/ProtocolBuffers/ExtensionRegistry.h delete mode 100644 Libraries/ProtocolBuffers/ExtensionRegistry.m delete mode 100644 Libraries/ProtocolBuffers/Field.h delete mode 100644 Libraries/ProtocolBuffers/Field.m delete mode 100644 Libraries/ProtocolBuffers/ForwardDeclarations.h delete mode 100644 Libraries/ProtocolBuffers/GeneratedMessage.h delete mode 100644 Libraries/ProtocolBuffers/GeneratedMessage.m delete mode 100644 Libraries/ProtocolBuffers/GeneratedMessage_Builder.h delete mode 100644 Libraries/ProtocolBuffers/GeneratedMessage_Builder.m delete mode 100644 Libraries/ProtocolBuffers/Message.h delete mode 100644 Libraries/ProtocolBuffers/Message_Builder.h delete mode 100644 Libraries/ProtocolBuffers/MutableExtensionRegistry.h delete mode 100644 Libraries/ProtocolBuffers/MutableExtensionRegistry.m delete mode 100644 Libraries/ProtocolBuffers/MutableField.h delete mode 100644 Libraries/ProtocolBuffers/MutableField.m delete mode 100644 Libraries/ProtocolBuffers/ProtocolBuffers.h delete mode 100644 Libraries/ProtocolBuffers/TextFormat.h delete mode 100644 Libraries/ProtocolBuffers/TextFormat.m delete mode 100644 Libraries/ProtocolBuffers/UnknownFieldSet.h delete mode 100644 Libraries/ProtocolBuffers/UnknownFieldSet.m delete mode 100644 Libraries/ProtocolBuffers/UnknownFieldSet_Builder.h delete mode 100644 Libraries/ProtocolBuffers/UnknownFieldSet_Builder.m delete mode 100644 Libraries/ProtocolBuffers/Utilities.h delete mode 100644 Libraries/ProtocolBuffers/Utilities.m delete mode 100644 Libraries/ProtocolBuffers/WireFormat.h delete mode 100644 Libraries/ProtocolBuffers/WireFormat.m rename Signal/{ => Images}/archive@2x.png (100%) rename Signal/{ => Images}/blue-archive@2x.png (100%) rename Signal/{ => Images}/call@2x.png (100%) rename Signal/{ => Images}/call_dark@2x.png (100%) rename Signal/{ => Images}/checkmark.png (100%) rename Signal/{ => Images}/contacts.png (100%) rename Signal/{ => Images}/contacts@2x.png (100%) rename Signal/{ => Images}/contacts_tab@2x.png (100%) rename Signal/{ => Images}/delete@2x.png (100%) rename Signal/{ => Images}/delete_history@2x.png (100%) rename Signal/{ => Images}/endcall@2x.png (100%) rename Signal/{ => Images}/favourite.png (100%) rename Signal/{ => Images}/info@2x.png (100%) rename Signal/{ => Images}/keypad@2x.png (100%) rename Signal/{ => Images}/lock@2x.png (100%) rename Signal/{ => Images}/lock_white@2x.png (100%) rename Signal/{ => Images}/logo_intro@2x.png (100%) rename Signal/{ => Images}/missed.png (100%) rename Signal/{ => Images}/mute_off@2x.png (100%) rename Signal/{ => Images}/mute_on@2x.png (100%) rename Signal/{ => Images}/photo@2x.png (100%) rename Signal/{ => Images}/quit@2x.png (100%) rename Signal/{ => Images}/received.png (100%) rename Signal/{ => Images}/red-delete@2x.png (100%) rename Signal/{ => Images}/reply.png (100%) rename Signal/{ => Images}/savephoto@2x.png (100%) rename Signal/{ => Images}/settings.png (100%) rename Signal/{ => Images}/settings_dark@2x.png (100%) rename Signal/{ => Images}/share@2x.png (100%) rename Signal/{ => Images}/shred@2x.png (100%) rename Signal/{ => Images}/signal@2x.png (100%) rename Signal/{ => Images}/signals.png (100%) rename Signal/{ => Images}/speaker_off@2x.png (100%) rename Signal/{ => Images}/speaker_on@2x.png (100%) create mode 100644 Signal/src/textsecure/Account/TSAccountManager.h create mode 100644 Signal/src/textsecure/Account/TSAccountManager.m create mode 100644 Signal/src/textsecure/Account/TSNumberVerifier.h create mode 100644 Signal/src/textsecure/Account/TSNumberVerifier.m create mode 100644 Signal/src/textsecure/Account/TSPreKeyManager.h create mode 100644 Signal/src/textsecure/Account/TSPreKeyManager.m create mode 100644 Signal/src/textsecure/Contacts/TSContact.h create mode 100644 Signal/src/textsecure/Contacts/TSContact.m create mode 100644 Signal/src/textsecure/Contacts/TSGroup.h create mode 100644 Signal/src/textsecure/Contacts/TSGroup.m create mode 100644 Signal/src/textsecure/Contacts/TSRecipient.h create mode 100644 Signal/src/textsecure/Contacts/TSRecipient.m create mode 100644 Signal/src/textsecure/Contacts/TSThread.h create mode 100644 Signal/src/textsecure/Contacts/TSThread.m create mode 100644 Signal/src/textsecure/Contacts/Threads/TSContactThread.h create mode 100644 Signal/src/textsecure/Contacts/Threads/TSContactThread.m create mode 100644 Signal/src/textsecure/Contacts/Threads/TSGroupThread.h create mode 100644 Signal/src/textsecure/Contacts/Threads/TSGroupThread.m create mode 100644 Signal/src/textsecure/Messages/IncomingPushMessageSignal.pb.h create mode 100644 Signal/src/textsecure/Messages/IncomingPushMessageSignal.pb.m create mode 100644 Signal/src/textsecure/Messages/TSAttachement.h create mode 100644 Signal/src/textsecure/Messages/TSAttachement.m create mode 100644 Signal/src/textsecure/Messages/TSCall.h create mode 100644 Signal/src/textsecure/Messages/TSCall.m create mode 100644 Signal/src/textsecure/Messages/TSErrorMessage.h create mode 100644 Signal/src/textsecure/Messages/TSErrorMessage.m create mode 100644 Signal/src/textsecure/Messages/TSGroupMessageManager.h create mode 100644 Signal/src/textsecure/Messages/TSGroupMessageManager.m create mode 100644 Signal/src/textsecure/Messages/TSIncomingMessage.h create mode 100644 Signal/src/textsecure/Messages/TSIncomingMessage.m create mode 100644 Signal/src/textsecure/Messages/TSInfoMessage.h create mode 100644 Signal/src/textsecure/Messages/TSInfoMessage.m create mode 100644 Signal/src/textsecure/Messages/TSInteraction.h create mode 100644 Signal/src/textsecure/Messages/TSInteraction.mm create mode 100644 Signal/src/textsecure/Messages/TSMessage.h create mode 100644 Signal/src/textsecure/Messages/TSMessage.m create mode 100644 Signal/src/textsecure/Messages/TSMessagesManager+sendMessages.h create mode 100644 Signal/src/textsecure/Messages/TSMessagesManager+sendMessages.m create mode 100644 Signal/src/textsecure/Messages/TSMessagesManager.h create mode 100644 Signal/src/textsecure/Messages/TSMessagesManager.m create mode 100644 Signal/src/textsecure/Messages/TSOutgoingMessage.h create mode 100644 Signal/src/textsecure/Messages/TSOutgoingMessage.m create mode 100644 Signal/src/textsecure/Messages/TSServerMessage.h create mode 100644 Signal/src/textsecure/Messages/TSServerMessage.m create mode 100644 Signal/src/textsecure/Network/Requests/TSContactsIntersectionRequest.h create mode 100644 Signal/src/textsecure/Network/Requests/TSContactsIntersectionRequest.m create mode 100644 Signal/src/textsecure/Network/Requests/TSDeregisterAccountRequest.h create mode 100644 Signal/src/textsecure/Network/Requests/TSDeregisterAccountRequest.m create mode 100644 Signal/src/textsecure/Network/Requests/TSRecipientPrekeyRequest.h create mode 100644 Signal/src/textsecure/Network/Requests/TSRecipientPrekeyRequest.m create mode 100644 Signal/src/textsecure/Network/Requests/TSRegisterForPushRequest.h create mode 100644 Signal/src/textsecure/Network/Requests/TSRegisterForPushRequest.m create mode 100644 Signal/src/textsecure/Network/Requests/TSRegisterPrekeysRequest.h create mode 100644 Signal/src/textsecure/Network/Requests/TSRegisterPrekeysRequest.m create mode 100644 Signal/src/textsecure/Network/Requests/TSRegisterWithTokenRequest.h create mode 100644 Signal/src/textsecure/Network/Requests/TSRegisterWithTokenRequest.m create mode 100644 Signal/src/textsecure/Network/Requests/TSRequest.h create mode 100644 Signal/src/textsecure/Network/Requests/TSRequest.m create mode 100644 Signal/src/textsecure/Network/Requests/TSRequestAttachment.h create mode 100644 Signal/src/textsecure/Network/Requests/TSRequestAttachment.m create mode 100644 Signal/src/textsecure/Network/Requests/TSRequestAttachmentId.h create mode 100644 Signal/src/textsecure/Network/Requests/TSRequestAttachmentId.m create mode 100644 Signal/src/textsecure/Network/Requests/TSRequestVerificationCodeRequest.h create mode 100644 Signal/src/textsecure/Network/Requests/TSRequestVerificationCodeRequest.m create mode 100644 Signal/src/textsecure/Network/Requests/TSServerCodeVerificationRequest.h create mode 100644 Signal/src/textsecure/Network/Requests/TSServerCodeVerificationRequest.m create mode 100644 Signal/src/textsecure/Network/Requests/TSSubmitMessageRequest.h create mode 100644 Signal/src/textsecure/Network/Requests/TSSubmitMessageRequest.m create mode 100644 Signal/src/textsecure/Network/Requests/TSUploadAttachment.h create mode 100644 Signal/src/textsecure/Network/Requests/TSUploadAttachment.m create mode 100644 Signal/src/textsecure/Network/TSNetworkManager.h create mode 100644 Signal/src/textsecure/Network/TSNetworkManager.m create mode 100644 Signal/src/textsecure/Network/TSSocketManager.h create mode 100644 Signal/src/textsecure/Network/TSSocketManager.m create mode 100644 Signal/src/textsecure/Security/SecurityUtils.h create mode 100644 Signal/src/textsecure/Security/SecurityUtils.m create mode 100644 Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+IdentityKeyStore.h create mode 100644 Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+IdentityKeyStore.m create mode 100644 Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+PreKeyStore.h create mode 100644 Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+PreKeyStore.m create mode 100644 Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+SessionStore.h create mode 100644 Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+SessionStore.m create mode 100644 Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+SignedPreKeyStore.h create mode 100644 Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+SignedPreKeyStore.m create mode 100644 Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+keyFromIntLong.h create mode 100644 Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+keyFromIntLong.m create mode 100644 Signal/src/textsecure/Storage/TSDatabaseView.h create mode 100644 Signal/src/textsecure/Storage/TSDatabaseView.m create mode 100644 Signal/src/textsecure/Storage/TSStorageKeys.h create mode 100644 Signal/src/textsecure/Storage/TSStorageManager+keyingMaterial.h create mode 100644 Signal/src/textsecure/Storage/TSStorageManager+keyingMaterial.m create mode 100644 Signal/src/textsecure/Storage/TSStorageManager.h create mode 100644 Signal/src/textsecure/Storage/TSStorageManager.m create mode 100644 Signal/src/textsecure/Storage/TSYapDatabaseObject.h create mode 100644 Signal/src/textsecure/Storage/TSYapDatabaseObject.m create mode 100644 Signal/src/textsecure/TSConstants.h create mode 100755 Signal/src/textsecure/Util/Cryptography.h create mode 100755 Signal/src/textsecure/Util/Cryptography.m create mode 100644 Signal/src/textsecure/Util/NSData+Base64.h create mode 100644 Signal/src/textsecure/Util/NSData+Base64.m create mode 100644 Signal/src/textsecure/Util/NSData+hexString.h create mode 100644 Signal/src/textsecure/Util/NSData+hexString.m create mode 100644 Signal/src/textsecure/Util/NSData+messagePadding.h create mode 100644 Signal/src/textsecure/Util/NSData+messagePadding.m create mode 100644 Signal/src/textsecure/Util/NSString+escape.h create mode 100644 Signal/src/textsecure/Util/NSString+escape.m create mode 100644 Signal/src/textsecure/Util/NSURLSessionDataTask+StatusCode.h create mode 100644 Signal/src/textsecure/Util/NSURLSessionDataTask+StatusCode.m delete mode 100644 Signal/src/view controllers/CallLogViewController.h delete mode 100644 Signal/src/view controllers/CallLogViewController.m delete mode 100644 Signal/src/view controllers/ContactBrowseViewController.h delete mode 100644 Signal/src/view controllers/ContactBrowseViewController.m delete mode 100644 Signal/src/view controllers/FavouritesViewController.h delete mode 100644 Signal/src/view controllers/FavouritesViewController.m delete mode 100644 Signal/src/view controllers/InboxFeedViewController.h delete mode 100644 Signal/src/view controllers/InboxFeedViewController.m create mode 100644 Signal/src/view controllers/InitialViewController.h create mode 100644 Signal/src/view controllers/InitialViewController.m delete mode 100644 Signal/src/view controllers/InviteContactModal.h delete mode 100644 Signal/src/view controllers/InviteContactModal.m delete mode 100644 Signal/src/view controllers/InviteContactsViewController.h delete mode 100644 Signal/src/view controllers/InviteContactsViewController.m delete mode 100644 Signal/src/view controllers/InviteContactsViewController.xib delete mode 100644 Signal/src/view controllers/LeftSideMenuViewController.h delete mode 100644 Signal/src/view controllers/LeftSideMenuViewController.m delete mode 100644 Signal/src/view controllers/SettingsViewController.h delete mode 100644 Signal/src/view controllers/SettingsViewController.m delete mode 100644 Signal/src/view controllers/TabBarParentViewController.h delete mode 100644 Signal/src/view controllers/TabBarParentViewController.m delete mode 100644 Signal/src/view controllers/TabBarParentViewController.xib delete mode 100644 Signal/src/view controllers/xibs/CallLogViewController.xib delete mode 100644 Signal/src/view controllers/xibs/ContactBrowseViewController.xib delete mode 100644 Signal/src/view controllers/xibs/FavouritesViewController.xib delete mode 100644 Signal/src/view controllers/xibs/InboxFeedViewController.xib delete mode 100644 Signal/src/view controllers/xibs/LeftSideMenuViewController.xib delete mode 100644 Signal/src/view controllers/xibs/SettingsViewController.xib delete mode 100644 Signal/src/views/CallLogTableViewCell.h delete mode 100644 Signal/src/views/CallLogTableViewCell.m delete mode 100644 Signal/src/views/InboxFeedFooterCell.h delete mode 100644 Signal/src/views/InboxFeedFooterCell.m delete mode 100644 Signal/src/views/InboxFeedFooterCell.xib delete mode 100644 Signal/src/views/InboxFeedTableViewCell.h delete mode 100644 Signal/src/views/InboxFeedTableViewCell.m delete mode 100644 Signal/src/views/xibs/CallLogTableViewCell.xib delete mode 100644 Signal/src/views/xibs/InboxFeedTableViewCell.xib delete mode 100644 Signal/test/fr.lproj/InfoPlist.strings create mode 100644 Signal/test/textsecure/CryptographyTests.mm create mode 100644 Signal/test/textsecure/TSMessageStorageTests.m create mode 100644 Signal/test/textsecure/TSStorageIdentityKeyStoreTests.m create mode 100644 Signal/test/textsecure/TSStoragePreKeyStoreTests.m create mode 100644 Signal/test/textsecure/TSStorageSignedPreKeyStore.m create mode 100644 Signal/test/textsecure/TextSecureKitTests.m diff --git a/Libraries/ProtocolBuffers/AbstractMessage.h b/Libraries/ProtocolBuffers/AbstractMessage.h deleted file mode 100644 index 4c99f6fd1..000000000 --- a/Libraries/ProtocolBuffers/AbstractMessage.h +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "Message.h" - -/** - * A partial implementation of the {@link Message} interface which implements - * as many methods of that interface as possible in terms of other methods. - * - * @author Cyrus Najmabadi - */ -@interface PBAbstractMessage : NSObject { -@private -} - -@end diff --git a/Libraries/ProtocolBuffers/AbstractMessage.m b/Libraries/ProtocolBuffers/AbstractMessage.m deleted file mode 100644 index 27ed6ea32..000000000 --- a/Libraries/ProtocolBuffers/AbstractMessage.m +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "AbstractMessage.h" - -#import "CodedOutputStream.h" - -@implementation PBAbstractMessage - -- (id) init { - if ((self = [super init])) { - } - - return self; -} - - -- (NSData*) data { - NSMutableData* data = [NSMutableData dataWithLength:(NSUInteger)self.serializedSize]; - PBCodedOutputStream* stream = [PBCodedOutputStream streamWithData:data]; - [self writeToCodedOutputStream:stream]; - return data; -} - - -- (BOOL) isInitialized { - @throw [NSException exceptionWithName:@"ImproperSubclassing" reason:@"" userInfo:nil]; -} - - -- (int32_t) serializedSize { - @throw [NSException exceptionWithName:@"ImproperSubclassing" reason:@"" userInfo:nil]; -} - - -- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output { - @throw [NSException exceptionWithName:@"ImproperSubclassing" reason:@"" userInfo:nil]; -} - - -- (void) writeToOutputStream:(NSOutputStream*) output { - PBCodedOutputStream* codedOutput = [PBCodedOutputStream streamWithOutputStream:output]; - [self writeToCodedOutputStream:codedOutput]; - [codedOutput flush]; -} - - -- (id) defaultInstance { - @throw [NSException exceptionWithName:@"ImproperSubclassing" reason:@"" userInfo:nil]; -} - - -- (PBUnknownFieldSet*) unknownFields { - @throw [NSException exceptionWithName:@"ImproperSubclassing" reason:@"" userInfo:nil]; -} - - -- (id) builder { - @throw [NSException exceptionWithName:@"ImproperSubclassing" reason:@"" userInfo:nil]; -} - - -@end diff --git a/Libraries/ProtocolBuffers/AbstractMessage_Builder.h b/Libraries/ProtocolBuffers/AbstractMessage_Builder.h deleted file mode 100644 index d5b764b20..000000000 --- a/Libraries/ProtocolBuffers/AbstractMessage_Builder.h +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "Message_Builder.h" - -/** - * A partial implementation of the {@link Message.Builder} interface which - * implements as many methods of that interface as possible in terms of - * other methods. - */ -@interface PBAbstractMessage_Builder : NSObject { -} - -@end diff --git a/Libraries/ProtocolBuffers/AbstractMessage_Builder.m b/Libraries/ProtocolBuffers/AbstractMessage_Builder.m deleted file mode 100644 index 0f32ff7c5..000000000 --- a/Libraries/ProtocolBuffers/AbstractMessage_Builder.m +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "AbstractMessage_Builder.h" - -#import "CodedInputStream.h" -#import "ExtensionRegistry.h" -#import "UnknownFieldSet.h" -#import "UnknownFieldSet_Builder.h" - - -@implementation PBAbstractMessage_Builder - -- (id) clone { - @throw [NSException exceptionWithName:@"ImproperSubclassing" reason:@"" userInfo:nil]; -} - - -- (id) clear { - @throw [NSException exceptionWithName:@"ImproperSubclassing" reason:@"" userInfo:nil]; -} - - -- (id) mergeFromCodedInputStream:(PBCodedInputStream*) input { - return [self mergeFromCodedInputStream:input extensionRegistry:[PBExtensionRegistry emptyRegistry]]; -} - - -- (id) mergeFromCodedInputStream:(PBCodedInputStream*) input - extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - @throw [NSException exceptionWithName:@"ImproperSubclassing" reason:@"" userInfo:nil]; -} - - -- (id) mergeUnknownFields:(PBUnknownFieldSet*) unknownFields { - PBUnknownFieldSet* merged = - [[[PBUnknownFieldSet builderWithUnknownFields:self.unknownFields] - mergeUnknownFields:unknownFields] build]; - - [self setUnknownFields:merged]; - return self; -} - - -- (id) mergeFromData:(NSData*) data { - PBCodedInputStream* input = [PBCodedInputStream streamWithData:data]; - [self mergeFromCodedInputStream:input]; - [input checkLastTagWas:0]; - return self; -} - - -- (id) mergeFromData:(NSData*) data - extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - PBCodedInputStream* input = [PBCodedInputStream streamWithData:data]; - [self mergeFromCodedInputStream:input extensionRegistry:extensionRegistry]; - [input checkLastTagWas:0]; - return self; -} - - -- (id) mergeFromInputStream:(NSInputStream*) input { - PBCodedInputStream* codedInput = [PBCodedInputStream streamWithInputStream:input]; - [self mergeFromCodedInputStream:codedInput]; - [codedInput checkLastTagWas:0]; - return self; -} - - -- (id) mergeFromInputStream:(NSInputStream*) input - extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - PBCodedInputStream* codedInput = [PBCodedInputStream streamWithInputStream:input]; - [self mergeFromCodedInputStream:codedInput extensionRegistry:extensionRegistry]; - [codedInput checkLastTagWas:0]; - return self; -} - - -- (id) build { - @throw [NSException exceptionWithName:@"ImproperSubclassing" reason:@"" userInfo:nil]; -} - - -- (id) buildPartial { - @throw [NSException exceptionWithName:@"ImproperSubclassing" reason:@"" userInfo:nil]; -} - - -- (BOOL) isInitialized { - @throw [NSException exceptionWithName:@"ImproperSubclassing" reason:@"" userInfo:nil]; -} - - -- (id) defaultInstance { - @throw [NSException exceptionWithName:@"ImproperSubclassing" reason:@"" userInfo:nil]; -} - - -- (PBUnknownFieldSet*) unknownFields { - @throw [NSException exceptionWithName:@"ImproperSubclassing" reason:@"" userInfo:nil]; -} - - -- (id) setUnknownFields:(PBUnknownFieldSet*) unknownFields { - @throw [NSException exceptionWithName:@"ImproperSubclassing" reason:@"" userInfo:nil]; -} - -@end diff --git a/Libraries/ProtocolBuffers/Bootstrap.h b/Libraries/ProtocolBuffers/Bootstrap.h deleted file mode 100644 index 42aa71a6f..000000000 --- a/Libraries/ProtocolBuffers/Bootstrap.h +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "ForwardDeclarations.h" - -#import "CodedInputStream.h" -#import "CodedOutputStream.h" -#import "ExtendableMessage.h" -#import "ExtendableMessage_Builder.h" -#import "ExtensionRegistry.h" -#import "GeneratedMessage.h" -#import "GeneratedMessage_Builder.h" -#import "Message_Builder.h" -#import "UnknownFieldSet.h" -#import "UnknownFieldSet_Builder.h" -#import "Utilities.h" diff --git a/Libraries/ProtocolBuffers/CodedInputStream.h b/Libraries/ProtocolBuffers/CodedInputStream.h deleted file mode 100644 index f992ce380..000000000 --- a/Libraries/ProtocolBuffers/CodedInputStream.h +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -@class PBExtensionRegistry; -@class PBUnknownFieldSet_Builder; -@protocol PBMessage_Builder; - -/** - * Reads and decodes protocol message fields. - * - * This class contains two kinds of methods: methods that read specific - * protocol message constructs and field types (e.g. {@link #readTag()} and - * {@link #readInt32()}) and methods that read low-level values (e.g. - * {@link #readRawVarint32()} and {@link #readRawBytes}). If you are reading - * encoded protocol messages, you should use the former methods, but if you are - * reading some other format of your own design, use the latter. - * - * @author Cyrus Najmabadi - */ -@interface PBCodedInputStream : NSObject { -@private - NSMutableData* buffer; - int32_t bufferSize; - int32_t bufferSizeAfterLimit; - int32_t bufferPos; - NSInputStream* input; - int32_t lastTag; - - /** - * The total number of bytes read before the current buffer. The total - * bytes read up to the current position can be computed as - * {@code totalBytesRetired + bufferPos}. - */ - int32_t totalBytesRetired; - - /** The absolute position of the end of the current message. */ - int32_t currentLimit; - - /** See setRecursionLimit() */ - int32_t recursionDepth; - int32_t recursionLimit; - - /** See setSizeLimit() */ - int32_t sizeLimit; -} - -+ (PBCodedInputStream*) streamWithData:(NSData*) data; -+ (PBCodedInputStream*) streamWithInputStream:(NSInputStream*) input; - -/** - * Attempt to read a field tag, returning zero if we have reached EOF. - * Protocol message parsers use this to read tags, since a protocol message - * may legally end wherever a tag occurs, and zero is not a valid tag number. - */ -- (int32_t) readTag; -- (BOOL) refillBuffer:(BOOL) mustSucceed; - -- (Float64) readDouble; -- (Float32) readFloat; -- (int64_t) readUInt64; -- (int32_t) readUInt32; -- (int64_t) readInt64; -- (int32_t) readInt32; -- (int64_t) readFixed64; -- (int32_t) readFixed32; -- (int32_t) readEnum; -- (int32_t) readSFixed32; -- (int64_t) readSFixed64; -- (int32_t) readSInt32; -- (int64_t) readSInt64; - -/** - * Read one byte from the input. - * - * @throws InvalidProtocolBuffer The end of the stream or the current - * limit was reached. - */ -- (int8_t) readRawByte; - -/** - * Read a raw Varint from the stream. If larger than 32 bits, discard the - * upper bits. - */ -- (int32_t) readRawVarint32; -- (int64_t) readRawVarint64; -- (int32_t) readRawLittleEndian32; -- (int64_t) readRawLittleEndian64; - -/** - * Read a fixed size of bytes from the input. - * - * @throws InvalidProtocolBuffer The end of the stream or the current - * limit was reached. - */ -- (NSData*) readRawData:(int32_t) size; - -/** - * Reads and discards a single field, given its tag value. - * - * @return {@code false} if the tag is an endgroup tag, in which case - * nothing is skipped. Otherwise, returns {@code true}. - */ -- (BOOL) skipField:(int32_t) tag; - - -/** - * Reads and discards {@code size} bytes. - * - * @throws InvalidProtocolBuffer The end of the stream or the current - * limit was reached. - */ -- (void) skipRawData:(int32_t) size; - -/** - * Reads and discards an entire message. This will read either until EOF - * or until an endgroup tag, whichever comes first. - */ -- (void) skipMessage; - -- (BOOL) isAtEnd; -- (int32_t) pushLimit:(int32_t) byteLimit; -- (void) recomputeBufferSizeAfterLimit; -- (void) popLimit:(int32_t) oldLimit; -- (int32_t) bytesUntilLimit; - -/** - * Decode a ZigZag-encoded 32-bit value. ZigZag encodes signed integers - * into values that can be efficiently encoded with varint. (Otherwise, - * negative values must be sign-extended to 64 bits to be varint encoded, - * thus always taking 10 bytes on the wire.) - * - * @param n An unsigned 32-bit integer, stored in a signed int. - * @return A signed 32-bit integer. - */ -int32_t decodeZigZag32(int32_t n); - -/** - * Decode a ZigZag-encoded 64-bit value. ZigZag encodes signed integers - * into values that can be efficiently encoded with varint. (Otherwise, - * negative values must be sign-extended to 64 bits to be varint encoded, - * thus always taking 10 bytes on the wire.) - * - * @param n An unsigned 64-bit integer, stored in a signed int. - * @return A signed 64-bit integer. - */ -int64_t decodeZigZag64(int64_t n); - -/** Read an embedded message field value from the stream. */ -- (void) readMessage:(id) builder extensionRegistry:(PBExtensionRegistry*) extensionRegistry; - -- (BOOL) readBool; -- (NSString*) readString; -- (NSData*) readData; - -- (void) readGroup:(int32_t) fieldNumber builder:(id) builder extensionRegistry:(PBExtensionRegistry*) extensionRegistry; - -/** - * Reads a {@code group} field value from the stream and merges it into the - * given {@link UnknownFieldSet}. - */ -- (void) readUnknownGroup:(int32_t) fieldNumber builder:(PBUnknownFieldSet_Builder*) builder; - -/** - * Verifies that the last call to readTag() returned the given tag value. - * This is used to verify that a nested group ended with the correct - * end tag. - * - * @throws InvalidProtocolBuffer {@code value} does not match the - * last tag. - */ -- (void) checkLastTagWas:(int32_t) value; - -@end diff --git a/Libraries/ProtocolBuffers/CodedInputStream.m b/Libraries/ProtocolBuffers/CodedInputStream.m deleted file mode 100644 index 516a37366..000000000 --- a/Libraries/ProtocolBuffers/CodedInputStream.m +++ /dev/null @@ -1,790 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "CodedInputStream.h" - -#import "Message_Builder.h" -#import "Utilities.h" -#import "WireFormat.h" -#import "UnknownFieldSet_Builder.h" - -@interface PBCodedInputStream () -@property (retain) NSMutableData* buffer; -@property (retain) NSInputStream* input; -@end - - -@implementation PBCodedInputStream - -const int32_t DEFAULT_RECURSION_LIMIT = 64; -const int32_t DEFAULT_SIZE_LIMIT = 64 << 20; // 64MB -const int32_t BUFFER_SIZE = 4096; - -@synthesize buffer; -@synthesize input; - -- (void) dealloc { - [input close]; - self.buffer = nil; - self.input = nil; -} - - -- (void) commonInit { - currentLimit = INT_MAX; - recursionLimit = DEFAULT_RECURSION_LIMIT; - sizeLimit = DEFAULT_SIZE_LIMIT; -} - - -- (id) initWithData:(NSData*) data { - if ((self = [super init])) { - self.buffer = [NSMutableData dataWithData:data]; - bufferSize = (int32_t)buffer.length; - self.input = nil; - [self commonInit]; - } - - return self; -} - - -- (id) initWithInputStream:(NSInputStream*) input_ { - if ((self = [super init])) { - self.buffer = [NSMutableData dataWithLength:BUFFER_SIZE]; - bufferSize = 0; - self.input = input_; - [input open]; - [self commonInit]; - } - - return self; -} - - -+ (PBCodedInputStream*) streamWithData:(NSData*) data { - return [[PBCodedInputStream alloc] initWithData:data]; -} - - -+ (PBCodedInputStream*) streamWithInputStream:(NSInputStream*) input { - return [[PBCodedInputStream alloc] initWithInputStream:input]; -} - - -/** - * Attempt to read a field tag, returning zero if we have reached EOF. - * Protocol message parsers use this to read tags, since a protocol message - * may legally end wherever a tag occurs, and zero is not a valid tag number. - */ -- (int32_t) readTag { - if (self.isAtEnd) { - lastTag = 0; - return 0; - } - - lastTag = [self readRawVarint32]; - if (lastTag == 0) { - // If we actually read zero, that's not a valid tag. - @throw [NSException exceptionWithName:@"InvalidProtocolBuffer" reason:@"Invalid Tag" userInfo:nil]; - } - return lastTag; -} - -/** - * Verifies that the last call to readTag() returned the given tag value. - * This is used to verify that a nested group ended with the correct - * end tag. - * - * @throws InvalidProtocolBufferException {@code value} does not match the - * last tag. - */ -- (void) checkLastTagWas:(int32_t) value { - if (lastTag != value) { - @throw [NSException exceptionWithName:@"InvalidProtocolBuffer" reason:@"Invalid End Tag" userInfo:nil]; - } -} - -/** - * Reads and discards a single field, given its tag value. - * - * @return {@code NO} if the tag is an endgroup tag, in which case - * nothing is skipped. Otherwise, returns {@code YES}. - */ -- (BOOL) skipField:(int32_t) tag { - switch (PBWireFormatGetTagWireType(tag)) { - case PBWireFormatVarint: - [self readInt32]; - return YES; - case PBWireFormatFixed64: - [self readRawLittleEndian64]; - return YES; - case PBWireFormatLengthDelimited: - [self skipRawData:[self readRawVarint32]]; - return YES; - case PBWireFormatStartGroup: - [self skipMessage]; - [self checkLastTagWas: - PBWireFormatMakeTag(PBWireFormatGetTagFieldNumber(tag), - PBWireFormatEndGroup)]; - return YES; - case PBWireFormatEndGroup: - return NO; - case PBWireFormatFixed32: - [self readRawLittleEndian32]; - return YES; - default: - @throw [NSException exceptionWithName:@"InvalidProtocolBuffer" reason:@"Invalid Wire Type" userInfo:nil]; - } -} - - -/** - * Reads and discards an entire message. This will read either until EOF - * or until an endgroup tag, whichever comes first. - */ -- (void) skipMessage { - while (YES) { - int32_t tag = [self readTag]; - if (tag == 0 || ![self skipField:tag]) { - return; - } - } -} - - -/** Read a {@code double} field value from the stream. */ -- (Float64) readDouble { - return convertInt64ToFloat64([self readRawLittleEndian64]); -} - - -/** Read a {@code float} field value from the stream. */ -- (Float32) readFloat { - return convertInt32ToFloat32([self readRawLittleEndian32]); -} - - -/** Read a {@code uint64} field value from the stream. */ -- (int64_t) readUInt64 { - return [self readRawVarint64]; -} - - -/** Read an {@code int64} field value from the stream. */ -- (int64_t) readInt64 { - return [self readRawVarint64]; -} - - -/** Read an {@code int32} field value from the stream. */ -- (int32_t) readInt32 { - return [self readRawVarint32]; -} - - -/** Read a {@code fixed64} field value from the stream. */ -- (int64_t) readFixed64 { - return [self readRawLittleEndian64]; -} - - -/** Read a {@code fixed32} field value from the stream. */ -- (int32_t) readFixed32 { - return [self readRawLittleEndian32]; -} - - -/** Read a {@code bool} field value from the stream. */ -- (BOOL) readBool { - return [self readRawVarint32] != 0; -} - - -/** Read a {@code string} field value from the stream. */ -- (NSString*) readString { - int32_t size = [self readRawVarint32]; - if (size <= (bufferSize - bufferPos) && size > 0) { - // Fast path: We already have the bytes in a contiguous buffer, so - // just copy directly from it. - // new String(buffer, bufferPos, size, "UTF-8"); - NSString* result = [[NSString alloc] initWithBytes:(((uint8_t*) buffer.bytes) + bufferPos) - length:(NSUInteger)size - encoding:NSUTF8StringEncoding]; - bufferPos += size; - return result; - } else { - // Slow path: Build a byte array first then copy it. - NSData* data = [self readRawData:size]; - return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; - } -} - - -/** Read a {@code group} field value from the stream. */ -- (void) readGroup:(int32_t) fieldNumber - builder:(id) builder - extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - if (recursionDepth >= recursionLimit) { - @throw [NSException exceptionWithName:@"InvalidProtocolBuffer" reason:@"Recursion Limit Exceeded" userInfo:nil]; - } - ++recursionDepth; - [builder mergeFromCodedInputStream:self extensionRegistry:extensionRegistry]; - [self checkLastTagWas:PBWireFormatMakeTag(fieldNumber, PBWireFormatEndGroup)]; - --recursionDepth; -} - - -/** - * Reads a {@code group} field value from the stream and merges it into the - * given {@link PBUnknownFieldSet}. - */ -- (void) readUnknownGroup:(int32_t) fieldNumber - builder:(PBUnknownFieldSet_Builder*) builder { - if (recursionDepth >= recursionLimit) { - @throw [NSException exceptionWithName:@"InvalidProtocolBuffer" reason:@"Recursion Limit Exceeded" userInfo:nil]; - } - ++recursionDepth; - [builder mergeFromCodedInputStream:self]; - [self checkLastTagWas:PBWireFormatMakeTag(fieldNumber, PBWireFormatEndGroup)]; - --recursionDepth; -} - - -/** Read an embedded message field value from the stream. */ -- (void) readMessage:(id) builder - extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - int32_t length = [self readRawVarint32]; - if (recursionDepth >= recursionLimit) { - @throw [NSException exceptionWithName:@"InvalidProtocolBuffer" reason:@"Recursion Limit Exceeded" userInfo:nil]; - } - int32_t oldLimit = [self pushLimit:length]; - ++recursionDepth; - [builder mergeFromCodedInputStream:self extensionRegistry:extensionRegistry]; - [self checkLastTagWas:0]; - --recursionDepth; - [self popLimit:oldLimit]; -} - - -/** Read a {@code bytes} field value from the stream. */ -- (NSData*) readData { - int32_t size = [self readRawVarint32]; - if (size < bufferSize - bufferPos && size > 0) { - // Fast path: We already have the bytes in a contiguous buffer, so - // just copy directly from it. - NSData* result = [NSData dataWithBytes:(((uint8_t*) buffer.bytes) + bufferPos) length:(NSUInteger)size]; - bufferPos += size; - return result; - } else { - // Slow path: Build a byte array first then copy it. - return [self readRawData:size]; - } -} - - -/** Read a {@code uint32} field value from the stream. */ -- (int32_t) readUInt32 { - return [self readRawVarint32]; -} - - -/** - * Read an enum field value from the stream. Caller is responsible - * for converting the numeric value to an actual enum. - */ -- (int32_t) readEnum { - return [self readRawVarint32]; -} - - -/** Read an {@code sfixed32} field value from the stream. */ -- (int32_t) readSFixed32 { - return [self readRawLittleEndian32]; -} - - -/** Read an {@code sfixed64} field value from the stream. */ -- (int64_t) readSFixed64 { - return [self readRawLittleEndian64]; -} - - -/** Read an {@code sint32} field value from the stream. */ -- (int32_t) readSInt32 { - return decodeZigZag32([self readRawVarint32]); -} - - -/** Read an {@code sint64} field value from the stream. */ -- (int64_t) readSInt64 { - return decodeZigZag64([self readRawVarint64]); -} - - -// ================================================================= - -/** - * Read a raw Varint from the stream. If larger than 32 bits, discard the - * upper bits. - */ -- (int32_t) readRawVarint32 { - int8_t tmp = [self readRawByte]; - if (tmp >= 0) { - return tmp; - } - int32_t result = tmp & 0x7f; - if ((tmp = [self readRawByte]) >= 0) { - result |= tmp << 7; - } else { - result |= (tmp & 0x7f) << 7; - if ((tmp = [self readRawByte]) >= 0) { - result |= tmp << 14; - } else { - result |= (tmp & 0x7f) << 14; - if ((tmp = [self readRawByte]) >= 0) { - result |= tmp << 21; - } else { - result |= (tmp & 0x7f) << 21; - result |= (tmp = [self readRawByte]) << 28; - if (tmp < 0) { - // Discard upper 32 bits. - for (int i = 0; i < 5; i++) { - if ([self readRawByte] >= 0) { - return result; - } - } - @throw [NSException exceptionWithName:@"InvalidProtocolBuffer" reason:@"malformedVarint" userInfo:nil]; - } - } - } - } - return result; -} - - -/** Read a raw Varint from the stream. */ -- (int64_t) readRawVarint64 { - int32_t shift = 0; - int64_t result = 0; - while (shift < 64) { - int8_t b = [self readRawByte]; - result |= (int64_t)(b & 0x7F) << shift; - if ((b & 0x80) == 0) { - return result; - } - shift += 7; - } - @throw [NSException exceptionWithName:@"InvalidProtocolBuffer" reason:@"malformedVarint" userInfo:nil]; -} - - -/** Read a 32-bit little-endian integer from the stream. */ -- (int32_t) readRawLittleEndian32 { - int8_t b1 = [self readRawByte]; - int8_t b2 = [self readRawByte]; - int8_t b3 = [self readRawByte]; - int8_t b4 = [self readRawByte]; - return - (((int32_t)b1 & 0xff) ) | - (((int32_t)b2 & 0xff) << 8) | - (((int32_t)b3 & 0xff) << 16) | - (((int32_t)b4 & 0xff) << 24); -} - - -/** Read a 64-bit little-endian integer from the stream. */ -- (int64_t) readRawLittleEndian64 { - int8_t b1 = [self readRawByte]; - int8_t b2 = [self readRawByte]; - int8_t b3 = [self readRawByte]; - int8_t b4 = [self readRawByte]; - int8_t b5 = [self readRawByte]; - int8_t b6 = [self readRawByte]; - int8_t b7 = [self readRawByte]; - int8_t b8 = [self readRawByte]; - return - (((int64_t)b1 & 0xff) ) | - (((int64_t)b2 & 0xff) << 8) | - (((int64_t)b3 & 0xff) << 16) | - (((int64_t)b4 & 0xff) << 24) | - (((int64_t)b5 & 0xff) << 32) | - (((int64_t)b6 & 0xff) << 40) | - (((int64_t)b7 & 0xff) << 48) | - (((int64_t)b8 & 0xff) << 56); -} - - -/** - * Decode a ZigZag-encoded 32-bit value. ZigZag encodes signed integers - * into values that can be efficiently encoded with varint. (Otherwise, - * negative values must be sign-extended to 64 bits to be varint encoded, - * thus always taking 10 bytes on the wire.) - * - * @param n An unsigned 32-bit integer, stored in a signed int - * @return A signed 32-bit integer. - */ -int32_t decodeZigZag32(int32_t n) { - return logicalRightShift32(n, 1) ^ -(n & 1); -} - - -/** - * Decode a ZigZag-encoded 64-bit value. ZigZag encodes signed integers - * into values that can be efficiently encoded with varint. (Otherwise, - * negative values must be sign-extended to 64 bits to be varint encoded, - * thus always taking 10 bytes on the wire.) - * - * @param n An unsigned 64-bit integer, stored in a signed int - * @return A signed 64-bit integer. - */ -int64_t decodeZigZag64(int64_t n) { - return logicalRightShift64(n, 1) ^ -(n & 1); -} - - -/** - * Set the maximum message recursion depth. In order to prevent malicious - * messages from causing stack overflows, {@code PBCodedInputStream} limits - * how deeply messages may be nested. The default limit is 64. - * - * @return the old limit. - */ -- (int32_t) setRecursionLimit:(int32_t) limit { - if (limit < 0) { - @throw [NSException exceptionWithName:@"IllegalArgument" reason:@"Recursion limit cannot be negative" userInfo:nil]; - } - int32_t oldLimit = recursionLimit; - recursionLimit = limit; - return oldLimit; -} - - -/** - * Set the maximum message size. In order to prevent malicious - * messages from exhausting memory or causing integer overflows, - * {@code PBCodedInputStream} limits how large a message may be. - * The default limit is 64MB. You should set this limit as small - * as you can without harming your app's functionality. Note that - * size limits only apply when reading from an {@code InputStream}, not - * when constructed around a raw byte array. - * - * @return the old limit. - */ -- (int32_t) setSizeLimit:(int32_t) limit { - if (limit < 0) { - @throw [NSException exceptionWithName:@"IllegalArgument" reason:@"Size limit cannot be negative:" userInfo:nil]; - } - int32_t oldLimit = sizeLimit; - sizeLimit = limit; - return oldLimit; -} - - -/** - * Resets the current size counter to zero (see {@link #setSizeLimit(int)}). - */ -- (void) resetSizeCounter { - totalBytesRetired = 0; -} - - -/** - * Sets {@code currentLimit} to (current position) + {@code byteLimit}. This - * is called when descending into a length-delimited embedded message. - * - * @return the old limit. - */ -- (int32_t) pushLimit:(int32_t) byteLimit { - if (byteLimit < 0) { - @throw [NSException exceptionWithName:@"InvalidProtocolBuffer" reason:@"negativeSize" userInfo:nil]; - } - byteLimit += totalBytesRetired + bufferPos; - int32_t oldLimit = currentLimit; - if (byteLimit > oldLimit) { - @throw [NSException exceptionWithName:@"InvalidProtocolBuffer" reason:@"truncatedMessage" userInfo:nil]; - } - currentLimit = byteLimit; - - [self recomputeBufferSizeAfterLimit]; - - return oldLimit; -} - - -- (void) recomputeBufferSizeAfterLimit { - bufferSize += bufferSizeAfterLimit; - int32_t bufferEnd = totalBytesRetired + bufferSize; - if (bufferEnd > currentLimit) { - // Limit is in current buffer. - bufferSizeAfterLimit = bufferEnd - currentLimit; - bufferSize -= bufferSizeAfterLimit; - } else { - bufferSizeAfterLimit = 0; - } -} - - -/** - * Discards the current limit, returning to the previous limit. - * - * @param oldLimit The old limit, as returned by {@code pushLimit}. - */ -- (void) popLimit:(int32_t) oldLimit { - currentLimit = oldLimit; - [self recomputeBufferSizeAfterLimit]; -} - - -/** - * Returns the number of bytes to be read before the current limit. - * If no limit is set, returns -1. - */ -- (int32_t) bytesUntilLimit { - if (currentLimit == INT_MAX) { - return -1; - } - - int32_t currentAbsolutePosition = totalBytesRetired + bufferPos; - return currentLimit - currentAbsolutePosition; -} - -/** - * Returns true if the stream has reached the end of the input. This is the - * case if either the end of the underlying input source has been reached or - * if the stream has reached a limit created using {@link #pushLimit(int)}. - */ -- (BOOL) isAtEnd { - return bufferPos == bufferSize && ![self refillBuffer:NO]; -} - - -/** - * Called with {@code this.buffer} is empty to read more bytes from the - * input. If {@code mustSucceed} is YES, refillBuffer() gurantees that - * either there will be at least one byte in the buffer when it returns - * or it will throw an exception. If {@code mustSucceed} is NO, - * refillBuffer() returns NO if no more bytes were available. - */ -- (BOOL) refillBuffer:(BOOL) mustSucceed { - if (bufferPos < bufferSize) { - @throw [NSException exceptionWithName:@"IllegalState" reason:@"refillBuffer called when buffer wasn't empty." userInfo:nil]; - } - - if (totalBytesRetired + bufferSize == currentLimit) { - // Oops, we hit a limit. - if (mustSucceed) { - @throw [NSException exceptionWithName:@"InvalidProtocolBuffer" reason:@"truncatedMessage" userInfo:nil]; - } else { - return NO; - } - } - - totalBytesRetired += bufferSize; - - // TODO(cyrusn): does NSInputStream behave the same as java.io.InputStream - // when there is no more data? - bufferPos = 0; - bufferSize = 0; - if (input != nil) { - bufferSize = (int32_t)[input read:buffer.mutableBytes maxLength:buffer.length]; - } - - if (bufferSize <= 0) { - bufferSize = 0; - if (mustSucceed) { - @throw [NSException exceptionWithName:@"InvalidProtocolBuffer" reason:@"truncatedMessage" userInfo:nil]; - } else { - return NO; - } - } else { - [self recomputeBufferSizeAfterLimit]; - NSInteger totalBytesRead = totalBytesRetired + bufferSize + bufferSizeAfterLimit; - if (totalBytesRead > sizeLimit || totalBytesRead < 0) { - @throw [NSException exceptionWithName:@"InvalidProtocolBuffer" reason:@"sizeLimitExceeded" userInfo:nil]; - } - return YES; - } -} - - -/** - * Read one byte from the input. - * - * @throws InvalidProtocolBufferException The end of the stream or the current - * limit was reached. - */ -- (int8_t) readRawByte { - if (bufferPos == bufferSize) { - [self refillBuffer:YES]; - } - int8_t* bytes = (int8_t*)buffer.bytes; - return bytes[bufferPos++]; -} - - -/** - * Read a fixed size of bytes from the input. - * - * @throws InvalidProtocolBufferException The end of the stream or the current - * limit was reached. - */ -- (NSData*) readRawData:(int32_t) size { - if (size < 0) { - @throw [NSException exceptionWithName:@"InvalidProtocolBuffer" reason:@"negativeSize" userInfo:nil]; - } - - if (totalBytesRetired + bufferPos + size > currentLimit) { - // Read to the end of the stream anyway. - [self skipRawData:currentLimit - totalBytesRetired - bufferPos]; - // Then fail. - @throw [NSException exceptionWithName:@"InvalidProtocolBuffer" reason:@"truncatedMessage" userInfo:nil]; - } - - if (size <= bufferSize - bufferPos) { - // We have all the bytes we need already. - NSData* data = [NSData dataWithBytes:(((int8_t*) buffer.bytes) + bufferPos) length:(NSUInteger)size]; - bufferPos += size; - return data; - } else if (size < BUFFER_SIZE) { - // Reading more bytes than are in the buffer, but not an excessive number - // of bytes. We can safely allocate the resulting array ahead of time. - - // First copy what we have. - NSMutableData* bytes = [NSMutableData dataWithLength:(NSUInteger)size]; - int32_t pos = bufferSize - bufferPos; - memcpy(bytes.mutableBytes, ((int8_t*)buffer.bytes) + bufferPos, pos); - bufferPos = bufferSize; - - // We want to use refillBuffer() and then copy from the buffer into our - // byte array rather than reading directly into our byte array because - // the input may be unbuffered. - [self refillBuffer:YES]; - - while (size - pos > bufferSize) { - memcpy(((int8_t*)bytes.mutableBytes) + pos, buffer.bytes, bufferSize); - pos += bufferSize; - bufferPos = bufferSize; - [self refillBuffer:YES]; - } - - memcpy(((int8_t*)bytes.mutableBytes) + pos, buffer.bytes, size - pos); - bufferPos = size - pos; - - return bytes; - } else { - // The size is very large. For security reasons, we can't allocate the - // entire byte array yet. The size comes directly from the input, so a - // maliciously-crafted message could provide a bogus very large size in - // order to trick the app into allocating a lot of memory. We avoid this - // by allocating and reading only a small chunk at a time, so that the - // malicious message must actuall* e* extremely large to cause - // problems. Meanwhile, we limit the allowed size of a message elsewhere. - - // Remember the buffer markers since we'll have to copy the bytes out of - // it later. - int32_t originalBufferPos = bufferPos; - int32_t originalBufferSize = bufferSize; - - // Mark the current buffer consumed. - totalBytesRetired += bufferSize; - bufferPos = 0; - bufferSize = 0; - - // Read all the rest of the bytes we need. - int32_t sizeLeft = size - (originalBufferSize - originalBufferPos); - NSMutableArray* chunks = [NSMutableArray array]; - - while (sizeLeft > 0) { - NSMutableData* chunk = [NSMutableData dataWithLength:(NSUInteger)MIN(sizeLeft, BUFFER_SIZE)]; - - int32_t pos = 0; - while (pos < (int32_t)chunk.length) { - int32_t n = 0; - if (input != nil) { - n = (int32_t)[input read:(((uint8_t*) chunk.mutableBytes) + pos) maxLength:chunk.length - (NSUInteger)pos]; - } - if (n <= 0) { - @throw [NSException exceptionWithName:@"InvalidProtocolBuffer" reason:@"truncatedMessage" userInfo:nil]; - } - totalBytesRetired += n; - pos += n; - } - sizeLeft -= chunk.length; - [chunks addObject:chunk]; - } - - // OK, got everything. Now concatenate it all into one buffer. - NSMutableData* bytes = [NSMutableData dataWithLength:(NSUInteger)size]; - - // Start by copying the leftover bytes from this.buffer. - int32_t pos = originalBufferSize - originalBufferPos; - memcpy(bytes.mutableBytes, ((int8_t*)buffer.bytes) + originalBufferPos, pos); - - // And now all the chunks. - for (NSData* chunk in chunks) { - memcpy(((int8_t*)bytes.mutableBytes) + pos, chunk.bytes, chunk.length); - pos += chunk.length; - } - - // Done. - return bytes; - } -} - - -/** - * Reads and discards {@code size} bytes. - * - * @throws InvalidProtocolBufferException The end of the stream or the current - * limit was reached. - */ -- (void) skipRawData:(int32_t) size { - if (size < 0) { - @throw [NSException exceptionWithName:@"InvalidProtocolBuffer" reason:@"negativeSize" userInfo:nil]; - } - - if (totalBytesRetired + bufferPos + size > currentLimit) { - // Read to the end of the stream anyway. - [self skipRawData:currentLimit - totalBytesRetired - bufferPos]; - // Then fail. - @throw [NSException exceptionWithName:@"InvalidProtocolBuffer" reason:@"truncatedMessage" userInfo:nil]; - } - - if (size <= (bufferSize - bufferPos)) { - // We have all the bytes we need already. - bufferPos += size; - } else { - // Skipping more bytes than are in the buffer. First skip what we have. - int32_t pos = bufferSize - bufferPos; - totalBytesRetired += pos; - bufferPos = 0; - bufferSize = 0; - - // Then skip directly from the InputStream for the rest. - while (pos < size) { - NSMutableData* data = [NSMutableData dataWithLength:(NSUInteger)(size - pos)]; - int32_t n = (input == nil) ? -1 : (int32_t)[input read:data.mutableBytes maxLength:(NSUInteger)(size - pos)]; - if (n <= 0) { - @throw [NSException exceptionWithName:@"InvalidProtocolBuffer" reason:@"truncatedMessage" userInfo:nil]; - } - pos += n; - totalBytesRetired += n; - } - } -} - - - -@end diff --git a/Libraries/ProtocolBuffers/CodedOutputStream.h b/Libraries/ProtocolBuffers/CodedOutputStream.h deleted file mode 100644 index 7f056112c..000000000 --- a/Libraries/ProtocolBuffers/CodedOutputStream.h +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -@class PBUnknownFieldSet; -@protocol PBMessage; - -/** - * Encodes and writes protocol message fields. - * - *

This class contains two kinds of methods: methods that write specific - * protocol message constructs and field types (e.g. {@link #writeTag} and - * {@link #writeInt32}) and methods that write low-level values (e.g. - * {@link #writeRawVarint32} and {@link #writeRawBytes}). If you are - * writing encoded protocol messages, you should use the former methods, but if - * you are writing some other format of your own design, use the latter. - * - *

This class is totally unsynchronized. - * - * @author Cyrus Najmabadi - */ -@interface PBCodedOutputStream : NSObject { - NSMutableData* buffer; - int32_t position; - NSOutputStream* output; -} - -+ (PBCodedOutputStream*) streamWithData:(NSMutableData*) data; -+ (PBCodedOutputStream*) streamWithOutputStream:(NSOutputStream*) output; -+ (PBCodedOutputStream*) streamWithOutputStream:(NSOutputStream*) output bufferSize:(int32_t) bufferSize; - - -/** - * Encode a ZigZag-encoded 32-bit value. ZigZag encodes signed integers - * into values that can be efficiently encoded with varint. (Otherwise, - * negative values must be sign-extended to 64 bits to be varint encoded, - * thus always taking 10 bytes on the wire.) - * - * @param n A signed 32-bit integer. - * @return An unsigned 32-bit integer, stored in a signed int. - */ -int32_t encodeZigZag32(int32_t n); - -/** - * Encode a ZigZag-encoded 64-bit value. ZigZag encodes signed integers - * into values that can be efficiently encoded with varint. (Otherwise, - * negative values must be sign-extended to 64 bits to be varint encoded, - * thus always taking 10 bytes on the wire.) - * - * @param n A signed 64-bit integer. - * @return An unsigned 64-bit integer, stored in a signed int. - */ -int64_t encodeZigZag64(int64_t n); - -int32_t computeDoubleSize(int32_t fieldNumber, Float64 value); -int32_t computeFloatSize(int32_t fieldNumber, Float32 value); -int32_t computeUInt64Size(int32_t fieldNumber, int64_t value); -int32_t computeInt64Size(int32_t fieldNumber, int64_t value); -int32_t computeInt32Size(int32_t fieldNumber, int32_t value); -int32_t computeFixed64Size(int32_t fieldNumber, int64_t value); -int32_t computeFixed32Size(int32_t fieldNumber, int32_t value); -int32_t computeBoolSize(int32_t fieldNumber, BOOL value); -int32_t computeStringSize(int32_t fieldNumber, NSString* value); -int32_t computeGroupSize(int32_t fieldNumber, id value); -int32_t computeUnknownGroupSize(int32_t fieldNumber, PBUnknownFieldSet* value); -int32_t computeMessageSize(int32_t fieldNumber, id value); -int32_t computeDataSize(int32_t fieldNumber, NSData* value); -int32_t computeUInt32Size(int32_t fieldNumber, int32_t value); -int32_t computeSFixed32Size(int32_t fieldNumber, int32_t value); -int32_t computeSFixed64Size(int32_t fieldNumber, int64_t value); -int32_t computeSInt32Size(int32_t fieldNumber, int32_t value); -int32_t computeSInt64Size(int32_t fieldNumber, int64_t value); -int32_t computeTagSize(int32_t fieldNumber); - -int32_t computeDoubleSizeNoTag(Float64 value); -int32_t computeFloatSizeNoTag(Float32 value); -int32_t computeUInt64SizeNoTag(int64_t value); -int32_t computeInt64SizeNoTag(int64_t value); -int32_t computeInt32SizeNoTag(int32_t value); -int32_t computeFixed64SizeNoTag(int64_t value); -int32_t computeFixed32SizeNoTag(int32_t value); -int32_t computeBoolSizeNoTag(BOOL value); -int32_t computeStringSizeNoTag(NSString* value); -int32_t computeGroupSizeNoTag(id value); -int32_t computeUnknownGroupSizeNoTag(PBUnknownFieldSet* value); -int32_t computeMessageSizeNoTag(id value); -int32_t computeDataSizeNoTag(NSData* value); -int32_t computeUInt32SizeNoTag(int32_t value); -int32_t computeEnumSizeNoTag(int32_t value); -int32_t computeSFixed32SizeNoTag(int32_t value); -int32_t computeSFixed64SizeNoTag(int64_t value); -int32_t computeSInt32SizeNoTag(int32_t value); -int32_t computeSInt64SizeNoTag(int64_t value); - -/** - * Compute the number of bytes that would be needed to encode a varint. - * {@code value} is treated as unsigned, so it won't be sign-extended if - * negative. - */ -int32_t computeRawVarint32Size(int32_t value); -int32_t computeRawVarint64Size(int64_t value); - -/** - * Compute the number of bytes that would be needed to encode a - * MessageSet extension to the stream. For historical reasons, - * the wire format differs from normal fields. - */ -int32_t computeMessageSetExtensionSize(int32_t fieldNumber, id value); - -/** - * Compute the number of bytes that would be needed to encode an - * unparsed MessageSet extension field to the stream. For - * historical reasons, the wire format differs from normal fields. - */ -int32_t computeRawMessageSetExtensionSize(int32_t fieldNumber, NSData* value); - -/** - * Compute the number of bytes that would be needed to encode an - * enum field, including tag. Caller is responsible for converting the - * enum value to its numeric value. - */ -int32_t computeEnumSize(int32_t fieldNumber, int32_t value); - -/** - * Flushes the stream and forces any buffered bytes to be written. This - * does not flush the underlying NSOutputStream. - */ -- (void) flush; - -- (void) writeRawByte:(uint8_t) value; - -- (void) writeTag:(int32_t) fieldNumber format:(int32_t) format; - -/** - * Encode and write a varint. {@code value} is treated as - * unsigned, so it won't be sign-extended if negative. - */ -- (void) writeRawVarint32:(int32_t) value; -- (void) writeRawVarint64:(int64_t) value; - -- (void) writeRawLittleEndian32:(int32_t) value; -- (void) writeRawLittleEndian64:(int64_t) value; - -- (void) writeRawData:(NSData*) data; -- (void) writeRawData:(NSData*) data offset:(int32_t) offset length:(int32_t) length; - -- (void) writeData:(int32_t) fieldNumber value:(NSData*) value; - -- (void) writeDouble:(int32_t) fieldNumber value:(Float64) value; -- (void) writeFloat:(int32_t) fieldNumber value:(Float32) value; -- (void) writeUInt64:(int32_t) fieldNumber value:(int64_t) value; -- (void) writeInt64:(int32_t) fieldNumber value:(int64_t) value; -- (void) writeInt32:(int32_t) fieldNumber value:(int32_t) value; -- (void) writeFixed64:(int32_t) fieldNumber value:(int64_t) value; -- (void) writeFixed32:(int32_t) fieldNumber value:(int32_t) value; -- (void) writeBool:(int32_t) fieldNumber value:(BOOL) value; -- (void) writeString:(int32_t) fieldNumber value:(NSString*) value; -- (void) writeGroup:(int32_t) fieldNumber value:(id) value; -- (void) writeUnknownGroup:(int32_t) fieldNumber value:(PBUnknownFieldSet*) value; -- (void) writeMessage:(int32_t) fieldNumber value:(id) value; -- (void) writeUInt32:(int32_t) fieldNumber value:(int32_t) value; -- (void) writeSFixed32:(int32_t) fieldNumber value:(int32_t) value; -- (void) writeSFixed64:(int32_t) fieldNumber value:(int64_t) value; -- (void) writeSInt32:(int32_t) fieldNumber value:(int32_t) value; -- (void) writeSInt64:(int32_t) fieldNumber value:(int64_t) value; - -- (void) writeDoubleNoTag:(Float64) value; -- (void) writeFloatNoTag:(Float32) value; -- (void) writeUInt64NoTag:(int64_t) value; -- (void) writeInt64NoTag:(int64_t) value; -- (void) writeInt32NoTag:(int32_t) value; -- (void) writeFixed64NoTag:(int64_t) value; -- (void) writeFixed32NoTag:(int32_t) value; -- (void) writeBoolNoTag:(BOOL) value; -- (void) writeStringNoTag:(NSString*) value; -- (void) writeGroupNoTag:(int32_t) fieldNumber value:(id) value; -- (void) writeUnknownGroupNoTag:(int32_t) fieldNumber value:(PBUnknownFieldSet*) value; -- (void) writeMessageNoTag:(id) value; -- (void) writeDataNoTag:(NSData*) value; -- (void) writeUInt32NoTag:(int32_t) value; -- (void) writeEnumNoTag:(int32_t) value; -- (void) writeSFixed32NoTag:(int32_t) value; -- (void) writeSFixed64NoTag:(int64_t) value; -- (void) writeSInt32NoTag:(int32_t) value; -- (void) writeSInt64NoTag:(int64_t) value; - - -/** - * Write a MessageSet extension field to the stream. For historical reasons, - * the wire format differs from normal fields. - */ -- (void) writeMessageSetExtension:(int32_t) fieldNumber value:(id) value; - -/** - * Write an unparsed MessageSet extension field to the stream. For - * historical reasons, the wire format differs from normal fields. - */ -- (void) writeRawMessageSetExtension:(int32_t) fieldNumber value:(NSData*) value; - -/** - * Write an enum field, including tag, to the stream. Caller is responsible - * for converting the enum value to its numeric value. - */ -- (void) writeEnum:(int32_t) fieldNumber value:(int32_t) value; - -@end diff --git a/Libraries/ProtocolBuffers/CodedOutputStream.m b/Libraries/ProtocolBuffers/CodedOutputStream.m deleted file mode 100644 index 5968dbd4b..000000000 --- a/Libraries/ProtocolBuffers/CodedOutputStream.m +++ /dev/null @@ -1,974 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "CodedOutputStream.h" - -#import "Message.h" -#import "Utilities.h" -#import "WireFormat.h" -#import "UnknownFieldSet.h" - -@interface PBCodedOutputStream () -@property (retain) NSMutableData* buffer; -@property int32_t position; -@property (retain) NSOutputStream* output; -@end - - -@implementation PBCodedOutputStream - -const int32_t DEFAULT_BUFFER_SIZE = 4096; -const int32_t LITTLE_ENDIAN_32_SIZE = 4; -const int32_t LITTLE_ENDIAN_64_SIZE = 8; - -@synthesize output; -@synthesize buffer; -@synthesize position; - -- (void) dealloc { - [output close]; - self.output = nil; - self.buffer = nil; - self.position = 0; -} - - -- (id) initWithOutputStream:(NSOutputStream*) output_ - data:(NSMutableData*) data_ { - if ((self = [super init])) { - self.output = output_; - self.buffer = data_; - self.position = 0; - - [output open]; - } - - return self; -} - - -+ (PBCodedOutputStream*) streamWithOutputStream:(NSOutputStream*) output - bufferSize:(int32_t) bufferSize { - NSMutableData* data = [NSMutableData dataWithLength:(NSUInteger)bufferSize]; - return [[PBCodedOutputStream alloc] initWithOutputStream:output - data:data]; -} - - -+ (PBCodedOutputStream*) streamWithOutputStream:(NSOutputStream*) output { - return [PBCodedOutputStream streamWithOutputStream:output bufferSize:DEFAULT_BUFFER_SIZE]; -} - - -+ (PBCodedOutputStream*) streamWithData:(NSMutableData*) data { - return [[PBCodedOutputStream alloc] initWithOutputStream:nil data:data]; -} - - -- (void) writeDoubleNoTag:(Float64) value { - [self writeRawLittleEndian64:convertFloat64ToInt64(value)]; -} - - -/** Write a {@code double} field, including tag, to the stream. */ -- (void) writeDouble:(int32_t) fieldNumber - value:(Float64) value { - [self writeTag:fieldNumber format:PBWireFormatFixed64]; - [self writeDoubleNoTag:value]; -} - - -- (void) writeFloatNoTag:(Float32) value { - [self writeRawLittleEndian32:convertFloat32ToInt32(value)]; -} - - -/** Write a {@code float} field, including tag, to the stream. */ -- (void) writeFloat:(int32_t) fieldNumber - value:(Float32) value { - [self writeTag:fieldNumber format:PBWireFormatFixed32]; - [self writeFloatNoTag:value]; -} - - -- (void) writeUInt64NoTag:(int64_t) value { - [self writeRawVarint64:value]; -} - - -/** Write a {@code uint64} field, including tag, to the stream. */ -- (void) writeUInt64:(int32_t) fieldNumber - value:(int64_t) value { - [self writeTag:fieldNumber format:PBWireFormatVarint]; - [self writeUInt64NoTag:value]; -} - - -- (void) writeInt64NoTag:(int64_t) value { - [self writeRawVarint64:value]; -} - - -/** Write an {@code int64} field, including tag, to the stream. */ -- (void) writeInt64:(int32_t) fieldNumber - value:(int64_t) value { - [self writeTag:fieldNumber format:PBWireFormatVarint]; - [self writeInt64NoTag:value]; -} - - -- (void) writeInt32NoTag:(int32_t) value { - if (value >= 0) { - [self writeRawVarint32:value]; - } else { - // Must sign-extend - [self writeRawVarint64:value]; - } -} - - -/** Write an {@code int32} field, including tag, to the stream. */ -- (void) writeInt32:(int32_t) fieldNumber - value:(int32_t) value { - [self writeTag:fieldNumber format:PBWireFormatVarint]; - [self writeInt32NoTag:value]; -} - - -- (void) writeFixed64NoTag:(int64_t) value { - [self writeRawLittleEndian64:value]; -} - - -/** Write a {@code fixed64} field, including tag, to the stream. */ -- (void) writeFixed64:(int32_t) fieldNumber - value:(int64_t) value { - [self writeTag:fieldNumber format:PBWireFormatFixed64]; - [self writeFixed64NoTag:value]; -} - - -- (void) writeFixed32NoTag:(int32_t) value { - [self writeRawLittleEndian32:value]; -} - - -/** Write a {@code fixed32} field, including tag, to the stream. */ -- (void) writeFixed32:(int32_t) fieldNumber - value:(int32_t) value { - [self writeTag:fieldNumber format:PBWireFormatFixed32]; - [self writeFixed32NoTag:value]; -} - - -- (void) writeBoolNoTag:(BOOL) value { - [self writeRawByte:(value ? 1 : 0)]; -} - - -/** Write a {@code bool} field, including tag, to the stream. */ -- (void) writeBool:(int32_t) fieldNumber - value:(BOOL) value { - [self writeTag:fieldNumber format:PBWireFormatVarint]; - [self writeBoolNoTag:value]; -} - - -- (void) writeStringNoTag:(NSString*) value { - NSData* data = [value dataUsingEncoding:NSUTF8StringEncoding]; - [self writeRawVarint32:(int32_t)data.length]; - [self writeRawData:data]; -} - - -/** Write a {@code string} field, including tag, to the stream. */ -- (void) writeString:(int32_t) fieldNumber - value:(NSString*) value { - // TODO(cyrusn): we could probably use: - // NSString:getBytes:maxLength:usedLength:encoding:options:range:remainingRange: - // to write directly into our buffer. - [self writeTag:fieldNumber format:PBWireFormatLengthDelimited]; - [self writeStringNoTag:value]; -} - - -- (void) writeGroupNoTag:(int32_t) fieldNumber - value:(id) value { - [value writeToCodedOutputStream:self]; - [self writeTag:fieldNumber format:PBWireFormatEndGroup]; -} - - -/** Write a {@code group} field, including tag, to the stream. */ -- (void) writeGroup:(int32_t) fieldNumber - value:(id) value { - [self writeTag:fieldNumber format:PBWireFormatStartGroup]; - [self writeGroupNoTag:fieldNumber value:value]; -} - - -- (void) writeUnknownGroupNoTag:(int32_t) fieldNumber - value:(PBUnknownFieldSet*) value { - [value writeToCodedOutputStream:self]; - [self writeTag:fieldNumber format:PBWireFormatEndGroup]; -} - - -/** Write a group represented by an {@link PBUnknownFieldSet}. */ -- (void) writeUnknownGroup:(int32_t) fieldNumber - value:(PBUnknownFieldSet*) value { - [self writeTag:fieldNumber format:PBWireFormatStartGroup]; - [self writeUnknownGroupNoTag:fieldNumber value:value]; -} - - -- (void) writeMessageNoTag:(id) value { - [self writeRawVarint32:[value serializedSize]]; - [value writeToCodedOutputStream:self]; -} - - -/** Write an embedded message field, including tag, to the stream. */ -- (void) writeMessage:(int32_t) fieldNumber - value:(id) value { - [self writeTag:fieldNumber format:PBWireFormatLengthDelimited]; - [self writeMessageNoTag:value]; -} - - -- (void) writeDataNoTag:(NSData*) value { - [self writeRawVarint32:(int32_t)value.length]; - [self writeRawData:value]; -} - - -/** Write a {@code bytes} field, including tag, to the stream. */ -- (void) writeData:(int32_t) fieldNumber value:(NSData*) value { - [self writeTag:fieldNumber format:PBWireFormatLengthDelimited]; - [self writeDataNoTag:value]; -} - - -- (void) writeUInt32NoTag:(int32_t) value { - [self writeRawVarint32:value]; -} - - -/** Write a {@code uint32} field, including tag, to the stream. */ -- (void) writeUInt32:(int32_t) fieldNumber - value:(int32_t) value { - [self writeTag:fieldNumber format:PBWireFormatVarint]; - [self writeUInt32NoTag:value]; -} - - -- (void) writeEnumNoTag:(int32_t) value { - [self writeRawVarint32:value]; -} - - -/** - * Write an enum field, including tag, to the stream. Caller is responsible - * for converting the enum value to its numeric value. - */ -- (void) writeEnum:(int32_t) fieldNumber - value:(int32_t) value { - [self writeTag:fieldNumber format:PBWireFormatVarint]; - [self writeEnumNoTag:value]; -} - - -- (void) writeSFixed32NoTag:(int32_t) value { - [self writeRawLittleEndian32:value]; -} - - -/** Write an {@code sfixed32} field, including tag, to the stream. */ -- (void) writeSFixed32:(int32_t) fieldNumber - value:(int32_t) value { - [self writeTag:fieldNumber format:PBWireFormatFixed32]; - [self writeSFixed32NoTag:value]; -} - - -- (void) writeSFixed64NoTag:(int64_t) value { - [self writeRawLittleEndian64:value]; -} - - -/** Write an {@code sfixed64} field, including tag, to the stream. */ -- (void) writeSFixed64:(int32_t) fieldNumber - value:(int64_t) value { - [self writeTag:fieldNumber format:PBWireFormatFixed64]; - [self writeSFixed64NoTag:value]; -} - - -- (void) writeSInt32NoTag:(int32_t) value { - [self writeRawVarint32:encodeZigZag32(value)]; -} - - -/** Write an {@code sint32} field, including tag, to the stream. */ -- (void) writeSInt32:(int32_t) fieldNumber - value:(int32_t) value { - [self writeTag:fieldNumber format:PBWireFormatVarint]; - [self writeSInt32NoTag:value]; -} - - -- (void) writeSInt64NoTag:(int64_t) value { - [self writeRawVarint64:encodeZigZag64(value)]; -} - - -/** Write an {@code sint64} field, including tag, to the stream. */ -- (void) writeSInt64:(int32_t) fieldNumber - value:(int64_t) value { - [self writeTag:fieldNumber format:PBWireFormatVarint]; - [self writeSInt64NoTag:value]; -} - - -/** - * Write a MessageSet extension field to the stream. For historical reasons, - * the wire format differs from normal fields. - */ -- (void) writeMessageSetExtension:(int32_t) fieldNumber - value:(id) value { - [self writeTag:PBWireFormatMessageSetItem format:PBWireFormatStartGroup]; - [self writeUInt32:PBWireFormatMessageSetTypeId value:fieldNumber]; - [self writeMessage:PBWireFormatMessageSetMessage value:value]; - [self writeTag:PBWireFormatMessageSetItem format:PBWireFormatEndGroup]; -} - - -/** - * Write an unparsed MessageSet extension field to the stream. For - * historical reasons, the wire format differs from normal fields. - */ -- (void) writeRawMessageSetExtension:(int32_t) fieldNumber - value:(NSData*) value { - [self writeTag:PBWireFormatMessageSetItem format:PBWireFormatStartGroup]; - [self writeUInt32:PBWireFormatMessageSetTypeId value:fieldNumber]; - [self writeData:PBWireFormatMessageSetMessage value:value]; - [self writeTag:PBWireFormatMessageSetItem format:PBWireFormatEndGroup]; -} - - -/** - * Compute the number of bytes that would be needed to encode a - * {@code double} field, including tag. - */ -int32_t computeDoubleSizeNoTag(Float64 value) { - return LITTLE_ENDIAN_64_SIZE; -} - - -/** - * Compute the number of bytes that would be needed to encode a - * {@code float} field, including tag. - */ -int32_t computeFloatSizeNoTag(Float32 value) { - return LITTLE_ENDIAN_32_SIZE; -} - - -/** - * Compute the number of bytes that would be needed to encode a - * {@code uint64} field, including tag. - */ -int32_t computeUInt64SizeNoTag(int64_t value) { - return computeRawVarint64Size(value); -} - - -/** - * Compute the number of bytes that would be needed to encode an - * {@code int64} field, including tag. - */ -int32_t computeInt64SizeNoTag(int64_t value) { - return computeRawVarint64Size(value); -} - - -/** - * Compute the number of bytes that would be needed to encode an - * {@code int32} field, including tag. - */ -int32_t computeInt32SizeNoTag(int32_t value) { - if (value >= 0) { - return computeRawVarint32Size(value); - } else { - // Must sign-extend. - return 10; - } -} - - -/** - * Compute the number of bytes that would be needed to encode a - * {@code fixed64} field, including tag. - */ -int32_t computeFixed64SizeNoTag(int64_t value) { - return LITTLE_ENDIAN_64_SIZE; -} - - -/** - * Compute the number of bytes that would be needed to encode a - * {@code fixed32} field, including tag. - */ -int32_t computeFixed32SizeNoTag(int32_t value) { - return LITTLE_ENDIAN_32_SIZE; -} - - -/** - * Compute the number of bytes that would be needed to encode a - * {@code bool} field, including tag. - */ -int32_t computeBoolSizeNoTag(BOOL value) { - return 1; -} - - -/** - * Compute the number of bytes that would be needed to encode a - * {@code string} field, including tag. - */ -int32_t computeStringSizeNoTag(NSString* value) { - NSData* data = [value dataUsingEncoding:NSUTF8StringEncoding]; - return computeRawVarint32Size((int32_t)data.length) + (int32_t)data.length; -} - - -/** - * Compute the number of bytes that would be needed to encode a - * {@code group} field, including tag. - */ -int32_t computeGroupSizeNoTag(id value) { - return [value serializedSize]; -} - - -/** - * Compute the number of bytes that would be needed to encode a - * {@code group} field represented by an {@code PBUnknownFieldSet}, including - * tag. - */ -int32_t computeUnknownGroupSizeNoTag(PBUnknownFieldSet* value) { - return value.serializedSize; -} - - -/** - * Compute the number of bytes that would be needed to encode an - * embedded message field, including tag. - */ -int32_t computeMessageSizeNoTag(id value) { - int32_t size = [value serializedSize]; - return computeRawVarint32Size(size) + size; -} - - -/** - * Compute the number of bytes that would be needed to encode a - * {@code bytes} field, including tag. - */ -int32_t computeDataSizeNoTag(NSData* value) { - return computeRawVarint32Size((int32_t)value.length) + (int32_t)value.length; -} - - -/** - * Compute the number of bytes that would be needed to encode a - * {@code uint32} field, including tag. - */ -int32_t computeUInt32SizeNoTag(int32_t value) { - return computeRawVarint32Size(value); -} - - -/** - * Compute the number of bytes that would be needed to encode an - * enum field, including tag. Caller is responsible for converting the - * enum value to its numeric value. - */ -int32_t computeEnumSizeNoTag(int32_t value) { - return computeRawVarint32Size(value); -} - - -/** - * Compute the number of bytes that would be needed to encode an - * {@code sfixed32} field, including tag. - */ -int32_t computeSFixed32SizeNoTag(int32_t value) { - return LITTLE_ENDIAN_32_SIZE; -} - - -/** - * Compute the number of bytes that would be needed to encode an - * {@code sfixed64} field, including tag. - */ -int32_t computeSFixed64SizeNoTag(int64_t value) { - return LITTLE_ENDIAN_64_SIZE; -} - - -/** - * Compute the number of bytes that would be needed to encode an - * {@code sint32} field, including tag. - */ -int32_t computeSInt32SizeNoTag(int32_t value) { - return computeRawVarint32Size(encodeZigZag32(value)); -} - - -/** - * Compute the number of bytes that would be needed to encode an - * {@code sint64} field, including tag. - */ -int32_t computeSInt64SizeNoTag(int64_t value) { - return computeRawVarint64Size(encodeZigZag64(value)); -} - - -/** - * Compute the number of bytes that would be needed to encode a - * {@code double} field, including tag. - */ -int32_t computeDoubleSize(int32_t fieldNumber, Float64 value) { - return computeTagSize(fieldNumber) + computeDoubleSizeNoTag(value); -} - - -/** - * Compute the number of bytes that would be needed to encode a - * {@code float} field, including tag. - */ -int32_t computeFloatSize(int32_t fieldNumber, Float32 value) { - return computeTagSize(fieldNumber) + computeFloatSizeNoTag(value); -} - - -/** - * Compute the number of bytes that would be needed to encode a - * {@code uint64} field, including tag. - */ -int32_t computeUInt64Size(int32_t fieldNumber, int64_t value) { - return computeTagSize(fieldNumber) + computeUInt64SizeNoTag(value); -} - - -/** - * Compute the number of bytes that would be needed to encode an - * {@code int64} field, including tag. - */ -int32_t computeInt64Size(int32_t fieldNumber, int64_t value) { - return computeTagSize(fieldNumber) + computeInt64SizeNoTag(value); -} - - -/** - * Compute the number of bytes that would be needed to encode an - * {@code int32} field, including tag. - */ -int32_t computeInt32Size(int32_t fieldNumber, int32_t value) { - return computeTagSize(fieldNumber) + computeInt32SizeNoTag(value); -} - - -/** - * Compute the number of bytes that would be needed to encode a - * {@code fixed64} field, including tag. - */ -int32_t computeFixed64Size(int32_t fieldNumber, int64_t value) { - return computeTagSize(fieldNumber) + computeFixed64SizeNoTag(value); -} - - -/** - * Compute the number of bytes that would be needed to encode a - * {@code fixed32} field, including tag. - */ -int32_t computeFixed32Size(int32_t fieldNumber, int32_t value) { - return computeTagSize(fieldNumber) + computeFixed32SizeNoTag(value); -} - - -/** - * Compute the number of bytes that would be needed to encode a - * {@code bool} field, including tag. - */ -int32_t computeBoolSize(int32_t fieldNumber, BOOL value) { - return computeTagSize(fieldNumber) + computeBoolSizeNoTag(value); -} - - -/** - * Compute the number of bytes that would be needed to encode a - * {@code string} field, including tag. - */ -int32_t computeStringSize(int32_t fieldNumber, NSString* value) { - return computeTagSize(fieldNumber) + computeStringSizeNoTag(value); -} - - -/** - * Compute the number of bytes that would be needed to encode a - * {@code group} field, including tag. - */ -int32_t computeGroupSize(int32_t fieldNumber, id value) { - return computeTagSize(fieldNumber) * 2 + computeGroupSizeNoTag(value); -} - - -/** - * Compute the number of bytes that would be needed to encode a - * {@code group} field represented by an {@code PBUnknownFieldSet}, including - * tag. - */ -int32_t computeUnknownGroupSize(int32_t fieldNumber, - PBUnknownFieldSet* value) { - return computeTagSize(fieldNumber) * 2 + computeUnknownGroupSizeNoTag(value); -} - - -/** - * Compute the number of bytes that would be needed to encode an - * embedded message field, including tag. - */ -int32_t computeMessageSize(int32_t fieldNumber, id value) { - return computeTagSize(fieldNumber) + computeMessageSizeNoTag(value); -} - - -/** - * Compute the number of bytes that would be needed to encode a - * {@code bytes} field, including tag. - */ -int32_t computeDataSize(int32_t fieldNumber, NSData* value) { - return computeTagSize(fieldNumber) + computeDataSizeNoTag(value); -} - - -/** - * Compute the number of bytes that would be needed to encode a - * {@code uint32} field, including tag. - */ -int32_t computeUInt32Size(int32_t fieldNumber, int32_t value) { - return computeTagSize(fieldNumber) + computeUInt32SizeNoTag(value); -} - - -/** - * Compute the number of bytes that would be needed to encode an - * enum field, including tag. Caller is responsible for converting the - * enum value to its numeric value. - */ -int32_t computeEnumSize(int32_t fieldNumber, int32_t value) { - return computeTagSize(fieldNumber) + computeEnumSizeNoTag(value); -} - - -/** - * Compute the number of bytes that would be needed to encode an - * {@code sfixed32} field, including tag. - */ -int32_t computeSFixed32Size(int32_t fieldNumber, int32_t value) { - return computeTagSize(fieldNumber) + computeSFixed32SizeNoTag(value); -} - - -/** - * Compute the number of bytes that would be needed to encode an - * {@code sfixed64} field, including tag. - */ -int32_t computeSFixed64Size(int32_t fieldNumber, int64_t value) { - return computeTagSize(fieldNumber) + computeSFixed64SizeNoTag(value); -} - - -/** - * Compute the number of bytes that would be needed to encode an - * {@code sint32} field, including tag. - */ -int32_t computeSInt32Size(int32_t fieldNumber, int32_t value) { - return computeTagSize(fieldNumber) + computeSInt32SizeNoTag(value); -} - - -/** - * Compute the number of bytes that would be needed to encode an - * {@code sint64} field, including tag. - */ -int32_t computeSInt64Size(int32_t fieldNumber, int64_t value) { - return computeTagSize(fieldNumber) + - computeRawVarint64Size(encodeZigZag64(value)); -} - - -/** - * Compute the number of bytes that would be needed to encode a - * MessageSet extension to the stream. For historical reasons, - * the wire format differs from normal fields. - */ -int32_t computeMessageSetExtensionSize(int32_t fieldNumber, id value) { - return computeTagSize(PBWireFormatMessageSetItem) * 2 + - computeUInt32Size(PBWireFormatMessageSetTypeId, fieldNumber) + - computeMessageSize(PBWireFormatMessageSetMessage, value); -} - - -/** - * Compute the number of bytes that would be needed to encode an - * unparsed MessageSet extension field to the stream. For - * historical reasons, the wire format differs from normal fields. - */ -int32_t computeRawMessageSetExtensionSize(int32_t fieldNumber, NSData* value) { - return computeTagSize(PBWireFormatMessageSetItem) * 2 + - computeUInt32Size(PBWireFormatMessageSetTypeId, fieldNumber) + - computeDataSize(PBWireFormatMessageSetMessage, value); -} - - -/** - * Internal helper that writes the current buffer to the output. The - * buffer position is reset to its initial value when this returns. - */ -- (void) refreshBuffer { - if (output == nil) { - // We're writing to a single buffer. - @throw [NSException exceptionWithName:@"OutOfSpace" reason:@"" userInfo:nil]; - } - - - [output write:buffer.bytes maxLength:(NSUInteger)position]; - position = 0; -} - - -/** - * Flushes the stream and forces any buffered bytes to be written. This - * does not flush the underlying OutputStream. - */ -- (void) flush { - if (output != nil) { - [self refreshBuffer]; - } -} - - -/** - * If writing to a flat array, return the space left in the array. - * Otherwise, throws {@code UnsupportedOperationException}. - */ -- (int32_t) spaceLeft { - if (output == nil) { - return (int32_t)buffer.length - position; - } else { - @throw [NSException exceptionWithName:@"UnsupportedOperation" - reason:@"spaceLeft() can only be called on CodedOutputStreams that are writing to a flat array." - userInfo:nil]; - } -} - - -/** - * Verifies that {@link #spaceLeft()} returns zero. It's common to create - * a byte array that is exactly big enough to hold a message, then write to - * it with a {@code PBCodedOutputStream}. Calling {@code checkNoSpaceLeft()} - * after writing verifies that the message was actually as big as expected, - * which can help catch bugs. - */ -- (void) checkNoSpaceLeft { - if (self.spaceLeft != 0) { - @throw [NSException exceptionWithName:@"IllegalState" reason:@"Did not write as much data as expected." userInfo:nil]; - } -} - - -/** Write a single byte. */ -- (void) writeRawByte:(uint8_t) value { - if (position == (int32_t)buffer.length) { - [self refreshBuffer]; - } - - ((uint8_t*)buffer.mutableBytes)[position++] = value; -} - - -/** Write an array of bytes. */ -- (void) writeRawData:(NSData*) data { - [self writeRawData:data offset:0 length:(int32_t)data.length]; -} - - -- (void) writeRawData:(NSData*) value offset:(int32_t) offset length:(int32_t) length { - if ((int32_t)buffer.length - position >= length) { - // We have room in the current buffer. - memcpy(((uint8_t*)buffer.mutableBytes) + position, ((uint8_t*)value.bytes) + offset, length); - position += length; - } else { - // Write extends past current buffer. Fill the rest of this buffer and flush. - int32_t bytesWritten = (int32_t)buffer.length - position; - memcpy(((uint8_t*)buffer.mutableBytes) + position, ((uint8_t*)value.bytes) + offset, bytesWritten); - offset += bytesWritten; - length -= bytesWritten; - position = (int32_t)buffer.length; - [self refreshBuffer]; - - // Now deal with the rest. - // Since we have an output stream, this is our buffer - // and buffer offset == 0 - if (length <= (int32_t)buffer.length) { - // Fits in new buffer. - memcpy((uint8_t*)buffer.mutableBytes, ((uint8_t*)value.bytes) + offset, length); - position = length; - } else { - // Write is very big. Let's do it all at once. - [output write:((uint8_t*) value.bytes) + offset maxLength:(NSUInteger)length]; - } - } -} - - -/** Encode and write a tag. */ -- (void) writeTag:(int32_t) fieldNumber - format:(int32_t) format { - [self writeRawVarint32:PBWireFormatMakeTag(fieldNumber, format)]; -} - - -/** Compute the number of bytes that would be needed to encode a tag. */ -int32_t computeTagSize(int32_t fieldNumber) { - return computeRawVarint32Size(PBWireFormatMakeTag(fieldNumber, 0)); -} - - -/** - * Encode and write a varint. {@code value} is treated as - * unsigned, so it won't be sign-extended if negative. - */ -- (void) writeRawVarint32:(int32_t) value { - while (YES) { - if ((value & ~0x7F) == 0) { - [self writeRawByte:(uint8_t)value]; - return; - } else { - [self writeRawByte:((value & 0x7F) | 0x80)]; - value = logicalRightShift32(value, 7); - } - } -} - - -/** - * Compute the number of bytes that would be needed to encode a varint. - * {@code value} is treated as unsigned, so it won't be sign-extended if - * negative. - */ -int32_t computeRawVarint32Size(int32_t value) { - if ((value & (0xffffffffLL << 7)) == 0) return 1; - if ((value & (0xffffffffLL << 14)) == 0) return 2; - if ((value & (0xffffffffLL << 21)) == 0) return 3; - if ((value & (0xffffffffLL << 28)) == 0) return 4; - return 5; -} - - -/** Encode and write a varint. */ -- (void) writeRawVarint64:(int64_t) value{ - while (YES) { - if ((value & ~0x7FL) == 0) { - [self writeRawByte:(uint8_t)((int32_t) value)]; - return; - } else { - [self writeRawByte:(uint8_t)(((int32_t) value & 0x7F) | 0x80)]; - value = logicalRightShift64(value, 7); - } - } -} - - -/** Compute the number of bytes that would be needed to encode a varint. */ -int32_t computeRawVarint64Size(int64_t value) { - if (((uint64_t)value & (0xffffffffffffffffULL << 7)) == 0) return 1; - if (((uint64_t)value & (0xffffffffffffffffULL << 14)) == 0) return 2; - if (((uint64_t)value & (0xffffffffffffffffULL << 21)) == 0) return 3; - if (((uint64_t)value & (0xffffffffffffffffULL << 28)) == 0) return 4; - if (((uint64_t)value & (0xffffffffffffffffULL << 35)) == 0) return 5; - if (((uint64_t)value & (0xffffffffffffffffULL << 42)) == 0) return 6; - if (((uint64_t)value & (0xffffffffffffffffULL << 49)) == 0) return 7; - if (((uint64_t)value & (0xffffffffffffffffULL << 56)) == 0) return 8; - if (((uint64_t)value & (0xffffffffffffffffULL << 63)) == 0) return 9; - return 10; -} - - -/** Write a little-endian 32-bit integer. */ -- (void) writeRawLittleEndian32:(int32_t) value { - [self writeRawByte:((value ) & 0xFF)]; - [self writeRawByte:((value >> 8) & 0xFF)]; - [self writeRawByte:((value >> 16) & 0xFF)]; - [self writeRawByte:((value >> 24) & 0xFF)]; -} - - -/** Write a little-endian 64-bit integer. */ -- (void) writeRawLittleEndian64:(int64_t) value { - [self writeRawByte:((int32_t)(value ) & 0xFF)]; - [self writeRawByte:((int32_t)(value >> 8) & 0xFF)]; - [self writeRawByte:((int32_t)(value >> 16) & 0xFF)]; - [self writeRawByte:((int32_t)(value >> 24) & 0xFF)]; - [self writeRawByte:((int32_t)(value >> 32) & 0xFF)]; - [self writeRawByte:((int32_t)(value >> 40) & 0xFF)]; - [self writeRawByte:((int32_t)(value >> 48) & 0xFF)]; - [self writeRawByte:((int32_t)(value >> 56) & 0xFF)]; -} - - -/** - * Encode a ZigZag-encoded 32-bit value. ZigZag encodes signed integers - * into values that can be efficiently encoded with varint. (Otherwise, - * negative values must be sign-extended to 64 bits to be varint encoded, - * thus always taking 10 bytes on the wire.) - * - * @param n A signed 32-bit integer. - * @return An unsigned 32-bit integer, stored in a signed int - */ -int32_t encodeZigZag32(int32_t n) { - // Note: the right-shift must be arithmetic - return (n << 1) ^ (n >> 31); -} - - -/** - * Encode a ZigZag-encoded 64-bit value. ZigZag encodes signed integers - * into values that can be efficiently encoded with varint. (Otherwise, - * negative values must be sign-extended to 64 bits to be varint encoded, - * thus always taking 10 bytes on the wire.) - * - * @param n A signed 64-bit integer. - * @return An unsigned 64-bit integer, stored in a signed int - */ -int64_t encodeZigZag64(int64_t n) { - // Note: the right-shift must be arithmetic - return (n << 1) ^ (n >> 63); -} - -@end diff --git a/Libraries/ProtocolBuffers/ConcreteExtensionField.h b/Libraries/ProtocolBuffers/ConcreteExtensionField.h deleted file mode 100644 index f3e82ec0f..000000000 --- a/Libraries/ProtocolBuffers/ConcreteExtensionField.h +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "ExtensionField.h" - -typedef enum { - PBExtensionTypeBool, - PBExtensionTypeFixed32, - PBExtensionTypeSFixed32, - PBExtensionTypeFloat, - PBExtensionTypeFixed64, - PBExtensionTypeSFixed64, - PBExtensionTypeDouble, - PBExtensionTypeInt32, - PBExtensionTypeInt64, - PBExtensionTypeSInt32, - PBExtensionTypeSInt64, - PBExtensionTypeUInt32, - PBExtensionTypeUInt64, - PBExtensionTypeBytes, - PBExtensionTypeString, - PBExtensionTypeMessage, - PBExtensionTypeGroup, - PBExtensionTypeEnum -} PBExtensionType; - -@interface PBConcreteExtensionField : NSObject { -@private - PBExtensionType type; - - Class extendedClass; - int32_t fieldNumber; - id defaultValue; - - Class messageOrGroupClass; - - BOOL isRepeated; - BOOL isPacked; - BOOL isMessageSetWireFormat; -} - -+ (PBConcreteExtensionField*) extensionWithType:(PBExtensionType) type - extendedClass:(Class) extendedClass - fieldNumber:(int32_t) fieldNumber - defaultValue:(id) defaultValue - messageOrGroupClass:(Class) messageOrGroupClass - isRepeated:(BOOL) isRepeated - isPacked:(BOOL) isPacked - isMessageSetWireFormat:(BOOL) isMessageSetWireFormat; - -@end diff --git a/Libraries/ProtocolBuffers/ConcreteExtensionField.m b/Libraries/ProtocolBuffers/ConcreteExtensionField.m deleted file mode 100644 index 045c85c65..000000000 --- a/Libraries/ProtocolBuffers/ConcreteExtensionField.m +++ /dev/null @@ -1,543 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "ConcreteExtensionField.h" -#import "CodedOutputStream.h" -#import "CodedInputStream.h" -#import "Message_Builder.h" -#import "Message.h" -#import "ExtendableMessage_Builder.h" - -@interface PBConcreteExtensionField() -@property PBExtensionType type; -@property Class extendedClass; -@property int32_t fieldNumber; -@property (retain) id defaultValue; -@property Class messageOrGroupClass; -@property BOOL isRepeated; -@property BOOL isPacked; -@property BOOL isMessageSetWireFormat; -@end - -@implementation PBConcreteExtensionField - -@synthesize type; -@synthesize extendedClass; -@synthesize fieldNumber; -@synthesize defaultValue; -@synthesize messageOrGroupClass; -@synthesize isRepeated; -@synthesize isPacked; -@synthesize isMessageSetWireFormat; - -- (void) dealloc { - self.type = 0; - self.extendedClass = nil; - self.fieldNumber = 0; - self.defaultValue = nil; - self.messageOrGroupClass = nil; - self.isRepeated = NO; - self.isPacked = NO; - self.isMessageSetWireFormat = NO; -} - - -- (id) initWithType:(PBExtensionType) type_ - extendedClass:(Class) extendedClass_ - fieldNumber:(int32_t) fieldNumber_ - defaultValue:(id) defaultValue_ - messageOrGroupClass:(Class) messageOrGroupClass_ - isRepeated:(BOOL) isRepeated_ - isPacked:(BOOL) isPacked_ - isMessageSetWireFormat:(BOOL) isMessageSetWireFormat_ { - if ((self = [super init])) { - self.type = type_; - self.extendedClass = extendedClass_; - self.fieldNumber = fieldNumber_; - self.defaultValue = defaultValue_; - self.messageOrGroupClass = messageOrGroupClass_; - self.isRepeated = isRepeated_; - self.isPacked = isPacked_; - self.isMessageSetWireFormat = isMessageSetWireFormat_; - } - - return self; -} - - -+ (PBConcreteExtensionField*) extensionWithType:(PBExtensionType) type - extendedClass:(Class) extendedClass - fieldNumber:(int32_t) fieldNumber - defaultValue:(id) defaultValue - messageOrGroupClass:(Class) messageOrGroupClass - isRepeated:(BOOL) isRepeated - isPacked:(BOOL) isPacked - isMessageSetWireFormat:(BOOL) isMessageSetWireFormat { - return [[PBConcreteExtensionField alloc] initWithType:type - extendedClass:extendedClass - fieldNumber:fieldNumber - defaultValue:defaultValue - messageOrGroupClass:messageOrGroupClass - isRepeated:isRepeated - isPacked:isPacked - isMessageSetWireFormat:isMessageSetWireFormat]; -} - - -- (PBWireFormat) wireType { - if (isPacked) { - return PBWireFormatLengthDelimited; - } - - switch (type) { - case PBExtensionTypeBool: return PBWireFormatVarint; - case PBExtensionTypeFixed32: return PBWireFormatFixed32; - case PBExtensionTypeSFixed32: return PBWireFormatFixed32; - case PBExtensionTypeFloat: return PBWireFormatFixed32; - case PBExtensionTypeFixed64: return PBWireFormatFixed64; - case PBExtensionTypeSFixed64: return PBWireFormatFixed64; - case PBExtensionTypeDouble: return PBWireFormatFixed64; - case PBExtensionTypeInt32: return PBWireFormatVarint; - case PBExtensionTypeInt64: return PBWireFormatVarint; - case PBExtensionTypeSInt32: return PBWireFormatVarint; - case PBExtensionTypeSInt64: return PBWireFormatVarint; - case PBExtensionTypeUInt32: return PBWireFormatVarint; - case PBExtensionTypeUInt64: return PBWireFormatVarint; - case PBExtensionTypeBytes: return PBWireFormatLengthDelimited; - case PBExtensionTypeString: return PBWireFormatLengthDelimited; - case PBExtensionTypeMessage: return PBWireFormatLengthDelimited; - case PBExtensionTypeGroup: return PBWireFormatStartGroup; - case PBExtensionTypeEnum: return PBWireFormatVarint; - } - - @throw [NSException exceptionWithName:@"InternalError" reason:@"" userInfo:nil]; -} - - -BOOL typeIsFixedSize(PBExtensionType type); -BOOL typeIsFixedSize(PBExtensionType type) { - switch (type) { - case PBExtensionTypeBool: - case PBExtensionTypeFixed32: - case PBExtensionTypeSFixed32: - case PBExtensionTypeFloat: - case PBExtensionTypeFixed64: - case PBExtensionTypeSFixed64: - case PBExtensionTypeDouble: - return YES; - default: - return NO; - } -} - - -int32_t typeSize(PBExtensionType type); -int32_t typeSize(PBExtensionType type) { - switch (type) { - case PBExtensionTypeBool: - return 1; - case PBExtensionTypeFixed32: - case PBExtensionTypeSFixed32: - case PBExtensionTypeFloat: - return 4; - case PBExtensionTypeFixed64: - case PBExtensionTypeSFixed64: - case PBExtensionTypeDouble: - return 8; - default: - @throw [NSException exceptionWithName:@"InternalError" reason:@"" userInfo:nil]; - } -} - - -- (void) writeSingleValue:(id) value - includingTagToCodedOutputStream:(PBCodedOutputStream*) output { - switch (type) { - case PBExtensionTypeBool: - [output writeBool:fieldNumber value:[value boolValue]]; - return; - case PBExtensionTypeFixed32: - [output writeFixed32:fieldNumber value:[value intValue]]; - return; - case PBExtensionTypeSFixed32: - [output writeSFixed32:fieldNumber value:[value intValue]]; - return; - case PBExtensionTypeFloat: - [output writeFloat:fieldNumber value:[value floatValue]]; - return; - case PBExtensionTypeFixed64: - [output writeFixed64:fieldNumber value:[value longLongValue]]; - return; - case PBExtensionTypeSFixed64: - [output writeSFixed64:fieldNumber value:[value longLongValue]]; - return; - case PBExtensionTypeDouble: - [output writeDouble:fieldNumber value:[value doubleValue]]; - return; - case PBExtensionTypeInt32: - [output writeInt32:fieldNumber value:[value intValue]]; - return; - case PBExtensionTypeInt64: - [output writeInt64:fieldNumber value:[value longLongValue]]; - return; - case PBExtensionTypeSInt32: - [output writeSInt32:fieldNumber value:[value intValue]]; - return; - case PBExtensionTypeSInt64: - [output writeSInt64:fieldNumber value:[value longLongValue]]; - return; - case PBExtensionTypeUInt32: - [output writeUInt32:fieldNumber value:[value intValue]]; - return; - case PBExtensionTypeUInt64: - [output writeUInt64:fieldNumber value:[value longLongValue]]; - return; - case PBExtensionTypeBytes: - [output writeData:fieldNumber value:value]; - return; - case PBExtensionTypeString: - [output writeString:fieldNumber value:value]; - return; - case PBExtensionTypeGroup: - [output writeGroup:fieldNumber value:value]; - return; - case PBExtensionTypeEnum: - [output writeEnum:fieldNumber value:[value intValue]]; - return; - case PBExtensionTypeMessage: - if (isMessageSetWireFormat) { - [output writeMessageSetExtension:fieldNumber value:value]; - } else { - [output writeMessage:fieldNumber value:value]; - } - return; - } - - @throw [NSException exceptionWithName:@"InternalError" reason:@"" userInfo:nil]; -} - - -- (void) writeSingleValue:(id) value - noTagToCodedOutputStream:(PBCodedOutputStream*) output { - switch (type) { - case PBExtensionTypeBool: - [output writeBoolNoTag:[value boolValue]]; - return; - case PBExtensionTypeFixed32: - [output writeFixed32NoTag:[value intValue]]; - return; - case PBExtensionTypeSFixed32: - [output writeSFixed32NoTag:[value intValue]]; - return; - case PBExtensionTypeFloat: - [output writeFloatNoTag:[value floatValue]]; - return; - case PBExtensionTypeFixed64: - [output writeFixed64NoTag:[value longLongValue]]; - return; - case PBExtensionTypeSFixed64: - [output writeSFixed64NoTag:[value longLongValue]]; - return; - case PBExtensionTypeDouble: - [output writeDoubleNoTag:[value doubleValue]]; - return; - case PBExtensionTypeInt32: - [output writeInt32NoTag:[value intValue]]; - return; - case PBExtensionTypeInt64: - [output writeInt64NoTag:[value longLongValue]]; - return; - case PBExtensionTypeSInt32: - [output writeSInt32NoTag:[value intValue]]; - return; - case PBExtensionTypeSInt64: - [output writeSInt64NoTag:[value longLongValue]]; - return; - case PBExtensionTypeUInt32: - [output writeUInt32NoTag:[value intValue]]; - return; - case PBExtensionTypeUInt64: - [output writeUInt64NoTag:[value longLongValue]]; - return; - case PBExtensionTypeBytes: - [output writeDataNoTag:value]; - return; - case PBExtensionTypeString: - [output writeStringNoTag:value]; - return; - case PBExtensionTypeGroup: - [output writeGroupNoTag:fieldNumber value:value]; - return; - case PBExtensionTypeEnum: - [output writeEnumNoTag:[value intValue]]; - return; - case PBExtensionTypeMessage: - [output writeMessageNoTag:value]; - return; - } - - @throw [NSException exceptionWithName:@"InternalError" reason:@"" userInfo:nil]; -} - - -- (int32_t) computeSingleSerializedSizeNoTag:(id) value { - switch (type) { - case PBExtensionTypeBool: return computeBoolSizeNoTag([value boolValue]); - case PBExtensionTypeFixed32: return computeFixed32SizeNoTag([value intValue]); - case PBExtensionTypeSFixed32: return computeSFixed32SizeNoTag([value intValue]); - case PBExtensionTypeFloat: return computeFloatSizeNoTag([value floatValue]); - case PBExtensionTypeFixed64: return computeFixed64SizeNoTag([value longLongValue]); - case PBExtensionTypeSFixed64: return computeSFixed64SizeNoTag([value longLongValue]); - case PBExtensionTypeDouble: return computeDoubleSizeNoTag([value doubleValue]); - case PBExtensionTypeInt32: return computeInt32SizeNoTag([value intValue]); - case PBExtensionTypeInt64: return computeInt64SizeNoTag([value longLongValue]); - case PBExtensionTypeSInt32: return computeSInt32SizeNoTag([value intValue]); - case PBExtensionTypeSInt64: return computeSInt64SizeNoTag([value longLongValue]); - case PBExtensionTypeUInt32: return computeUInt32SizeNoTag([value intValue]); - case PBExtensionTypeUInt64: return computeUInt64SizeNoTag([value longLongValue]); - case PBExtensionTypeBytes: return computeDataSizeNoTag(value); - case PBExtensionTypeString: return computeStringSizeNoTag(value); - case PBExtensionTypeGroup: return computeGroupSizeNoTag(value); - case PBExtensionTypeEnum: return computeEnumSizeNoTag([value intValue]); - case PBExtensionTypeMessage: return computeMessageSizeNoTag(value); - } - - @throw [NSException exceptionWithName:@"InternalError" reason:@"" userInfo:nil]; -} - - -- (int32_t) computeSingleSerializedSizeIncludingTag:(id) value { - switch (type) { - case PBExtensionTypeBool: return computeBoolSize(fieldNumber, [value boolValue]); - case PBExtensionTypeFixed32: return computeFixed32Size(fieldNumber, [value intValue]); - case PBExtensionTypeSFixed32: return computeSFixed32Size(fieldNumber, [value intValue]); - case PBExtensionTypeFloat: return computeFloatSize(fieldNumber, [value floatValue]); - case PBExtensionTypeFixed64: return computeFixed64Size(fieldNumber, [value longLongValue]); - case PBExtensionTypeSFixed64: return computeSFixed64Size(fieldNumber, [value longLongValue]); - case PBExtensionTypeDouble: return computeDoubleSize(fieldNumber, [value doubleValue]); - case PBExtensionTypeInt32: return computeInt32Size(fieldNumber, [value intValue]); - case PBExtensionTypeInt64: return computeInt64Size(fieldNumber, [value longLongValue]); - case PBExtensionTypeSInt32: return computeSInt32Size(fieldNumber, [value intValue]); - case PBExtensionTypeSInt64: return computeSInt64Size(fieldNumber, [value longLongValue]); - case PBExtensionTypeUInt32: return computeUInt32Size(fieldNumber, [value intValue]); - case PBExtensionTypeUInt64: return computeUInt64Size(fieldNumber, [value longLongValue]); - case PBExtensionTypeBytes: return computeDataSize(fieldNumber, value); - case PBExtensionTypeString: return computeStringSize(fieldNumber, value); - case PBExtensionTypeGroup: return computeGroupSize(fieldNumber, value); - case PBExtensionTypeEnum: return computeEnumSize(fieldNumber, [value intValue]); - case PBExtensionTypeMessage: - if (isMessageSetWireFormat) { - return computeMessageSetExtensionSize(fieldNumber, value); - } else { - return computeMessageSize(fieldNumber, value); - } - } - - @throw [NSException exceptionWithName:@"InternalError" reason:@"" userInfo:nil]; -} - - -- (void) writeRepeatedValues:(NSArray*) values - includingTagsToCodedOutputStream:(PBCodedOutputStream*) output { - if (isPacked) { - [output writeTag:fieldNumber format:PBWireFormatLengthDelimited]; - int32_t dataSize = 0; - if (typeIsFixedSize(type)) { - dataSize = (int32_t)values.count * typeSize(type); - } else { - for (id value in values) { - dataSize += [self computeSingleSerializedSizeNoTag:value]; - } - } - [output writeRawVarint32:dataSize]; - for (id value in values) { - [self writeSingleValue:value noTagToCodedOutputStream:output]; - } - } else { - for (id value in values) { - [self writeSingleValue:value includingTagToCodedOutputStream:output]; - } - } -} - - -- (void) writeValue:(id) value includingTagToCodedOutputStream:(PBCodedOutputStream*) output { - if (isRepeated) { - [self writeRepeatedValues:value includingTagsToCodedOutputStream:output]; - } else { - [self writeSingleValue:value includingTagToCodedOutputStream:output]; - } -} - - -- (int32_t) computeRepeatedSerializedSizeIncludingTags:(NSArray*) values { - if (isPacked) { - int32_t size = 0; - if (typeIsFixedSize(type)) { - size = (int32_t)values.count * typeSize(type); - } else { - for (id value in values) { - size += [self computeSingleSerializedSizeNoTag:value]; - } - } - return size + computeTagSize(fieldNumber) + computeRawVarint32Size(size); - } else { - int32_t size = 0; - for (id value in values) { - size += [self computeSingleSerializedSizeIncludingTag:value]; - } - return size; - } -} - - -- (int32_t) computeSerializedSizeIncludingTag:(id) value { - if (isRepeated) { - return [self computeRepeatedSerializedSizeIncludingTags:value]; - } else { - return [self computeSingleSerializedSizeIncludingTag:value]; - } -} - - -- (void) mergeMessageSetExtentionFromCodedInputStream:(PBCodedInputStream*) input - unknownFields:(PBUnknownFieldSet_Builder*) unknownFields { - @throw [NSException exceptionWithName:@"NYI" reason:@"" userInfo:nil]; - - // The wire format for MessageSet is: - // message MessageSet { - // repeated group Item = 1 { - // required int32 typeId = 2; - // required bytes message = 3; - // } - // } - // "typeId" is the extension's field number. The extension can only be - // a message type, where "message" contains the encoded bytes of that - // message. - // - // In practice, we will probably never see a MessageSet item in which - // the message appears before the type ID, or where either field does not - // appear exactly once. However, in theory such cases are valid, so we - // should be prepared to accept them. - - //int typeId = 0; -// ByteString rawBytes = null; -// -// while (true) { -// final int tag = input.readTag(); -// if (tag == 0) { -// break; -// } -// -// if (tag == WireFormat.MESSAGE_SET_TYPE_ID_TAG) { -// typeId = input.readUInt32(); -// // Zero is not a valid type ID. -// if (typeId != 0) { -// if (rawBytes != null) { -// unknownFields.mergeField(typeId, -// UnknownFieldSet.Field.newBuilder() -// .addLengthDelimited(rawBytes) -// .build()); -// rawBytes = null; -// } -// } -// } else if (tag == WireFormat.MESSAGE_SET_MESSAGE_TAG) { -// if (typeId == 0) { -// // We haven't seen a type ID yet, so we have to store the raw bytes -// // for now. -// rawBytes = input.readBytes(); -// } else { -// unknownFields.mergeField(typeId, -// UnknownFieldSet.Field.newBuilder() -// .addLengthDelimited(input.readBytes()) -// .build()); -// } -// } else { -// // Unknown fieldNumber. Skip it. -// if (!input.skipField(tag)) { -// break; // end of group -// } -// } -// } -// -// input.checkLastTagWas(WireFormat.MESSAGE_SET_ITEM_END_TAG); -} - - -- (id) readSingleValueFromCodedInputStream:(PBCodedInputStream*) input - extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - switch (type) { - case PBExtensionTypeBool: return [NSNumber numberWithBool:[input readBool]]; - case PBExtensionTypeFixed32: return [NSNumber numberWithInt:[input readFixed32]]; - case PBExtensionTypeSFixed32: return [NSNumber numberWithInt:[input readSFixed32]]; - case PBExtensionTypeFloat: return [NSNumber numberWithFloat:[input readFloat]]; - case PBExtensionTypeFixed64: return [NSNumber numberWithLongLong:[input readFixed64]]; - case PBExtensionTypeSFixed64: return [NSNumber numberWithLongLong:[input readSFixed64]]; - case PBExtensionTypeDouble: return [NSNumber numberWithDouble:[input readDouble]]; - case PBExtensionTypeInt32: return [NSNumber numberWithInt:[input readInt32]]; - case PBExtensionTypeInt64: return [NSNumber numberWithLongLong:[input readInt64]]; - case PBExtensionTypeSInt32: return [NSNumber numberWithInt:[input readSInt32]]; - case PBExtensionTypeSInt64: return [NSNumber numberWithLongLong:[input readSInt64]]; - case PBExtensionTypeUInt32: return [NSNumber numberWithInt:[input readUInt32]]; - case PBExtensionTypeUInt64: return [NSNumber numberWithLongLong:[input readUInt64]]; - case PBExtensionTypeBytes: return [input readData]; - case PBExtensionTypeString: return [input readString]; - case PBExtensionTypeEnum: return [NSNumber numberWithInt:[input readEnum]]; - case PBExtensionTypeGroup: - { - id builder = [messageOrGroupClass builder]; - [input readGroup:fieldNumber builder:builder extensionRegistry:extensionRegistry]; - return [builder build]; - } - - case PBExtensionTypeMessage: - { - id builder = [messageOrGroupClass builder]; - [input readMessage:builder extensionRegistry:extensionRegistry]; - return [builder build]; - } - } - - @throw [NSException exceptionWithName:@"InternalError" reason:@"" userInfo:nil]; -} - - -- (void) mergeFromCodedInputStream:(PBCodedInputStream*) input - unknownFields:(PBUnknownFieldSet_Builder*) unknownFields - extensionRegistry:(PBExtensionRegistry*) extensionRegistry - builder:(PBExtendableMessage_Builder*) builder - tag:(int32_t) tag { - if (isPacked) { - int32_t length = [input readRawVarint32]; - int32_t limit = [input pushLimit:length]; - while ([input bytesUntilLimit] > 0) { - id value = [self readSingleValueFromCodedInputStream:input extensionRegistry:extensionRegistry]; - [builder addExtension:self value:value]; - } - [input popLimit:limit]; - } else if (isMessageSetWireFormat) { - [self mergeMessageSetExtentionFromCodedInputStream:input - unknownFields:unknownFields]; - } else { - id value = [self readSingleValueFromCodedInputStream:input extensionRegistry:extensionRegistry]; - if (isRepeated) { - [builder addExtension:self value:value]; - } else { - [builder setExtension:self value:value]; - } - } -} - - -@end diff --git a/Libraries/ProtocolBuffers/ExtendableMessage.h b/Libraries/ProtocolBuffers/ExtendableMessage.h deleted file mode 100644 index 1571479b8..000000000 --- a/Libraries/ProtocolBuffers/ExtendableMessage.h +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "GeneratedMessage.h" -@protocol PBExtensionField; - -/** - * Generated message classes for message types that contain extension ranges - * subclass this. - * - *

This class implements type-safe accessors for extensions. They - * implement all the same operations that you can do with normal fields -- - * e.g. "has", "get", and "getCount" -- but for extensions. The extensions - * are identified using instances of the class {@link GeneratedExtension}; - * the protocol compiler generates a static instance of this class for every - * extension in its input. Through the magic of generics, all is made - * type-safe. - * - *

For example, imagine you have the {@code .proto} file: - * - *

- * option java_class = "MyProto";
- *
- * message Foo {
- *   extensions 1000 to max;
- * }
- *
- * extend Foo {
- *   optional int32 bar;
- * }
- * 
- * - *

Then you might write code like: - * - *

- * MyProto.Foo foo = getFoo();
- * int i = foo.getExtension(MyProto.bar);
- * 
- * - *

See also {@link ExtendableBuilder}. - */ -@interface PBExtendableMessage : PBGeneratedMessage { -@private - NSMutableDictionary* extensionMap; - NSMutableDictionary* extensionRegistry; -} - -@property (retain) NSMutableDictionary* extensionMap; -@property (retain) NSMutableDictionary* extensionRegistry; - -- (BOOL) hasExtension:(id) extension; -- (id) getExtension:(id) extension; - -//@protected -- (BOOL) extensionsAreInitialized; -- (int32_t) extensionsSerializedSize; -- (void) writeExtensionsToCodedOutputStream:(PBCodedOutputStream*) output - from:(int32_t) startInclusive - to:(int32_t) endExclusive; - - - -/* @internal */ -- (void) ensureExtensionIsRegistered:(id) extension; - -@end diff --git a/Libraries/ProtocolBuffers/ExtendableMessage.m b/Libraries/ProtocolBuffers/ExtendableMessage.m deleted file mode 100644 index e9df70d58..000000000 --- a/Libraries/ProtocolBuffers/ExtendableMessage.m +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "ExtendableMessage.h" - -#import "ExtensionField.h" - -@implementation PBExtendableMessage - -@synthesize extensionMap; -@synthesize extensionRegistry; - -- (void) dealloc { - self.extensionMap = nil; - self.extensionRegistry = nil; -} - - -- (BOOL) isInitialized:(id) object { - if ([object isKindOfClass:[NSArray class]]) { - for (id child in object) { - if (![self isInitialized:child]) { - return NO; - } - } - } else if ([object conformsToProtocol:@protocol(PBMessage)]) { - return [object isInitialized]; - } - - return YES; -} - - -- (BOOL) extensionsAreInitialized { - return [self isInitialized:extensionMap.allValues]; -} - - -- (id) getExtension:(id) extension { - [self ensureExtensionIsRegistered:extension]; - id value = [extensionMap objectForKey:[NSNumber numberWithInt:[extension fieldNumber]]]; - if (value != nil) { - return value; - } - - return [extension defaultValue]; -} - - -- (void) ensureExtensionIsRegistered:(id) extension { - if ([extension extendedClass] != [self class]) { - @throw [NSException exceptionWithName:@"IllegalArgument" reason:@"Trying to use an extension for another type" userInfo:nil]; - } - - if (extensionRegistry == nil) { - self.extensionRegistry = [NSMutableDictionary dictionary]; - } - [extensionRegistry setObject:extension - forKey:[NSNumber numberWithInt:[extension fieldNumber]]]; -} - - -- (BOOL) hasExtension:(id) extension { - return nil != [extensionMap objectForKey:[NSNumber numberWithInt:[extension fieldNumber]]]; -} - - -- (void) writeExtensionsToCodedOutputStream:(PBCodedOutputStream*) output - from:(int32_t) startInclusive - to:(int32_t) endExclusive { - // man, i really wish Cocoa had a Sorted/TreeMap - NSArray* sortedKeys = [extensionMap.allKeys sortedArrayUsingSelector:@selector(compare:)]; - for (NSNumber* number in sortedKeys) { - int32_t fieldNumber = [number intValue]; - if (fieldNumber >= startInclusive && fieldNumber < endExclusive) { - id extension = [extensionRegistry objectForKey:number]; - id value = [extensionMap objectForKey:number]; - [extension writeValue:value includingTagToCodedOutputStream:output]; - } - } -} - - -- (int32_t) extensionsSerializedSize { - int32_t size = 0; - for (NSNumber* number in extensionMap) { - id extension = [extensionRegistry objectForKey:number]; - id value = [extensionMap objectForKey:number]; - size += [extension computeSerializedSizeIncludingTag:value]; - } - - return size; -} - -@end diff --git a/Libraries/ProtocolBuffers/ExtendableMessage_Builder.h b/Libraries/ProtocolBuffers/ExtendableMessage_Builder.h deleted file mode 100644 index 316c91b21..000000000 --- a/Libraries/ProtocolBuffers/ExtendableMessage_Builder.h +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "GeneratedMessage_Builder.h" - -@protocol PBExtensionField; -@class PBExtendableMessage_Builder; -@class PBExtendableMessage; - -/** - * Generated message builders for message types that contain extension ranges - * subclass this. - * - *

This class implements type-safe accessors for extensions. They - * implement all the same operations that you can do with normal fields -- - * e.g. "get", "set", and "add" -- but for extensions. The extensions are - * identified using instances of the class {@link GeneratedExtension}; the - * protocol compiler generates a static instance of this class for every - * extension in its input. Through the magic of generics, all is made - * type-safe. - * - *

For example, imagine you have the {@code .proto} file: - * - *

- * option java_class = "MyProto";
- *
- * message Foo {
- *   extensions 1000 to max;
- * }
- *
- * extend Foo {
- *   optional int32 bar;
- * }
- * 
- * - *

Then you might write code like: - * - *

- * MyProto.Foo foo =
- *   MyProto.Foo.newBuilder()
- *     .setExtension(MyProto.bar, 123)
- *     .build();
- * 
- * - *

See also {@link ExtendableMessage}. - */ -@interface PBExtendableMessage_Builder : PBGeneratedMessage_Builder { -} - -- (id) getExtension:(id) extension; -- (BOOL) hasExtension:(id) extension; -- (PBExtendableMessage_Builder*) setExtension:(id) extension - value:(id) value; -- (PBExtendableMessage_Builder*) addExtension:(id) extension - value:(id) value; -- (PBExtendableMessage_Builder*) setExtension:(id) extension - index:(int32_t) index - value:(id) value; -- (PBExtendableMessage_Builder*) clearExtension:(id) extension; - -/* @protected */ -- (void) mergeExtensionFields:(PBExtendableMessage*) other; - -@end diff --git a/Libraries/ProtocolBuffers/ExtendableMessage_Builder.m b/Libraries/ProtocolBuffers/ExtendableMessage_Builder.m deleted file mode 100644 index c47de3e22..000000000 --- a/Libraries/ProtocolBuffers/ExtendableMessage_Builder.m +++ /dev/null @@ -1,173 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "ExtendableMessage_Builder.h" - -#import "ExtendableMessage.h" -#import "ExtensionField.h" -#import "WireFormat.h" -#import "ExtensionRegistry.h" - -@implementation PBExtendableMessage_Builder - -- (PBExtendableMessage*) internalGetResult { - @throw [NSException exceptionWithName:@"ImproperSubclassing" reason:@"" userInfo:nil]; -} - - -/** - * Called by subclasses to parse an unknown field or an extension. - * @return {@code YES} unless the tag is an end-group tag. - */ -- (BOOL) parseUnknownField:(PBCodedInputStream*) input - unknownFields:(PBUnknownFieldSet_Builder*) unknownFields - extensionRegistry:(PBExtensionRegistry*) extensionRegistry - tag:(int32_t) tag { - PBExtendableMessage* message = [self internalGetResult]; - int32_t wireType = PBWireFormatGetTagWireType(tag); - int32_t fieldNumber = PBWireFormatGetTagFieldNumber(tag); - - id extension = [extensionRegistry getExtension:[message class] - fieldNumber:fieldNumber]; - - if (extension != nil) { - if ([extension wireType] == wireType) { - [extension mergeFromCodedInputStream:input - unknownFields:unknownFields - extensionRegistry:extensionRegistry - builder:self - tag:tag]; - return YES; - } - } - - return [super parseUnknownField:input unknownFields:unknownFields extensionRegistry:extensionRegistry tag:tag]; -} - - -- (id) getExtension:(id) extension { - return [[self internalGetResult] getExtension:extension]; -} - - -- (BOOL) hasExtension:(id) extension { - return [[self internalGetResult] hasExtension:extension]; -} - - -- (PBExtendableMessage_Builder*) setExtension:(id) extension - value:(id) value { - PBExtendableMessage* message = [self internalGetResult]; - [message ensureExtensionIsRegistered:extension]; - - if ([extension isRepeated]) { - @throw [NSException exceptionWithName:@"IllegalArgument" reason:@"Must call addExtension() for repeated types." userInfo:nil]; - } - - if (message.extensionMap == nil) { - message.extensionMap = [NSMutableDictionary dictionary]; - } - [message.extensionMap setObject:value forKey:[NSNumber numberWithInt:[extension fieldNumber]]]; - return self; -} - - -- (PBExtendableMessage_Builder*) addExtension:(id) extension - value:(id) value { - PBExtendableMessage* message = [self internalGetResult]; - [message ensureExtensionIsRegistered:extension]; - - if (![extension isRepeated]) { - @throw [NSException exceptionWithName:@"IllegalArgument" reason:@"Must call setExtension() for singular types." userInfo:nil]; - } - - if (message.extensionMap == nil) { - message.extensionMap = [NSMutableDictionary dictionary]; - } - NSNumber* fieldNumber = [NSNumber numberWithInt:[extension fieldNumber]]; - NSMutableArray* list = [message.extensionMap objectForKey:fieldNumber]; - if (list == nil) { - list = [NSMutableArray array]; - [message.extensionMap setObject:list forKey:fieldNumber]; - } - - [list addObject:value]; - return self; -} - - -- (PBExtendableMessage_Builder*) setExtension:(id) extension - index:(int32_t) index - value:(id) value { - PBExtendableMessage* message = [self internalGetResult]; - [message ensureExtensionIsRegistered:extension]; - - if (![extension isRepeated]) { - @throw [NSException exceptionWithName:@"IllegalArgument" reason:@"Must call setExtension() for singular types." userInfo:nil]; - } - - if (message.extensionMap == nil) { - message.extensionMap = [NSMutableDictionary dictionary]; - } - - NSNumber* fieldNumber = [NSNumber numberWithInt:[extension fieldNumber]]; - NSMutableArray* list = [message.extensionMap objectForKey:fieldNumber]; - - [list replaceObjectAtIndex:(NSUInteger)index withObject:value]; - - return self; -} - - -- (PBExtendableMessage_Builder*) clearExtension:(id) extension { - PBExtendableMessage* message = [self internalGetResult]; - [message ensureExtensionIsRegistered:extension]; - [message.extensionMap removeObjectForKey:[NSNumber numberWithInt:[extension fieldNumber]]]; - - return self; -} - - -- (void) mergeExtensionFields:(PBExtendableMessage*) other { - PBExtendableMessage* thisMessage = [self internalGetResult]; - if ([thisMessage class] != [other class]) { - @throw [NSException exceptionWithName:@"IllegalArgument" reason:@"Cannot merge extensions from a different type" userInfo:nil]; - } - - if (other.extensionMap.count > 0) { - if (thisMessage.extensionMap == nil) { - thisMessage.extensionMap = [NSMutableDictionary dictionary]; - } - - NSDictionary* registry = other.extensionRegistry; - for (NSNumber* fieldNumber in other.extensionMap) { - id thisField = [registry objectForKey:fieldNumber]; - id value = [other.extensionMap objectForKey:fieldNumber]; - - if ([thisField isRepeated]) { - NSMutableArray* list = [thisMessage.extensionMap objectForKey:fieldNumber]; - if (list == nil) { - list = [NSMutableArray array]; - [thisMessage.extensionMap setObject:list forKey:fieldNumber]; - } - - [list addObjectsFromArray:value]; - } else { - [thisMessage.extensionMap setObject:value forKey:fieldNumber]; - } - } - } -} - -@end diff --git a/Libraries/ProtocolBuffers/ExtensionField.h b/Libraries/ProtocolBuffers/ExtensionField.h deleted file mode 100644 index 34f7c3c76..000000000 --- a/Libraries/ProtocolBuffers/ExtensionField.h +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "WireFormat.h" -@class PBCodedInputStream; -@class PBUnknownFieldSet_Builder; -@class PBExtendableMessage_Builder; -@class PBCodedOutputStream; -@class PBExtensionRegistry; - -@protocol PBExtensionField -- (int32_t) fieldNumber; -- (PBWireFormat) wireType; -- (BOOL) isRepeated; -- (Class) extendedClass; -- (id) defaultValue; - -- (void) mergeFromCodedInputStream:(PBCodedInputStream*) input - unknownFields:(PBUnknownFieldSet_Builder*) unknownFields - extensionRegistry:(PBExtensionRegistry*) extensionRegistry - builder:(PBExtendableMessage_Builder*) builder - tag:(int32_t) tag; -- (void) writeValue:(id) value includingTagToCodedOutputStream:(PBCodedOutputStream*) output; -- (int32_t) computeSerializedSizeIncludingTag:(id) value; -@end diff --git a/Libraries/ProtocolBuffers/ExtensionRegistry.h b/Libraries/ProtocolBuffers/ExtensionRegistry.h deleted file mode 100644 index 444b765a3..000000000 --- a/Libraries/ProtocolBuffers/ExtensionRegistry.h +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * A table of known extensions, searchable by name or field number. When - * parsing a protocol message that might have extensions, you must provide - * an {@code ExtensionRegistry} in which you have registered any extensions - * that you want to be able to parse. Otherwise, those extensions will just - * be treated like unknown fields. - * - *

For example, if you had the {@code .proto} file: - * - *

- * option java_class = "MyProto";
- *
- * message Foo {
- *   extensions 1000 to max;
- * }
- *
- * extend Foo {
- *   optional int32 bar;
- * }
- * 
- * - * Then you might write code like: - * - *
- * ExtensionRegistry registry = ExtensionRegistry.newInstance();
- * registry.add(MyProto.bar);
- * MyProto.Foo message = MyProto.Foo.parseFrom(input, registry);
- * 
- * - *

Background: - * - *

You might wonder why this is necessary. Two alternatives might come to - * mind. First, you might imagine a system where generated extensions are - * automatically registered when their containing classes are loaded. This - * is a popular technique, but is bad design; among other things, it creates a - * situation where behavior can change depending on what classes happen to be - * loaded. It also introduces a security vulnerability, because an - * unprivileged class could cause its code to be called unexpectedly from a - * privileged class by registering itself as an extension of the right type. - * - *

Another option you might consider is lazy parsing: do not parse an - * extension until it is first requested, at which point the caller must - * provide a type to use. This introduces a different set of problems. First, - * it would require a mutex lock any time an extension was accessed, which - * would be slow. Second, corrupt data would not be detected until first - * access, at which point it would be much harder to deal with it. Third, it - * could violate the expectation that message objects are immutable, since the - * type provided could be any arbitrary message class. An unpriviledged user - * could take advantage of this to inject a mutable object into a message - * belonging to priviledged code and create mischief. - * - * @author Cyrus Najmabadi - */ - -@protocol PBExtensionField; - -@interface PBExtensionRegistry : NSObject { -@protected - NSDictionary* classMap; -} - -+ (PBExtensionRegistry*) emptyRegistry; -- (id) getExtension:(Class) clazz fieldNumber:(NSInteger) fieldNumber; - -/* @protected */ -- (id) initWithClassMap:(NSDictionary*) classMap; -- (id) keyForClass:(Class) clazz; - -@end diff --git a/Libraries/ProtocolBuffers/ExtensionRegistry.m b/Libraries/ProtocolBuffers/ExtensionRegistry.m deleted file mode 100644 index 4412b2a59..000000000 --- a/Libraries/ProtocolBuffers/ExtensionRegistry.m +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "ExtensionRegistry.h" - -@interface PBExtensionRegistry() -@property (retain) NSDictionary* classMap; -@end - -@implementation PBExtensionRegistry - -@synthesize classMap; - -- (void) dealloc { - self.classMap = nil; -} - -static PBExtensionRegistry* emptyRegistry = nil; - -+ (void) initialize { - if (self == [PBExtensionRegistry class]) { - emptyRegistry = [[PBExtensionRegistry alloc] initWithClassMap:[NSDictionary dictionary]]; - } -} - - -- (id) initWithClassMap:(NSDictionary*) map_{ - if ((self = [super init])) { - self.classMap = map_; - } - - return self; -} - - -- (id) keyForClass:(Class) clazz { - return NSStringFromClass(clazz); -} - - -+ (PBExtensionRegistry*) emptyRegistry { - return emptyRegistry; -} - - -- (id) getExtension:(Class) clazz fieldNumber:(NSInteger) fieldNumber { - NSDictionary* extensionMap = [classMap objectForKey:[self keyForClass:clazz]]; - return [extensionMap objectForKey:[NSNumber numberWithInteger:fieldNumber]]; -} - -@end diff --git a/Libraries/ProtocolBuffers/Field.h b/Libraries/ProtocolBuffers/Field.h deleted file mode 100644 index 851e5eb3e..000000000 --- a/Libraries/ProtocolBuffers/Field.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -@class PBCodedOutputStream; - -@interface PBField : NSObject { -@protected - NSMutableArray* mutableVarintList; - NSMutableArray* mutableFixed32List; - NSMutableArray* mutableFixed64List; - NSMutableArray* mutableLengthDelimitedList; - NSMutableArray* mutableGroupList; -} - -- (NSArray*) varintList; -- (NSArray*) fixed32List; -- (NSArray*) fixed64List; -- (NSArray*) lengthDelimitedList; -- (NSArray*) groupList; - -+ (PBField*) defaultInstance; - -- (void) writeTo:(int32_t) fieldNumber - output:(PBCodedOutputStream*) output; - -- (int32_t) getSerializedSize:(int32_t) fieldNumber; -- (void) writeAsMessageSetExtensionTo:(int32_t) fieldNumber - output:(PBCodedOutputStream*) output; -- (int32_t) getSerializedSizeAsMessageSetExtension:(int32_t) fieldNumber; - -@end diff --git a/Libraries/ProtocolBuffers/Field.m b/Libraries/ProtocolBuffers/Field.m deleted file mode 100644 index 66095f932..000000000 --- a/Libraries/ProtocolBuffers/Field.m +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "Field.h" - -#import "CodedOutputStream.h" -#import "MutableField.h" - -@interface PBField () -@property (retain) NSMutableArray* mutableVarintList; -@property (retain) NSMutableArray* mutableFixed32List; -@property (retain) NSMutableArray* mutableFixed64List; -@property (retain) NSMutableArray* mutableLengthDelimitedList; -@property (retain) NSMutableArray* mutableGroupList; -@end - -@implementation PBField - -static PBField* defaultInstance = nil; - -+ (void) initialize { - if (self == [PBField class]) { - defaultInstance = [[PBField alloc] init]; - } -} - - -@synthesize mutableVarintList; -@synthesize mutableFixed32List; -@synthesize mutableFixed64List; -@synthesize mutableLengthDelimitedList; -@synthesize mutableGroupList; - - -- (void) dealloc { - self.mutableVarintList = nil; - self.mutableFixed32List = nil; - self.mutableFixed64List = nil; - self.mutableLengthDelimitedList = nil; - self.mutableGroupList = nil; -} - - -+ (PBField*) defaultInstance { - return defaultInstance; -} - - -- (NSArray*) varintList { - return mutableVarintList; -} - - -- (NSArray*) fixed32List { - return mutableFixed32List; -} - - -- (NSArray*) fixed64List { - return mutableFixed64List; -} - - -- (NSArray*) lengthDelimitedList { - return mutableLengthDelimitedList; -} - - -- (NSArray*) groupList { - return mutableGroupList; -} - - -- (void) writeTo:(int32_t) fieldNumber - output:(PBCodedOutputStream*) output { - for (NSNumber* value in self.varintList) { - [output writeUInt64:fieldNumber value:value.longLongValue]; - } - for (NSNumber* value in self.fixed32List) { - [output writeFixed32:fieldNumber value:value.intValue]; - } - for (NSNumber* value in self.fixed64List) { - [output writeFixed64:fieldNumber value:value.longLongValue]; - } - for (NSData* value in self.lengthDelimitedList) { - [output writeData:fieldNumber value:value]; - } - for (PBUnknownFieldSet* value in self.groupList) { - [output writeUnknownGroup:fieldNumber value:value]; - } -} - - -- (int32_t) getSerializedSize:(int32_t) fieldNumber { - int32_t result = 0; - for (NSNumber* value in self.varintList) { - result += computeUInt64Size(fieldNumber, value.longLongValue); - } - for (NSNumber* value in self.fixed32List) { - result += computeFixed32Size(fieldNumber, value.intValue); - } - for (NSNumber* value in self.fixed64List) { - result += computeFixed64Size(fieldNumber, value.longLongValue); - } - for (NSData* value in self.lengthDelimitedList) { - result += computeDataSize(fieldNumber, value); - } - for (PBUnknownFieldSet* value in self.groupList) { - result += computeUnknownGroupSize(fieldNumber, value); - } - return result; -} - - -- (void) writeAsMessageSetExtensionTo:(int32_t) fieldNumber - output:(PBCodedOutputStream*) output { - for (NSData* value in self.lengthDelimitedList) { - [output writeRawMessageSetExtension:fieldNumber value:value]; - } -} - - -- (int32_t) getSerializedSizeAsMessageSetExtension:(int32_t) fieldNumber { - int32_t result = 0; - for (NSData* value in self.lengthDelimitedList) { - result += computeRawMessageSetExtensionSize(fieldNumber, value); - } - return result; -} - - -@end diff --git a/Libraries/ProtocolBuffers/ForwardDeclarations.h b/Libraries/ProtocolBuffers/ForwardDeclarations.h deleted file mode 100644 index e121d67a6..000000000 --- a/Libraries/ProtocolBuffers/ForwardDeclarations.h +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -@protocol PBMessage; -@protocol PBMessage_Builder; -@protocol PBExtensionField; - -@class PBAbstractMessage; -@class PBCodedInputStream; -@class PBCodedOutputStream; -@class PBConcreteExtensionField; -@class PBExtendableMessage_Builder; -@class PBExtendableMessage; -@class PBExtensionRegistry; -@class PBField; -@class PBGeneratedMessage; -@class PBGeneratedMessage_Builder; -@class PBMutableExtensionRegistry; -@class PBMutableField; -@class PBUnknownFieldSet; -@class PBUnknownFieldSet_Builder; diff --git a/Libraries/ProtocolBuffers/GeneratedMessage.h b/Libraries/ProtocolBuffers/GeneratedMessage.h deleted file mode 100644 index 13c83ea0f..000000000 --- a/Libraries/ProtocolBuffers/GeneratedMessage.h +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "AbstractMessage.h" - -/** - * All generated protocol message classes extend this class. This class - * implements most of the Message and Builder interfaces using Java reflection. - * Users can ignore this class and pretend that generated messages implement - * the Message interface directly. - * - * @author Cyrus Najmabadi - */ -@interface PBGeneratedMessage : PBAbstractMessage { -@private - PBUnknownFieldSet* unknownFields; - -@protected - int32_t memoizedSerializedSize; -} - -@end diff --git a/Libraries/ProtocolBuffers/GeneratedMessage.m b/Libraries/ProtocolBuffers/GeneratedMessage.m deleted file mode 100644 index d8e578d53..000000000 --- a/Libraries/ProtocolBuffers/GeneratedMessage.m +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "GeneratedMessage.h" - -#import "UnknownFieldSet.h" - -@interface PBGeneratedMessage () -@property (retain) PBUnknownFieldSet* unknownFields; -@end - - -@implementation PBGeneratedMessage - -@synthesize unknownFields; - -- (void) dealloc { - self.unknownFields = nil; -} - - -- (id) init { - if ((self = [super init])) { - self.unknownFields = [PBUnknownFieldSet defaultInstance]; - memoizedSerializedSize = -1; - } - - return self; -} - -@end diff --git a/Libraries/ProtocolBuffers/GeneratedMessage_Builder.h b/Libraries/ProtocolBuffers/GeneratedMessage_Builder.h deleted file mode 100644 index acbad6d2b..000000000 --- a/Libraries/ProtocolBuffers/GeneratedMessage_Builder.h +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "AbstractMessage_Builder.h" - -@class PBUnknownFieldSet_Builder; - -@interface PBGeneratedMessage_Builder : PBAbstractMessage_Builder { -} - -/* @protected */ -- (BOOL) parseUnknownField:(PBCodedInputStream*) input - unknownFields:(PBUnknownFieldSet_Builder*) unknownFields - extensionRegistry:(PBExtensionRegistry*) extensionRegistry - tag:(int32_t) tag; - -- (void) checkInitialized; - -@end diff --git a/Libraries/ProtocolBuffers/GeneratedMessage_Builder.m b/Libraries/ProtocolBuffers/GeneratedMessage_Builder.m deleted file mode 100644 index 73f408be6..000000000 --- a/Libraries/ProtocolBuffers/GeneratedMessage_Builder.m +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "GeneratedMessage_Builder.h" - -#import "GeneratedMessage.h" -#import "Message.h" -#import "Message_Builder.h" -#import "UnknownFieldSet.h" -#import "UnknownFieldSet_Builder.h" - - -@interface PBGeneratedMessage () -@property (retain) PBUnknownFieldSet* unknownFields; -@end - - -@implementation PBGeneratedMessage_Builder - -/** - * Get the message being built. We don't just pass this to the - * constructor because it becomes null when build() is called. - */ -- (PBGeneratedMessage*) internalGetResult { - @throw [NSException exceptionWithName:@"ImproperSubclassing" reason:@"" userInfo:nil]; -} - - -- (void) checkInitialized { - PBGeneratedMessage* result = self.internalGetResult; - if (result != nil && !result.isInitialized) { - @throw [NSException exceptionWithName:@"UninitializedMessage" reason:@"" userInfo:nil]; - } -} - - -- (PBUnknownFieldSet*) unknownFields { - return self.internalGetResult.unknownFields; -} - - -- (id) setUnknownFields:(PBUnknownFieldSet*) unknownFields { - self.internalGetResult.unknownFields = unknownFields; - return self; -} - - -- (id) mergeUnknownFields:(PBUnknownFieldSet*) unknownFields { - PBGeneratedMessage* result = self.internalGetResult; - result.unknownFields = - [[[PBUnknownFieldSet builderWithUnknownFields:result.unknownFields] - mergeUnknownFields:unknownFields] build]; - return self; -} - - -- (BOOL) isInitialized { - return self.internalGetResult.isInitialized; -} - - -/** - * Called by subclasses to parse an unknown field. - * @return {@code YES} unless the tag is an end-group tag. - */ -- (BOOL) parseUnknownField:(PBCodedInputStream*) input - unknownFields:(PBUnknownFieldSet_Builder*) unknownFields - extensionRegistry:(PBExtensionRegistry*) extensionRegistry - tag:(int32_t) tag { - return [unknownFields mergeFieldFrom:tag input:input]; -} - - -- (void) checkInitializedParsed { - PBGeneratedMessage* result = self.internalGetResult; - if (result != nil && !result.isInitialized) { - @throw [NSException exceptionWithName:@"InvalidProtocolBuffer" reason:@"" userInfo:nil]; - } -} - -@end diff --git a/Libraries/ProtocolBuffers/Message.h b/Libraries/ProtocolBuffers/Message.h deleted file mode 100644 index 6db5d1518..000000000 --- a/Libraries/ProtocolBuffers/Message.h +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -@class PBUnknownFieldSet; -@class PBCodedOutputStream; -@protocol PBMessage_Builder; - -/** - * Abstract interface implemented by Protocol Message objects. - * - * @author Cyrus Najmabadi - */ -@protocol PBMessage -/** - * Get an instance of the type with all fields set to their default values. - * This may or may not be a singleton. This differs from the - * {@code getDefaultInstance()} method of generated message classes in that - * this method is an abstract method of the {@code Message} interface - * whereas {@code getDefaultInstance()} is a static method of a specific - * class. They return the same thing. - */ -- (id) defaultInstance; - -/** - * Get the {@code UnknownFieldSet} - */ -- (PBUnknownFieldSet*) unknownFields; - -/** - * Get the number of bytes required to encode this message. The result - * is only computed on the first call and memoized after that. - */ -- (int32_t) serializedSize; - -/** - * Returns true if all required fields in the message and all embedded - * messages are set, false otherwise. - */ -- (BOOL) isInitialized; - -/** - * Serializes the message and writes it to {@code output}. This does not - * flush or close the stream. - */ -- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output; -- (void) writeToOutputStream:(NSOutputStream*) output; - -/** - * Serializes the message to a {@code ByteString} and returns it. This is - * just a trivial wrapper around - * {@link #writeTo(CodedOutputStream)}. - */ -- (NSData*) data; - -/** - * Constructs a new builder for a message of the same type as this message. - */ -- (id) builder; -@end diff --git a/Libraries/ProtocolBuffers/Message_Builder.h b/Libraries/ProtocolBuffers/Message_Builder.h deleted file mode 100644 index 8326d8877..000000000 --- a/Libraries/ProtocolBuffers/Message_Builder.h +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -@protocol PBMessage; -@protocol PBMessage_Builder; -@class PBUnknownFieldSet; -@class PBCodedInputStream; -@class PBExtensionRegistry; - -/** - * Abstract interface implemented by Protocol Message builders. - */ -@protocol PBMessage_Builder -/** Resets all fields to their default values. */ -- (id) clear; - -/** - * Construct the final message. Once this is called, the Builder is no - * longer valid, and calling any other method may throw a - * NullPointerException. If you need to continue working with the builder - * after calling {@code build()}, {@code clone()} it first. - * @throws UninitializedMessageException The message is missing one or more - * required fields (i.e. {@link #isInitialized()} returns false). - * Use {@link #buildPartial()} to bypass this check. - */ -- (id) build; - -/** - * Like {@link #build()}, but does not throw an exception if the message - * is missing required fields. Instead, a partial message is returned. - */ -- (id) buildPartial; -- (id) clone; - -/** - * Returns true if all required fields in the message and all embedded - * messages are set, false otherwise. - */ -- (BOOL) isInitialized; - -/** - * Get the message's type's default instance. - * See {@link Message#getDefaultInstanceForType()}. - */ -- (id) defaultInstance; - -- (PBUnknownFieldSet*) unknownFields; -- (id) setUnknownFields:(PBUnknownFieldSet*) unknownFields; - -/** - * Merge some unknown fields into the {@link UnknownFieldSet} for this - * message. - */ -- (id) mergeUnknownFields:(PBUnknownFieldSet*) unknownFields; - -/** - * Parses a message of this type from the input and merges it with this - * message, as if using {@link Builder#mergeFrom(Message)}. - * - *

Warning: This does not verify that all required fields are present in - * the input message. If you call {@link #build()} without setting all - * required fields, it will throw an {@link UninitializedMessageException}, - * which is a {@code RuntimeException} and thus might not be caught. There - * are a few good ways to deal with this: - *

    - *
  • Call {@link #isInitialized()} to verify that all required fields - * are set before building. - *
  • Parse the message separately using one of the static - * {@code parseFrom} methods, then use {@link #mergeFrom(Message)} - * to merge it with this one. {@code parseFrom} will throw an - * {@link InvalidProtocolBufferException} (an {@code IOException}) - * if some required fields are missing. - *
  • Use {@code buildPartial()} to build, which ignores missing - * required fields. - *
- * - *

Note: The caller should call - * {@link CodedInputStream#checkLastTagWas(int)} after calling this to - * verify that the last tag seen was the appropriate end-group tag, - * or zero for EOF. - */ -- (id) mergeFromCodedInputStream:(PBCodedInputStream*) input; - -/** - * Like {@link Builder#mergeFrom(CodedInputStream)}, but also - * parses extensions. The extensions that you want to be able to parse - * must be registered in {@code extensionRegistry}. Extensions not in - * the registry will be treated as unknown fields. - */ -- (id) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; - -/** - * Parse {@code data} as a message of this type and merge it with the - * message being built. This is just a small wrapper around - * {@link #mergeFrom(CodedInputStream)}. - */ -- (id) mergeFromData:(NSData*) data; - -/** - * Parse {@code data} as a message of this type and merge it with the - * message being built. This is just a small wrapper around - * {@link #mergeFrom(CodedInputStream,ExtensionRegistry)}. - */ -- (id) mergeFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry; - -/** - * Parse a message of this type from {@code input} and merge it with the - * message being built. This is just a small wrapper around - * {@link #mergeFrom(CodedInputStream)}. Note that this method always - * reads the entire input (unless it throws an exception). If you - * want it to stop earlier, you will need to wrap your input in some - * wrapper stream that limits reading. Despite usually reading the entire - * input, this does not close the stream. - */ -- (id) mergeFromInputStream:(NSInputStream*) input; - -/** - * Parse a message of this type from {@code input} and merge it with the - * message being built. This is just a small wrapper around - * {@link #mergeFrom(CodedInputStream,ExtensionRegistry)}. - */ -- (id) mergeFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -@end diff --git a/Libraries/ProtocolBuffers/MutableExtensionRegistry.h b/Libraries/ProtocolBuffers/MutableExtensionRegistry.h deleted file mode 100644 index d2ebf7a5e..000000000 --- a/Libraries/ProtocolBuffers/MutableExtensionRegistry.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "ExtensionRegistry.h" - -@interface PBMutableExtensionRegistry : PBExtensionRegistry { -@private - NSMutableDictionary* mutableClassMap; -} - -+ (PBMutableExtensionRegistry*) registry; - -- (void) addExtension:(id) extension; - -@end diff --git a/Libraries/ProtocolBuffers/MutableExtensionRegistry.m b/Libraries/ProtocolBuffers/MutableExtensionRegistry.m deleted file mode 100644 index d2409bae6..000000000 --- a/Libraries/ProtocolBuffers/MutableExtensionRegistry.m +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "MutableExtensionRegistry.h" - -#import "ExtensionField.h" - -@interface PBMutableExtensionRegistry() -@property (retain) NSMutableDictionary* mutableClassMap; -@end - -@implementation PBMutableExtensionRegistry - -@synthesize mutableClassMap; - -- (void) dealloc { - self.mutableClassMap = nil; -} - - -- (id) initWithClassMap:(NSMutableDictionary*) mutableClassMap_ { - if ((self = [super initWithClassMap:mutableClassMap_])) { - self.mutableClassMap = mutableClassMap_; - } - - return self; -} - - -+ (PBMutableExtensionRegistry*) registry { - return [[PBMutableExtensionRegistry alloc] initWithClassMap:[NSMutableDictionary dictionary]]; -} - - -- (void) addExtension:(id) extension { - if (extension == nil) { - return; - } - - Class extendedClass = [extension extendedClass]; - id key = [self keyForClass:extendedClass]; - - NSMutableDictionary* extensionMap = [classMap objectForKey:key]; - if (extensionMap == nil) { - extensionMap = [NSMutableDictionary dictionary]; - [mutableClassMap setObject:extensionMap forKey:key]; - } - - [extensionMap setObject:extension - forKey:[NSNumber numberWithInteger:[extension fieldNumber]]]; -} - - -@end diff --git a/Libraries/ProtocolBuffers/MutableField.h b/Libraries/ProtocolBuffers/MutableField.h deleted file mode 100644 index d45b8dcbd..000000000 --- a/Libraries/ProtocolBuffers/MutableField.h +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "Field.h" - -@class PBUnknownFieldSet; - -@interface PBMutableField : PBField { -} - -+ (PBMutableField*) field; - -- (PBMutableField*) mergeFromField:(PBField*) other; - -- (PBMutableField*) clear; -- (PBMutableField*) addVarint:(int64_t) value; -- (PBMutableField*) addFixed32:(int32_t) value; -- (PBMutableField*) addFixed64:(int64_t) value; -- (PBMutableField*) addLengthDelimited:(NSData*) value; -- (PBMutableField*) addGroup:(PBUnknownFieldSet*) value; - -@end diff --git a/Libraries/ProtocolBuffers/MutableField.m b/Libraries/ProtocolBuffers/MutableField.m deleted file mode 100644 index 17712bd7f..000000000 --- a/Libraries/ProtocolBuffers/MutableField.m +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "MutableField.h" - -#import "Field.h" - -@interface PBField () -@property (retain) NSMutableArray* mutableVarintList; -@property (retain) NSMutableArray* mutableFixed32List; -@property (retain) NSMutableArray* mutableFixed64List; -@property (retain) NSMutableArray* mutableLengthDelimitedList; -@property (retain) NSMutableArray* mutableGroupList; -@end - - -@implementation PBMutableField - - -+ (PBMutableField*) field { - return [[PBMutableField alloc] init]; -} - - -- (id) init { - if ((self = [super init])) { - } - - return self; -} - - -- (PBMutableField*) clear { - self.mutableVarintList = nil; - self.mutableFixed32List = nil; - self.mutableFixed64List = nil; - self.mutableLengthDelimitedList = nil; - self.mutableGroupList = nil; - return self; -} - - -- (PBMutableField*) mergeFromField:(PBField*) other { - if (other.varintList.count > 0) { - if (mutableVarintList == nil) { - self.mutableVarintList = [NSMutableArray array]; - } - [mutableVarintList addObjectsFromArray:other.varintList]; - } - - if (other.fixed32List.count > 0) { - if (mutableFixed32List == nil) { - self.mutableFixed32List = [NSMutableArray array]; - } - [mutableFixed32List addObjectsFromArray:other.fixed32List]; - } - - if (other.fixed64List.count > 0) { - if (mutableFixed64List == nil) { - self.mutableFixed64List = [NSMutableArray array]; - } - [mutableFixed64List addObjectsFromArray:other.fixed64List]; - } - - if (other.lengthDelimitedList.count > 0) { - if (mutableLengthDelimitedList == nil) { - self.mutableLengthDelimitedList = [NSMutableArray array]; - } - [mutableLengthDelimitedList addObjectsFromArray:other.lengthDelimitedList]; - } - - if (other.groupList.count > 0) { - if (mutableGroupList == nil) { - self.mutableGroupList = [NSMutableArray array]; - } - [mutableGroupList addObjectsFromArray:other.groupList]; - } - - return self; -} - - -- (PBMutableField*) addVarint:(int64_t) value { - if (mutableVarintList == nil) { - self.mutableVarintList = [NSMutableArray array]; - } - [mutableVarintList addObject:[NSNumber numberWithLongLong:value]]; - return self; -} - - -- (PBMutableField*) addFixed32:(int32_t) value { - if (mutableFixed32List == nil) { - self.mutableFixed32List = [NSMutableArray array]; - } - [mutableFixed32List addObject:[NSNumber numberWithInt:value]]; - return self; -} - - -- (PBMutableField*) addFixed64:(int64_t) value { - if (mutableFixed64List == nil) { - self.mutableFixed64List = [NSMutableArray array]; - } - [mutableFixed64List addObject:[NSNumber numberWithLongLong:value]]; - return self; -} - - -- (PBMutableField*) addLengthDelimited:(NSData*) value { - if (mutableLengthDelimitedList == nil) { - self.mutableLengthDelimitedList = [NSMutableArray array]; - } - [mutableLengthDelimitedList addObject:value]; - return self; -} - - -- (PBMutableField*) addGroup:(PBUnknownFieldSet*) value { - if (mutableGroupList == nil) { - self.mutableGroupList = [NSMutableArray array]; - } - [mutableGroupList addObject:value]; - return self; -} - -@end diff --git a/Libraries/ProtocolBuffers/ProtocolBuffers.h b/Libraries/ProtocolBuffers/ProtocolBuffers.h deleted file mode 100644 index 5a13609ef..000000000 --- a/Libraries/ProtocolBuffers/ProtocolBuffers.h +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "Bootstrap.h" - -#import "AbstractMessage.h" -#import "AbstractMessage_Builder.h" -#import "CodedInputStream.h" -#import "CodedOutputStream.h" -#import "ConcreteExtensionField.h" -#import "ExtendableMessage.h" -#import "ExtendableMessage_Builder.h" -#import "ExtensionField.h" -#import "ExtensionRegistry.h" -#import "Field.h" -#import "GeneratedMessage.h" -#import "GeneratedMessage_Builder.h" -#import "Message.h" -#import "Message_Builder.h" -#import "MutableExtensionRegistry.h" -#import "MutableField.h" -#import "UnknownFieldSet.h" -#import "UnknownFieldSet_Builder.h" -#import "Utilities.h" -#import "WireFormat.h" diff --git a/Libraries/ProtocolBuffers/TextFormat.h b/Libraries/ProtocolBuffers/TextFormat.h deleted file mode 100644 index 7153bd8c7..000000000 --- a/Libraries/ProtocolBuffers/TextFormat.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -@interface PBTextFormat : NSObject { - -} - -+ (int32_t) parseInt32:(NSString*) text; -+ (int32_t) parseUInt32:(NSString*) text; -+ (int64_t) parseInt64:(NSString*) text; -+ (int64_t) parseUInt64:(NSString*) text; - -+ (NSData*) unescapeBytes:(NSString*) input; - -@end diff --git a/Libraries/ProtocolBuffers/TextFormat.m b/Libraries/ProtocolBuffers/TextFormat.m deleted file mode 100644 index e2d4c4e0b..000000000 --- a/Libraries/ProtocolBuffers/TextFormat.m +++ /dev/null @@ -1,238 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "TextFormat.h" - -#import "Utilities.h" - -@implementation PBTextFormat - - -BOOL allZeroes(NSString* string); -BOOL allZeroes(NSString* string) { - for (int i = 0; i < (int32_t)string.length; i++) { - if ([string characterAtIndex:(NSUInteger)i] != '0') { - return NO; - } - } - - return YES; -} - - -/** Is this an octal digit? */ -BOOL isOctal(unichar c); -BOOL isOctal(unichar c) { - return '0' <= c && c <= '7'; -} - - -/** Is this an octal digit? */ -BOOL isDecimal(unichar c); -BOOL isDecimal(unichar c) { - return '0' <= c && c <= '9'; -} - -/** Is this a hex digit? */ -BOOL isHex(unichar c); -BOOL isHex(unichar c) { - return - isDecimal(c) || - ('a' <= c && c <= 'f') || - ('A' <= c && c <= 'F'); -} - - -+ (int64_t) parseInteger:(NSString*) text - isSigned:(BOOL) isSigned - isLong:(BOOL) isLong { - if (text.length == 0) { - @throw [NSException exceptionWithName:@"NumberFormat" reason:@"Number was blank" userInfo:nil]; - } - - if (isblank([text characterAtIndex:0])) { - @throw [NSException exceptionWithName:@"NumberFormat" reason:@"Invalid character" userInfo:nil]; - } - - if ([text hasPrefix:@"-"]) { - if (!isSigned) { - @throw [NSException exceptionWithName:@"NumberFormat" reason:@"Number must be positive" userInfo:nil]; - } - } - - // now call into the appropriate conversion utilities. - int64_t result; - const char* in_string = text.UTF8String; - char* out_string = NULL; - errno = 0; - if (isLong) { - if (isSigned) { - result = strtoll(in_string, &out_string, 0); - } else { - result = convertUInt64ToInt64(strtoull(in_string, &out_string, 0)); - } - } else { - if (isSigned) { - result = strtol(in_string, &out_string, 0); - } else { - result = convertUInt32ToInt32((unsigned int)strtoul(in_string, &out_string, 0)); - } - } - - // from the man pages: - // (Thus, i* tr is not `\0' but **endptr is `\0' on return, the entire - // string was valid.) - if (*in_string == 0 || *out_string != 0) { - @throw [NSException exceptionWithName:@"NumberFormat" reason:@"IllegalNumber" userInfo:nil]; - } - - if (errno == ERANGE) { - @throw [NSException exceptionWithName:@"NumberFormat" reason:@"Number out of range" userInfo:nil]; - } - - return result; -} - - -/** - * Parse a 32-bit signed integer from the text. This function recognizes - * the prefixes "0x" and "0" to signify hexidecimal and octal numbers, - * respectively. - */ -+ (int32_t) parseInt32:(NSString*) text { - return (int32_t)[self parseInteger:text isSigned:YES isLong:NO]; -} - - -/** - * Parse a 32-bit unsigned integer from the text. This function recognizes - * the prefixes "0x" and "0" to signify hexidecimal and octal numbers, - * respectively. The result is coerced to a (signed) {@code int} when returned. - */ -+ (int32_t) parseUInt32:(NSString*) text { - return (int32_t)[self parseInteger:text isSigned:NO isLong:NO]; -} - - -/** - * Parse a 64-bit signed integer from the text. This function recognizes - * the prefixes "0x" and "0" to signify hexidecimal and octal numbers, - * respectively. - */ -+ (int64_t) parseInt64:(NSString*) text { - return [self parseInteger:text isSigned:YES isLong:YES]; -} - - -/** - * Parse a 64-bit unsigned integer from the text. This function recognizes - * the prefixes "0x" and "0" to signify hexidecimal and octal numbers, - * respectively. The result is coerced to a (signed) {@code long} when - * returned. - */ -+ (int64_t) parseUInt64:(NSString*) text { - return [self parseInteger:text isSigned:NO isLong:YES]; -} - -/** - * Interpret a character as a digit (in any base up to 36) and return the - * numeric value. This is like {@code Character.digit()} but we don't accept - * non-ASCII digits. - */ -int32_t digitValue(unichar c); -int32_t digitValue(unichar c) { - if ('0' <= c && c <= '9') { - return c - '0'; - } else if ('a' <= c && c <= 'z') { - return c - 'a' + 10; - } else { - return c - 'A' + 10; - } -} - - -/** - * Un-escape a byte sequence as escaped using - * {@link #escapeBytes(ByteString)}. Two-digit hex escapes (starting with - * "\x") are also recognized. - */ -+ (NSData*) unescapeBytes:(NSString*) input { - NSMutableData* result = [NSMutableData dataWithLength:input.length]; - - int32_t pos = 0; - for (int32_t i = 0; i < (int32_t)input.length; i++) { - unichar c = [input characterAtIndex:(NSUInteger)i]; - if (c == '\\') { - if (i + 1 < (int32_t)input.length) { - ++i; - c = [input characterAtIndex:(NSUInteger)i]; - if (isOctal(c)) { - // Octal escape. - int32_t code = digitValue(c); - if (i + 1 < (int32_t)input.length && isOctal([input characterAtIndex:(NSUInteger)(i + 1)])) { - ++i; - code = code * 8 + digitValue([input characterAtIndex:(NSUInteger)i]); - } - if (i + 1 < (int32_t)input.length && isOctal([input characterAtIndex:(NSUInteger)(i + 1)])) { - ++i; - code = code * 8 + digitValue([input characterAtIndex:(NSUInteger)i]); - } - ((int8_t*)result.mutableBytes)[pos++] = (int8_t)code; - } else { - switch (c) { - case 'a' : ((int8_t*)result.mutableBytes)[pos++] = 0x07; break; - case 'b' : ((int8_t*)result.mutableBytes)[pos++] = '\b'; break; - case 'f' : ((int8_t*)result.mutableBytes)[pos++] = '\f'; break; - case 'n' : ((int8_t*)result.mutableBytes)[pos++] = '\n'; break; - case 'r' : ((int8_t*)result.mutableBytes)[pos++] = '\r'; break; - case 't' : ((int8_t*)result.mutableBytes)[pos++] = '\t'; break; - case 'v' : ((int8_t*)result.mutableBytes)[pos++] = 0x0b; break; - case '\\': ((int8_t*)result.mutableBytes)[pos++] = '\\'; break; - case '\'': ((int8_t*)result.mutableBytes)[pos++] = '\''; break; - case '"' : ((int8_t*)result.mutableBytes)[pos++] = '\"'; break; - - case 'x': // hex escape - { - int32_t code = 0; - if (i + 1 < (int32_t)input.length && isHex([input characterAtIndex:(NSUInteger)(i + 1)])) { - ++i; - code = digitValue([input characterAtIndex:(NSUInteger)i]); - } else { - @throw [NSException exceptionWithName:@"InvalidEscape" reason:@"Invalid escape sequence: '\\x' with no digits" userInfo:nil]; - } - if (i + 1 < (int32_t)input.length && isHex([input characterAtIndex:(NSUInteger)(i + 1)])) { - ++i; - code = code * 16 + digitValue([input characterAtIndex:(NSUInteger)i]); - } - ((int8_t*)result.mutableBytes)[pos++] = (int8_t)code; - break; - } - - default: - @throw [NSException exceptionWithName:@"InvalidEscape" reason:@"Invalid escape sequence" userInfo:nil]; - } - } - } else { - @throw [NSException exceptionWithName:@"InvalidEscape" reason:@"Invalid escape sequence: '\\' at end of string" userInfo:nil]; - } - } else { - ((int8_t*)result.mutableBytes)[pos++] = (int8_t)c; - } - } - - [result setLength:(NSUInteger)pos]; - return result; -} - -@end diff --git a/Libraries/ProtocolBuffers/UnknownFieldSet.h b/Libraries/ProtocolBuffers/UnknownFieldSet.h deleted file mode 100644 index 6fd88be55..000000000 --- a/Libraries/ProtocolBuffers/UnknownFieldSet.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -@class PBUnknownFieldSet_Builder; -@class PBUnknownFieldSet; -@class PBField; -@class PBCodedOutputStream; - -@interface PBUnknownFieldSet : NSObject { -@private - NSDictionary* fields; -} - -@property (readonly, retain) NSDictionary* fields; - -+ (PBUnknownFieldSet*) defaultInstance; - -+ (PBUnknownFieldSet*) setWithFields:(NSMutableDictionary*) fields; -+ (PBUnknownFieldSet*) parseFromData:(NSData*) data; - -+ (PBUnknownFieldSet_Builder*) builder; -+ (PBUnknownFieldSet_Builder*) builderWithUnknownFields:(PBUnknownFieldSet*) other; - -- (void) writeAsMessageSetTo:(PBCodedOutputStream*) output; -- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output; -- (NSData*) data; - -- (int32_t) serializedSize; -- (int32_t) serializedSizeAsMessageSet; - -- (BOOL) hasField:(int32_t) number; -- (PBField*) getField:(int32_t) number; - -@end diff --git a/Libraries/ProtocolBuffers/UnknownFieldSet.m b/Libraries/ProtocolBuffers/UnknownFieldSet.m deleted file mode 100644 index 1c0bcc135..000000000 --- a/Libraries/ProtocolBuffers/UnknownFieldSet.m +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "UnknownFieldSet.h" - -#import "CodedInputStream.h" -#import "CodedOutputStream.h" -#import "Field.h" -#import "UnknownFieldSet_Builder.h" - -@interface PBUnknownFieldSet() -@property (retain) NSDictionary* fields; -@end - - -@implementation PBUnknownFieldSet - -static PBUnknownFieldSet* defaultInstance = nil; - -+ (void) initialize { - if (self == [PBUnknownFieldSet class]) { - defaultInstance = [PBUnknownFieldSet setWithFields:[NSMutableDictionary dictionary]]; - } -} - - -@synthesize fields; - -- (void) dealloc { - self.fields = nil; -} - - -+ (PBUnknownFieldSet*) defaultInstance { - return defaultInstance; -} - - -- (id) initWithFields:(NSMutableDictionary*) fields_ { - if ((self = [super init])) { - self.fields = fields_; - } - - return self; -} - - -+ (PBUnknownFieldSet*) setWithFields:(NSMutableDictionary*) fields { - return [[PBUnknownFieldSet alloc] initWithFields:fields]; -} - - -- (BOOL) hasField:(int32_t) number { - return [fields objectForKey:[NSNumber numberWithInt:number]] != nil; -} - - -- (PBField*) getField:(int32_t) number { - PBField* result = [fields objectForKey:[NSNumber numberWithInt:number]]; - return (result == nil) ? [PBField defaultInstance] : result; -} - - -- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output { - NSArray* sortedKeys = [fields.allKeys sortedArrayUsingSelector:@selector(compare:)]; - for (NSNumber* number in sortedKeys) { - PBField* value = [fields objectForKey:number]; - [value writeTo:number.intValue output:output]; - } -} - - -- (void) writeToOutputStream:(NSOutputStream*) output { - PBCodedOutputStream* codedOutput = [PBCodedOutputStream streamWithOutputStream:output]; - [self writeToCodedOutputStream:codedOutput]; - [codedOutput flush]; -} - - -+ (PBUnknownFieldSet*) parseFromCodedInputStream:(PBCodedInputStream*) input { - return [[[PBUnknownFieldSet builder] mergeFromCodedInputStream:input] build]; -} - - -+ (PBUnknownFieldSet*) parseFromData:(NSData*) data { - return [[[PBUnknownFieldSet builder] mergeFromData:data] build]; -} - - -+ (PBUnknownFieldSet*) parseFromInputStream:(NSInputStream*) input { - return [[[PBUnknownFieldSet builder] mergeFromInputStream:input] build]; -} - - -+ (PBUnknownFieldSet_Builder*) builder { - return [[PBUnknownFieldSet_Builder alloc] init]; -} - - -+ (PBUnknownFieldSet_Builder*) builderWithUnknownFields:(PBUnknownFieldSet*) copyFrom { - return [[PBUnknownFieldSet builder] mergeUnknownFields:copyFrom]; -} - - -/** Get the number of bytes required to encode this set. */ -- (int32_t) serializedSize { - int32_t result = 0; - for (NSNumber* number in fields) { - result += [[fields objectForKey:number] getSerializedSize:number.intValue]; - } - return result; -} - -/** - * Serializes the set and writes it to {@code output} using - * {@code MessageSet} wire format. - */ -- (void) writeAsMessageSetTo:(PBCodedOutputStream*) output { - for (NSNumber* number in fields) { - [[fields objectForKey:number] writeAsMessageSetExtensionTo:number.intValue output:output]; - } -} - - -/** - * Get the number of bytes required to encode this set using - * {@code MessageSet} wire format. - */ -- (int32_t) serializedSizeAsMessageSet { - int32_t result = 0; - for (NSNumber* number in fields) { - result += [[fields objectForKey:number] getSerializedSizeAsMessageSetExtension:number.intValue]; - } - return result; -} - - -/** - * Serializes the message to a {@code ByteString} and returns it. This is - * just a trivial wrapper around {@link #writeTo(PBCodedOutputStream)}. - */ -- (NSData*) data { - NSMutableData* data = [NSMutableData dataWithLength:(NSUInteger)self.serializedSize]; - PBCodedOutputStream* output = [PBCodedOutputStream streamWithData:data]; - - [self writeToCodedOutputStream:output]; - return data; -} - -@end diff --git a/Libraries/ProtocolBuffers/UnknownFieldSet_Builder.h b/Libraries/ProtocolBuffers/UnknownFieldSet_Builder.h deleted file mode 100644 index f8ed7899c..000000000 --- a/Libraries/ProtocolBuffers/UnknownFieldSet_Builder.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -@class PBField; -@class PBMutableField; -@class PBUnknownFieldSet; -@class PBUnknownFieldSet_Builder; -@class PBCodedInputStream; - -@interface PBUnknownFieldSet_Builder : NSObject { -@private - NSMutableDictionary* fields; - - // Optimization: We keep around a builder for the last field that was - // modified so that we can efficiently add to it multiple times in a - // row (important when parsing an unknown repeated field). - int32_t lastFieldNumber; - - PBMutableField* lastField; -} - -+ (PBUnknownFieldSet_Builder*) newBuilder:(PBUnknownFieldSet*) unknownFields; - -- (PBUnknownFieldSet*) build; -- (PBUnknownFieldSet_Builder*) mergeUnknownFields:(PBUnknownFieldSet*) other; - -- (PBUnknownFieldSet_Builder*) mergeFromCodedInputStream:(PBCodedInputStream*) input; -- (PBUnknownFieldSet_Builder*) mergeFromData:(NSData*) data; -- (PBUnknownFieldSet_Builder*) mergeFromInputStream:(NSInputStream*) input; - -- (PBUnknownFieldSet_Builder*) mergeVarintField:(int32_t) number value:(int32_t) value; - -- (BOOL) mergeFieldFrom:(int32_t) tag input:(PBCodedInputStream*) input; - -- (PBUnknownFieldSet_Builder*) addField:(PBField*) field forNumber:(int32_t) number; - -- (PBUnknownFieldSet_Builder*) clear; -- (PBUnknownFieldSet_Builder*) mergeField:(PBField*) field forNumber:(int32_t) number; - -@end diff --git a/Libraries/ProtocolBuffers/UnknownFieldSet_Builder.m b/Libraries/ProtocolBuffers/UnknownFieldSet_Builder.m deleted file mode 100644 index 957e6fc2f..000000000 --- a/Libraries/ProtocolBuffers/UnknownFieldSet_Builder.m +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "UnknownFieldSet_Builder.h" - -#import "CodedInputStream.h" -#import "Field.h" -#import "MutableField.h" -#import "UnknownFieldSet.h" -#import "WireFormat.h" - -@interface PBUnknownFieldSet_Builder () -@property (retain) NSMutableDictionary* fields; -@property int32_t lastFieldNumber; -@property (retain) PBMutableField* lastField; -@end - - -@implementation PBUnknownFieldSet_Builder - -@synthesize fields; -@synthesize lastFieldNumber; -@synthesize lastField; - - -- (void) dealloc { - self.fields = nil; - self.lastFieldNumber = 0; - self.lastField = nil; -} - - -- (id) init { - if ((self = [super init])) { - self.fields = [NSMutableDictionary dictionary]; - } - return self; -} - - -+ (PBUnknownFieldSet_Builder*) newBuilder:(PBUnknownFieldSet*) unknownFields { - PBUnknownFieldSet_Builder* builder = [[PBUnknownFieldSet_Builder alloc] init]; - [builder mergeUnknownFields:unknownFields]; - return builder; -} - - -/** - * Add a field to the {@code PBUnknownFieldSet}. If a field with the same - * number already exists, it is removed. - */ -- (PBUnknownFieldSet_Builder*) addField:(PBField*) field forNumber:(int32_t) number { - if (number == 0) { - @throw [NSException exceptionWithName:@"IllegalArgument" reason:@"" userInfo:nil]; - } - if (lastField != nil && lastFieldNumber == number) { - // Discard this. - self.lastField = nil; - lastFieldNumber = 0; - } - [fields setObject:field forKey:[NSNumber numberWithInt:number]]; - return self; -} - - -/** - * Get a field builder for the given field number which includes any - * values that already exist. - */ -- (PBMutableField*) getFieldBuilder:(int32_t) number { - if (lastField != nil) { - if (number == lastFieldNumber) { - return lastField; - } - // Note: addField() will reset lastField and lastFieldNumber. - [self addField:lastField forNumber:lastFieldNumber]; - } - if (number == 0) { - return nil; - } else { - PBField* existing = [fields objectForKey:[NSNumber numberWithInt:number]]; - lastFieldNumber = number; - self.lastField = [PBMutableField field]; - if (existing != nil) { - [lastField mergeFromField:existing]; - } - return lastField; - } -} - - -- (PBUnknownFieldSet*) build { - [self getFieldBuilder:0]; // Force lastField to be built. - PBUnknownFieldSet* result; - if (fields.count == 0) { - result = [PBUnknownFieldSet defaultInstance]; - } else { - result = [PBUnknownFieldSet setWithFields:fields]; - } - self.fields = nil; - return result; -} - - -/** Check if the given field number is present in the set. */ -- (BOOL) hasField:(int32_t) number { - if (number == 0) { - @throw [NSException exceptionWithName:@"IllegalArgument" reason:@"" userInfo:nil]; - } - - return number == lastFieldNumber || ([fields objectForKey:[NSNumber numberWithInt:number]] != nil); -} - - -/** - * Add a field to the {@code PBUnknownFieldSet}. If a field with the same - * number already exists, the two are merged. - */ -- (PBUnknownFieldSet_Builder*) mergeField:(PBField*) field forNumber:(int32_t) number { - if (number == 0) { - @throw [NSException exceptionWithName:@"IllegalArgument" reason:@"" userInfo:nil]; - } - if ([self hasField:number]) { - [[self getFieldBuilder:number] mergeFromField:field]; - } else { - // Optimization: We could call getFieldBuilder(number).mergeFrom(field) - // in this case, but that would create a copy of the PBField object. - // We'd rather reuse the one passed to us, so call addField() instead. - [self addField:field forNumber:number]; - } - - return self; -} - - -- (PBUnknownFieldSet_Builder*) mergeUnknownFields:(PBUnknownFieldSet*) other { - if (other != [PBUnknownFieldSet defaultInstance]) { - for (NSNumber* number in other.fields) { - PBField* field = [other.fields objectForKey:number]; - [self mergeField:field forNumber:[number intValue]]; - } - } - return self; -} - - -- (PBUnknownFieldSet_Builder*) mergeFromData:(NSData*) data { - PBCodedInputStream* input = [PBCodedInputStream streamWithData:data]; - [self mergeFromCodedInputStream:input]; - [input checkLastTagWas:0]; - return self; -} - - -- (PBUnknownFieldSet_Builder*) mergeFromInputStream:(NSInputStream*) input { - @throw [NSException exceptionWithName:@"" reason:@"" userInfo:nil]; -} - - -- (PBUnknownFieldSet_Builder*) mergeVarintField:(int32_t) number value:(int32_t) value { - if (number == 0) { - @throw [NSException exceptionWithName:@"IllegalArgument" reason:@"Zero is not a valid field number." userInfo:nil]; - } - - [[self getFieldBuilder:number] addVarint:value]; - return self; -} - - -/** - * Parse a single field from {@code input} and merge it into this set. - * @param tag The field's tag number, which was already parsed. - * @return {@code NO} if the tag is an engroup tag. - */ -- (BOOL) mergeFieldFrom:(int32_t) tag input:(PBCodedInputStream*) input { - int32_t number = PBWireFormatGetTagFieldNumber(tag); - switch (PBWireFormatGetTagWireType(tag)) { - case PBWireFormatVarint: - [[self getFieldBuilder:number] addVarint:[input readInt64]]; - return YES; - case PBWireFormatFixed64: - [[self getFieldBuilder:number] addFixed64:[input readFixed64]]; - return YES; - case PBWireFormatLengthDelimited: - [[self getFieldBuilder:number] addLengthDelimited:[input readData]]; - return YES; - case PBWireFormatStartGroup: { - PBUnknownFieldSet_Builder* subBuilder = [PBUnknownFieldSet builder]; - [input readUnknownGroup:number builder:subBuilder]; - [[self getFieldBuilder:number] addGroup:[subBuilder build]]; - return YES; - } - case PBWireFormatEndGroup: - return NO; - case PBWireFormatFixed32: - [[self getFieldBuilder:number] addFixed32:[input readFixed32]]; - return YES; - default: - @throw [NSException exceptionWithName:@"InvalidProtocolBuffer" reason:@"" userInfo:nil]; - } -} - - -/** - * Parse an entire message from {@code input} and merge its fields into - * this set. - */ -- (PBUnknownFieldSet_Builder*) mergeFromCodedInputStream:(PBCodedInputStream*) input { - while (YES) { - int32_t tag = [input readTag]; - if (tag == 0 || ![self mergeFieldFrom:tag input:input]) { - break; - } - } - return self; -} - - -- (PBUnknownFieldSet_Builder*) clear { - self.fields = [NSMutableDictionary dictionary]; - self.lastFieldNumber = 0; - self.lastField = nil; - return self; -} - -@end diff --git a/Libraries/ProtocolBuffers/Utilities.h b/Libraries/ProtocolBuffers/Utilities.h deleted file mode 100644 index 288a9a5c3..000000000 --- a/Libraries/ProtocolBuffers/Utilities.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -int64_t convertFloat64ToInt64(Float64 f); -int32_t convertFloat32ToInt32(Float32 f); -Float64 convertInt64ToFloat64(int64_t f); -Float32 convertInt32ToFloat32(int32_t f); - -uint64_t convertInt64ToUInt64(int64_t i); -int64_t convertUInt64ToInt64(uint64_t u); -uint32_t convertInt32ToUInt32(int32_t i); -int64_t convertUInt32ToInt32(uint32_t u); - -int32_t logicalRightShift32(int32_t value, int32_t spaces); -int64_t logicalRightShift64(int64_t value, int32_t spaces); diff --git a/Libraries/ProtocolBuffers/Utilities.m b/Libraries/ProtocolBuffers/Utilities.m deleted file mode 100644 index 3a98a7f8f..000000000 --- a/Libraries/ProtocolBuffers/Utilities.m +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "Utilities.h" - -int64_t convertFloat64ToInt64(Float64 v) { - union { Float64 f; int64_t i; } u; - u.f = v; - return u.i; -} - - -int32_t convertFloat32ToInt32(Float32 v) { - union { Float32 f; int32_t i; } u; - u.f = v; - return u.i; -} - - -Float64 convertInt64ToFloat64(int64_t v) { - union { Float64 f; int64_t i; } u; - u.i = v; - return u.f; -} - - -Float32 convertInt32ToFloat32(int32_t v) { - union { Float32 f; int32_t i; } u; - u.i = v; - return u.f; -} - - -uint64_t convertInt64ToUInt64(int64_t v) { - union { int64_t i; uint64_t u; } u; - u.i = v; - return u.u; -} - - -int64_t convertUInt64ToInt64(uint64_t v) { - union { int64_t i; uint64_t u; } u; - u.u = v; - return u.i; -} - -uint32_t convertInt32ToUInt32(int32_t v) { - union { int32_t i; uint32_t u; } u; - u.i = v; - return u.u; -} - - -int64_t convertUInt32ToInt32(uint32_t v) { - union { int32_t i; uint32_t u; } u; - u.u = v; - return u.i; -} - - -int32_t logicalRightShift32(int32_t value, int32_t spaces) { - return (int32_t)convertUInt32ToInt32((convertInt32ToUInt32(value) >> spaces)); -} - - -int64_t logicalRightShift64(int64_t value, int32_t spaces) { - return convertUInt64ToInt64((convertInt64ToUInt64(value) >> spaces)); -} diff --git a/Libraries/ProtocolBuffers/WireFormat.h b/Libraries/ProtocolBuffers/WireFormat.h deleted file mode 100644 index d0e0a34f4..000000000 --- a/Libraries/ProtocolBuffers/WireFormat.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -typedef enum { - PBWireFormatVarint = 0, - PBWireFormatFixed64 = 1, - PBWireFormatLengthDelimited = 2, - PBWireFormatStartGroup = 3, - PBWireFormatEndGroup = 4, - PBWireFormatFixed32 = 5, - - PBWireFormatTagTypeBits = 3, - PBWireFormatTagTypeMask = 7 /* = (1 << PBWireFormatTagTypeBits) - 1*/, - - PBWireFormatMessageSetItem = 1, - PBWireFormatMessageSetTypeId = 2, - PBWireFormatMessageSetMessage = 3 -} PBWireFormat; - -int32_t PBWireFormatMakeTag(int32_t fieldNumber, int32_t wireType); -int32_t PBWireFormatGetTagWireType(int32_t tag); -int32_t PBWireFormatGetTagFieldNumber(int32_t tag); - -#define PBWireFormatMessageSetItemTag (PBWireFormatMakeTag(PBWireFormatMessageSetItem, PBWireFormatStartGroup)) -#define PBWireFormatMessageSetItemEndTag (PBWireFormatMakeTag(PBWireFormatMessageSetItem, PBWireFormatEndGroup)) -#define PBWireFormatMessageSetTypeIdTag (PBWireFormatMakeTag(PBWireFormatMessageSetTypeId, PBWireFormatVarint)) -#define PBWireFormatMessageSetMessageTag (PBWireFormatMakeTag(PBWireFormatMessageSetMessage, PBWireFormatLengthDelimited)) diff --git a/Libraries/ProtocolBuffers/WireFormat.m b/Libraries/ProtocolBuffers/WireFormat.m deleted file mode 100644 index 65ab84128..000000000 --- a/Libraries/ProtocolBuffers/WireFormat.m +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2008 Cyrus Najmabadi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "WireFormat.h" - -#import "Utilities.h" - -int32_t PBWireFormatMakeTag(int32_t fieldNumber, int32_t wireType) { - return (fieldNumber << PBWireFormatTagTypeBits) | wireType; -} - - -int32_t PBWireFormatGetTagWireType(int32_t tag) { - return tag & PBWireFormatTagTypeMask; -} - - -int32_t PBWireFormatGetTagFieldNumber(int32_t tag) { - return logicalRightShift32(tag, PBWireFormatTagTypeBits); -} diff --git a/Podfile b/Podfile index cc121e973..3184f2e82 100644 --- a/Podfile +++ b/Podfile @@ -1,14 +1,19 @@ platform :ios, '7.0' source 'https://github.com/CocoaPods/Specs.git' +inhibit_all_warnings! link_with ["Signal", "SignalTests"] pod 'UICKeyChainStore', :podspec => 'Podspecs/UICKeyChainStore.podspec' +pod 'SocketRocket', :git => 'https://github.com/square/SocketRocket.git', :commit => 'd0585af165' pod 'OpenSSL', '~> 1.0.109' -pod 'MMDrawerController', '~> 0.5.7' pod 'libPhoneNumber-iOS', '~> 0.7' +pod 'AxolotlKit', '~> 0.1' pod 'PastelogKit', '~> 1.2' -pod 'AFNetworking', '~> 2.4.1' pod 'TwistedOakCollapsingFutures','~> 1.0' +pod 'YapDatabase/SQLCipher' +pod 'AFNetworking', '~> 2.4' +pod 'Mantle', '~> 1.5' + pod 'JSQMessagesViewController', :git => 'https://github.com/dtsbourg/JSQMessagesViewController', :branch => 'JSignalQ' pod 'DJWActionSheet' diff --git a/Podfile.lock b/Podfile.lock index 75330180a..9a0920ab2 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,85 +1,113 @@ PODS: - - AFNetworking (2.4.1): - - AFNetworking/NSURLConnection - - AFNetworking/NSURLSession - - AFNetworking/Reachability - - AFNetworking/Security - - AFNetworking/Serialization - - AFNetworking/UIKit - - AFNetworking/NSURLConnection (2.4.1): - - AFNetworking/Reachability - - AFNetworking/Security - - AFNetworking/Serialization - - AFNetworking/NSURLSession (2.4.1): - - AFNetworking/Reachability - - AFNetworking/Security - - AFNetworking/Serialization - - AFNetworking/Reachability (2.4.1) - - AFNetworking/Security (2.4.1) - - AFNetworking/Serialization (2.4.1) - - AFNetworking/UIKit (2.4.1): + - 25519 (1.8) + - AFNetworking (2.5.0): + - AFNetworking/NSURLConnection (= 2.5.0) + - AFNetworking/NSURLSession (= 2.5.0) + - AFNetworking/Reachability (= 2.5.0) + - AFNetworking/Security (= 2.5.0) + - AFNetworking/Serialization (= 2.5.0) + - AFNetworking/UIKit (= 2.5.0) + - AFNetworking/NSURLConnection (2.5.0): + - AFNetworking/Reachability + - AFNetworking/Security + - AFNetworking/Serialization + - AFNetworking/NSURLSession (2.5.0): + - AFNetworking/Reachability + - AFNetworking/Security + - AFNetworking/Serialization + - AFNetworking/Reachability (2.5.0) + - AFNetworking/Security (2.5.0) + - AFNetworking/Serialization (2.5.0) + - AFNetworking/UIKit (2.5.0): - AFNetworking/NSURLConnection - AFNetworking/NSURLSession + - AxolotlKit (0.1): + - 25519 (~> 1.8) + - HKDFKit (~> 0.0.3) + - ProtocolBuffers (~> 1.9.2) - CocoaLumberjack (1.9.2): - - CocoaLumberjack/Extensions + - CocoaLumberjack/Extensions (= 1.9.2) - CocoaLumberjack/Core (1.9.2) - CocoaLumberjack/Extensions (1.9.2): - CocoaLumberjack/Core - DJWActionSheet (1.0.4) + - HKDFKit (0.0.3) - JSQMessagesViewController (6.0-beta6): - JSQSystemSoundPlayer (~> 2.0.0) - JSQSystemSoundPlayer (2.0.0) - libPhoneNumber-iOS (0.7.3) - - MMDrawerController (0.5.7): - - MMDrawerController/Core - - MMDrawerController/MMDrawerBarButtonItem - - MMDrawerController/MMDrawerVisualStates - - MMDrawerController/Subclass - - MMDrawerController/Core (0.5.7) - - MMDrawerController/MMDrawerBarButtonItem (0.5.7): - - MMDrawerController/Core - - MMDrawerController/MMDrawerVisualStates (0.5.7): - - MMDrawerController/Core - - MMDrawerController/Subclass (0.5.7): - - MMDrawerController/Core + - Mantle (1.5.1): + - Mantle/extobjc (= 1.5.1) + - Mantle/extobjc (1.5.1) - OpenSSL (1.0.109) - PastelogKit (1.2): - CocoaLumberjack (~> 1.9) + - ProtocolBuffers (1.9.2) + - SocketRocket (0.3.1-beta2) + - SQLCipher/common (3.1.0) + - SQLCipher/fts (3.1.0): + - SQLCipher/common - TwistedOakCollapsingFutures (1.0.0): - UnionFind (~> 1.0) - UICKeyChainStore (1.0.7) - UnionFind (1.0.1) + - YapDatabase/common (2.5.3): + - CocoaLumberjack (~> 1) + - YapDatabase/SQLCipher (2.5.3): + - SQLCipher/fts + - YapDatabase/common DEPENDENCIES: - - AFNetworking (~> 2.4.1) + - AFNetworking (~> 2.4) + - AxolotlKit (~> 0.1) - DJWActionSheet - JSQMessagesViewController (from `https://github.com/dtsbourg/JSQMessagesViewController`, branch `JSignalQ`) - libPhoneNumber-iOS (~> 0.7) - - MMDrawerController (~> 0.5.7) + - Mantle (~> 1.5) - OpenSSL (~> 1.0.109) - PastelogKit (~> 1.2) + - SocketRocket (from `https://github.com/square/SocketRocket.git`, commit `d0585af165`) - TwistedOakCollapsingFutures (~> 1.0) - UICKeyChainStore (from `Podspecs/UICKeyChainStore.podspec`) + - YapDatabase/SQLCipher EXTERNAL SOURCES: JSQMessagesViewController: :branch: JSignalQ :git: https://github.com/dtsbourg/JSQMessagesViewController + SocketRocket: + :commit: d0585af165 + :git: https://github.com/square/SocketRocket.git UICKeyChainStore: :podspec: Podspecs/UICKeyChainStore.podspec +CHECKOUT OPTIONS: + JSQMessagesViewController: + :commit: 21d877492e948f27fde4115573a809798cc78210 + :git: https://github.com/dtsbourg/JSQMessagesViewController + SocketRocket: + :commit: d0585af165 + :git: https://github.com/square/SocketRocket.git + SPEC CHECKSUMS: - AFNetworking: 0aabc6fae66d6e5d039eeb21c315843c7aae51ab + 25519: 601ffb5d258aa33d642062d6fa4096db210e02e7 + AFNetworking: 0f54cb5d16ce38c1b76948faffb8d5fb705021c7 + AxolotlKit: 395c3302e840a1b9f053e9733002d586d4b10ce0 CocoaLumberjack: 205769c032b5fef85b92472046bcc8b7e7c8a817 DJWActionSheet: d88b302d7c29523e1e9fb9b62cfac46f59bb90d9 + HKDFKit: 5998cf1bbb611e7ecc6bd3eaaef8c7a7da7be949 JSQMessagesViewController: 960a09d11978bea52d1a676e97980838f8d98652 JSQSystemSoundPlayer: c98443b1cbb3b45db09d0d3d6c2355cf78294981 libPhoneNumber-iOS: 98fc07d70c8fdb5e6a8e3442c37e97353065c20e - MMDrawerController: c3ab7a318ddc7e2bcd133139c3161af08c6e1197 + Mantle: d7c5ac734579ec751c58fecbf56189853056c58c OpenSSL: 4810adf5c99b0e2cd20670a11a987c805e8a521c PastelogKit: 8bab71b1d187617a83e7124cffe9eb1a600e6695 + ProtocolBuffers: a834d6fe4ae0cc94d081b864e4948bdd483ad228 + SocketRocket: 9cbe08469513356cddc0afcab1ff160bd190296a + SQLCipher: 981110217eb93c2779c34fb59e646a1c1da918d8 TwistedOakCollapsingFutures: 07aab84fd3958dc94d55ef705b12857d9fbe61d1 UICKeyChainStore: eef407137f0397e95a3df32cdf05f7e2ddd99647 UnionFind: 45777a8b6878d3a602af3654cc3a09b87389d356 + YapDatabase: 096e860167b04e629b88bea33dfb7a4153279bb0 -COCOAPODS: 0.34.4 +COCOAPODS: 0.35.0 diff --git a/Signal.xcodeproj/project.pbxproj b/Signal.xcodeproj/project.pbxproj index fa90def76..9124f5fe5 100644 --- a/Signal.xcodeproj/project.pbxproj +++ b/Signal.xcodeproj/project.pbxproj @@ -12,29 +12,10 @@ 70377AAB1918450100CAF501 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 70377AAA1918450100CAF501 /* MobileCoreServices.framework */; }; 7038632718F70C0700D4A43F /* CryptoTools.m in Sources */ = {isa = PBXBuildFile; fileRef = 7038632418F70C0700D4A43F /* CryptoTools.m */; }; 7038632818F70C0700D4A43F /* EvpSymetricUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 7038632618F70C0700D4A43F /* EvpSymetricUtil.m */; }; - 707E548C18FF0B8A00C8649D /* InviteContactModal.m in Sources */ = {isa = PBXBuildFile; fileRef = 707E548B18FF0B8A00C8649D /* InviteContactModal.m */; }; 707E549218FF26E800C8649D /* SmsInvite.m in Sources */ = {isa = PBXBuildFile; fileRef = 707E549118FF26E800C8649D /* SmsInvite.m */; }; 7095B7B018F46D35002C66E2 /* PhoneNumberUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 7095B7AF18F46D35002C66E2 /* PhoneNumberUtil.m */; }; 70B800A6190C53180042E3F0 /* libspandsp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 70B800A3190C529C0042E3F0 /* libspandsp.a */; }; 70B800AF190C548D0042E3F0 /* libspeex.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 70B800AC190C54790042E3F0 /* libspeex.a */; }; - 70B8010C190C55660042E3F0 /* AbstractMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 70B800E3190C55660042E3F0 /* AbstractMessage.m */; }; - 70B8010D190C55660042E3F0 /* AbstractMessage_Builder.m in Sources */ = {isa = PBXBuildFile; fileRef = 70B800E5190C55660042E3F0 /* AbstractMessage_Builder.m */; }; - 70B8010E190C55660042E3F0 /* CodedInputStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 70B800E8190C55660042E3F0 /* CodedInputStream.m */; }; - 70B8010F190C55660042E3F0 /* CodedOutputStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 70B800EA190C55660042E3F0 /* CodedOutputStream.m */; }; - 70B80110190C55660042E3F0 /* ConcreteExtensionField.m in Sources */ = {isa = PBXBuildFile; fileRef = 70B800EC190C55660042E3F0 /* ConcreteExtensionField.m */; }; - 70B80111190C55660042E3F0 /* ExtendableMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 70B800EE190C55660042E3F0 /* ExtendableMessage.m */; }; - 70B80112190C55660042E3F0 /* ExtendableMessage_Builder.m in Sources */ = {isa = PBXBuildFile; fileRef = 70B800F0190C55660042E3F0 /* ExtendableMessage_Builder.m */; }; - 70B80113190C55660042E3F0 /* ExtensionRegistry.m in Sources */ = {isa = PBXBuildFile; fileRef = 70B800F3190C55660042E3F0 /* ExtensionRegistry.m */; }; - 70B80114190C55660042E3F0 /* Field.m in Sources */ = {isa = PBXBuildFile; fileRef = 70B800F5190C55660042E3F0 /* Field.m */; }; - 70B80115190C55660042E3F0 /* GeneratedMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 70B800F8190C55660042E3F0 /* GeneratedMessage.m */; }; - 70B80116190C55660042E3F0 /* GeneratedMessage_Builder.m in Sources */ = {isa = PBXBuildFile; fileRef = 70B800FA190C55660042E3F0 /* GeneratedMessage_Builder.m */; }; - 70B80117190C55660042E3F0 /* MutableExtensionRegistry.m in Sources */ = {isa = PBXBuildFile; fileRef = 70B800FE190C55660042E3F0 /* MutableExtensionRegistry.m */; }; - 70B80118190C55660042E3F0 /* MutableField.m in Sources */ = {isa = PBXBuildFile; fileRef = 70B80100190C55660042E3F0 /* MutableField.m */; }; - 70B80119190C55660042E3F0 /* TextFormat.m in Sources */ = {isa = PBXBuildFile; fileRef = 70B80103190C55660042E3F0 /* TextFormat.m */; }; - 70B8011A190C55660042E3F0 /* UnknownFieldSet.m in Sources */ = {isa = PBXBuildFile; fileRef = 70B80105190C55660042E3F0 /* UnknownFieldSet.m */; }; - 70B8011B190C55660042E3F0 /* UnknownFieldSet_Builder.m in Sources */ = {isa = PBXBuildFile; fileRef = 70B80107190C55660042E3F0 /* UnknownFieldSet_Builder.m */; }; - 70B8011C190C55660042E3F0 /* Utilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 70B80109190C55660042E3F0 /* Utilities.m */; }; - 70B8011D190C55660042E3F0 /* WireFormat.m in Sources */ = {isa = PBXBuildFile; fileRef = 70B8010B190C55660042E3F0 /* WireFormat.m */; }; 70B8FEE21909FE360042E3F0 /* 171756__nenadsimic__picked-coin-echo-2.wav in Resources */ = {isa = PBXBuildFile; fileRef = 70B8FEE11909FE360042E3F0 /* 171756__nenadsimic__picked-coin-echo-2.wav */; }; 70BAFD5D190584BE00FA5E0B /* NotificationTracker.m in Sources */ = {isa = PBXBuildFile; fileRef = 70BAFD5C190584BE00FA5E0B /* NotificationTracker.m */; }; 762D9DCF18281C7400A5E418 /* SettingsTableHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 762D9DCE18281C7400A5E418 /* SettingsTableHeaderView.m */; }; @@ -49,9 +30,6 @@ 768A1A2B17FC9CD300E00ED8 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 768A1A2A17FC9CD300E00ED8 /* libz.dylib */; }; 76919BF71805D190008C664A /* ContactManagerTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 76919BF61805D190008C664A /* ContactManagerTest.m */; }; 76B818A1182C39460088060E /* PreferenceListViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76B8189D182C39460088060E /* PreferenceListViewController.xib */; }; - 76C87F13181EE11C00C4ACAB /* InboxFeedFooterCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 76C87F12181EE11C00C4ACAB /* InboxFeedFooterCell.m */; }; - 76C87F14181EE11C00C4ACAB /* InboxFeedFooterCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 76C87F12181EE11C00C4ACAB /* InboxFeedFooterCell.m */; }; - 76C87F17181EE2EB00C4ACAB /* InboxFeedFooterCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76C87F15181EE2EB00C4ACAB /* InboxFeedFooterCell.xib */; }; 76C87F19181EFCE600C4ACAB /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 76C87F18181EFCE600C4ACAB /* MediaPlayer.framework */; }; 76D713E7182D3E3F00C9C9C8 /* PreferenceListTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 76D713E6182D3E3F00C9C9C8 /* PreferenceListTableViewCell.m */; }; 76D713E8182D3E3F00C9C9C8 /* PreferenceListTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 76D713E6182D3E3F00C9C9C8 /* PreferenceListTableViewCell.m */; }; @@ -180,7 +158,7 @@ 76EB05FB18170B33006006FC /* CallConnectUtil_Responder.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04A018170B33006006FC /* CallConnectUtil_Responder.m */; }; 76EB05FC18170B33006006FC /* CallConnectUtil_Server.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04A218170B33006006FC /* CallConnectUtil_Server.m */; }; 76EB05FD18170B33006006FC /* CallConnectUtil_Server.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04A218170B33006006FC /* CallConnectUtil_Server.m */; }; - 76EB05FE18170B33006006FC /* InitiateSignal.pb.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04A418170B33006006FC /* InitiateSignal.pb.m */; }; + 76EB05FE18170B33006006FC /* InitiateSignal.pb.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04A418170B33006006FC /* InitiateSignal.pb.m */; settings = {COMPILER_FLAGS = "-w"; }; }; 76EB05FF18170B33006006FC /* InitiateSignal.pb.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04A418170B33006006FC /* InitiateSignal.pb.m */; }; 76EB060118170B33006006FC /* InitiateSignal.proto in Resources */ = {isa = PBXBuildFile; fileRef = 76EB04A518170B33006006FC /* InitiateSignal.proto */; }; 76EB060218170B33006006FC /* InitiatorSessionDescriptor.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04A718170B33006006FC /* InitiatorSessionDescriptor.m */; }; @@ -251,53 +229,27 @@ 76EB064718170B33006006FC /* TimeUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04FA18170B33006006FC /* TimeUtil.m */; }; 76EB064818170B33006006FC /* Zid.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04FD18170B33006006FC /* Zid.m */; }; 76EB064918170B33006006FC /* Zid.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04FD18170B33006006FC /* Zid.m */; }; - 76EB064C18170B34006006FC /* ContactBrowseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB050218170B33006006FC /* ContactBrowseViewController.m */; }; - 76EB064D18170B34006006FC /* ContactBrowseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB050218170B33006006FC /* ContactBrowseViewController.m */; }; 76EB064E18170B34006006FC /* ContactDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB050418170B33006006FC /* ContactDetailViewController.m */; }; 76EB064F18170B34006006FC /* ContactDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB050418170B33006006FC /* ContactDetailViewController.m */; }; 76EB065018170B34006006FC /* DialerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB050618170B33006006FC /* DialerViewController.m */; }; 76EB065118170B34006006FC /* DialerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB050618170B33006006FC /* DialerViewController.m */; }; - 76EB065218170B34006006FC /* FavouritesViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB050818170B33006006FC /* FavouritesViewController.m */; }; - 76EB065318170B34006006FC /* FavouritesViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB050818170B33006006FC /* FavouritesViewController.m */; }; - 76EB065418170B34006006FC /* InboxFeedViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB050A18170B33006006FC /* InboxFeedViewController.m */; }; - 76EB065518170B34006006FC /* InboxFeedViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB050A18170B33006006FC /* InboxFeedViewController.m */; }; 76EB065618170B34006006FC /* InCallViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB050C18170B33006006FC /* InCallViewController.m */; }; 76EB065718170B34006006FC /* InCallViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB050C18170B33006006FC /* InCallViewController.m */; }; - 76EB065818170B34006006FC /* LeftSideMenuViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB050E18170B33006006FC /* LeftSideMenuViewController.m */; }; - 76EB065918170B34006006FC /* LeftSideMenuViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB050E18170B33006006FC /* LeftSideMenuViewController.m */; }; 76EB065A18170B34006006FC /* NextResponderScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB051018170B33006006FC /* NextResponderScrollView.m */; }; 76EB065B18170B34006006FC /* NextResponderScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB051018170B33006006FC /* NextResponderScrollView.m */; }; - 76EB065C18170B34006006FC /* CallLogViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB051218170B33006006FC /* CallLogViewController.m */; }; - 76EB065D18170B34006006FC /* CallLogViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB051218170B33006006FC /* CallLogViewController.m */; }; 76EB066018170B34006006FC /* RegisterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB051618170B33006006FC /* RegisterViewController.m */; }; 76EB066118170B34006006FC /* RegisterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB051618170B33006006FC /* RegisterViewController.m */; }; - 76EB066218170B34006006FC /* SettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB051818170B33006006FC /* SettingsViewController.m */; }; - 76EB066318170B34006006FC /* SettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB051818170B33006006FC /* SettingsViewController.m */; }; - 76EB066418170B34006006FC /* TabBarParentViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB051A18170B33006006FC /* TabBarParentViewController.m */; }; - 76EB066518170B34006006FC /* TabBarParentViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB051A18170B33006006FC /* TabBarParentViewController.m */; }; - 76EB066718170B34006006FC /* TabBarParentViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB051B18170B33006006FC /* TabBarParentViewController.xib */; }; 76EB066918170B34006006FC /* CallAudioManagerDemo.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB051D18170B33006006FC /* CallAudioManagerDemo.xib */; }; 76EB066D18170B34006006FC /* ContactDetailTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB051F18170B33006006FC /* ContactDetailTableViewCell.xib */; }; 76EB066F18170B34006006FC /* ContactDetailViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB052018170B33006006FC /* ContactDetailViewController.xib */; }; 76EB067118170B34006006FC /* DialerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB052118170B33006006FC /* DialerViewController.xib */; }; - 76EB067518170B34006006FC /* FavouritesViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB052318170B33006006FC /* FavouritesViewController.xib */; }; - 76EB067718170B34006006FC /* InboxFeedViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB052418170B33006006FC /* InboxFeedViewController.xib */; }; 76EB067918170B34006006FC /* InCallViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB052518170B33006006FC /* InCallViewController.xib */; }; - 76EB067B18170B34006006FC /* LeftSideMenuViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB052618170B33006006FC /* LeftSideMenuViewController.xib */; }; - 76EB067D18170B34006006FC /* CallLogViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB052718170B33006006FC /* CallLogViewController.xib */; }; 76EB068118170B34006006FC /* RegisterViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB052918170B33006006FC /* RegisterViewController.xib */; }; - 76EB068318170B34006006FC /* SettingsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB052A18170B33006006FC /* SettingsViewController.xib */; }; 76EB068418170B34006006FC /* ContactDetailTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB052D18170B33006006FC /* ContactDetailTableViewCell.m */; }; 76EB068518170B34006006FC /* ContactDetailTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB052D18170B33006006FC /* ContactDetailTableViewCell.m */; }; 76EB068618170B34006006FC /* ContactTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB052F18170B33006006FC /* ContactTableViewCell.m */; }; 76EB068718170B34006006FC /* ContactTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB052F18170B33006006FC /* ContactTableViewCell.m */; }; - 76EB068C18170B34006006FC /* InboxFeedTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB053518170B33006006FC /* InboxFeedTableViewCell.m */; }; - 76EB068D18170B34006006FC /* InboxFeedTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB053518170B33006006FC /* InboxFeedTableViewCell.m */; }; - 76EB068E18170B34006006FC /* CallLogTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB053718170B33006006FC /* CallLogTableViewCell.m */; }; - 76EB068F18170B34006006FC /* CallLogTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB053718170B33006006FC /* CallLogTableViewCell.m */; }; 76EB069318170B34006006FC /* ContactTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB053A18170B33006006FC /* ContactTableViewCell.xib */; }; - 76EB069718170B34006006FC /* InboxFeedTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB053C18170B33006006FC /* InboxFeedTableViewCell.xib */; }; - 76EB069D18170B34006006FC /* CallLogTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB053F18170B33006006FC /* CallLogTableViewCell.xib */; }; A10FDF79184FB4BB007FF963 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 76C87F18181EFCE600C4ACAB /* MediaPlayer.framework */; }; A11CD70D17FA230600A2D1B1 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A11CD70C17FA230600A2D1B1 /* QuartzCore.framework */; }; A123C14916F902EE000AE905 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A163E8AA16F3F6A90094D68B /* Security.framework */; }; @@ -348,6 +300,128 @@ AA0C8E498E2046B0B81EEE6E /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8313AE91B4954215858A5662 /* libPods.a */; }; B60C16651988999D00E97A6C /* VersionMigrations.m in Sources */ = {isa = PBXBuildFile; fileRef = B60C16641988999D00E97A6C /* VersionMigrations.m */; }; B60EDE041A05A01700D73516 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B60EDE031A05A01700D73516 /* AudioToolbox.framework */; }; + B633C5801A1D190B0059AC12 /* archive@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C4FE1A1D190B0059AC12 /* archive@2x.png */; }; + B633C5811A1D190B0059AC12 /* archive_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C4FF1A1D190B0059AC12 /* archive_icon.png */; }; + B633C5821A1D190B0059AC12 /* archive_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5001A1D190B0059AC12 /* archive_icon@2x.png */; }; + B633C5831A1D190B0059AC12 /* backspace.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5011A1D190B0059AC12 /* backspace.png */; }; + B633C5841A1D190B0059AC12 /* backspace@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5021A1D190B0059AC12 /* backspace@2x.png */; }; + B633C5851A1D190B0059AC12 /* blue-archive@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5031A1D190B0059AC12 /* blue-archive@2x.png */; }; + B633C5861A1D190B0059AC12 /* call@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5041A1D190B0059AC12 /* call@2x.png */; }; + B633C5871A1D190B0059AC12 /* call_dark@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5051A1D190B0059AC12 /* call_dark@2x.png */; }; + B633C5881A1D190B0059AC12 /* checkbox_checkmark.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5061A1D190B0059AC12 /* checkbox_checkmark.png */; }; + B633C5891A1D190B0059AC12 /* checkbox_checkmark@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5071A1D190B0059AC12 /* checkbox_checkmark@2x.png */; }; + B633C58A1A1D190B0059AC12 /* checkbox_empty.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5081A1D190B0059AC12 /* checkbox_empty.png */; }; + B633C58B1A1D190B0059AC12 /* checkbox_empty@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5091A1D190B0059AC12 /* checkbox_empty@2x.png */; }; + B633C58C1A1D190B0059AC12 /* checkmark.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C50A1A1D190B0059AC12 /* checkmark.png */; }; + B633C58D1A1D190B0059AC12 /* contact_default_feed.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C50B1A1D190B0059AC12 /* contact_default_feed.png */; }; + B633C58E1A1D190B0059AC12 /* contacts.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C50C1A1D190B0059AC12 /* contacts.png */; }; + B633C58F1A1D190B0059AC12 /* contacts@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C50D1A1D190B0059AC12 /* contacts@2x.png */; }; + B633C5901A1D190B0059AC12 /* contacts_arrow.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C50E1A1D190B0059AC12 /* contacts_arrow.png */; }; + B633C5911A1D190B0059AC12 /* contacts_arrow@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C50F1A1D190B0059AC12 /* contacts_arrow@2x.png */; }; + B633C5921A1D190B0059AC12 /* contacts_tab@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5101A1D190B0059AC12 /* contacts_tab@2x.png */; }; + B633C5961A1D190B0059AC12 /* DefaultContactImage.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5141A1D190B0059AC12 /* DefaultContactImage.png */; }; + B633C5971A1D190B0059AC12 /* delete@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5151A1D190B0059AC12 /* delete@2x.png */; }; + B633C5981A1D190B0059AC12 /* delete_history@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5161A1D190B0059AC12 /* delete_history@2x.png */; }; + B633C5991A1D190B0059AC12 /* dismiss_notification_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5171A1D190B0059AC12 /* dismiss_notification_icon.png */; }; + B633C59A1A1D190B0059AC12 /* dismiss_notification_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5181A1D190B0059AC12 /* dismiss_notification_icon@2x.png */; }; + B633C59B1A1D190B0059AC12 /* drop_down_arrow_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5191A1D190B0059AC12 /* drop_down_arrow_icon.png */; }; + B633C59C1A1D190B0059AC12 /* drop_down_arrow_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C51A1A1D190B0059AC12 /* drop_down_arrow_icon@2x.png */; }; + B633C59D1A1D190B0059AC12 /* endcall@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C51B1A1D190B0059AC12 /* endcall@2x.png */; }; + B633C59E1A1D190B0059AC12 /* expanded_cell_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C51C1A1D190B0059AC12 /* expanded_cell_icon.png */; }; + B633C59F1A1D190B0059AC12 /* expanded_cell_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C51D1A1D190B0059AC12 /* expanded_cell_icon@2x.png */; }; + B633C5A01A1D190B0059AC12 /* favourite.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C51E1A1D190B0059AC12 /* favourite.png */; }; + B633C5A11A1D190B0059AC12 /* favourite_false_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C51F1A1D190B0059AC12 /* favourite_false_icon.png */; }; + B633C5A21A1D190B0059AC12 /* favourite_false_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5201A1D190B0059AC12 /* favourite_false_icon@2x.png */; }; + B633C5A31A1D190B0059AC12 /* favourite_true_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5211A1D190B0059AC12 /* favourite_true_icon.png */; }; + B633C5A41A1D190B0059AC12 /* favourite_true_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5221A1D190B0059AC12 /* favourite_true_icon@2x.png */; }; + B633C5A51A1D190B0059AC12 /* forward_button.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5231A1D190B0059AC12 /* forward_button.png */; }; + B633C5A61A1D190B0059AC12 /* forward_button@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5241A1D190B0059AC12 /* forward_button@2x.png */; }; + B633C5A71A1D190B0059AC12 /* home_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5251A1D190B0059AC12 /* home_icon.png */; }; + B633C5A81A1D190B0059AC12 /* icon_contacts.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5261A1D190B0059AC12 /* icon_contacts.png */; }; + B633C5A91A1D190B0059AC12 /* icon_favourites.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5271A1D190B0059AC12 /* icon_favourites.png */; }; + B633C5AA1A1D190B0059AC12 /* icon_keypad.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5281A1D190B0059AC12 /* icon_keypad.png */; }; + B633C5AB1A1D190B0059AC12 /* icon_recents.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5291A1D190B0059AC12 /* icon_recents.png */; }; + B633C5AC1A1D190B0059AC12 /* in_call_phone_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C52A1A1D190B0059AC12 /* in_call_phone_icon.png */; }; + B633C5AD1A1D190B0059AC12 /* in_call_phone_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C52B1A1D190B0059AC12 /* in_call_phone_icon@2x.png */; }; + B633C5AE1A1D190B0059AC12 /* in_call_phrase_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C52C1A1D190B0059AC12 /* in_call_phrase_icon.png */; }; + B633C5AF1A1D190B0059AC12 /* in_call_phrase_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C52D1A1D190B0059AC12 /* in_call_phrase_icon@2x.png */; }; + B633C5B01A1D190B0059AC12 /* incoming_call_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C52E1A1D190B0059AC12 /* incoming_call_icon.png */; }; + B633C5B11A1D190B0059AC12 /* incoming_call_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C52F1A1D190B0059AC12 /* incoming_call_icon@2x.png */; }; + B633C5B21A1D190B0059AC12 /* info@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5301A1D190B0059AC12 /* info@2x.png */; }; + B633C5B41A1D190B0059AC12 /* keypad@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5321A1D190B0059AC12 /* keypad@2x.png */; }; + B633C5B51A1D190B0059AC12 /* lock@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5331A1D190B0059AC12 /* lock@2x.png */; }; + B633C5B61A1D190B0059AC12 /* lock_white@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5341A1D190B0059AC12 /* lock_white@2x.png */; }; + B633C5B71A1D190B0059AC12 /* logo_intro@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5351A1D190B0059AC12 /* logo_intro@2x.png */; }; + B633C5B91A1D190B0059AC12 /* menu_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5371A1D190B0059AC12 /* menu_icon.png */; }; + B633C5BA1A1D190B0059AC12 /* menu_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5381A1D190B0059AC12 /* menu_icon@2x.png */; }; + B633C5BB1A1D190B0059AC12 /* message_bubble.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5391A1D190B0059AC12 /* message_bubble.png */; }; + B633C5BC1A1D190B0059AC12 /* message_bubble@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C53A1A1D190B0059AC12 /* message_bubble@2x.png */; }; + B633C5BD1A1D190B0059AC12 /* message_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C53B1A1D190B0059AC12 /* message_icon.png */; }; + B633C5BE1A1D190B0059AC12 /* missed.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C53C1A1D190B0059AC12 /* missed.png */; }; + B633C5BF1A1D190B0059AC12 /* mute_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C53D1A1D190B0059AC12 /* mute_icon.png */; }; + B633C5C01A1D190B0059AC12 /* mute_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C53E1A1D190B0059AC12 /* mute_icon@2x.png */; }; + B633C5C11A1D190B0059AC12 /* mute_icon_selected.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C53F1A1D190B0059AC12 /* mute_icon_selected.png */; }; + B633C5C21A1D190B0059AC12 /* mute_icon_selected@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5401A1D190B0059AC12 /* mute_icon_selected@2x.png */; }; + B633C5C31A1D190B0059AC12 /* mute_off@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5411A1D190B0059AC12 /* mute_off@2x.png */; }; + B633C5C41A1D190B0059AC12 /* mute_on@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5421A1D190B0059AC12 /* mute_on@2x.png */; }; + B633C5C51A1D190B0059AC12 /* notification_detail_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5431A1D190B0059AC12 /* notification_detail_icon.png */; }; + B633C5C61A1D190B0059AC12 /* notification_detail_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5441A1D190B0059AC12 /* notification_detail_icon@2x.png */; }; + B633C5C71A1D190B0059AC12 /* notification_mini_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5451A1D190B0059AC12 /* notification_mini_icon.png */; }; + B633C5C81A1D190B0059AC12 /* notification_mini_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5461A1D190B0059AC12 /* notification_mini_icon@2x.png */; }; + B633C5C91A1D190B0059AC12 /* outgoing_call_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5471A1D190B0059AC12 /* outgoing_call_icon.png */; }; + B633C5CA1A1D190B0059AC12 /* outgoing_call_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5481A1D190B0059AC12 /* outgoing_call_icon@2x.png */; }; + B633C5CB1A1D190B0059AC12 /* phone_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5491A1D190B0059AC12 /* phone_icon.png */; }; + B633C5CC1A1D190B0059AC12 /* phone_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C54A1A1D190B0059AC12 /* phone_icon@2x.png */; }; + B633C5CD1A1D190B0059AC12 /* photo@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C54B1A1D190B0059AC12 /* photo@2x.png */; }; + B633C5CE1A1D190B0059AC12 /* quit@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C54C1A1D190B0059AC12 /* quit@2x.png */; }; + B633C5CF1A1D190B0059AC12 /* received.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C54D1A1D190B0059AC12 /* received.png */; }; + B633C5D01A1D190B0059AC12 /* red-delete@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C54E1A1D190B0059AC12 /* red-delete@2x.png */; }; + B633C5D11A1D190B0059AC12 /* reply.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C54F1A1D190B0059AC12 /* reply.png */; }; + B633C5D21A1D190B0059AC12 /* savephoto@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5501A1D190B0059AC12 /* savephoto@2x.png */; }; + B633C5D31A1D190B0059AC12 /* search_cancel.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5511A1D190B0059AC12 /* search_cancel.png */; }; + B633C5D41A1D190B0059AC12 /* search_cancel@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5521A1D190B0059AC12 /* search_cancel@2x.png */; }; + B633C5D51A1D190B0059AC12 /* search_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5531A1D190B0059AC12 /* search_icon.png */; }; + B633C5D61A1D190B0059AC12 /* search_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5541A1D190B0059AC12 /* search_icon@2x.png */; }; + B633C5D71A1D190B0059AC12 /* send_code_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5551A1D190B0059AC12 /* send_code_icon.png */; }; + B633C5D81A1D190B0059AC12 /* send_code_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5561A1D190B0059AC12 /* send_code_icon@2x.png */; }; + B633C5D91A1D190B0059AC12 /* settings.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5571A1D190B0059AC12 /* settings.png */; }; + B633C5DA1A1D190B0059AC12 /* settings_dark@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5581A1D190B0059AC12 /* settings_dark@2x.png */; }; + B633C5DB1A1D190B0059AC12 /* share@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5591A1D190B0059AC12 /* share@2x.png */; }; + B633C5DC1A1D190B0059AC12 /* shred@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C55A1A1D190B0059AC12 /* shred@2x.png */; }; + B633C5DF1A1D190B0059AC12 /* signal@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C55E1A1D190B0059AC12 /* signal@2x.png */; }; + B633C5E01A1D190B0059AC12 /* signals.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C55F1A1D190B0059AC12 /* signals.png */; }; + B633C5E11A1D190B0059AC12 /* speaker_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5601A1D190B0059AC12 /* speaker_icon.png */; }; + B633C5E21A1D190B0059AC12 /* speaker_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5611A1D190B0059AC12 /* speaker_icon@2x.png */; }; + B633C5E31A1D190B0059AC12 /* speaker_icon_selected.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5621A1D190B0059AC12 /* speaker_icon_selected.png */; }; + B633C5E41A1D190B0059AC12 /* speaker_icon_selected@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5631A1D190B0059AC12 /* speaker_icon_selected@2x.png */; }; + B633C5E51A1D190B0059AC12 /* speaker_off@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5641A1D190B0059AC12 /* speaker_off@2x.png */; }; + B633C5E61A1D190B0059AC12 /* speaker_on@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5651A1D190B0059AC12 /* speaker_on@2x.png */; }; + B633C5E71A1D190B0059AC12 /* spinner_connecting.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5661A1D190B0059AC12 /* spinner_connecting.png */; }; + B633C5E81A1D190B0059AC12 /* spinner_connecting@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5671A1D190B0059AC12 /* spinner_connecting@2x.png */; }; + B633C5E91A1D190B0059AC12 /* spinner_connecting_flash.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5681A1D190B0059AC12 /* spinner_connecting_flash.png */; }; + B633C5EA1A1D190B0059AC12 /* spinner_connecting_flash@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5691A1D190B0059AC12 /* spinner_connecting_flash@2x.png */; }; + B633C5EB1A1D190B0059AC12 /* spinner_error.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C56A1A1D190B0059AC12 /* spinner_error.png */; }; + B633C5EC1A1D190B0059AC12 /* spinner_error@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C56B1A1D190B0059AC12 /* spinner_error@2x.png */; }; + B633C5ED1A1D190B0059AC12 /* spinner_ringing.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C56C1A1D190B0059AC12 /* spinner_ringing.png */; }; + B633C5EE1A1D190B0059AC12 /* spinner_ringing@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C56D1A1D190B0059AC12 /* spinner_ringing@2x.png */; }; + B633C5EF1A1D190B0059AC12 /* tab_icon_contacts.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C56E1A1D190B0059AC12 /* tab_icon_contacts.png */; }; + B633C5F01A1D190B0059AC12 /* tab_icon_contacts@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C56F1A1D190B0059AC12 /* tab_icon_contacts@2x.png */; }; + B633C5F11A1D190B0059AC12 /* tab_icon_favourites.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5701A1D190B0059AC12 /* tab_icon_favourites.png */; }; + B633C5F21A1D190B0059AC12 /* tab_icon_favourites@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5711A1D190B0059AC12 /* tab_icon_favourites@2x.png */; }; + B633C5F31A1D190B0059AC12 /* tab_icon_inbox.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5721A1D190B0059AC12 /* tab_icon_inbox.png */; }; + B633C5F41A1D190B0059AC12 /* tab_icon_inbox@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5731A1D190B0059AC12 /* tab_icon_inbox@2x.png */; }; + B633C5F51A1D190B0059AC12 /* tab_icon_keypad.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5741A1D190B0059AC12 /* tab_icon_keypad.png */; }; + B633C5F61A1D190B0059AC12 /* tab_icon_keypad@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5751A1D190B0059AC12 /* tab_icon_keypad@2x.png */; }; + B633C5F71A1D190B0059AC12 /* tab_icon_menu.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5761A1D190B0059AC12 /* tab_icon_menu.png */; }; + B633C5F81A1D190B0059AC12 /* tab_icon_menu@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5771A1D190B0059AC12 /* tab_icon_menu@2x.png */; }; + B633C5F91A1D190B0059AC12 /* trash_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5781A1D190B0059AC12 /* trash_icon.png */; }; + B633C5FA1A1D190B0059AC12 /* trash_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5791A1D190B0059AC12 /* trash_icon@2x.png */; }; + B633C5FB1A1D190B0059AC12 /* volume_high.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C57A1A1D190B0059AC12 /* volume_high.png */; }; + B633C5FC1A1D190B0059AC12 /* volume_high@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C57B1A1D190B0059AC12 /* volume_high@2x.png */; }; + B633C5FD1A1D190B0059AC12 /* volume_low.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C57C1A1D190B0059AC12 /* volume_low.png */; }; + B633C5FE1A1D190B0059AC12 /* volume_low@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C57D1A1D190B0059AC12 /* volume_low@2x.png */; }; + B633C5FF1A1D190B0059AC12 /* whisper_notification_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C57E1A1D190B0059AC12 /* whisper_notification_icon.png */; }; + B633C6001A1D190B0059AC12 /* whisper_notification_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C57F1A1D190B0059AC12 /* whisper_notification_icon@2x.png */; }; B63761E319E1F487005735D1 /* AFHTTPSessionManager+SignalMethods.m in Sources */ = {isa = PBXBuildFile; fileRef = B63761E219E1F487005735D1 /* AFHTTPSessionManager+SignalMethods.m */; }; B63761EC19E1FBE8005735D1 /* HttpRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B63761E519E1FBE8005735D1 /* HttpRequest.m */; }; B63761ED19E1FBE8005735D1 /* HttpRequestOrResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = B63761E719E1FBE8005735D1 /* HttpRequestOrResponse.m */; }; @@ -361,6 +435,65 @@ B684A46D19C3446200B11029 /* PushManagerTest.m in Sources */ = {isa = PBXBuildFile; fileRef = B684A46C19C3446200B11029 /* PushManagerTest.m */; }; B6850E5A1995A4710068E715 /* whisperFake.cer in Resources */ = {isa = PBXBuildFile; fileRef = B6850E591995A4710068E715 /* whisperFake.cer */; }; B69CD25119773E79005CE69A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B69CD25019773E79005CE69A /* XCTest.framework */; }; + B6B095E41A1D25C5008BFAA6 /* CryptographyTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = B6B095DE1A1D25C5008BFAA6 /* CryptographyTests.mm */; }; + B6B095E51A1D25C5008BFAA6 /* TextSecureKitTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B095DF1A1D25C5008BFAA6 /* TextSecureKitTests.m */; }; + B6B095E61A1D25C5008BFAA6 /* TSMessageStorageTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B095E01A1D25C5008BFAA6 /* TSMessageStorageTests.m */; }; + B6B095E71A1D25C5008BFAA6 /* TSStorageIdentityKeyStoreTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B095E11A1D25C5008BFAA6 /* TSStorageIdentityKeyStoreTests.m */; }; + B6B095E81A1D25C5008BFAA6 /* TSStoragePreKeyStoreTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B095E21A1D25C5008BFAA6 /* TSStoragePreKeyStoreTests.m */; }; + B6B095E91A1D25C5008BFAA6 /* TSStorageSignedPreKeyStore.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B095E31A1D25C5008BFAA6 /* TSStorageSignedPreKeyStore.m */; }; + B6B096611A1D25ED008BFAA6 /* TSAccountManager.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B095ED1A1D25ED008BFAA6 /* TSAccountManager.m */; }; + B6B096621A1D25ED008BFAA6 /* TSNumberVerifier.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B095EF1A1D25ED008BFAA6 /* TSNumberVerifier.m */; }; + B6B096631A1D25ED008BFAA6 /* TSPreKeyManager.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B095F11A1D25ED008BFAA6 /* TSPreKeyManager.m */; }; + B6B096641A1D25ED008BFAA6 /* TSContactThread.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B095F51A1D25ED008BFAA6 /* TSContactThread.m */; }; + B6B096651A1D25ED008BFAA6 /* TSGroupThread.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B095F71A1D25ED008BFAA6 /* TSGroupThread.m */; }; + B6B096661A1D25ED008BFAA6 /* TSContact.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B095F91A1D25ED008BFAA6 /* TSContact.m */; }; + B6B096671A1D25ED008BFAA6 /* TSGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B095FB1A1D25ED008BFAA6 /* TSGroup.m */; }; + B6B096681A1D25ED008BFAA6 /* TSRecipient.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B095FD1A1D25ED008BFAA6 /* TSRecipient.m */; }; + B6B096691A1D25ED008BFAA6 /* TSThread.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B095FF1A1D25ED008BFAA6 /* TSThread.m */; }; + B6B0966A1A1D25ED008BFAA6 /* IncomingPushMessageSignal.pb.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B096021A1D25ED008BFAA6 /* IncomingPushMessageSignal.pb.m */; settings = {COMPILER_FLAGS = "-w"; }; }; + B6B0966B1A1D25ED008BFAA6 /* TSAttachement.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B096041A1D25ED008BFAA6 /* TSAttachement.m */; }; + B6B0966C1A1D25ED008BFAA6 /* TSCall.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B096061A1D25ED008BFAA6 /* TSCall.m */; }; + B6B0966D1A1D25ED008BFAA6 /* TSErrorMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B096081A1D25ED008BFAA6 /* TSErrorMessage.m */; }; + B6B0966E1A1D25ED008BFAA6 /* TSGroupMessageManager.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B0960A1A1D25ED008BFAA6 /* TSGroupMessageManager.m */; }; + B6B0966F1A1D25ED008BFAA6 /* TSIncomingMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B0960C1A1D25ED008BFAA6 /* TSIncomingMessage.m */; }; + B6B096701A1D25ED008BFAA6 /* TSInfoMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B0960E1A1D25ED008BFAA6 /* TSInfoMessage.m */; }; + B6B096711A1D25ED008BFAA6 /* TSInteraction.mm in Sources */ = {isa = PBXBuildFile; fileRef = B6B096101A1D25ED008BFAA6 /* TSInteraction.mm */; }; + B6B096721A1D25ED008BFAA6 /* TSMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B096121A1D25ED008BFAA6 /* TSMessage.m */; }; + B6B096731A1D25ED008BFAA6 /* TSMessagesManager+sendMessages.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B096141A1D25ED008BFAA6 /* TSMessagesManager+sendMessages.m */; }; + B6B096741A1D25ED008BFAA6 /* TSMessagesManager.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B096161A1D25ED008BFAA6 /* TSMessagesManager.m */; }; + B6B096751A1D25ED008BFAA6 /* TSOutgoingMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B096181A1D25ED008BFAA6 /* TSOutgoingMessage.m */; }; + B6B096761A1D25ED008BFAA6 /* TSServerMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B0961A1A1D25ED008BFAA6 /* TSServerMessage.m */; }; + B6B096771A1D25ED008BFAA6 /* TSContactsIntersectionRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B0961E1A1D25ED008BFAA6 /* TSContactsIntersectionRequest.m */; }; + B6B096781A1D25ED008BFAA6 /* TSDeregisterAccountRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B096201A1D25ED008BFAA6 /* TSDeregisterAccountRequest.m */; }; + B6B096791A1D25ED008BFAA6 /* TSRecipientPrekeyRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B096221A1D25ED008BFAA6 /* TSRecipientPrekeyRequest.m */; }; + B6B0967A1A1D25ED008BFAA6 /* TSRegisterForPushRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B096241A1D25ED008BFAA6 /* TSRegisterForPushRequest.m */; }; + B6B0967B1A1D25ED008BFAA6 /* TSRegisterPrekeysRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B096261A1D25ED008BFAA6 /* TSRegisterPrekeysRequest.m */; }; + B6B0967C1A1D25ED008BFAA6 /* TSRegisterWithTokenRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B096281A1D25ED008BFAA6 /* TSRegisterWithTokenRequest.m */; }; + B6B0967D1A1D25ED008BFAA6 /* TSRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B0962A1A1D25ED008BFAA6 /* TSRequest.m */; }; + B6B0967E1A1D25ED008BFAA6 /* TSRequestAttachment.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B0962C1A1D25ED008BFAA6 /* TSRequestAttachment.m */; }; + B6B0967F1A1D25ED008BFAA6 /* TSRequestAttachmentId.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B0962E1A1D25ED008BFAA6 /* TSRequestAttachmentId.m */; }; + B6B096801A1D25ED008BFAA6 /* TSRequestVerificationCodeRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B096301A1D25ED008BFAA6 /* TSRequestVerificationCodeRequest.m */; }; + B6B096811A1D25ED008BFAA6 /* TSServerCodeVerificationRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B096321A1D25ED008BFAA6 /* TSServerCodeVerificationRequest.m */; }; + B6B096821A1D25ED008BFAA6 /* TSSubmitMessageRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B096341A1D25ED008BFAA6 /* TSSubmitMessageRequest.m */; }; + B6B096831A1D25ED008BFAA6 /* TSUploadAttachment.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B096361A1D25ED008BFAA6 /* TSUploadAttachment.m */; }; + B6B096841A1D25ED008BFAA6 /* TSNetworkManager.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B096381A1D25ED008BFAA6 /* TSNetworkManager.m */; }; + B6B096851A1D25ED008BFAA6 /* TSSocketManager.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B0963A1A1D25ED008BFAA6 /* TSSocketManager.m */; }; + B6B096861A1D25ED008BFAA6 /* SecurityUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B0963D1A1D25ED008BFAA6 /* SecurityUtils.m */; }; + B6B096871A1D25ED008BFAA6 /* TSStorageManager+IdentityKeyStore.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B096411A1D25ED008BFAA6 /* TSStorageManager+IdentityKeyStore.m */; }; + B6B096881A1D25ED008BFAA6 /* TSStorageManager+keyFromIntLong.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B096431A1D25ED008BFAA6 /* TSStorageManager+keyFromIntLong.m */; }; + B6B096891A1D25ED008BFAA6 /* TSStorageManager+PreKeyStore.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B096451A1D25ED008BFAA6 /* TSStorageManager+PreKeyStore.m */; }; + B6B0968A1A1D25ED008BFAA6 /* TSStorageManager+SessionStore.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B096471A1D25ED008BFAA6 /* TSStorageManager+SessionStore.m */; }; + B6B0968B1A1D25ED008BFAA6 /* TSStorageManager+SignedPreKeyStore.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B096491A1D25ED008BFAA6 /* TSStorageManager+SignedPreKeyStore.m */; }; + B6B0968C1A1D25ED008BFAA6 /* TSDatabaseView.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B0964B1A1D25ED008BFAA6 /* TSDatabaseView.m */; }; + B6B0968D1A1D25ED008BFAA6 /* TSStorageManager+keyingMaterial.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B0964E1A1D25ED008BFAA6 /* TSStorageManager+keyingMaterial.m */; }; + B6B0968E1A1D25ED008BFAA6 /* TSStorageManager.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B096501A1D25ED008BFAA6 /* TSStorageManager.m */; }; + B6B0968F1A1D25ED008BFAA6 /* TSYapDatabaseObject.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B096521A1D25ED008BFAA6 /* TSYapDatabaseObject.m */; }; + B6B096901A1D25ED008BFAA6 /* Cryptography.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B096561A1D25ED008BFAA6 /* Cryptography.m */; }; + B6B096911A1D25ED008BFAA6 /* NSData+Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B096581A1D25ED008BFAA6 /* NSData+Base64.m */; }; + B6B096921A1D25ED008BFAA6 /* NSData+hexString.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B0965A1A1D25ED008BFAA6 /* NSData+hexString.m */; }; + B6B096931A1D25ED008BFAA6 /* NSData+messagePadding.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B0965C1A1D25ED008BFAA6 /* NSData+messagePadding.m */; }; + B6B096941A1D25ED008BFAA6 /* NSString+escape.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B0965E1A1D25ED008BFAA6 /* NSString+escape.m */; }; + B6B096951A1D25ED008BFAA6 /* NSURLSessionDataTask+StatusCode.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B096601A1D25ED008BFAA6 /* NSURLSessionDataTask+StatusCode.m */; }; B6B1013C196D213F007E3930 /* SGNKeychainUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B1013B196D213F007E3930 /* SGNKeychainUtil.m */; }; B6B9ECFC198B31BA00C620D3 /* PushManager.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B9ECFB198B31BA00C620D3 /* PushManager.m */; }; B6C93C4E199567AD00EDF894 /* DebugLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = B6C93C4D199567AD00EDF894 /* DebugLogger.m */; }; @@ -368,7 +501,6 @@ B90418E7183E9DD40038554A /* DateUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = B90418E5183E9DD40038554A /* DateUtil.m */; }; B942EB0E183A9633000887BB /* SearchBarTitleView.m in Sources */ = {isa = PBXBuildFile; fileRef = B942EB0D183A9633000887BB /* SearchBarTitleView.m */; }; B942EB0F183A9633000887BB /* SearchBarTitleView.m in Sources */ = {isa = PBXBuildFile; fileRef = B942EB0D183A9633000887BB /* SearchBarTitleView.m */; }; - B942EB10183AC467000887BB /* ContactBrowseViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB051E18170B33006006FC /* ContactBrowseViewController.xib */; }; B96A3100187DA1B600648F3E /* HelveticaNeueLTStd-Bd.otf in Resources */ = {isa = PBXBuildFile; fileRef = B96A30FE187DA1B600648F3E /* HelveticaNeueLTStd-Bd.otf */; }; B97940271832BD2400BD66CB /* UIUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = B97940261832BD2400BD66CB /* UIUtil.m */; }; B97940281832BD2400BD66CB /* UIUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = B97940261832BD2400BD66CB /* UIUtil.m */; }; @@ -384,9 +516,6 @@ B9B89C54185A2B5F00A24465 /* LeftSideMenuCell.m in Sources */ = {isa = PBXBuildFile; fileRef = B9B89C53185A2B5F00A24465 /* LeftSideMenuCell.m */; }; B9B89C55185A2B5F00A24465 /* LeftSideMenuCell.m in Sources */ = {isa = PBXBuildFile; fileRef = B9B89C53185A2B5F00A24465 /* LeftSideMenuCell.m */; }; B9B89C58185A2B7000A24465 /* LeftSideMenuCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = B9B89C56185A2B7000A24465 /* LeftSideMenuCell.xib */; }; - B9CA51BA18809ACA007E204E /* InviteContactsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B9CA51B818809ACA007E204E /* InviteContactsViewController.m */; }; - B9CA51BB18809ACA007E204E /* InviteContactsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B9CA51B818809ACA007E204E /* InviteContactsViewController.m */; }; - B9CA51BD18809ACA007E204E /* InviteContactsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = B9CA51B918809ACA007E204E /* InviteContactsViewController.xib */; }; B9EB5ABD1884C002007CBB57 /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B9EB5ABC1884C002007CBB57 /* MessageUI.framework */; }; B9EB5AC61884D370007CBB57 /* UnseenWhisperUserCell.m in Sources */ = {isa = PBXBuildFile; fileRef = B9EB5AC51884D370007CBB57 /* UnseenWhisperUserCell.m */; }; B9EB5AC71884D370007CBB57 /* UnseenWhisperUserCell.m in Sources */ = {isa = PBXBuildFile; fileRef = B9EB5AC51884D370007CBB57 /* UnseenWhisperUserCell.m */; }; @@ -433,116 +562,20 @@ E1370BF118A0689000826894 /* AppIcon76x76.png in Resources */ = {isa = PBXBuildFile; fileRef = E18AB3FB18A05734001A532A /* AppIcon76x76.png */; }; E1370BF218A0689000826894 /* AppIcon76x76@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E18AB3FC18A05734001A532A /* AppIcon76x76@2x.png */; }; E1370BF618A068A600826894 /* whisperReal.cer in Resources */ = {isa = PBXBuildFile; fileRef = E1C407C117F0C246007BEE65 /* whisperReal.cer */; }; - E14874A218A0692F002CC4F3 /* archive_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B3018A0660300826894 /* archive_icon.png */; }; - E14874A318A0692F002CC4F3 /* archive_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B3118A0660300826894 /* archive_icon@2x.png */; }; - E14874A418A0692F002CC4F3 /* backspace.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B3218A0660300826894 /* backspace.png */; }; - E14874A518A0692F002CC4F3 /* backspace@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B3318A0660300826894 /* backspace@2x.png */; }; - E14874A618A0692F002CC4F3 /* checkbox_checkmark.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B3418A0660300826894 /* checkbox_checkmark.png */; }; - E14874A718A0692F002CC4F3 /* checkbox_checkmark@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B3518A0660300826894 /* checkbox_checkmark@2x.png */; }; - E14874A818A0692F002CC4F3 /* checkbox_empty.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B3618A0660300826894 /* checkbox_empty.png */; }; - E14874A918A0692F002CC4F3 /* checkbox_empty@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B3718A0660300826894 /* checkbox_empty@2x.png */; }; - E14874AA18A0692F002CC4F3 /* contact_default_feed.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B3818A0660300826894 /* contact_default_feed.png */; }; - E14874AB18A0692F002CC4F3 /* contacts_arrow.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B3918A0660300826894 /* contacts_arrow.png */; }; - E14874AC18A0692F002CC4F3 /* contacts_arrow@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B3A18A0660300826894 /* contacts_arrow@2x.png */; }; - E14874AD18A0692F002CC4F3 /* DefaultContactImage.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B3B18A0660300826894 /* DefaultContactImage.png */; }; - E14874AE18A0692F002CC4F3 /* dismiss_notification_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B3C18A0660300826894 /* dismiss_notification_icon.png */; }; - E14874AF18A0692F002CC4F3 /* dismiss_notification_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B3D18A0660300826894 /* dismiss_notification_icon@2x.png */; }; - E14874B018A0692F002CC4F3 /* drop_down_arrow_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B3E18A0660300826894 /* drop_down_arrow_icon.png */; }; - E14874B118A0692F002CC4F3 /* drop_down_arrow_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B3F18A0660300826894 /* drop_down_arrow_icon@2x.png */; }; - E14874B218A0692F002CC4F3 /* expanded_cell_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B4018A0660300826894 /* expanded_cell_icon.png */; }; - E14874B318A0692F002CC4F3 /* expanded_cell_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B4118A0660300826894 /* expanded_cell_icon@2x.png */; }; - E14874B418A0692F002CC4F3 /* favourite_false_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B4218A0660300826894 /* favourite_false_icon.png */; }; - E14874B518A0692F002CC4F3 /* favourite_false_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B4318A0660300826894 /* favourite_false_icon@2x.png */; }; - E14874B618A0692F002CC4F3 /* favourite_true_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B4418A0660300826894 /* favourite_true_icon.png */; }; - E14874B718A0692F002CC4F3 /* favourite_true_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B4518A0660300826894 /* favourite_true_icon@2x.png */; }; - E14874B818A0692F002CC4F3 /* forward_button.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B4618A0660300826894 /* forward_button.png */; }; - E14874B918A0692F002CC4F3 /* forward_button@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B4718A0660300826894 /* forward_button@2x.png */; }; - E14874BA18A0692F002CC4F3 /* home_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B4818A0660300826894 /* home_icon.png */; }; - E14874BB18A0692F002CC4F3 /* icon_contacts.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B4918A0660300826894 /* icon_contacts.png */; }; - E14874BC18A0692F002CC4F3 /* icon_favourites.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B4A18A0660300826894 /* icon_favourites.png */; }; - E14874BD18A0692F002CC4F3 /* icon_keypad.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B4B18A0660300826894 /* icon_keypad.png */; }; - E14874BE18A0692F002CC4F3 /* icon_recents.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B4C18A0660300826894 /* icon_recents.png */; }; - E14874BF18A0692F002CC4F3 /* in_call_phone_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B4D18A0660300826894 /* in_call_phone_icon.png */; }; - E14874C018A0692F002CC4F3 /* in_call_phone_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B4E18A0660300826894 /* in_call_phone_icon@2x.png */; }; - E14874C118A0692F002CC4F3 /* in_call_phrase_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B4F18A0660300826894 /* in_call_phrase_icon.png */; }; - E14874C218A0692F002CC4F3 /* in_call_phrase_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B5018A0660300826894 /* in_call_phrase_icon@2x.png */; }; - E14874C318A0692F002CC4F3 /* incoming_call_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B5118A0660300826894 /* incoming_call_icon.png */; }; - E14874C418A0692F002CC4F3 /* incoming_call_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B5218A0660300826894 /* incoming_call_icon@2x.png */; }; - E14874C518A0692F002CC4F3 /* menu_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B5318A0660300826894 /* menu_icon.png */; }; - E14874C618A0692F002CC4F3 /* menu_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B5418A0660300826894 /* menu_icon@2x.png */; }; - E14874C718A0692F002CC4F3 /* message_bubble.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B5518A0660300826894 /* message_bubble.png */; }; - E14874C818A0692F002CC4F3 /* message_bubble@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B5618A0660300826894 /* message_bubble@2x.png */; }; - E14874C918A0692F002CC4F3 /* mute_icon_selected.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B5718A0660300826894 /* mute_icon_selected.png */; }; - E14874CA18A0692F002CC4F3 /* mute_icon_selected@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B5818A0660300826894 /* mute_icon_selected@2x.png */; }; - E14874CB18A0692F002CC4F3 /* mute_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B5918A0660300826894 /* mute_icon.png */; }; - E14874CC18A0692F002CC4F3 /* mute_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B5A18A0660300826894 /* mute_icon@2x.png */; }; - E14874CD18A0692F002CC4F3 /* notification_detail_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B5B18A0660300826894 /* notification_detail_icon.png */; }; - E14874CE18A0692F002CC4F3 /* notification_detail_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B5C18A0660300826894 /* notification_detail_icon@2x.png */; }; - E14874CF18A0692F002CC4F3 /* notification_mini_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B5D18A0660300826894 /* notification_mini_icon.png */; }; - E14874D018A0692F002CC4F3 /* notification_mini_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B5E18A0660300826894 /* notification_mini_icon@2x.png */; }; - E14874D118A0692F002CC4F3 /* outgoing_call_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B5F18A0660300826894 /* outgoing_call_icon.png */; }; - E14874D218A0692F002CC4F3 /* outgoing_call_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B6018A0660300826894 /* outgoing_call_icon@2x.png */; }; - E14874D318A0692F002CC4F3 /* search_cancel.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B6118A0660300826894 /* search_cancel.png */; }; - E14874D418A0692F002CC4F3 /* search_cancel@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B6218A0660300826894 /* search_cancel@2x.png */; }; - E14874D518A0692F002CC4F3 /* search_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B6318A0660300826894 /* search_icon.png */; }; - E14874D618A0692F002CC4F3 /* search_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B6418A0660300826894 /* search_icon@2x.png */; }; - E14874D718A0692F002CC4F3 /* send_code_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B6518A0660300826894 /* send_code_icon.png */; }; - E14874D818A0692F002CC4F3 /* send_code_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B6618A0660300826894 /* send_code_icon@2x.png */; }; - E14874D918A0692F002CC4F3 /* speaker_icon_selected.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B6718A0660300826894 /* speaker_icon_selected.png */; }; - E14874DA18A0692F002CC4F3 /* speaker_icon_selected@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B6818A0660300826894 /* speaker_icon_selected@2x.png */; }; - E14874DB18A0692F002CC4F3 /* speaker_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B6918A0660300826894 /* speaker_icon.png */; }; - E14874DC18A0692F002CC4F3 /* speaker_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B6A18A0660300826894 /* speaker_icon@2x.png */; }; - E14874DD18A0692F002CC4F3 /* spinner_connecting_flash.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B6B18A0660300826894 /* spinner_connecting_flash.png */; }; - E14874DE18A0692F002CC4F3 /* spinner_connecting_flash@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B6C18A0660300826894 /* spinner_connecting_flash@2x.png */; }; - E14874DF18A06930002CC4F3 /* spinner_connecting.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B6D18A0660300826894 /* spinner_connecting.png */; }; - E14874E018A06930002CC4F3 /* spinner_connecting@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B6E18A0660300826894 /* spinner_connecting@2x.png */; }; - E14874E118A06930002CC4F3 /* spinner_error.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B6F18A0660300826894 /* spinner_error.png */; }; - E14874E218A06930002CC4F3 /* spinner_error@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B7018A0660300826894 /* spinner_error@2x.png */; }; - E14874E318A06930002CC4F3 /* spinner_ringing.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B7118A0660300826894 /* spinner_ringing.png */; }; - E14874E418A06930002CC4F3 /* spinner_ringing@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B7218A0660300826894 /* spinner_ringing@2x.png */; }; - E14874E518A06930002CC4F3 /* tab_icon_contacts.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B7318A0660300826894 /* tab_icon_contacts.png */; }; - E14874E618A06930002CC4F3 /* tab_icon_contacts@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B7418A0660300826894 /* tab_icon_contacts@2x.png */; }; - E14874E718A06930002CC4F3 /* tab_icon_favourites.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B7518A0660300826894 /* tab_icon_favourites.png */; }; - E14874E818A06930002CC4F3 /* tab_icon_favourites@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B7618A0660300826894 /* tab_icon_favourites@2x.png */; }; - E14874E918A06930002CC4F3 /* tab_icon_inbox.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B7718A0660300826894 /* tab_icon_inbox.png */; }; - E14874EA18A06930002CC4F3 /* tab_icon_inbox@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B7818A0660300826894 /* tab_icon_inbox@2x.png */; }; - E14874EB18A06930002CC4F3 /* tab_icon_keypad.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B7918A0660300826894 /* tab_icon_keypad.png */; }; - E14874EC18A06930002CC4F3 /* tab_icon_keypad@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B7A18A0660300826894 /* tab_icon_keypad@2x.png */; }; - E14874ED18A06930002CC4F3 /* tab_icon_menu.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B7B18A0660300826894 /* tab_icon_menu.png */; }; - E14874EE18A06930002CC4F3 /* tab_icon_menu@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B7C18A0660300826894 /* tab_icon_menu@2x.png */; }; - E14874EF18A06930002CC4F3 /* trash_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B7D18A0660300826894 /* trash_icon.png */; }; - E14874F018A06930002CC4F3 /* trash_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B7E18A0660300826894 /* trash_icon@2x.png */; }; - E14874F118A06930002CC4F3 /* volume_high.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B7F18A0660300826894 /* volume_high.png */; }; - E14874F218A06930002CC4F3 /* volume_high@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B8018A0660300826894 /* volume_high@2x.png */; }; - E14874F318A06930002CC4F3 /* volume_low.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B8118A0660300826894 /* volume_low.png */; }; - E14874F418A06930002CC4F3 /* volume_low@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B8218A0660300826894 /* volume_low@2x.png */; }; - E14874F518A06930002CC4F3 /* whisper_notification_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B8318A0660300826894 /* whisper_notification_icon.png */; }; - E14874F618A06930002CC4F3 /* whisper_notification_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1370B8418A0660300826894 /* whisper_notification_icon@2x.png */; }; - E14874F718A06951002CC4F3 /* CallLogTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB053F18170B33006006FC /* CallLogTableViewCell.xib */; }; E14874F818A06951002CC4F3 /* ContactTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB053A18170B33006006FC /* ContactTableViewCell.xib */; }; E14874F918A06951002CC4F3 /* CountryCodeTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = B97CBFB018861023008E0DE9 /* CountryCodeTableViewCell.xib */; }; E14874FA18A06951002CC4F3 /* FavouriteTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = B9A578B3183D610300C17105 /* FavouriteTableViewCell.xib */; }; - E14874FB18A06951002CC4F3 /* InboxFeedFooterCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76C87F15181EE2EB00C4ACAB /* InboxFeedFooterCell.xib */; }; - E14874FC18A06951002CC4F3 /* InboxFeedTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB053C18170B33006006FC /* InboxFeedTableViewCell.xib */; }; E14874FD18A06951002CC4F3 /* LeftSideMenuCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = B9B89C56185A2B7000A24465 /* LeftSideMenuCell.xib */; }; E14874FE18A06951002CC4F3 /* PreferenceListTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76D713E9182D3E5100C9C9C8 /* PreferenceListTableViewCell.xib */; }; E14874FF18A06951002CC4F3 /* UnseenWhisperUserCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = B9EB5AC81884D387007CBB57 /* UnseenWhisperUserCell.xib */; }; E148750018A06966002CC4F3 /* CallAudioManagerDemo.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB051D18170B33006006FC /* CallAudioManagerDemo.xib */; }; - E148750118A06966002CC4F3 /* CallLogViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB052718170B33006006FC /* CallLogViewController.xib */; }; - E148750218A06966002CC4F3 /* ContactBrowseViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB051E18170B33006006FC /* ContactBrowseViewController.xib */; }; E148750318A06966002CC4F3 /* ContactDetailTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB051F18170B33006006FC /* ContactDetailTableViewCell.xib */; }; E148750418A06966002CC4F3 /* ContactDetailViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB052018170B33006006FC /* ContactDetailViewController.xib */; }; E148750518A06966002CC4F3 /* CountryCodeViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = B97CBFA718860EA3008E0DE9 /* CountryCodeViewController.xib */; }; E148750618A06966002CC4F3 /* DialerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB052118170B33006006FC /* DialerViewController.xib */; }; - E148750818A06966002CC4F3 /* FavouritesViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB052318170B33006006FC /* FavouritesViewController.xib */; }; - E148750918A06966002CC4F3 /* InboxFeedViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB052418170B33006006FC /* InboxFeedViewController.xib */; }; E148750A18A06966002CC4F3 /* InCallViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB052518170B33006006FC /* InCallViewController.xib */; }; - E148750B18A06966002CC4F3 /* InviteContactsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = B9CA51B918809ACA007E204E /* InviteContactsViewController.xib */; }; - E148750C18A06966002CC4F3 /* LeftSideMenuViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB052618170B33006006FC /* LeftSideMenuViewController.xib */; }; E148750D18A06966002CC4F3 /* PreferenceListViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76B8189D182C39460088060E /* PreferenceListViewController.xib */; }; E148750E18A06966002CC4F3 /* RegisterViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB052918170B33006006FC /* RegisterViewController.xib */; }; - E148750F18A06966002CC4F3 /* SettingsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB052A18170B33006006FC /* SettingsViewController.xib */; }; - E148751018A06966002CC4F3 /* TabBarParentViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB051B18170B33006006FC /* TabBarParentViewController.xib */; }; E148751218A06AFD002CC4F3 /* HelveticaNeueLTStd-Bd.otf in Resources */ = {isa = PBXBuildFile; fileRef = B96A30FE187DA1B600648F3E /* HelveticaNeueLTStd-Bd.otf */; }; E148751318A06AFD002CC4F3 /* HelveticaNeueLTStd-Th.otf in Resources */ = {isa = PBXBuildFile; fileRef = 765052B1182BF839008313E1 /* HelveticaNeueLTStd-Th.otf */; }; E148751418A06AFD002CC4F3 /* HelveticaNeueLTStd-Lt.otf in Resources */ = {isa = PBXBuildFile; fileRef = 765052A518294C9F008313E1 /* HelveticaNeueLTStd-Lt.otf */; }; @@ -551,8 +584,6 @@ E16E5BEF18AAC40200B7C403 /* EC25KeyAgreementProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = E16E5BEB18AAC40200B7C403 /* EC25KeyAgreementProtocol.m */; }; E16E5BF018AAC40200B7C403 /* EvpKeyAgreement.m in Sources */ = {isa = PBXBuildFile; fileRef = E16E5BED18AAC40200B7C403 /* EvpKeyAgreement.m */; }; E16E5BF918AAF02100B7C403 /* EC25AgreerTest.m in Sources */ = {isa = PBXBuildFile; fileRef = E16E5BF818AAF02100B7C403 /* EC25AgreerTest.m */; }; - E16E5C1418AEDB5A00B7C403 /* message_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = E16E5C1218AEDB5A00B7C403 /* message_icon.png */; }; - E16E5C1518AEDB5A00B7C403 /* phone_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = E16E5C1318AEDB5A00B7C403 /* phone_icon.png */; }; E19167A418A9687800B7A468 /* DH3KKeyAgreementParticipant.m in Sources */ = {isa = PBXBuildFile; fileRef = E19167A318A9687800B7A468 /* DH3KKeyAgreementParticipant.m */; }; E197B60C18BBEC1A00F073E5 /* AudioPacker.m in Sources */ = {isa = PBXBuildFile; fileRef = E197B5E918BBEC1A00F073E5 /* AudioPacker.m */; }; E197B60D18BBEC1A00F073E5 /* AudioSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = E197B5EB18BBEC1A00F073E5 /* AudioSocket.m */; }; @@ -578,24 +609,9 @@ FC31962A1A067D8F0094C78E /* MessageComposeTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FC3196291A067D8F0094C78E /* MessageComposeTableViewController.m */; }; FC31962D1A06A2190094C78E /* FingerprintViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FC31962C1A06A2190094C78E /* FingerprintViewController.m */; }; FC3196301A0814130094C78E /* SettingsTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FC31962F1A0814130094C78E /* SettingsTableViewController.m */; }; - FC4F9FE51A16258C00DA100A /* logo_intro@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FC4F9FE41A16258C00DA100A /* logo_intro@2x.png */; }; - FC4F9FED1A1658EE00DA100A /* call@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FC4F9FEC1A1658EE00DA100A /* call@2x.png */; }; - FC4F9FF31A1664EA00DA100A /* mute_off@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FC4F9FEE1A1664EA00DA100A /* mute_off@2x.png */; }; - FC4F9FF41A1664EA00DA100A /* speaker_off@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FC4F9FEF1A1664EA00DA100A /* speaker_off@2x.png */; }; - FC4F9FF51A1664EA00DA100A /* speaker_on@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FC4F9FF01A1664EA00DA100A /* speaker_on@2x.png */; }; - FC4F9FF61A1664EA00DA100A /* mute_on@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FC4F9FF11A1664EA00DA100A /* mute_on@2x.png */; }; - FC4F9FF71A1664EA00DA100A /* endcall@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FC4F9FF21A1664EA00DA100A /* endcall@2x.png */; }; - FC4F9FFD1A179FCF00DA100A /* lock@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FC4F9FFC1A179FCF00DA100A /* lock@2x.png */; }; - FC4F9FFF1A17A39E00DA100A /* photo@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FC4F9FFE1A17A39E00DA100A /* photo@2x.png */; }; - FC4FA0071A18BDAE00DA100A /* info@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FC4FA0061A18BDAE00DA100A /* info@2x.png */; }; - FC4FA0091A18BF3100DA100A /* lock_white@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FC4FA0081A18BF3100DA100A /* lock_white@2x.png */; }; - FC4FA00D1A18CC4300DA100A /* shred@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FC4FA00C1A18CC4300DA100A /* shred@2x.png */; }; - FC4FA0171A1A180D00DA100A /* red-delete@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FC4FA0131A1A180D00DA100A /* red-delete@2x.png */; }; - FC4FA0181A1A180D00DA100A /* delete@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FC4FA0141A1A180D00DA100A /* delete@2x.png */; }; - FC4FA0191A1A180D00DA100A /* archive@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FC4FA0151A1A180D00DA100A /* archive@2x.png */; }; - FC4FA01A1A1A180D00DA100A /* blue-archive@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FC4FA0161A1A180D00DA100A /* blue-archive@2x.png */; }; FC4FA0231A1B8A8D00DA100A /* Socket.m in Sources */ = {isa = PBXBuildFile; fileRef = FC4FA0221A1B8A8D00DA100A /* Socket.m */; }; FC4FA0261A1B9DC600DA100A /* SignalsNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = FC4FA0251A1B9DC600DA100A /* SignalsNavigationController.m */; }; + FC4FA0331A1D46AE00DA100A /* InitialViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FC4FA0321A1D46AE00DA100A /* InitialViewController.m */; }; FCAC963519FEF4E20046DFC5 /* Storyboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FCAC963419FEF4E20046DFC5 /* Storyboard.storyboard */; }; FCAC963C19FEF9280046DFC5 /* SignalsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FCAC963B19FEF9280046DFC5 /* SignalsViewController.m */; }; FCAC964019FEF99A0046DFC5 /* TableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = FCAC963E19FEF99A0046DFC5 /* TableViewCell.m */; }; @@ -603,25 +619,9 @@ FCAC964419FEFD8B0046DFC5 /* DemoDataFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = FCAC964319FEFD8B0046DFC5 /* DemoDataFactory.m */; }; FCAC964719FEFE1A0046DFC5 /* DemoDataModel.m in Sources */ = {isa = PBXBuildFile; fileRef = FCAC964619FEFE1A0046DFC5 /* DemoDataModel.m */; }; FCAC965119FF0A6E0046DFC5 /* MessagesViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FCAC965019FF0A6E0046DFC5 /* MessagesViewController.m */; }; - FCAFC2EC1A0C469C00AE5136 /* checkmark.png in Resources */ = {isa = PBXBuildFile; fileRef = FCAFC2EB1A0C469C00AE5136 /* checkmark.png */; }; - FCAFC2EE1A0C472200AE5136 /* reply.png in Resources */ = {isa = PBXBuildFile; fileRef = FCAFC2ED1A0C472200AE5136 /* reply.png */; }; - FCAFC2F11A0C4ACF00AE5136 /* received.png in Resources */ = {isa = PBXBuildFile; fileRef = FCAFC2EF1A0C4ACF00AE5136 /* received.png */; }; - FCAFC2F21A0C4ACF00AE5136 /* missed.png in Resources */ = {isa = PBXBuildFile; fileRef = FCAFC2F01A0C4ACF00AE5136 /* missed.png */; }; - FCAFC30C1A0C560E00AE5136 /* signals.png in Resources */ = {isa = PBXBuildFile; fileRef = FCAFC3091A0C560E00AE5136 /* signals.png */; }; - FCAFC30D1A0C560E00AE5136 /* settings.png in Resources */ = {isa = PBXBuildFile; fileRef = FCAFC30A1A0C560E00AE5136 /* settings.png */; }; - FCAFC3211A0D394300AE5136 /* favourite.png in Resources */ = {isa = PBXBuildFile; fileRef = FCAFC3201A0D394300AE5136 /* favourite.png */; }; - FCAFC3281A0D466F00AE5136 /* delete_history@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FCAFC3251A0D466F00AE5136 /* delete_history@2x.png */; }; - FCAFC3291A0D466F00AE5136 /* signal@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FCAFC3261A0D466F00AE5136 /* signal@2x.png */; }; - FCAFC32A1A0D466F00AE5136 /* call_dark@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FCAFC3271A0D466F00AE5136 /* call_dark@2x.png */; }; - FCAFC32E1A0D46D500AE5136 /* settings_dark@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FCAFC32D1A0D46D500AE5136 /* settings_dark@2x.png */; }; - FCAFC3301A0D5E3000AE5136 /* share@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FCAFC32F1A0D5E3000AE5136 /* share@2x.png */; }; - FCAFC3341A0D656100AE5136 /* contacts_tab@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FCAFC3331A0D656100AE5136 /* contacts_tab@2x.png */; }; - FCAFC3361A0D680100AE5136 /* keypad@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FCAFC3351A0D680100AE5136 /* keypad@2x.png */; }; FCAFC33F1A0F948F00AE5136 /* ActionContactDetailCell.m in Sources */ = {isa = PBXBuildFile; fileRef = FCAFC33E1A0F948F00AE5136 /* ActionContactDetailCell.m */; }; FCB11D8A1A1284BB002F93FB /* SettingsTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = FCB11D891A1284BB002F93FB /* SettingsTableViewCell.m */; }; FCB11D8C1A129A76002F93FB /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FCB11D8B1A129A76002F93FB /* CoreMedia.framework */; }; - FCB11D8F1A12A388002F93FB /* savephoto@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FCB11D8D1A12A388002F93FB /* savephoto@2x.png */; }; - FCB11D901A12A388002F93FB /* quit@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FCB11D8E1A12A388002F93FB /* quit@2x.png */; }; FCB11D931A12A4AA002F93FB /* FullImageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FCB11D921A12A4AA002F93FB /* FullImageViewController.m */; }; FCF72A081A01A765006BC849 /* ContactsTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FCF72A071A01A765006BC849 /* ContactsTableViewController.m */; }; FCF72A131A02D27F006BC849 /* ContactDetailTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FCF72A111A02D27F006BC849 /* ContactDetailTableViewController.m */; }; @@ -681,56 +681,12 @@ 7038632418F70C0700D4A43F /* CryptoTools.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CryptoTools.m; sourceTree = ""; }; 7038632518F70C0700D4A43F /* EvpSymetricUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EvpSymetricUtil.h; sourceTree = ""; }; 7038632618F70C0700D4A43F /* EvpSymetricUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EvpSymetricUtil.m; sourceTree = ""; }; - 707E548A18FF0B8A00C8649D /* InviteContactModal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InviteContactModal.h; sourceTree = ""; }; - 707E548B18FF0B8A00C8649D /* InviteContactModal.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InviteContactModal.m; sourceTree = ""; }; 707E549018FF26E800C8649D /* SmsInvite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SmsInvite.h; sourceTree = ""; }; 707E549118FF26E800C8649D /* SmsInvite.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SmsInvite.m; sourceTree = ""; }; 7095B7AE18F46D35002C66E2 /* PhoneNumberUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PhoneNumberUtil.h; sourceTree = ""; }; 7095B7AF18F46D35002C66E2 /* PhoneNumberUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PhoneNumberUtil.m; sourceTree = ""; }; 70B8009E190C529C0042E3F0 /* spandsp.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = spandsp.xcodeproj; path = Libraries/spandsp/spandsp/spandsp.xcodeproj; sourceTree = ""; }; 70B800A7190C54790042E3F0 /* speex.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = speex.xcodeproj; path = Libraries/speex/speex.xcodeproj; sourceTree = ""; }; - 70B800E2190C55660042E3F0 /* AbstractMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AbstractMessage.h; sourceTree = ""; }; - 70B800E3190C55660042E3F0 /* AbstractMessage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AbstractMessage.m; sourceTree = ""; }; - 70B800E4190C55660042E3F0 /* AbstractMessage_Builder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AbstractMessage_Builder.h; sourceTree = ""; }; - 70B800E5190C55660042E3F0 /* AbstractMessage_Builder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AbstractMessage_Builder.m; sourceTree = ""; }; - 70B800E6190C55660042E3F0 /* Bootstrap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Bootstrap.h; sourceTree = ""; }; - 70B800E7190C55660042E3F0 /* CodedInputStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CodedInputStream.h; sourceTree = ""; }; - 70B800E8190C55660042E3F0 /* CodedInputStream.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CodedInputStream.m; sourceTree = ""; }; - 70B800E9190C55660042E3F0 /* CodedOutputStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CodedOutputStream.h; sourceTree = ""; }; - 70B800EA190C55660042E3F0 /* CodedOutputStream.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CodedOutputStream.m; sourceTree = ""; }; - 70B800EB190C55660042E3F0 /* ConcreteExtensionField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConcreteExtensionField.h; sourceTree = ""; }; - 70B800EC190C55660042E3F0 /* ConcreteExtensionField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConcreteExtensionField.m; sourceTree = ""; }; - 70B800ED190C55660042E3F0 /* ExtendableMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExtendableMessage.h; sourceTree = ""; }; - 70B800EE190C55660042E3F0 /* ExtendableMessage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ExtendableMessage.m; sourceTree = ""; }; - 70B800EF190C55660042E3F0 /* ExtendableMessage_Builder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExtendableMessage_Builder.h; sourceTree = ""; }; - 70B800F0190C55660042E3F0 /* ExtendableMessage_Builder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ExtendableMessage_Builder.m; sourceTree = ""; }; - 70B800F1190C55660042E3F0 /* ExtensionField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExtensionField.h; sourceTree = ""; }; - 70B800F2190C55660042E3F0 /* ExtensionRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExtensionRegistry.h; sourceTree = ""; }; - 70B800F3190C55660042E3F0 /* ExtensionRegistry.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ExtensionRegistry.m; sourceTree = ""; }; - 70B800F4190C55660042E3F0 /* Field.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Field.h; sourceTree = ""; }; - 70B800F5190C55660042E3F0 /* Field.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Field.m; sourceTree = ""; }; - 70B800F6190C55660042E3F0 /* ForwardDeclarations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ForwardDeclarations.h; sourceTree = ""; }; - 70B800F7190C55660042E3F0 /* GeneratedMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeneratedMessage.h; sourceTree = ""; }; - 70B800F8190C55660042E3F0 /* GeneratedMessage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedMessage.m; sourceTree = ""; }; - 70B800F9190C55660042E3F0 /* GeneratedMessage_Builder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeneratedMessage_Builder.h; sourceTree = ""; }; - 70B800FA190C55660042E3F0 /* GeneratedMessage_Builder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedMessage_Builder.m; sourceTree = ""; }; - 70B800FB190C55660042E3F0 /* Message.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Message.h; sourceTree = ""; }; - 70B800FC190C55660042E3F0 /* Message_Builder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Message_Builder.h; sourceTree = ""; }; - 70B800FD190C55660042E3F0 /* MutableExtensionRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MutableExtensionRegistry.h; sourceTree = ""; }; - 70B800FE190C55660042E3F0 /* MutableExtensionRegistry.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MutableExtensionRegistry.m; sourceTree = ""; }; - 70B800FF190C55660042E3F0 /* MutableField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MutableField.h; sourceTree = ""; }; - 70B80100190C55660042E3F0 /* MutableField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MutableField.m; sourceTree = ""; }; - 70B80101190C55660042E3F0 /* ProtocolBuffers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProtocolBuffers.h; sourceTree = ""; }; - 70B80102190C55660042E3F0 /* TextFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextFormat.h; sourceTree = ""; }; - 70B80103190C55660042E3F0 /* TextFormat.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TextFormat.m; sourceTree = ""; }; - 70B80104190C55660042E3F0 /* UnknownFieldSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnknownFieldSet.h; sourceTree = ""; }; - 70B80105190C55660042E3F0 /* UnknownFieldSet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UnknownFieldSet.m; sourceTree = ""; }; - 70B80106190C55660042E3F0 /* UnknownFieldSet_Builder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnknownFieldSet_Builder.h; sourceTree = ""; }; - 70B80107190C55660042E3F0 /* UnknownFieldSet_Builder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UnknownFieldSet_Builder.m; sourceTree = ""; }; - 70B80108190C55660042E3F0 /* Utilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Utilities.h; sourceTree = ""; }; - 70B80109190C55660042E3F0 /* Utilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Utilities.m; sourceTree = ""; }; - 70B8010A190C55660042E3F0 /* WireFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WireFormat.h; sourceTree = ""; }; - 70B8010B190C55660042E3F0 /* WireFormat.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WireFormat.m; sourceTree = ""; }; 70B8FEE11909FE360042E3F0 /* 171756__nenadsimic__picked-coin-echo-2.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = "171756__nenadsimic__picked-coin-echo-2.wav"; sourceTree = ""; }; 70BAFD5B190584BE00FA5E0B /* NotificationTracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotificationTracker.h; sourceTree = ""; }; 70BAFD5C190584BE00FA5E0B /* NotificationTracker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NotificationTracker.m; sourceTree = ""; }; @@ -747,9 +703,6 @@ 768A1A2A17FC9CD300E00ED8 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; 76919BF61805D190008C664A /* ContactManagerTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ContactManagerTest.m; path = contact/ContactManagerTest.m; sourceTree = ""; }; 76B8189D182C39460088060E /* PreferenceListViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = PreferenceListViewController.xib; path = ../PreferenceListViewController.xib; sourceTree = ""; }; - 76C87F11181EE11C00C4ACAB /* InboxFeedFooterCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InboxFeedFooterCell.h; sourceTree = ""; }; - 76C87F12181EE11C00C4ACAB /* InboxFeedFooterCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InboxFeedFooterCell.m; sourceTree = ""; }; - 76C87F15181EE2EB00C4ACAB /* InboxFeedFooterCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = InboxFeedFooterCell.xib; path = ../InboxFeedFooterCell.xib; sourceTree = ""; }; 76C87F18181EFCE600C4ACAB /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = System/Library/Frameworks/MediaPlayer.framework; sourceTree = SDKROOT; }; 76D713E5182D3E3F00C9C9C8 /* PreferenceListTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PreferenceListTableViewCell.h; sourceTree = ""; }; 76D713E6182D3E3F00C9C9C8 /* PreferenceListTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PreferenceListTableViewCell.m; sourceTree = ""; }; @@ -960,54 +913,27 @@ 76EB04FB18170B33006006FC /* Util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Util.h; sourceTree = ""; }; 76EB04FC18170B33006006FC /* Zid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Zid.h; sourceTree = ""; }; 76EB04FD18170B33006006FC /* Zid.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Zid.m; sourceTree = ""; }; - 76EB050118170B33006006FC /* ContactBrowseViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactBrowseViewController.h; sourceTree = ""; }; - 76EB050218170B33006006FC /* ContactBrowseViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContactBrowseViewController.m; sourceTree = ""; }; 76EB050318170B33006006FC /* ContactDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactDetailViewController.h; sourceTree = ""; }; 76EB050418170B33006006FC /* ContactDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContactDetailViewController.m; sourceTree = ""; }; 76EB050518170B33006006FC /* DialerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DialerViewController.h; sourceTree = ""; }; 76EB050618170B33006006FC /* DialerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DialerViewController.m; sourceTree = ""; }; - 76EB050718170B33006006FC /* FavouritesViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FavouritesViewController.h; sourceTree = ""; }; - 76EB050818170B33006006FC /* FavouritesViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FavouritesViewController.m; sourceTree = ""; }; - 76EB050918170B33006006FC /* InboxFeedViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InboxFeedViewController.h; sourceTree = ""; }; - 76EB050A18170B33006006FC /* InboxFeedViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InboxFeedViewController.m; sourceTree = ""; }; 76EB050B18170B33006006FC /* InCallViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InCallViewController.h; sourceTree = ""; }; 76EB050C18170B33006006FC /* InCallViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InCallViewController.m; sourceTree = ""; }; - 76EB050D18170B33006006FC /* LeftSideMenuViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LeftSideMenuViewController.h; sourceTree = ""; }; - 76EB050E18170B33006006FC /* LeftSideMenuViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LeftSideMenuViewController.m; sourceTree = ""; }; 76EB050F18170B33006006FC /* NextResponderScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NextResponderScrollView.h; sourceTree = ""; }; 76EB051018170B33006006FC /* NextResponderScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NextResponderScrollView.m; sourceTree = ""; }; - 76EB051118170B33006006FC /* CallLogViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallLogViewController.h; sourceTree = ""; }; - 76EB051218170B33006006FC /* CallLogViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CallLogViewController.m; sourceTree = ""; }; 76EB051518170B33006006FC /* RegisterViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterViewController.h; sourceTree = ""; }; 76EB051618170B33006006FC /* RegisterViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RegisterViewController.m; sourceTree = ""; }; - 76EB051718170B33006006FC /* SettingsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingsViewController.h; sourceTree = ""; }; - 76EB051818170B33006006FC /* SettingsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SettingsViewController.m; sourceTree = ""; }; - 76EB051918170B33006006FC /* TabBarParentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TabBarParentViewController.h; sourceTree = ""; }; - 76EB051A18170B33006006FC /* TabBarParentViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TabBarParentViewController.m; sourceTree = ""; }; - 76EB051B18170B33006006FC /* TabBarParentViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = TabBarParentViewController.xib; path = ../TabBarParentViewController.xib; sourceTree = ""; }; 76EB051D18170B33006006FC /* CallAudioManagerDemo.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CallAudioManagerDemo.xib; sourceTree = ""; }; - 76EB051E18170B33006006FC /* ContactBrowseViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ContactBrowseViewController.xib; sourceTree = ""; }; 76EB051F18170B33006006FC /* ContactDetailTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ContactDetailTableViewCell.xib; sourceTree = ""; }; 76EB052018170B33006006FC /* ContactDetailViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ContactDetailViewController.xib; sourceTree = ""; }; 76EB052118170B33006006FC /* DialerViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DialerViewController.xib; sourceTree = ""; }; - 76EB052318170B33006006FC /* FavouritesViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = FavouritesViewController.xib; sourceTree = ""; }; - 76EB052418170B33006006FC /* InboxFeedViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = InboxFeedViewController.xib; sourceTree = ""; }; 76EB052518170B33006006FC /* InCallViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = InCallViewController.xib; sourceTree = ""; }; - 76EB052618170B33006006FC /* LeftSideMenuViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LeftSideMenuViewController.xib; sourceTree = ""; }; - 76EB052718170B33006006FC /* CallLogViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CallLogViewController.xib; sourceTree = ""; }; 76EB052918170B33006006FC /* RegisterViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RegisterViewController.xib; sourceTree = ""; }; - 76EB052A18170B33006006FC /* SettingsViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SettingsViewController.xib; sourceTree = ""; }; 76EB052C18170B33006006FC /* ContactDetailTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactDetailTableViewCell.h; sourceTree = ""; }; 76EB052D18170B33006006FC /* ContactDetailTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContactDetailTableViewCell.m; sourceTree = ""; }; 76EB052E18170B33006006FC /* ContactTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactTableViewCell.h; sourceTree = ""; }; 76EB052F18170B33006006FC /* ContactTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContactTableViewCell.m; sourceTree = ""; }; - 76EB053418170B33006006FC /* InboxFeedTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InboxFeedTableViewCell.h; sourceTree = ""; }; - 76EB053518170B33006006FC /* InboxFeedTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InboxFeedTableViewCell.m; sourceTree = ""; }; - 76EB053618170B33006006FC /* CallLogTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallLogTableViewCell.h; sourceTree = ""; }; - 76EB053718170B33006006FC /* CallLogTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CallLogTableViewCell.m; sourceTree = ""; }; 76EB053A18170B33006006FC /* ContactTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ContactTableViewCell.xib; sourceTree = ""; }; - 76EB053C18170B33006006FC /* InboxFeedTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = InboxFeedTableViewCell.xib; sourceTree = ""; }; - 76EB053F18170B33006006FC /* CallLogTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CallLogTableViewCell.xib; sourceTree = ""; }; 8313AE91B4954215858A5662 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; 91E46203423941C0C94D90E9 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; 9CC6C6BD3B51923FD6317C94 /* Pods.ad-hoc distribution.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods.ad-hoc distribution.xcconfig"; path = "Pods/Target Support Files/Pods/Pods.ad-hoc distribution.xcconfig"; sourceTree = ""; }; @@ -1067,6 +993,128 @@ B60C16631988999D00E97A6C /* VersionMigrations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VersionMigrations.h; sourceTree = ""; }; B60C16641988999D00E97A6C /* VersionMigrations.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VersionMigrations.m; sourceTree = ""; }; B60EDE031A05A01700D73516 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; + B633C4FE1A1D190B0059AC12 /* archive@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "archive@2x.png"; sourceTree = ""; }; + B633C4FF1A1D190B0059AC12 /* archive_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = archive_icon.png; sourceTree = ""; }; + B633C5001A1D190B0059AC12 /* archive_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "archive_icon@2x.png"; sourceTree = ""; }; + B633C5011A1D190B0059AC12 /* backspace.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = backspace.png; sourceTree = ""; }; + B633C5021A1D190B0059AC12 /* backspace@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "backspace@2x.png"; sourceTree = ""; }; + B633C5031A1D190B0059AC12 /* blue-archive@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "blue-archive@2x.png"; sourceTree = ""; }; + B633C5041A1D190B0059AC12 /* call@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "call@2x.png"; sourceTree = ""; }; + B633C5051A1D190B0059AC12 /* call_dark@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "call_dark@2x.png"; sourceTree = ""; }; + B633C5061A1D190B0059AC12 /* checkbox_checkmark.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = checkbox_checkmark.png; sourceTree = ""; }; + B633C5071A1D190B0059AC12 /* checkbox_checkmark@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "checkbox_checkmark@2x.png"; sourceTree = ""; }; + B633C5081A1D190B0059AC12 /* checkbox_empty.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = checkbox_empty.png; sourceTree = ""; }; + B633C5091A1D190B0059AC12 /* checkbox_empty@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "checkbox_empty@2x.png"; sourceTree = ""; }; + B633C50A1A1D190B0059AC12 /* checkmark.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = checkmark.png; sourceTree = ""; }; + B633C50B1A1D190B0059AC12 /* contact_default_feed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = contact_default_feed.png; sourceTree = ""; }; + B633C50C1A1D190B0059AC12 /* contacts.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = contacts.png; sourceTree = ""; }; + B633C50D1A1D190B0059AC12 /* contacts@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "contacts@2x.png"; sourceTree = ""; }; + B633C50E1A1D190B0059AC12 /* contacts_arrow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = contacts_arrow.png; sourceTree = ""; }; + B633C50F1A1D190B0059AC12 /* contacts_arrow@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "contacts_arrow@2x.png"; sourceTree = ""; }; + B633C5101A1D190B0059AC12 /* contacts_tab@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "contacts_tab@2x.png"; sourceTree = ""; }; + B633C5141A1D190B0059AC12 /* DefaultContactImage.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = DefaultContactImage.png; sourceTree = ""; }; + B633C5151A1D190B0059AC12 /* delete@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "delete@2x.png"; sourceTree = ""; }; + B633C5161A1D190B0059AC12 /* delete_history@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "delete_history@2x.png"; sourceTree = ""; }; + B633C5171A1D190B0059AC12 /* dismiss_notification_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = dismiss_notification_icon.png; sourceTree = ""; }; + B633C5181A1D190B0059AC12 /* dismiss_notification_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "dismiss_notification_icon@2x.png"; sourceTree = ""; }; + B633C5191A1D190B0059AC12 /* drop_down_arrow_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = drop_down_arrow_icon.png; sourceTree = ""; }; + B633C51A1A1D190B0059AC12 /* drop_down_arrow_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "drop_down_arrow_icon@2x.png"; sourceTree = ""; }; + B633C51B1A1D190B0059AC12 /* endcall@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "endcall@2x.png"; sourceTree = ""; }; + B633C51C1A1D190B0059AC12 /* expanded_cell_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = expanded_cell_icon.png; sourceTree = ""; }; + B633C51D1A1D190B0059AC12 /* expanded_cell_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "expanded_cell_icon@2x.png"; sourceTree = ""; }; + B633C51E1A1D190B0059AC12 /* favourite.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = favourite.png; sourceTree = ""; }; + B633C51F1A1D190B0059AC12 /* favourite_false_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = favourite_false_icon.png; sourceTree = ""; }; + B633C5201A1D190B0059AC12 /* favourite_false_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "favourite_false_icon@2x.png"; sourceTree = ""; }; + B633C5211A1D190B0059AC12 /* favourite_true_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = favourite_true_icon.png; sourceTree = ""; }; + B633C5221A1D190B0059AC12 /* favourite_true_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "favourite_true_icon@2x.png"; sourceTree = ""; }; + B633C5231A1D190B0059AC12 /* forward_button.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = forward_button.png; sourceTree = ""; }; + B633C5241A1D190B0059AC12 /* forward_button@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "forward_button@2x.png"; sourceTree = ""; }; + B633C5251A1D190B0059AC12 /* home_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = home_icon.png; sourceTree = ""; }; + B633C5261A1D190B0059AC12 /* icon_contacts.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon_contacts.png; sourceTree = ""; }; + B633C5271A1D190B0059AC12 /* icon_favourites.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon_favourites.png; sourceTree = ""; }; + B633C5281A1D190B0059AC12 /* icon_keypad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon_keypad.png; sourceTree = ""; }; + B633C5291A1D190B0059AC12 /* icon_recents.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon_recents.png; sourceTree = ""; }; + B633C52A1A1D190B0059AC12 /* in_call_phone_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = in_call_phone_icon.png; sourceTree = ""; }; + B633C52B1A1D190B0059AC12 /* in_call_phone_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "in_call_phone_icon@2x.png"; sourceTree = ""; }; + B633C52C1A1D190B0059AC12 /* in_call_phrase_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = in_call_phrase_icon.png; sourceTree = ""; }; + B633C52D1A1D190B0059AC12 /* in_call_phrase_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "in_call_phrase_icon@2x.png"; sourceTree = ""; }; + B633C52E1A1D190B0059AC12 /* incoming_call_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = incoming_call_icon.png; sourceTree = ""; }; + B633C52F1A1D190B0059AC12 /* incoming_call_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "incoming_call_icon@2x.png"; sourceTree = ""; }; + B633C5301A1D190B0059AC12 /* info@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "info@2x.png"; sourceTree = ""; }; + B633C5321A1D190B0059AC12 /* keypad@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "keypad@2x.png"; sourceTree = ""; }; + B633C5331A1D190B0059AC12 /* lock@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "lock@2x.png"; sourceTree = ""; }; + B633C5341A1D190B0059AC12 /* lock_white@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "lock_white@2x.png"; sourceTree = ""; }; + B633C5351A1D190B0059AC12 /* logo_intro@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "logo_intro@2x.png"; sourceTree = ""; }; + B633C5371A1D190B0059AC12 /* menu_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_icon.png; sourceTree = ""; }; + B633C5381A1D190B0059AC12 /* menu_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "menu_icon@2x.png"; sourceTree = ""; }; + B633C5391A1D190B0059AC12 /* message_bubble.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = message_bubble.png; sourceTree = ""; }; + B633C53A1A1D190B0059AC12 /* message_bubble@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "message_bubble@2x.png"; sourceTree = ""; }; + B633C53B1A1D190B0059AC12 /* message_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = message_icon.png; sourceTree = ""; }; + B633C53C1A1D190B0059AC12 /* missed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = missed.png; sourceTree = ""; }; + B633C53D1A1D190B0059AC12 /* mute_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = mute_icon.png; sourceTree = ""; }; + B633C53E1A1D190B0059AC12 /* mute_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "mute_icon@2x.png"; sourceTree = ""; }; + B633C53F1A1D190B0059AC12 /* mute_icon_selected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = mute_icon_selected.png; sourceTree = ""; }; + B633C5401A1D190B0059AC12 /* mute_icon_selected@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "mute_icon_selected@2x.png"; sourceTree = ""; }; + B633C5411A1D190B0059AC12 /* mute_off@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "mute_off@2x.png"; sourceTree = ""; }; + B633C5421A1D190B0059AC12 /* mute_on@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "mute_on@2x.png"; sourceTree = ""; }; + B633C5431A1D190B0059AC12 /* notification_detail_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = notification_detail_icon.png; sourceTree = ""; }; + B633C5441A1D190B0059AC12 /* notification_detail_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "notification_detail_icon@2x.png"; sourceTree = ""; }; + B633C5451A1D190B0059AC12 /* notification_mini_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = notification_mini_icon.png; sourceTree = ""; }; + B633C5461A1D190B0059AC12 /* notification_mini_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "notification_mini_icon@2x.png"; sourceTree = ""; }; + B633C5471A1D190B0059AC12 /* outgoing_call_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = outgoing_call_icon.png; sourceTree = ""; }; + B633C5481A1D190B0059AC12 /* outgoing_call_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "outgoing_call_icon@2x.png"; sourceTree = ""; }; + B633C5491A1D190B0059AC12 /* phone_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = phone_icon.png; sourceTree = ""; }; + B633C54A1A1D190B0059AC12 /* phone_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "phone_icon@2x.png"; sourceTree = ""; }; + B633C54B1A1D190B0059AC12 /* photo@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "photo@2x.png"; sourceTree = ""; }; + B633C54C1A1D190B0059AC12 /* quit@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "quit@2x.png"; sourceTree = ""; }; + B633C54D1A1D190B0059AC12 /* received.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = received.png; sourceTree = ""; }; + B633C54E1A1D190B0059AC12 /* red-delete@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "red-delete@2x.png"; sourceTree = ""; }; + B633C54F1A1D190B0059AC12 /* reply.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = reply.png; sourceTree = ""; }; + B633C5501A1D190B0059AC12 /* savephoto@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "savephoto@2x.png"; sourceTree = ""; }; + B633C5511A1D190B0059AC12 /* search_cancel.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = search_cancel.png; sourceTree = ""; }; + B633C5521A1D190B0059AC12 /* search_cancel@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "search_cancel@2x.png"; sourceTree = ""; }; + B633C5531A1D190B0059AC12 /* search_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = search_icon.png; sourceTree = ""; }; + B633C5541A1D190B0059AC12 /* search_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "search_icon@2x.png"; sourceTree = ""; }; + B633C5551A1D190B0059AC12 /* send_code_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = send_code_icon.png; sourceTree = ""; }; + B633C5561A1D190B0059AC12 /* send_code_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "send_code_icon@2x.png"; sourceTree = ""; }; + B633C5571A1D190B0059AC12 /* settings.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = settings.png; sourceTree = ""; }; + B633C5581A1D190B0059AC12 /* settings_dark@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "settings_dark@2x.png"; sourceTree = ""; }; + B633C5591A1D190B0059AC12 /* share@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "share@2x.png"; sourceTree = ""; }; + B633C55A1A1D190B0059AC12 /* shred@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "shred@2x.png"; sourceTree = ""; }; + B633C55E1A1D190B0059AC12 /* signal@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "signal@2x.png"; sourceTree = ""; }; + B633C55F1A1D190B0059AC12 /* signals.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = signals.png; sourceTree = ""; }; + B633C5601A1D190B0059AC12 /* speaker_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = speaker_icon.png; sourceTree = ""; }; + B633C5611A1D190B0059AC12 /* speaker_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "speaker_icon@2x.png"; sourceTree = ""; }; + B633C5621A1D190B0059AC12 /* speaker_icon_selected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = speaker_icon_selected.png; sourceTree = ""; }; + B633C5631A1D190B0059AC12 /* speaker_icon_selected@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "speaker_icon_selected@2x.png"; sourceTree = ""; }; + B633C5641A1D190B0059AC12 /* speaker_off@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "speaker_off@2x.png"; sourceTree = ""; }; + B633C5651A1D190B0059AC12 /* speaker_on@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "speaker_on@2x.png"; sourceTree = ""; }; + B633C5661A1D190B0059AC12 /* spinner_connecting.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = spinner_connecting.png; sourceTree = ""; }; + B633C5671A1D190B0059AC12 /* spinner_connecting@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "spinner_connecting@2x.png"; sourceTree = ""; }; + B633C5681A1D190B0059AC12 /* spinner_connecting_flash.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = spinner_connecting_flash.png; sourceTree = ""; }; + B633C5691A1D190B0059AC12 /* spinner_connecting_flash@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "spinner_connecting_flash@2x.png"; sourceTree = ""; }; + B633C56A1A1D190B0059AC12 /* spinner_error.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = spinner_error.png; sourceTree = ""; }; + B633C56B1A1D190B0059AC12 /* spinner_error@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "spinner_error@2x.png"; sourceTree = ""; }; + B633C56C1A1D190B0059AC12 /* spinner_ringing.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = spinner_ringing.png; sourceTree = ""; }; + B633C56D1A1D190B0059AC12 /* spinner_ringing@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "spinner_ringing@2x.png"; sourceTree = ""; }; + B633C56E1A1D190B0059AC12 /* tab_icon_contacts.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tab_icon_contacts.png; sourceTree = ""; }; + B633C56F1A1D190B0059AC12 /* tab_icon_contacts@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tab_icon_contacts@2x.png"; sourceTree = ""; }; + B633C5701A1D190B0059AC12 /* tab_icon_favourites.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tab_icon_favourites.png; sourceTree = ""; }; + B633C5711A1D190B0059AC12 /* tab_icon_favourites@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tab_icon_favourites@2x.png"; sourceTree = ""; }; + B633C5721A1D190B0059AC12 /* tab_icon_inbox.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tab_icon_inbox.png; sourceTree = ""; }; + B633C5731A1D190B0059AC12 /* tab_icon_inbox@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tab_icon_inbox@2x.png"; sourceTree = ""; }; + B633C5741A1D190B0059AC12 /* tab_icon_keypad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tab_icon_keypad.png; sourceTree = ""; }; + B633C5751A1D190B0059AC12 /* tab_icon_keypad@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tab_icon_keypad@2x.png"; sourceTree = ""; }; + B633C5761A1D190B0059AC12 /* tab_icon_menu.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tab_icon_menu.png; sourceTree = ""; }; + B633C5771A1D190B0059AC12 /* tab_icon_menu@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tab_icon_menu@2x.png"; sourceTree = ""; }; + B633C5781A1D190B0059AC12 /* trash_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = trash_icon.png; sourceTree = ""; }; + B633C5791A1D190B0059AC12 /* trash_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "trash_icon@2x.png"; sourceTree = ""; }; + B633C57A1A1D190B0059AC12 /* volume_high.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = volume_high.png; sourceTree = ""; }; + B633C57B1A1D190B0059AC12 /* volume_high@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "volume_high@2x.png"; sourceTree = ""; }; + B633C57C1A1D190B0059AC12 /* volume_low.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = volume_low.png; sourceTree = ""; }; + B633C57D1A1D190B0059AC12 /* volume_low@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "volume_low@2x.png"; sourceTree = ""; }; + B633C57E1A1D190B0059AC12 /* whisper_notification_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = whisper_notification_icon.png; sourceTree = ""; }; + B633C57F1A1D190B0059AC12 /* whisper_notification_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "whisper_notification_icon@2x.png"; sourceTree = ""; }; B63761E119E1F487005735D1 /* AFHTTPSessionManager+SignalMethods.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "AFHTTPSessionManager+SignalMethods.h"; sourceTree = ""; }; B63761E219E1F487005735D1 /* AFHTTPSessionManager+SignalMethods.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "AFHTTPSessionManager+SignalMethods.m"; sourceTree = ""; }; B63761E419E1FBE8005735D1 /* HttpRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpRequest.h; sourceTree = ""; }; @@ -1127,6 +1175,120 @@ B684A46C19C3446200B11029 /* PushManagerTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PushManagerTest.m; path = Signal/test/push/PushManagerTest.m; sourceTree = SOURCE_ROOT; }; B6850E591995A4710068E715 /* whisperFake.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = whisperFake.cer; sourceTree = ""; }; B69CD25019773E79005CE69A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + B6B095DE1A1D25C5008BFAA6 /* CryptographyTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CryptographyTests.mm; sourceTree = ""; }; + B6B095DF1A1D25C5008BFAA6 /* TextSecureKitTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TextSecureKitTests.m; sourceTree = ""; }; + B6B095E01A1D25C5008BFAA6 /* TSMessageStorageTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSMessageStorageTests.m; sourceTree = ""; }; + B6B095E11A1D25C5008BFAA6 /* TSStorageIdentityKeyStoreTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSStorageIdentityKeyStoreTests.m; sourceTree = ""; }; + B6B095E21A1D25C5008BFAA6 /* TSStoragePreKeyStoreTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSStoragePreKeyStoreTests.m; sourceTree = ""; }; + B6B095E31A1D25C5008BFAA6 /* TSStorageSignedPreKeyStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSStorageSignedPreKeyStore.m; sourceTree = ""; }; + B6B095EC1A1D25ED008BFAA6 /* TSAccountManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSAccountManager.h; sourceTree = ""; }; + B6B095ED1A1D25ED008BFAA6 /* TSAccountManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSAccountManager.m; sourceTree = ""; }; + B6B095EE1A1D25ED008BFAA6 /* TSNumberVerifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSNumberVerifier.h; sourceTree = ""; }; + B6B095EF1A1D25ED008BFAA6 /* TSNumberVerifier.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSNumberVerifier.m; sourceTree = ""; }; + B6B095F01A1D25ED008BFAA6 /* TSPreKeyManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSPreKeyManager.h; sourceTree = ""; }; + B6B095F11A1D25ED008BFAA6 /* TSPreKeyManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSPreKeyManager.m; sourceTree = ""; }; + B6B095F41A1D25ED008BFAA6 /* TSContactThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSContactThread.h; sourceTree = ""; }; + B6B095F51A1D25ED008BFAA6 /* TSContactThread.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSContactThread.m; sourceTree = ""; }; + B6B095F61A1D25ED008BFAA6 /* TSGroupThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSGroupThread.h; sourceTree = ""; }; + B6B095F71A1D25ED008BFAA6 /* TSGroupThread.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSGroupThread.m; sourceTree = ""; }; + B6B095F81A1D25ED008BFAA6 /* TSContact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSContact.h; sourceTree = ""; }; + B6B095F91A1D25ED008BFAA6 /* TSContact.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSContact.m; sourceTree = ""; }; + B6B095FA1A1D25ED008BFAA6 /* TSGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSGroup.h; sourceTree = ""; }; + B6B095FB1A1D25ED008BFAA6 /* TSGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSGroup.m; sourceTree = ""; }; + B6B095FC1A1D25ED008BFAA6 /* TSRecipient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSRecipient.h; sourceTree = ""; }; + B6B095FD1A1D25ED008BFAA6 /* TSRecipient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSRecipient.m; sourceTree = ""; }; + B6B095FE1A1D25ED008BFAA6 /* TSThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSThread.h; sourceTree = ""; }; + B6B095FF1A1D25ED008BFAA6 /* TSThread.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSThread.m; sourceTree = ""; }; + B6B096011A1D25ED008BFAA6 /* IncomingPushMessageSignal.pb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IncomingPushMessageSignal.pb.h; sourceTree = ""; }; + B6B096021A1D25ED008BFAA6 /* IncomingPushMessageSignal.pb.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IncomingPushMessageSignal.pb.m; sourceTree = ""; }; + B6B096031A1D25ED008BFAA6 /* TSAttachement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSAttachement.h; sourceTree = ""; }; + B6B096041A1D25ED008BFAA6 /* TSAttachement.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSAttachement.m; sourceTree = ""; }; + B6B096051A1D25ED008BFAA6 /* TSCall.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSCall.h; sourceTree = ""; }; + B6B096061A1D25ED008BFAA6 /* TSCall.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSCall.m; sourceTree = ""; }; + B6B096071A1D25ED008BFAA6 /* TSErrorMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSErrorMessage.h; sourceTree = ""; }; + B6B096081A1D25ED008BFAA6 /* TSErrorMessage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSErrorMessage.m; sourceTree = ""; }; + B6B096091A1D25ED008BFAA6 /* TSGroupMessageManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSGroupMessageManager.h; sourceTree = ""; }; + B6B0960A1A1D25ED008BFAA6 /* TSGroupMessageManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSGroupMessageManager.m; sourceTree = ""; }; + B6B0960B1A1D25ED008BFAA6 /* TSIncomingMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSIncomingMessage.h; sourceTree = ""; }; + B6B0960C1A1D25ED008BFAA6 /* TSIncomingMessage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSIncomingMessage.m; sourceTree = ""; }; + B6B0960D1A1D25ED008BFAA6 /* TSInfoMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSInfoMessage.h; sourceTree = ""; }; + B6B0960E1A1D25ED008BFAA6 /* TSInfoMessage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSInfoMessage.m; sourceTree = ""; }; + B6B0960F1A1D25ED008BFAA6 /* TSInteraction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSInteraction.h; sourceTree = ""; }; + B6B096101A1D25ED008BFAA6 /* TSInteraction.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TSInteraction.mm; sourceTree = ""; }; + B6B096111A1D25ED008BFAA6 /* TSMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSMessage.h; sourceTree = ""; }; + B6B096121A1D25ED008BFAA6 /* TSMessage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSMessage.m; sourceTree = ""; }; + B6B096131A1D25ED008BFAA6 /* TSMessagesManager+sendMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "TSMessagesManager+sendMessages.h"; sourceTree = ""; }; + B6B096141A1D25ED008BFAA6 /* TSMessagesManager+sendMessages.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "TSMessagesManager+sendMessages.m"; sourceTree = ""; }; + B6B096151A1D25ED008BFAA6 /* TSMessagesManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSMessagesManager.h; sourceTree = ""; }; + B6B096161A1D25ED008BFAA6 /* TSMessagesManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSMessagesManager.m; sourceTree = ""; }; + B6B096171A1D25ED008BFAA6 /* TSOutgoingMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSOutgoingMessage.h; sourceTree = ""; }; + B6B096181A1D25ED008BFAA6 /* TSOutgoingMessage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSOutgoingMessage.m; sourceTree = ""; }; + B6B096191A1D25ED008BFAA6 /* TSServerMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSServerMessage.h; sourceTree = ""; }; + B6B0961A1A1D25ED008BFAA6 /* TSServerMessage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSServerMessage.m; sourceTree = ""; }; + B6B0961D1A1D25ED008BFAA6 /* TSContactsIntersectionRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSContactsIntersectionRequest.h; sourceTree = ""; }; + B6B0961E1A1D25ED008BFAA6 /* TSContactsIntersectionRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSContactsIntersectionRequest.m; sourceTree = ""; }; + B6B0961F1A1D25ED008BFAA6 /* TSDeregisterAccountRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSDeregisterAccountRequest.h; sourceTree = ""; }; + B6B096201A1D25ED008BFAA6 /* TSDeregisterAccountRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSDeregisterAccountRequest.m; sourceTree = ""; }; + B6B096211A1D25ED008BFAA6 /* TSRecipientPrekeyRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSRecipientPrekeyRequest.h; sourceTree = ""; }; + B6B096221A1D25ED008BFAA6 /* TSRecipientPrekeyRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSRecipientPrekeyRequest.m; sourceTree = ""; }; + B6B096231A1D25ED008BFAA6 /* TSRegisterForPushRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSRegisterForPushRequest.h; sourceTree = ""; }; + B6B096241A1D25ED008BFAA6 /* TSRegisterForPushRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSRegisterForPushRequest.m; sourceTree = ""; }; + B6B096251A1D25ED008BFAA6 /* TSRegisterPrekeysRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSRegisterPrekeysRequest.h; sourceTree = ""; }; + B6B096261A1D25ED008BFAA6 /* TSRegisterPrekeysRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSRegisterPrekeysRequest.m; sourceTree = ""; }; + B6B096271A1D25ED008BFAA6 /* TSRegisterWithTokenRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSRegisterWithTokenRequest.h; sourceTree = ""; }; + B6B096281A1D25ED008BFAA6 /* TSRegisterWithTokenRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSRegisterWithTokenRequest.m; sourceTree = ""; }; + B6B096291A1D25ED008BFAA6 /* TSRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSRequest.h; sourceTree = ""; }; + B6B0962A1A1D25ED008BFAA6 /* TSRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSRequest.m; sourceTree = ""; }; + B6B0962B1A1D25ED008BFAA6 /* TSRequestAttachment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSRequestAttachment.h; sourceTree = ""; }; + B6B0962C1A1D25ED008BFAA6 /* TSRequestAttachment.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSRequestAttachment.m; sourceTree = ""; }; + B6B0962D1A1D25ED008BFAA6 /* TSRequestAttachmentId.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSRequestAttachmentId.h; sourceTree = ""; }; + B6B0962E1A1D25ED008BFAA6 /* TSRequestAttachmentId.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSRequestAttachmentId.m; sourceTree = ""; }; + B6B0962F1A1D25ED008BFAA6 /* TSRequestVerificationCodeRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSRequestVerificationCodeRequest.h; sourceTree = ""; }; + B6B096301A1D25ED008BFAA6 /* TSRequestVerificationCodeRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSRequestVerificationCodeRequest.m; sourceTree = ""; }; + B6B096311A1D25ED008BFAA6 /* TSServerCodeVerificationRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSServerCodeVerificationRequest.h; sourceTree = ""; }; + B6B096321A1D25ED008BFAA6 /* TSServerCodeVerificationRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSServerCodeVerificationRequest.m; sourceTree = ""; }; + B6B096331A1D25ED008BFAA6 /* TSSubmitMessageRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSSubmitMessageRequest.h; sourceTree = ""; }; + B6B096341A1D25ED008BFAA6 /* TSSubmitMessageRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSSubmitMessageRequest.m; sourceTree = ""; }; + B6B096351A1D25ED008BFAA6 /* TSUploadAttachment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSUploadAttachment.h; sourceTree = ""; }; + B6B096361A1D25ED008BFAA6 /* TSUploadAttachment.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSUploadAttachment.m; sourceTree = ""; }; + B6B096371A1D25ED008BFAA6 /* TSNetworkManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSNetworkManager.h; sourceTree = ""; }; + B6B096381A1D25ED008BFAA6 /* TSNetworkManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSNetworkManager.m; sourceTree = ""; }; + B6B096391A1D25ED008BFAA6 /* TSSocketManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSSocketManager.h; sourceTree = ""; }; + B6B0963A1A1D25ED008BFAA6 /* TSSocketManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSSocketManager.m; sourceTree = ""; }; + B6B0963C1A1D25ED008BFAA6 /* SecurityUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecurityUtils.h; sourceTree = ""; }; + B6B0963D1A1D25ED008BFAA6 /* SecurityUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SecurityUtils.m; sourceTree = ""; }; + B6B096401A1D25ED008BFAA6 /* TSStorageManager+IdentityKeyStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "TSStorageManager+IdentityKeyStore.h"; sourceTree = ""; }; + B6B096411A1D25ED008BFAA6 /* TSStorageManager+IdentityKeyStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "TSStorageManager+IdentityKeyStore.m"; sourceTree = ""; }; + B6B096421A1D25ED008BFAA6 /* TSStorageManager+keyFromIntLong.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "TSStorageManager+keyFromIntLong.h"; sourceTree = ""; }; + B6B096431A1D25ED008BFAA6 /* TSStorageManager+keyFromIntLong.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "TSStorageManager+keyFromIntLong.m"; sourceTree = ""; }; + B6B096441A1D25ED008BFAA6 /* TSStorageManager+PreKeyStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "TSStorageManager+PreKeyStore.h"; sourceTree = ""; }; + B6B096451A1D25ED008BFAA6 /* TSStorageManager+PreKeyStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "TSStorageManager+PreKeyStore.m"; sourceTree = ""; }; + B6B096461A1D25ED008BFAA6 /* TSStorageManager+SessionStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "TSStorageManager+SessionStore.h"; sourceTree = ""; }; + B6B096471A1D25ED008BFAA6 /* TSStorageManager+SessionStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "TSStorageManager+SessionStore.m"; sourceTree = ""; }; + B6B096481A1D25ED008BFAA6 /* TSStorageManager+SignedPreKeyStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "TSStorageManager+SignedPreKeyStore.h"; sourceTree = ""; }; + B6B096491A1D25ED008BFAA6 /* TSStorageManager+SignedPreKeyStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "TSStorageManager+SignedPreKeyStore.m"; sourceTree = ""; }; + B6B0964A1A1D25ED008BFAA6 /* TSDatabaseView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSDatabaseView.h; sourceTree = ""; }; + B6B0964B1A1D25ED008BFAA6 /* TSDatabaseView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSDatabaseView.m; sourceTree = ""; }; + B6B0964C1A1D25ED008BFAA6 /* TSStorageKeys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSStorageKeys.h; sourceTree = ""; }; + B6B0964D1A1D25ED008BFAA6 /* TSStorageManager+keyingMaterial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "TSStorageManager+keyingMaterial.h"; sourceTree = ""; }; + B6B0964E1A1D25ED008BFAA6 /* TSStorageManager+keyingMaterial.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "TSStorageManager+keyingMaterial.m"; sourceTree = ""; }; + B6B0964F1A1D25ED008BFAA6 /* TSStorageManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSStorageManager.h; sourceTree = ""; }; + B6B096501A1D25ED008BFAA6 /* TSStorageManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSStorageManager.m; sourceTree = ""; }; + B6B096511A1D25ED008BFAA6 /* TSYapDatabaseObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSYapDatabaseObject.h; sourceTree = ""; }; + B6B096521A1D25ED008BFAA6 /* TSYapDatabaseObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSYapDatabaseObject.m; sourceTree = ""; }; + B6B096531A1D25ED008BFAA6 /* TSConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSConstants.h; sourceTree = ""; }; + B6B096551A1D25ED008BFAA6 /* Cryptography.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Cryptography.h; sourceTree = ""; }; + B6B096561A1D25ED008BFAA6 /* Cryptography.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Cryptography.m; sourceTree = ""; }; + B6B096571A1D25ED008BFAA6 /* NSData+Base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+Base64.h"; sourceTree = ""; }; + B6B096581A1D25ED008BFAA6 /* NSData+Base64.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+Base64.m"; sourceTree = ""; }; + B6B096591A1D25ED008BFAA6 /* NSData+hexString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+hexString.h"; sourceTree = ""; }; + B6B0965A1A1D25ED008BFAA6 /* NSData+hexString.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+hexString.m"; sourceTree = ""; }; + B6B0965B1A1D25ED008BFAA6 /* NSData+messagePadding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+messagePadding.h"; sourceTree = ""; }; + B6B0965C1A1D25ED008BFAA6 /* NSData+messagePadding.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+messagePadding.m"; sourceTree = ""; }; + B6B0965D1A1D25ED008BFAA6 /* NSString+escape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+escape.h"; sourceTree = ""; }; + B6B0965E1A1D25ED008BFAA6 /* NSString+escape.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+escape.m"; sourceTree = ""; }; + B6B0965F1A1D25ED008BFAA6 /* NSURLSessionDataTask+StatusCode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSURLSessionDataTask+StatusCode.h"; sourceTree = ""; }; + B6B096601A1D25ED008BFAA6 /* NSURLSessionDataTask+StatusCode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSURLSessionDataTask+StatusCode.m"; sourceTree = ""; }; B6B1013A196D213F007E3930 /* SGNKeychainUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SGNKeychainUtil.h; sourceTree = ""; }; B6B1013B196D213F007E3930 /* SGNKeychainUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SGNKeychainUtil.m; sourceTree = ""; }; B6B9ECFA198B31BA00C620D3 /* PushManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PushManager.h; sourceTree = ""; }; @@ -1152,9 +1314,6 @@ B9B89C52185A2B5F00A24465 /* LeftSideMenuCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LeftSideMenuCell.h; sourceTree = ""; }; B9B89C53185A2B5F00A24465 /* LeftSideMenuCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LeftSideMenuCell.m; sourceTree = ""; }; B9B89C56185A2B7000A24465 /* LeftSideMenuCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LeftSideMenuCell.xib; sourceTree = ""; }; - B9CA51B718809ACA007E204E /* InviteContactsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InviteContactsViewController.h; sourceTree = ""; }; - B9CA51B818809ACA007E204E /* InviteContactsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InviteContactsViewController.m; sourceTree = ""; }; - B9CA51B918809ACA007E204E /* InviteContactsViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = InviteContactsViewController.xib; path = ../InviteContactsViewController.xib; sourceTree = ""; }; B9EB5ABC1884C002007CBB57 /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; }; B9EB5AC41884D370007CBB57 /* UnseenWhisperUserCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnseenWhisperUserCell.h; sourceTree = ""; }; B9EB5AC51884D370007CBB57 /* UnseenWhisperUserCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UnseenWhisperUserCell.m; sourceTree = ""; }; @@ -1180,91 +1339,6 @@ D24B5BD4169F568C00681372 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = ../../../../../../System/Library/Frameworks/AudioToolbox.framework; sourceTree = ""; }; D2AEACDB16C426DA00C364C0 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; }; E108ED13187E34FD0045AEA3 /* iTunesArtwork@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "iTunesArtwork@2x.png"; sourceTree = ""; }; - E1370B3018A0660300826894 /* archive_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = archive_icon.png; sourceTree = ""; }; - E1370B3118A0660300826894 /* archive_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "archive_icon@2x.png"; sourceTree = ""; }; - E1370B3218A0660300826894 /* backspace.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = backspace.png; sourceTree = ""; }; - E1370B3318A0660300826894 /* backspace@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "backspace@2x.png"; sourceTree = ""; }; - E1370B3418A0660300826894 /* checkbox_checkmark.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = checkbox_checkmark.png; sourceTree = ""; }; - E1370B3518A0660300826894 /* checkbox_checkmark@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "checkbox_checkmark@2x.png"; sourceTree = ""; }; - E1370B3618A0660300826894 /* checkbox_empty.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = checkbox_empty.png; sourceTree = ""; }; - E1370B3718A0660300826894 /* checkbox_empty@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "checkbox_empty@2x.png"; sourceTree = ""; }; - E1370B3818A0660300826894 /* contact_default_feed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = contact_default_feed.png; sourceTree = ""; }; - E1370B3918A0660300826894 /* contacts_arrow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = contacts_arrow.png; sourceTree = ""; }; - E1370B3A18A0660300826894 /* contacts_arrow@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "contacts_arrow@2x.png"; sourceTree = ""; }; - E1370B3B18A0660300826894 /* DefaultContactImage.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = DefaultContactImage.png; sourceTree = ""; }; - E1370B3C18A0660300826894 /* dismiss_notification_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = dismiss_notification_icon.png; sourceTree = ""; }; - E1370B3D18A0660300826894 /* dismiss_notification_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "dismiss_notification_icon@2x.png"; sourceTree = ""; }; - E1370B3E18A0660300826894 /* drop_down_arrow_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = drop_down_arrow_icon.png; sourceTree = ""; }; - E1370B3F18A0660300826894 /* drop_down_arrow_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "drop_down_arrow_icon@2x.png"; sourceTree = ""; }; - E1370B4018A0660300826894 /* expanded_cell_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = expanded_cell_icon.png; sourceTree = ""; }; - E1370B4118A0660300826894 /* expanded_cell_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "expanded_cell_icon@2x.png"; sourceTree = ""; }; - E1370B4218A0660300826894 /* favourite_false_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = favourite_false_icon.png; sourceTree = ""; }; - E1370B4318A0660300826894 /* favourite_false_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "favourite_false_icon@2x.png"; sourceTree = ""; }; - E1370B4418A0660300826894 /* favourite_true_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = favourite_true_icon.png; sourceTree = ""; }; - E1370B4518A0660300826894 /* favourite_true_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "favourite_true_icon@2x.png"; sourceTree = ""; }; - E1370B4618A0660300826894 /* forward_button.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = forward_button.png; sourceTree = ""; }; - E1370B4718A0660300826894 /* forward_button@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "forward_button@2x.png"; sourceTree = ""; }; - E1370B4818A0660300826894 /* home_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = home_icon.png; sourceTree = ""; }; - E1370B4918A0660300826894 /* icon_contacts.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon_contacts.png; sourceTree = ""; }; - E1370B4A18A0660300826894 /* icon_favourites.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon_favourites.png; sourceTree = ""; }; - E1370B4B18A0660300826894 /* icon_keypad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon_keypad.png; sourceTree = ""; }; - E1370B4C18A0660300826894 /* icon_recents.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon_recents.png; sourceTree = ""; }; - E1370B4D18A0660300826894 /* in_call_phone_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = in_call_phone_icon.png; sourceTree = ""; }; - E1370B4E18A0660300826894 /* in_call_phone_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "in_call_phone_icon@2x.png"; sourceTree = ""; }; - E1370B4F18A0660300826894 /* in_call_phrase_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = in_call_phrase_icon.png; sourceTree = ""; }; - E1370B5018A0660300826894 /* in_call_phrase_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "in_call_phrase_icon@2x.png"; sourceTree = ""; }; - E1370B5118A0660300826894 /* incoming_call_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = incoming_call_icon.png; sourceTree = ""; }; - E1370B5218A0660300826894 /* incoming_call_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "incoming_call_icon@2x.png"; sourceTree = ""; }; - E1370B5318A0660300826894 /* menu_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_icon.png; sourceTree = ""; }; - E1370B5418A0660300826894 /* menu_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "menu_icon@2x.png"; sourceTree = ""; }; - E1370B5518A0660300826894 /* message_bubble.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = message_bubble.png; sourceTree = ""; }; - E1370B5618A0660300826894 /* message_bubble@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "message_bubble@2x.png"; sourceTree = ""; }; - E1370B5718A0660300826894 /* mute_icon_selected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = mute_icon_selected.png; sourceTree = ""; }; - E1370B5818A0660300826894 /* mute_icon_selected@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "mute_icon_selected@2x.png"; sourceTree = ""; }; - E1370B5918A0660300826894 /* mute_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = mute_icon.png; sourceTree = ""; }; - E1370B5A18A0660300826894 /* mute_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "mute_icon@2x.png"; sourceTree = ""; }; - E1370B5B18A0660300826894 /* notification_detail_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = notification_detail_icon.png; sourceTree = ""; }; - E1370B5C18A0660300826894 /* notification_detail_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "notification_detail_icon@2x.png"; sourceTree = ""; }; - E1370B5D18A0660300826894 /* notification_mini_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = notification_mini_icon.png; sourceTree = ""; }; - E1370B5E18A0660300826894 /* notification_mini_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "notification_mini_icon@2x.png"; sourceTree = ""; }; - E1370B5F18A0660300826894 /* outgoing_call_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = outgoing_call_icon.png; sourceTree = ""; }; - E1370B6018A0660300826894 /* outgoing_call_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "outgoing_call_icon@2x.png"; sourceTree = ""; }; - E1370B6118A0660300826894 /* search_cancel.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = search_cancel.png; sourceTree = ""; }; - E1370B6218A0660300826894 /* search_cancel@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "search_cancel@2x.png"; sourceTree = ""; }; - E1370B6318A0660300826894 /* search_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = search_icon.png; sourceTree = ""; }; - E1370B6418A0660300826894 /* search_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "search_icon@2x.png"; sourceTree = ""; }; - E1370B6518A0660300826894 /* send_code_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = send_code_icon.png; sourceTree = ""; }; - E1370B6618A0660300826894 /* send_code_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "send_code_icon@2x.png"; sourceTree = ""; }; - E1370B6718A0660300826894 /* speaker_icon_selected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = speaker_icon_selected.png; sourceTree = ""; }; - E1370B6818A0660300826894 /* speaker_icon_selected@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "speaker_icon_selected@2x.png"; sourceTree = ""; }; - E1370B6918A0660300826894 /* speaker_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = speaker_icon.png; sourceTree = ""; }; - E1370B6A18A0660300826894 /* speaker_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "speaker_icon@2x.png"; sourceTree = ""; }; - E1370B6B18A0660300826894 /* spinner_connecting_flash.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = spinner_connecting_flash.png; sourceTree = ""; }; - E1370B6C18A0660300826894 /* spinner_connecting_flash@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "spinner_connecting_flash@2x.png"; sourceTree = ""; }; - E1370B6D18A0660300826894 /* spinner_connecting.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = spinner_connecting.png; sourceTree = ""; }; - E1370B6E18A0660300826894 /* spinner_connecting@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "spinner_connecting@2x.png"; sourceTree = ""; }; - E1370B6F18A0660300826894 /* spinner_error.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = spinner_error.png; sourceTree = ""; }; - E1370B7018A0660300826894 /* spinner_error@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "spinner_error@2x.png"; sourceTree = ""; }; - E1370B7118A0660300826894 /* spinner_ringing.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = spinner_ringing.png; sourceTree = ""; }; - E1370B7218A0660300826894 /* spinner_ringing@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "spinner_ringing@2x.png"; sourceTree = ""; }; - E1370B7318A0660300826894 /* tab_icon_contacts.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tab_icon_contacts.png; sourceTree = ""; }; - E1370B7418A0660300826894 /* tab_icon_contacts@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tab_icon_contacts@2x.png"; sourceTree = ""; }; - E1370B7518A0660300826894 /* tab_icon_favourites.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tab_icon_favourites.png; sourceTree = ""; }; - E1370B7618A0660300826894 /* tab_icon_favourites@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tab_icon_favourites@2x.png"; sourceTree = ""; }; - E1370B7718A0660300826894 /* tab_icon_inbox.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tab_icon_inbox.png; sourceTree = ""; }; - E1370B7818A0660300826894 /* tab_icon_inbox@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tab_icon_inbox@2x.png"; sourceTree = ""; }; - E1370B7918A0660300826894 /* tab_icon_keypad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tab_icon_keypad.png; sourceTree = ""; }; - E1370B7A18A0660300826894 /* tab_icon_keypad@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tab_icon_keypad@2x.png"; sourceTree = ""; }; - E1370B7B18A0660300826894 /* tab_icon_menu.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tab_icon_menu.png; sourceTree = ""; }; - E1370B7C18A0660300826894 /* tab_icon_menu@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tab_icon_menu@2x.png"; sourceTree = ""; }; - E1370B7D18A0660300826894 /* trash_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = trash_icon.png; sourceTree = ""; }; - E1370B7E18A0660300826894 /* trash_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "trash_icon@2x.png"; sourceTree = ""; }; - E1370B7F18A0660300826894 /* volume_high.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = volume_high.png; sourceTree = ""; }; - E1370B8018A0660300826894 /* volume_high@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "volume_high@2x.png"; sourceTree = ""; }; - E1370B8118A0660300826894 /* volume_low.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = volume_low.png; sourceTree = ""; }; - E1370B8218A0660300826894 /* volume_low@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "volume_low@2x.png"; sourceTree = ""; }; - E1370B8318A0660300826894 /* whisper_notification_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = whisper_notification_icon.png; sourceTree = ""; }; - E1370B8418A0660300826894 /* whisper_notification_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "whisper_notification_icon@2x.png"; sourceTree = ""; }; E1370BDA18A066F600826894 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; E1370BDB18A066F600826894 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; E1370BDC18A066F600826894 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; @@ -1275,8 +1349,6 @@ E16E5BEC18AAC40200B7C403 /* EvpKeyAgreement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EvpKeyAgreement.h; sourceTree = ""; }; E16E5BED18AAC40200B7C403 /* EvpKeyAgreement.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EvpKeyAgreement.m; sourceTree = ""; }; E16E5BF818AAF02100B7C403 /* EC25AgreerTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EC25AgreerTest.m; sourceTree = ""; }; - E16E5C1218AEDB5A00B7C403 /* message_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = message_icon.png; sourceTree = ""; }; - E16E5C1318AEDB5A00B7C403 /* phone_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = phone_icon.png; sourceTree = ""; }; E18AB3F418A05734001A532A /* AppIcon29x29.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = AppIcon29x29.jpg; sourceTree = ""; }; E18AB3F518A05734001A532A /* AppIcon29x29.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = AppIcon29x29.png; sourceTree = ""; }; E18AB3F618A05734001A532A /* AppIcon29x29@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "AppIcon29x29@2x.png"; sourceTree = ""; }; @@ -1347,26 +1419,12 @@ FC31962C1A06A2190094C78E /* FingerprintViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FingerprintViewController.m; sourceTree = ""; }; FC31962E1A0814130094C78E /* SettingsTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingsTableViewController.h; sourceTree = ""; }; FC31962F1A0814130094C78E /* SettingsTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SettingsTableViewController.m; sourceTree = ""; }; - FC4F9FE41A16258C00DA100A /* logo_intro@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "logo_intro@2x.png"; sourceTree = ""; }; - FC4F9FEC1A1658EE00DA100A /* call@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "call@2x.png"; sourceTree = ""; }; - FC4F9FEE1A1664EA00DA100A /* mute_off@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "mute_off@2x.png"; sourceTree = ""; }; - FC4F9FEF1A1664EA00DA100A /* speaker_off@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "speaker_off@2x.png"; sourceTree = ""; }; - FC4F9FF01A1664EA00DA100A /* speaker_on@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "speaker_on@2x.png"; sourceTree = ""; }; - FC4F9FF11A1664EA00DA100A /* mute_on@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "mute_on@2x.png"; sourceTree = ""; }; - FC4F9FF21A1664EA00DA100A /* endcall@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "endcall@2x.png"; sourceTree = ""; }; - FC4F9FFC1A179FCF00DA100A /* lock@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "lock@2x.png"; sourceTree = ""; }; - FC4F9FFE1A17A39E00DA100A /* photo@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "photo@2x.png"; sourceTree = ""; }; - FC4FA0061A18BDAE00DA100A /* info@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "info@2x.png"; sourceTree = ""; }; - FC4FA0081A18BF3100DA100A /* lock_white@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "lock_white@2x.png"; sourceTree = ""; }; - FC4FA00C1A18CC4300DA100A /* shred@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "shred@2x.png"; sourceTree = ""; }; - FC4FA0131A1A180D00DA100A /* red-delete@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "red-delete@2x.png"; sourceTree = ""; }; - FC4FA0141A1A180D00DA100A /* delete@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "delete@2x.png"; sourceTree = ""; }; - FC4FA0151A1A180D00DA100A /* archive@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "archive@2x.png"; sourceTree = ""; }; - FC4FA0161A1A180D00DA100A /* blue-archive@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "blue-archive@2x.png"; sourceTree = ""; }; FC4FA0211A1B8A8D00DA100A /* Socket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Socket.h; sourceTree = ""; }; FC4FA0221A1B8A8D00DA100A /* Socket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Socket.m; sourceTree = ""; }; FC4FA0241A1B9DC600DA100A /* SignalsNavigationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SignalsNavigationController.h; sourceTree = ""; }; FC4FA0251A1B9DC600DA100A /* SignalsNavigationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SignalsNavigationController.m; sourceTree = ""; }; + FC4FA0311A1D46AE00DA100A /* InitialViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InitialViewController.h; sourceTree = ""; }; + FC4FA0321A1D46AE00DA100A /* InitialViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InitialViewController.m; sourceTree = ""; }; FCAC963419FEF4E20046DFC5 /* Storyboard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Storyboard.storyboard; path = Signal/src/Storyboard/Storyboard.storyboard; sourceTree = SOURCE_ROOT; }; FCAC963A19FEF9280046DFC5 /* SignalsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SignalsViewController.h; path = UITests/SignalsViewController.h; sourceTree = ""; }; FCAC963B19FEF9280046DFC5 /* SignalsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SignalsViewController.m; path = UITests/SignalsViewController.m; sourceTree = ""; }; @@ -1379,27 +1437,11 @@ FCAC964619FEFE1A0046DFC5 /* DemoDataModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DemoDataModel.m; sourceTree = ""; }; FCAC964F19FF0A6E0046DFC5 /* MessagesViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MessagesViewController.h; sourceTree = ""; }; FCAC965019FF0A6E0046DFC5 /* MessagesViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MessagesViewController.m; sourceTree = ""; }; - FCAFC2EB1A0C469C00AE5136 /* checkmark.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = checkmark.png; sourceTree = ""; }; - FCAFC2ED1A0C472200AE5136 /* reply.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = reply.png; sourceTree = ""; }; - FCAFC2EF1A0C4ACF00AE5136 /* received.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = received.png; sourceTree = ""; }; - FCAFC2F01A0C4ACF00AE5136 /* missed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = missed.png; sourceTree = ""; }; - FCAFC3091A0C560E00AE5136 /* signals.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = signals.png; sourceTree = ""; }; - FCAFC30A1A0C560E00AE5136 /* settings.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = settings.png; sourceTree = ""; }; - FCAFC3201A0D394300AE5136 /* favourite.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = favourite.png; sourceTree = ""; }; - FCAFC3251A0D466F00AE5136 /* delete_history@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "delete_history@2x.png"; sourceTree = ""; }; - FCAFC3261A0D466F00AE5136 /* signal@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "signal@2x.png"; sourceTree = ""; }; - FCAFC3271A0D466F00AE5136 /* call_dark@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "call_dark@2x.png"; sourceTree = ""; }; - FCAFC32D1A0D46D500AE5136 /* settings_dark@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "settings_dark@2x.png"; sourceTree = ""; }; - FCAFC32F1A0D5E3000AE5136 /* share@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "share@2x.png"; sourceTree = ""; }; - FCAFC3331A0D656100AE5136 /* contacts_tab@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "contacts_tab@2x.png"; sourceTree = ""; }; - FCAFC3351A0D680100AE5136 /* keypad@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "keypad@2x.png"; sourceTree = ""; }; FCAFC33D1A0F948F00AE5136 /* ActionContactDetailCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ActionContactDetailCell.h; sourceTree = ""; }; FCAFC33E1A0F948F00AE5136 /* ActionContactDetailCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ActionContactDetailCell.m; sourceTree = ""; }; FCB11D881A1284BB002F93FB /* SettingsTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingsTableViewCell.h; sourceTree = ""; }; FCB11D891A1284BB002F93FB /* SettingsTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SettingsTableViewCell.m; sourceTree = ""; }; FCB11D8B1A129A76002F93FB /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; - FCB11D8D1A12A388002F93FB /* savephoto@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "savephoto@2x.png"; sourceTree = ""; }; - FCB11D8E1A12A388002F93FB /* quit@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "quit@2x.png"; sourceTree = ""; }; FCB11D911A12A4AA002F93FB /* FullImageViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FullImageViewController.h; sourceTree = ""; }; FCB11D921A12A4AA002F93FB /* FullImageViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FullImageViewController.m; sourceTree = ""; }; FCF72A061A01A765006BC849 /* ContactsTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactsTableViewController.h; sourceTree = ""; }; @@ -1497,64 +1539,6 @@ name = Products; sourceTree = ""; }; - 70B800C8190C55320042E3F0 /* Libraries */ = { - isa = PBXGroup; - children = ( - 70B800E1190C55660042E3F0 /* ProtocolBuffers */, - ); - name = Libraries; - sourceTree = ""; - }; - 70B800E1190C55660042E3F0 /* ProtocolBuffers */ = { - isa = PBXGroup; - children = ( - 70B800E2190C55660042E3F0 /* AbstractMessage.h */, - 70B800E3190C55660042E3F0 /* AbstractMessage.m */, - 70B800E4190C55660042E3F0 /* AbstractMessage_Builder.h */, - 70B800E5190C55660042E3F0 /* AbstractMessage_Builder.m */, - 70B800E6190C55660042E3F0 /* Bootstrap.h */, - 70B800E7190C55660042E3F0 /* CodedInputStream.h */, - 70B800E8190C55660042E3F0 /* CodedInputStream.m */, - 70B800E9190C55660042E3F0 /* CodedOutputStream.h */, - 70B800EA190C55660042E3F0 /* CodedOutputStream.m */, - 70B800EB190C55660042E3F0 /* ConcreteExtensionField.h */, - 70B800EC190C55660042E3F0 /* ConcreteExtensionField.m */, - 70B800ED190C55660042E3F0 /* ExtendableMessage.h */, - 70B800EE190C55660042E3F0 /* ExtendableMessage.m */, - 70B800EF190C55660042E3F0 /* ExtendableMessage_Builder.h */, - 70B800F0190C55660042E3F0 /* ExtendableMessage_Builder.m */, - 70B800F1190C55660042E3F0 /* ExtensionField.h */, - 70B800F2190C55660042E3F0 /* ExtensionRegistry.h */, - 70B800F3190C55660042E3F0 /* ExtensionRegistry.m */, - 70B800F4190C55660042E3F0 /* Field.h */, - 70B800F5190C55660042E3F0 /* Field.m */, - 70B800F6190C55660042E3F0 /* ForwardDeclarations.h */, - 70B800F7190C55660042E3F0 /* GeneratedMessage.h */, - 70B800F8190C55660042E3F0 /* GeneratedMessage.m */, - 70B800F9190C55660042E3F0 /* GeneratedMessage_Builder.h */, - 70B800FA190C55660042E3F0 /* GeneratedMessage_Builder.m */, - 70B800FB190C55660042E3F0 /* Message.h */, - 70B800FC190C55660042E3F0 /* Message_Builder.h */, - 70B800FD190C55660042E3F0 /* MutableExtensionRegistry.h */, - 70B800FE190C55660042E3F0 /* MutableExtensionRegistry.m */, - 70B800FF190C55660042E3F0 /* MutableField.h */, - 70B80100190C55660042E3F0 /* MutableField.m */, - 70B80101190C55660042E3F0 /* ProtocolBuffers.h */, - 70B80102190C55660042E3F0 /* TextFormat.h */, - 70B80103190C55660042E3F0 /* TextFormat.m */, - 70B80104190C55660042E3F0 /* UnknownFieldSet.h */, - 70B80105190C55660042E3F0 /* UnknownFieldSet.m */, - 70B80106190C55660042E3F0 /* UnknownFieldSet_Builder.h */, - 70B80107190C55660042E3F0 /* UnknownFieldSet_Builder.m */, - 70B80108190C55660042E3F0 /* Utilities.h */, - 70B80109190C55660042E3F0 /* Utilities.m */, - 70B8010A190C55660042E3F0 /* WireFormat.h */, - 70B8010B190C55660042E3F0 /* WireFormat.m */, - ); - name = ProtocolBuffers; - path = Libraries/ProtocolBuffers; - sourceTree = ""; - }; 70DBA29918CFE98500771DAD /* crypto */ = { isa = PBXGroup; children = ( @@ -1588,100 +1572,6 @@ name = contact; sourceTree = ""; }; - 76AD2C7B17FB4604000246B0 /* Images */ = { - isa = PBXGroup; - children = ( - E1370B3018A0660300826894 /* archive_icon.png */, - E1370B3118A0660300826894 /* archive_icon@2x.png */, - E1370B3218A0660300826894 /* backspace.png */, - E1370B3318A0660300826894 /* backspace@2x.png */, - E1370B3418A0660300826894 /* checkbox_checkmark.png */, - E1370B3518A0660300826894 /* checkbox_checkmark@2x.png */, - E1370B3618A0660300826894 /* checkbox_empty.png */, - E1370B3718A0660300826894 /* checkbox_empty@2x.png */, - E1370B3818A0660300826894 /* contact_default_feed.png */, - E1370B3918A0660300826894 /* contacts_arrow.png */, - E1370B3A18A0660300826894 /* contacts_arrow@2x.png */, - E1370B3B18A0660300826894 /* DefaultContactImage.png */, - E1370B3C18A0660300826894 /* dismiss_notification_icon.png */, - E1370B3D18A0660300826894 /* dismiss_notification_icon@2x.png */, - E1370B3E18A0660300826894 /* drop_down_arrow_icon.png */, - E1370B3F18A0660300826894 /* drop_down_arrow_icon@2x.png */, - E1370B4018A0660300826894 /* expanded_cell_icon.png */, - E1370B4118A0660300826894 /* expanded_cell_icon@2x.png */, - E1370B4218A0660300826894 /* favourite_false_icon.png */, - E1370B4318A0660300826894 /* favourite_false_icon@2x.png */, - E1370B4418A0660300826894 /* favourite_true_icon.png */, - E1370B4518A0660300826894 /* favourite_true_icon@2x.png */, - E1370B4618A0660300826894 /* forward_button.png */, - E1370B4718A0660300826894 /* forward_button@2x.png */, - E1370B4818A0660300826894 /* home_icon.png */, - E1370B4918A0660300826894 /* icon_contacts.png */, - E1370B4A18A0660300826894 /* icon_favourites.png */, - E1370B4B18A0660300826894 /* icon_keypad.png */, - E1370B4C18A0660300826894 /* icon_recents.png */, - E1370B4D18A0660300826894 /* in_call_phone_icon.png */, - E1370B4E18A0660300826894 /* in_call_phone_icon@2x.png */, - E1370B4F18A0660300826894 /* in_call_phrase_icon.png */, - E1370B5018A0660300826894 /* in_call_phrase_icon@2x.png */, - E1370B5118A0660300826894 /* incoming_call_icon.png */, - E1370B5218A0660300826894 /* incoming_call_icon@2x.png */, - E1370B5318A0660300826894 /* menu_icon.png */, - E1370B5418A0660300826894 /* menu_icon@2x.png */, - E1370B5518A0660300826894 /* message_bubble.png */, - E1370B5618A0660300826894 /* message_bubble@2x.png */, - E16E5C1218AEDB5A00B7C403 /* message_icon.png */, - E1370B5918A0660300826894 /* mute_icon.png */, - E1370B5A18A0660300826894 /* mute_icon@2x.png */, - E1370B5718A0660300826894 /* mute_icon_selected.png */, - E1370B5818A0660300826894 /* mute_icon_selected@2x.png */, - E1370B5B18A0660300826894 /* notification_detail_icon.png */, - E1370B5C18A0660300826894 /* notification_detail_icon@2x.png */, - E1370B5D18A0660300826894 /* notification_mini_icon.png */, - E1370B5E18A0660300826894 /* notification_mini_icon@2x.png */, - E1370B5F18A0660300826894 /* outgoing_call_icon.png */, - E1370B6018A0660300826894 /* outgoing_call_icon@2x.png */, - E16E5C1318AEDB5A00B7C403 /* phone_icon.png */, - E1370B6118A0660300826894 /* search_cancel.png */, - E1370B6218A0660300826894 /* search_cancel@2x.png */, - E1370B6318A0660300826894 /* search_icon.png */, - E1370B6418A0660300826894 /* search_icon@2x.png */, - E1370B6518A0660300826894 /* send_code_icon.png */, - E1370B6618A0660300826894 /* send_code_icon@2x.png */, - E1370B6918A0660300826894 /* speaker_icon.png */, - E1370B6A18A0660300826894 /* speaker_icon@2x.png */, - E1370B6718A0660300826894 /* speaker_icon_selected.png */, - E1370B6818A0660300826894 /* speaker_icon_selected@2x.png */, - E1370B6D18A0660300826894 /* spinner_connecting.png */, - E1370B6E18A0660300826894 /* spinner_connecting@2x.png */, - E1370B6B18A0660300826894 /* spinner_connecting_flash.png */, - E1370B6C18A0660300826894 /* spinner_connecting_flash@2x.png */, - E1370B6F18A0660300826894 /* spinner_error.png */, - E1370B7018A0660300826894 /* spinner_error@2x.png */, - E1370B7118A0660300826894 /* spinner_ringing.png */, - E1370B7218A0660300826894 /* spinner_ringing@2x.png */, - E1370B7318A0660300826894 /* tab_icon_contacts.png */, - E1370B7418A0660300826894 /* tab_icon_contacts@2x.png */, - E1370B7518A0660300826894 /* tab_icon_favourites.png */, - E1370B7618A0660300826894 /* tab_icon_favourites@2x.png */, - E1370B7718A0660300826894 /* tab_icon_inbox.png */, - E1370B7818A0660300826894 /* tab_icon_inbox@2x.png */, - E1370B7918A0660300826894 /* tab_icon_keypad.png */, - E1370B7A18A0660300826894 /* tab_icon_keypad@2x.png */, - E1370B7B18A0660300826894 /* tab_icon_menu.png */, - E1370B7C18A0660300826894 /* tab_icon_menu@2x.png */, - E1370B7D18A0660300826894 /* trash_icon.png */, - E1370B7E18A0660300826894 /* trash_icon@2x.png */, - E1370B7F18A0660300826894 /* volume_high.png */, - E1370B8018A0660300826894 /* volume_high@2x.png */, - E1370B8118A0660300826894 /* volume_low.png */, - E1370B8218A0660300826894 /* volume_low@2x.png */, - E1370B8318A0660300826894 /* whisper_notification_icon.png */, - E1370B8418A0660300826894 /* whisper_notification_icon@2x.png */, - ); - path = Images; - sourceTree = ""; - }; 76EB03C118170B33006006FC /* src */ = { isa = PBXGroup; children = ( @@ -1698,6 +1588,7 @@ E1B3DC731885EFA100B7F794 /* NotificationManifest.h */, 70BAFD5B190584BE00FA5E0B /* NotificationTracker.h */, 70BAFD5C190584BE00FA5E0B /* NotificationTracker.m */, + B6B095EA1A1D25ED008BFAA6 /* textsecure */, 76EB048818170B33006006FC /* phone */, 76EB04B118170B33006006FC /* profiling */, 76EB04C818170B33006006FC /* util */, @@ -2190,36 +2081,18 @@ 76EB04FE18170B33006006FC /* view controllers */ = { isa = PBXGroup; children = ( - 76EB051118170B33006006FC /* CallLogViewController.h */, - 76EB051218170B33006006FC /* CallLogViewController.m */, - 76EB050118170B33006006FC /* ContactBrowseViewController.h */, - 76EB050218170B33006006FC /* ContactBrowseViewController.m */, 76EB050318170B33006006FC /* ContactDetailViewController.h */, 76EB050418170B33006006FC /* ContactDetailViewController.m */, B97CBFA518860EA3008E0DE9 /* CountryCodeViewController.h */, B97CBFA618860EA3008E0DE9 /* CountryCodeViewController.m */, 76EB050518170B33006006FC /* DialerViewController.h */, 76EB050618170B33006006FC /* DialerViewController.m */, - 76EB050718170B33006006FC /* FavouritesViewController.h */, - 76EB050818170B33006006FC /* FavouritesViewController.m */, - 76EB050918170B33006006FC /* InboxFeedViewController.h */, - 76EB050A18170B33006006FC /* InboxFeedViewController.m */, 76EB050B18170B33006006FC /* InCallViewController.h */, 76EB050C18170B33006006FC /* InCallViewController.m */, - 707E548A18FF0B8A00C8649D /* InviteContactModal.h */, - 707E548B18FF0B8A00C8649D /* InviteContactModal.m */, - B9CA51B718809ACA007E204E /* InviteContactsViewController.h */, - B9CA51B818809ACA007E204E /* InviteContactsViewController.m */, - 76EB050D18170B33006006FC /* LeftSideMenuViewController.h */, - 76EB050E18170B33006006FC /* LeftSideMenuViewController.m */, 76EB050F18170B33006006FC /* NextResponderScrollView.h */, 76EB051018170B33006006FC /* NextResponderScrollView.m */, 76EB051518170B33006006FC /* RegisterViewController.h */, 76EB051618170B33006006FC /* RegisterViewController.m */, - 76EB051718170B33006006FC /* SettingsViewController.h */, - 76EB051818170B33006006FC /* SettingsViewController.m */, - 76EB051918170B33006006FC /* TabBarParentViewController.h */, - 76EB051A18170B33006006FC /* TabBarParentViewController.m */, 76EB051C18170B33006006FC /* xibs */, ); path = "view controllers"; @@ -2229,21 +2102,13 @@ isa = PBXGroup; children = ( 76EB051D18170B33006006FC /* CallAudioManagerDemo.xib */, - 76EB052718170B33006006FC /* CallLogViewController.xib */, - 76EB051E18170B33006006FC /* ContactBrowseViewController.xib */, 76EB051F18170B33006006FC /* ContactDetailTableViewCell.xib */, 76EB052018170B33006006FC /* ContactDetailViewController.xib */, B97CBFA718860EA3008E0DE9 /* CountryCodeViewController.xib */, 76EB052118170B33006006FC /* DialerViewController.xib */, - 76EB052318170B33006006FC /* FavouritesViewController.xib */, - 76EB052418170B33006006FC /* InboxFeedViewController.xib */, 76EB052518170B33006006FC /* InCallViewController.xib */, - B9CA51B918809ACA007E204E /* InviteContactsViewController.xib */, - 76EB052618170B33006006FC /* LeftSideMenuViewController.xib */, 76B8189D182C39460088060E /* PreferenceListViewController.xib */, 76EB052918170B33006006FC /* RegisterViewController.xib */, - 76EB052A18170B33006006FC /* SettingsViewController.xib */, - 76EB051B18170B33006006FC /* TabBarParentViewController.xib */, ); path = xibs; sourceTree = ""; @@ -2251,8 +2116,6 @@ 76EB052B18170B33006006FC /* views */ = { isa = PBXGroup; children = ( - 76EB053618170B33006006FC /* CallLogTableViewCell.h */, - 76EB053718170B33006006FC /* CallLogTableViewCell.m */, 76EB052C18170B33006006FC /* ContactDetailTableViewCell.h */, 76EB052D18170B33006006FC /* ContactDetailTableViewCell.m */, 76EB052E18170B33006006FC /* ContactTableViewCell.h */, @@ -2263,10 +2126,6 @@ 765052AE182AC9B5008313E1 /* DialerButtonView.m */, B9A578AF183D60ED00C17105 /* FavouriteTableViewCell.h */, B9A578B0183D60ED00C17105 /* FavouriteTableViewCell.m */, - 76C87F11181EE11C00C4ACAB /* InboxFeedFooterCell.h */, - 76C87F12181EE11C00C4ACAB /* InboxFeedFooterCell.m */, - 76EB053418170B33006006FC /* InboxFeedTableViewCell.h */, - 76EB053518170B33006006FC /* InboxFeedTableViewCell.m */, 70377AA71916BA0500CAF501 /* InteractiveLabel.h */, 70377AA81916BA0500CAF501 /* InteractiveLabel.m */, B9B89C52185A2B5F00A24465 /* LeftSideMenuCell.h */, @@ -2289,12 +2148,9 @@ 76EB053818170B33006006FC /* xibs */ = { isa = PBXGroup; children = ( - 76EB053F18170B33006006FC /* CallLogTableViewCell.xib */, 76EB053A18170B33006006FC /* ContactTableViewCell.xib */, B97CBFB018861023008E0DE9 /* CountryCodeTableViewCell.xib */, B9A578B3183D610300C17105 /* FavouriteTableViewCell.xib */, - 76C87F15181EE2EB00C4ACAB /* InboxFeedFooterCell.xib */, - 76EB053C18170B33006006FC /* InboxFeedTableViewCell.xib */, B9B89C56185A2B7000A24465 /* LeftSideMenuCell.xib */, 76D713E9182D3E5100C9C9C8 /* PreferenceListTableViewCell.xib */, B9EB5AC81884D387007CBB57 /* UnseenWhisperUserCell.xib */, @@ -2312,6 +2168,7 @@ A157072E17F0CD6D007C2BD6 /* phone */, A157073417F0CD6D007C2BD6 /* profiling */, A157073917F0CD6D007C2BD6 /* Supporting Files */, + B6B095DD1A1D25C5008BFAA6 /* textsecure */, A157073D17F0CD6D007C2BD6 /* util */, B684A46C19C3446200B11029 /* PushManagerTest.m */, A157073B17F0CD6D007C2BD6 /* TestUtil.h */, @@ -2492,6 +2349,135 @@ path = util; sourceTree = ""; }; + B633C4FD1A1D190B0059AC12 /* Images */ = { + isa = PBXGroup; + children = ( + B633C4FE1A1D190B0059AC12 /* archive@2x.png */, + B633C4FF1A1D190B0059AC12 /* archive_icon.png */, + B633C5001A1D190B0059AC12 /* archive_icon@2x.png */, + B633C5011A1D190B0059AC12 /* backspace.png */, + B633C5021A1D190B0059AC12 /* backspace@2x.png */, + B633C5031A1D190B0059AC12 /* blue-archive@2x.png */, + B633C5041A1D190B0059AC12 /* call@2x.png */, + B633C5051A1D190B0059AC12 /* call_dark@2x.png */, + B633C5061A1D190B0059AC12 /* checkbox_checkmark.png */, + B633C5071A1D190B0059AC12 /* checkbox_checkmark@2x.png */, + B633C5081A1D190B0059AC12 /* checkbox_empty.png */, + B633C5091A1D190B0059AC12 /* checkbox_empty@2x.png */, + B633C50A1A1D190B0059AC12 /* checkmark.png */, + B633C50B1A1D190B0059AC12 /* contact_default_feed.png */, + B633C50C1A1D190B0059AC12 /* contacts.png */, + B633C50D1A1D190B0059AC12 /* contacts@2x.png */, + B633C50E1A1D190B0059AC12 /* contacts_arrow.png */, + B633C50F1A1D190B0059AC12 /* contacts_arrow@2x.png */, + B633C5101A1D190B0059AC12 /* contacts_tab@2x.png */, + B633C5141A1D190B0059AC12 /* DefaultContactImage.png */, + B633C5151A1D190B0059AC12 /* delete@2x.png */, + B633C5161A1D190B0059AC12 /* delete_history@2x.png */, + B633C5171A1D190B0059AC12 /* dismiss_notification_icon.png */, + B633C5181A1D190B0059AC12 /* dismiss_notification_icon@2x.png */, + B633C5191A1D190B0059AC12 /* drop_down_arrow_icon.png */, + B633C51A1A1D190B0059AC12 /* drop_down_arrow_icon@2x.png */, + B633C51B1A1D190B0059AC12 /* endcall@2x.png */, + B633C51C1A1D190B0059AC12 /* expanded_cell_icon.png */, + B633C51D1A1D190B0059AC12 /* expanded_cell_icon@2x.png */, + B633C51E1A1D190B0059AC12 /* favourite.png */, + B633C51F1A1D190B0059AC12 /* favourite_false_icon.png */, + B633C5201A1D190B0059AC12 /* favourite_false_icon@2x.png */, + B633C5211A1D190B0059AC12 /* favourite_true_icon.png */, + B633C5221A1D190B0059AC12 /* favourite_true_icon@2x.png */, + B633C5231A1D190B0059AC12 /* forward_button.png */, + B633C5241A1D190B0059AC12 /* forward_button@2x.png */, + B633C5251A1D190B0059AC12 /* home_icon.png */, + B633C5261A1D190B0059AC12 /* icon_contacts.png */, + B633C5271A1D190B0059AC12 /* icon_favourites.png */, + B633C5281A1D190B0059AC12 /* icon_keypad.png */, + B633C5291A1D190B0059AC12 /* icon_recents.png */, + B633C52A1A1D190B0059AC12 /* in_call_phone_icon.png */, + B633C52B1A1D190B0059AC12 /* in_call_phone_icon@2x.png */, + B633C52C1A1D190B0059AC12 /* in_call_phrase_icon.png */, + B633C52D1A1D190B0059AC12 /* in_call_phrase_icon@2x.png */, + B633C52E1A1D190B0059AC12 /* incoming_call_icon.png */, + B633C52F1A1D190B0059AC12 /* incoming_call_icon@2x.png */, + B633C5301A1D190B0059AC12 /* info@2x.png */, + B633C5321A1D190B0059AC12 /* keypad@2x.png */, + B633C5331A1D190B0059AC12 /* lock@2x.png */, + B633C5341A1D190B0059AC12 /* lock_white@2x.png */, + B633C5351A1D190B0059AC12 /* logo_intro@2x.png */, + B633C5371A1D190B0059AC12 /* menu_icon.png */, + B633C5381A1D190B0059AC12 /* menu_icon@2x.png */, + B633C5391A1D190B0059AC12 /* message_bubble.png */, + B633C53A1A1D190B0059AC12 /* message_bubble@2x.png */, + B633C53B1A1D190B0059AC12 /* message_icon.png */, + B633C53C1A1D190B0059AC12 /* missed.png */, + B633C53D1A1D190B0059AC12 /* mute_icon.png */, + B633C53E1A1D190B0059AC12 /* mute_icon@2x.png */, + B633C53F1A1D190B0059AC12 /* mute_icon_selected.png */, + B633C5401A1D190B0059AC12 /* mute_icon_selected@2x.png */, + B633C5411A1D190B0059AC12 /* mute_off@2x.png */, + B633C5421A1D190B0059AC12 /* mute_on@2x.png */, + B633C5431A1D190B0059AC12 /* notification_detail_icon.png */, + B633C5441A1D190B0059AC12 /* notification_detail_icon@2x.png */, + B633C5451A1D190B0059AC12 /* notification_mini_icon.png */, + B633C5461A1D190B0059AC12 /* notification_mini_icon@2x.png */, + B633C5471A1D190B0059AC12 /* outgoing_call_icon.png */, + B633C5481A1D190B0059AC12 /* outgoing_call_icon@2x.png */, + B633C5491A1D190B0059AC12 /* phone_icon.png */, + B633C54A1A1D190B0059AC12 /* phone_icon@2x.png */, + B633C54B1A1D190B0059AC12 /* photo@2x.png */, + B633C54C1A1D190B0059AC12 /* quit@2x.png */, + B633C54D1A1D190B0059AC12 /* received.png */, + B633C54E1A1D190B0059AC12 /* red-delete@2x.png */, + B633C54F1A1D190B0059AC12 /* reply.png */, + B633C5501A1D190B0059AC12 /* savephoto@2x.png */, + B633C5511A1D190B0059AC12 /* search_cancel.png */, + B633C5521A1D190B0059AC12 /* search_cancel@2x.png */, + B633C5531A1D190B0059AC12 /* search_icon.png */, + B633C5541A1D190B0059AC12 /* search_icon@2x.png */, + B633C5551A1D190B0059AC12 /* send_code_icon.png */, + B633C5561A1D190B0059AC12 /* send_code_icon@2x.png */, + B633C5571A1D190B0059AC12 /* settings.png */, + B633C5581A1D190B0059AC12 /* settings_dark@2x.png */, + B633C5591A1D190B0059AC12 /* share@2x.png */, + B633C55A1A1D190B0059AC12 /* shred@2x.png */, + B633C55E1A1D190B0059AC12 /* signal@2x.png */, + B633C55F1A1D190B0059AC12 /* signals.png */, + B633C5601A1D190B0059AC12 /* speaker_icon.png */, + B633C5611A1D190B0059AC12 /* speaker_icon@2x.png */, + B633C5621A1D190B0059AC12 /* speaker_icon_selected.png */, + B633C5631A1D190B0059AC12 /* speaker_icon_selected@2x.png */, + B633C5641A1D190B0059AC12 /* speaker_off@2x.png */, + B633C5651A1D190B0059AC12 /* speaker_on@2x.png */, + B633C5661A1D190B0059AC12 /* spinner_connecting.png */, + B633C5671A1D190B0059AC12 /* spinner_connecting@2x.png */, + B633C5681A1D190B0059AC12 /* spinner_connecting_flash.png */, + B633C5691A1D190B0059AC12 /* spinner_connecting_flash@2x.png */, + B633C56A1A1D190B0059AC12 /* spinner_error.png */, + B633C56B1A1D190B0059AC12 /* spinner_error@2x.png */, + B633C56C1A1D190B0059AC12 /* spinner_ringing.png */, + B633C56D1A1D190B0059AC12 /* spinner_ringing@2x.png */, + B633C56E1A1D190B0059AC12 /* tab_icon_contacts.png */, + B633C56F1A1D190B0059AC12 /* tab_icon_contacts@2x.png */, + B633C5701A1D190B0059AC12 /* tab_icon_favourites.png */, + B633C5711A1D190B0059AC12 /* tab_icon_favourites@2x.png */, + B633C5721A1D190B0059AC12 /* tab_icon_inbox.png */, + B633C5731A1D190B0059AC12 /* tab_icon_inbox@2x.png */, + B633C5741A1D190B0059AC12 /* tab_icon_keypad.png */, + B633C5751A1D190B0059AC12 /* tab_icon_keypad@2x.png */, + B633C5761A1D190B0059AC12 /* tab_icon_menu.png */, + B633C5771A1D190B0059AC12 /* tab_icon_menu@2x.png */, + B633C5781A1D190B0059AC12 /* trash_icon.png */, + B633C5791A1D190B0059AC12 /* trash_icon@2x.png */, + B633C57A1A1D190B0059AC12 /* volume_high.png */, + B633C57B1A1D190B0059AC12 /* volume_high@2x.png */, + B633C57C1A1D190B0059AC12 /* volume_low.png */, + B633C57D1A1D190B0059AC12 /* volume_low@2x.png */, + B633C57E1A1D190B0059AC12 /* whisper_notification_icon.png */, + B633C57F1A1D190B0059AC12 /* whisper_notification_icon@2x.png */, + ); + path = Images; + sourceTree = ""; + }; B6416F35199A0478003C5699 /* an.lproj */ = { isa = PBXGroup; children = ( @@ -2852,6 +2838,214 @@ name = Requests; sourceTree = ""; }; + B6B095DD1A1D25C5008BFAA6 /* textsecure */ = { + isa = PBXGroup; + children = ( + B6B095DE1A1D25C5008BFAA6 /* CryptographyTests.mm */, + B6B095DF1A1D25C5008BFAA6 /* TextSecureKitTests.m */, + B6B095E01A1D25C5008BFAA6 /* TSMessageStorageTests.m */, + B6B095E11A1D25C5008BFAA6 /* TSStorageIdentityKeyStoreTests.m */, + B6B095E21A1D25C5008BFAA6 /* TSStoragePreKeyStoreTests.m */, + B6B095E31A1D25C5008BFAA6 /* TSStorageSignedPreKeyStore.m */, + ); + path = textsecure; + sourceTree = ""; + }; + B6B095EA1A1D25ED008BFAA6 /* textsecure */ = { + isa = PBXGroup; + children = ( + B6B095EB1A1D25ED008BFAA6 /* Account */, + B6B095F21A1D25ED008BFAA6 /* Contacts */, + B6B096001A1D25ED008BFAA6 /* Messages */, + B6B0961B1A1D25ED008BFAA6 /* Network */, + B6B0963B1A1D25ED008BFAA6 /* Security */, + B6B0963E1A1D25ED008BFAA6 /* Storage */, + B6B096531A1D25ED008BFAA6 /* TSConstants.h */, + B6B096541A1D25ED008BFAA6 /* Util */, + ); + path = textsecure; + sourceTree = ""; + }; + B6B095EB1A1D25ED008BFAA6 /* Account */ = { + isa = PBXGroup; + children = ( + B6B095EC1A1D25ED008BFAA6 /* TSAccountManager.h */, + B6B095ED1A1D25ED008BFAA6 /* TSAccountManager.m */, + B6B095EE1A1D25ED008BFAA6 /* TSNumberVerifier.h */, + B6B095EF1A1D25ED008BFAA6 /* TSNumberVerifier.m */, + B6B095F01A1D25ED008BFAA6 /* TSPreKeyManager.h */, + B6B095F11A1D25ED008BFAA6 /* TSPreKeyManager.m */, + ); + path = Account; + sourceTree = ""; + }; + B6B095F21A1D25ED008BFAA6 /* Contacts */ = { + isa = PBXGroup; + children = ( + B6B095F31A1D25ED008BFAA6 /* Threads */, + B6B095F81A1D25ED008BFAA6 /* TSContact.h */, + B6B095F91A1D25ED008BFAA6 /* TSContact.m */, + B6B095FA1A1D25ED008BFAA6 /* TSGroup.h */, + B6B095FB1A1D25ED008BFAA6 /* TSGroup.m */, + B6B095FC1A1D25ED008BFAA6 /* TSRecipient.h */, + B6B095FD1A1D25ED008BFAA6 /* TSRecipient.m */, + B6B095FE1A1D25ED008BFAA6 /* TSThread.h */, + B6B095FF1A1D25ED008BFAA6 /* TSThread.m */, + ); + path = Contacts; + sourceTree = ""; + }; + B6B095F31A1D25ED008BFAA6 /* Threads */ = { + isa = PBXGroup; + children = ( + B6B095F41A1D25ED008BFAA6 /* TSContactThread.h */, + B6B095F51A1D25ED008BFAA6 /* TSContactThread.m */, + B6B095F61A1D25ED008BFAA6 /* TSGroupThread.h */, + B6B095F71A1D25ED008BFAA6 /* TSGroupThread.m */, + ); + path = Threads; + sourceTree = ""; + }; + B6B096001A1D25ED008BFAA6 /* Messages */ = { + isa = PBXGroup; + children = ( + B6B096011A1D25ED008BFAA6 /* IncomingPushMessageSignal.pb.h */, + B6B096021A1D25ED008BFAA6 /* IncomingPushMessageSignal.pb.m */, + B6B096031A1D25ED008BFAA6 /* TSAttachement.h */, + B6B096041A1D25ED008BFAA6 /* TSAttachement.m */, + B6B096051A1D25ED008BFAA6 /* TSCall.h */, + B6B096061A1D25ED008BFAA6 /* TSCall.m */, + B6B096071A1D25ED008BFAA6 /* TSErrorMessage.h */, + B6B096081A1D25ED008BFAA6 /* TSErrorMessage.m */, + B6B096091A1D25ED008BFAA6 /* TSGroupMessageManager.h */, + B6B0960A1A1D25ED008BFAA6 /* TSGroupMessageManager.m */, + B6B0960B1A1D25ED008BFAA6 /* TSIncomingMessage.h */, + B6B0960C1A1D25ED008BFAA6 /* TSIncomingMessage.m */, + B6B0960D1A1D25ED008BFAA6 /* TSInfoMessage.h */, + B6B0960E1A1D25ED008BFAA6 /* TSInfoMessage.m */, + B6B0960F1A1D25ED008BFAA6 /* TSInteraction.h */, + B6B096101A1D25ED008BFAA6 /* TSInteraction.mm */, + B6B096111A1D25ED008BFAA6 /* TSMessage.h */, + B6B096121A1D25ED008BFAA6 /* TSMessage.m */, + B6B096131A1D25ED008BFAA6 /* TSMessagesManager+sendMessages.h */, + B6B096141A1D25ED008BFAA6 /* TSMessagesManager+sendMessages.m */, + B6B096151A1D25ED008BFAA6 /* TSMessagesManager.h */, + B6B096161A1D25ED008BFAA6 /* TSMessagesManager.m */, + B6B096171A1D25ED008BFAA6 /* TSOutgoingMessage.h */, + B6B096181A1D25ED008BFAA6 /* TSOutgoingMessage.m */, + B6B096191A1D25ED008BFAA6 /* TSServerMessage.h */, + B6B0961A1A1D25ED008BFAA6 /* TSServerMessage.m */, + ); + path = Messages; + sourceTree = ""; + }; + B6B0961B1A1D25ED008BFAA6 /* Network */ = { + isa = PBXGroup; + children = ( + B6B0961C1A1D25ED008BFAA6 /* Requests */, + B6B096371A1D25ED008BFAA6 /* TSNetworkManager.h */, + B6B096381A1D25ED008BFAA6 /* TSNetworkManager.m */, + B6B096391A1D25ED008BFAA6 /* TSSocketManager.h */, + B6B0963A1A1D25ED008BFAA6 /* TSSocketManager.m */, + ); + path = Network; + sourceTree = ""; + }; + B6B0961C1A1D25ED008BFAA6 /* Requests */ = { + isa = PBXGroup; + children = ( + B6B0961D1A1D25ED008BFAA6 /* TSContactsIntersectionRequest.h */, + B6B0961E1A1D25ED008BFAA6 /* TSContactsIntersectionRequest.m */, + B6B0961F1A1D25ED008BFAA6 /* TSDeregisterAccountRequest.h */, + B6B096201A1D25ED008BFAA6 /* TSDeregisterAccountRequest.m */, + B6B096211A1D25ED008BFAA6 /* TSRecipientPrekeyRequest.h */, + B6B096221A1D25ED008BFAA6 /* TSRecipientPrekeyRequest.m */, + B6B096231A1D25ED008BFAA6 /* TSRegisterForPushRequest.h */, + B6B096241A1D25ED008BFAA6 /* TSRegisterForPushRequest.m */, + B6B096251A1D25ED008BFAA6 /* TSRegisterPrekeysRequest.h */, + B6B096261A1D25ED008BFAA6 /* TSRegisterPrekeysRequest.m */, + B6B096271A1D25ED008BFAA6 /* TSRegisterWithTokenRequest.h */, + B6B096281A1D25ED008BFAA6 /* TSRegisterWithTokenRequest.m */, + B6B096291A1D25ED008BFAA6 /* TSRequest.h */, + B6B0962A1A1D25ED008BFAA6 /* TSRequest.m */, + B6B0962B1A1D25ED008BFAA6 /* TSRequestAttachment.h */, + B6B0962C1A1D25ED008BFAA6 /* TSRequestAttachment.m */, + B6B0962D1A1D25ED008BFAA6 /* TSRequestAttachmentId.h */, + B6B0962E1A1D25ED008BFAA6 /* TSRequestAttachmentId.m */, + B6B0962F1A1D25ED008BFAA6 /* TSRequestVerificationCodeRequest.h */, + B6B096301A1D25ED008BFAA6 /* TSRequestVerificationCodeRequest.m */, + B6B096311A1D25ED008BFAA6 /* TSServerCodeVerificationRequest.h */, + B6B096321A1D25ED008BFAA6 /* TSServerCodeVerificationRequest.m */, + B6B096331A1D25ED008BFAA6 /* TSSubmitMessageRequest.h */, + B6B096341A1D25ED008BFAA6 /* TSSubmitMessageRequest.m */, + B6B096351A1D25ED008BFAA6 /* TSUploadAttachment.h */, + B6B096361A1D25ED008BFAA6 /* TSUploadAttachment.m */, + ); + path = Requests; + sourceTree = ""; + }; + B6B0963B1A1D25ED008BFAA6 /* Security */ = { + isa = PBXGroup; + children = ( + B6B0963C1A1D25ED008BFAA6 /* SecurityUtils.h */, + B6B0963D1A1D25ED008BFAA6 /* SecurityUtils.m */, + ); + path = Security; + sourceTree = ""; + }; + B6B0963E1A1D25ED008BFAA6 /* Storage */ = { + isa = PBXGroup; + children = ( + B6B0963F1A1D25ED008BFAA6 /* AxolotlStore */, + B6B0964A1A1D25ED008BFAA6 /* TSDatabaseView.h */, + B6B0964B1A1D25ED008BFAA6 /* TSDatabaseView.m */, + B6B0964C1A1D25ED008BFAA6 /* TSStorageKeys.h */, + B6B0964D1A1D25ED008BFAA6 /* TSStorageManager+keyingMaterial.h */, + B6B0964E1A1D25ED008BFAA6 /* TSStorageManager+keyingMaterial.m */, + B6B0964F1A1D25ED008BFAA6 /* TSStorageManager.h */, + B6B096501A1D25ED008BFAA6 /* TSStorageManager.m */, + B6B096511A1D25ED008BFAA6 /* TSYapDatabaseObject.h */, + B6B096521A1D25ED008BFAA6 /* TSYapDatabaseObject.m */, + ); + path = Storage; + sourceTree = ""; + }; + B6B0963F1A1D25ED008BFAA6 /* AxolotlStore */ = { + isa = PBXGroup; + children = ( + B6B096401A1D25ED008BFAA6 /* TSStorageManager+IdentityKeyStore.h */, + B6B096411A1D25ED008BFAA6 /* TSStorageManager+IdentityKeyStore.m */, + B6B096421A1D25ED008BFAA6 /* TSStorageManager+keyFromIntLong.h */, + B6B096431A1D25ED008BFAA6 /* TSStorageManager+keyFromIntLong.m */, + B6B096441A1D25ED008BFAA6 /* TSStorageManager+PreKeyStore.h */, + B6B096451A1D25ED008BFAA6 /* TSStorageManager+PreKeyStore.m */, + B6B096461A1D25ED008BFAA6 /* TSStorageManager+SessionStore.h */, + B6B096471A1D25ED008BFAA6 /* TSStorageManager+SessionStore.m */, + B6B096481A1D25ED008BFAA6 /* TSStorageManager+SignedPreKeyStore.h */, + B6B096491A1D25ED008BFAA6 /* TSStorageManager+SignedPreKeyStore.m */, + ); + path = AxolotlStore; + sourceTree = ""; + }; + B6B096541A1D25ED008BFAA6 /* Util */ = { + isa = PBXGroup; + children = ( + B6B096551A1D25ED008BFAA6 /* Cryptography.h */, + B6B096561A1D25ED008BFAA6 /* Cryptography.m */, + B6B096571A1D25ED008BFAA6 /* NSData+Base64.h */, + B6B096581A1D25ED008BFAA6 /* NSData+Base64.m */, + B6B096591A1D25ED008BFAA6 /* NSData+hexString.h */, + B6B0965A1A1D25ED008BFAA6 /* NSData+hexString.m */, + B6B0965B1A1D25ED008BFAA6 /* NSData+messagePadding.h */, + B6B0965C1A1D25ED008BFAA6 /* NSData+messagePadding.m */, + B6B0965D1A1D25ED008BFAA6 /* NSString+escape.h */, + B6B0965E1A1D25ED008BFAA6 /* NSString+escape.m */, + B6B0965F1A1D25ED008BFAA6 /* NSURLSessionDataTask+StatusCode.h */, + B6B096601A1D25ED008BFAA6 /* NSURLSessionDataTask+StatusCode.m */, + ); + path = Util; + sourceTree = ""; + }; B6B6C3C419193F5B00C0B76B /* Translations */ = { isa = PBXGroup; children = ( @@ -2910,7 +3104,6 @@ isa = PBXGroup; children = ( D221A093169C9E5E00537ABF /* Signal */, - 70B800C8190C55320042E3F0 /* Libraries */, D221A08C169C9E5E00537ABF /* Frameworks */, D221A08A169C9E5E00537ABF /* Products */, 70B8009E190C529C0042E3F0 /* spandsp.xcodeproj */, @@ -2960,8 +3153,8 @@ isa = PBXGroup; children = ( B657DDC91911A40500F45B0C /* Signal.entitlements */, + B633C4FD1A1D190B0059AC12 /* Images */, 765052A318294C9F008313E1 /* Fonts */, - 76AD2C7B17FB4604000246B0 /* Images */, B67EBF5C19194AC60084CCFD /* Settings.bundle */, 76EB03C118170B33006006FC /* src */, D221A094169C9E5E00537ABF /* Supporting Files */, @@ -2974,7 +3167,6 @@ D221A094169C9E5E00537ABF /* Supporting Files */ = { isa = PBXGroup; children = ( - FCAFC2F91A0C4E1700AE5136 /* icons8 */, B6B6C3C419193F5B00C0B76B /* Translations */, E18AB40618A05754001A532A /* AudioFiles */, E1370BDA18A066F600826894 /* Default-568h@2x.png */, @@ -3180,45 +3372,6 @@ name = ViewControllers; sourceTree = ""; }; - FCAFC2F91A0C4E1700AE5136 /* icons8 */ = { - isa = PBXGroup; - children = ( - FC4FA0131A1A180D00DA100A /* red-delete@2x.png */, - FC4FA0141A1A180D00DA100A /* delete@2x.png */, - FC4FA0151A1A180D00DA100A /* archive@2x.png */, - FC4FA0161A1A180D00DA100A /* blue-archive@2x.png */, - FC4FA00C1A18CC4300DA100A /* shred@2x.png */, - FC4FA0081A18BF3100DA100A /* lock_white@2x.png */, - FC4FA0061A18BDAE00DA100A /* info@2x.png */, - FC4F9FFE1A17A39E00DA100A /* photo@2x.png */, - FC4F9FFC1A179FCF00DA100A /* lock@2x.png */, - FC4F9FEE1A1664EA00DA100A /* mute_off@2x.png */, - FC4F9FEF1A1664EA00DA100A /* speaker_off@2x.png */, - FC4F9FF01A1664EA00DA100A /* speaker_on@2x.png */, - FC4F9FF11A1664EA00DA100A /* mute_on@2x.png */, - FC4F9FF21A1664EA00DA100A /* endcall@2x.png */, - FC4F9FEC1A1658EE00DA100A /* call@2x.png */, - FC4F9FE41A16258C00DA100A /* logo_intro@2x.png */, - FCB11D8D1A12A388002F93FB /* savephoto@2x.png */, - FCB11D8E1A12A388002F93FB /* quit@2x.png */, - FCAFC3351A0D680100AE5136 /* keypad@2x.png */, - FCAFC3331A0D656100AE5136 /* contacts_tab@2x.png */, - FCAFC32F1A0D5E3000AE5136 /* share@2x.png */, - FCAFC32D1A0D46D500AE5136 /* settings_dark@2x.png */, - FCAFC3251A0D466F00AE5136 /* delete_history@2x.png */, - FCAFC3261A0D466F00AE5136 /* signal@2x.png */, - FCAFC3271A0D466F00AE5136 /* call_dark@2x.png */, - FCAFC3201A0D394300AE5136 /* favourite.png */, - FCAFC3091A0C560E00AE5136 /* signals.png */, - FCAFC30A1A0C560E00AE5136 /* settings.png */, - FCAFC2EF1A0C4ACF00AE5136 /* received.png */, - FCAFC2F01A0C4ACF00AE5136 /* missed.png */, - FCAFC2ED1A0C472200AE5136 /* reply.png */, - FCAFC2EB1A0C469C00AE5136 /* checkmark.png */, - ); - name = icons8; - sourceTree = ""; - }; FCFD25791A1543D500F4C644 /* Signup */ = { isa = PBXGroup; children = ( @@ -3226,6 +3379,8 @@ FCFD257E1A154B2C00F4C644 /* RegistrationViewController.m */, FCFD25801A154B3800F4C644 /* CodeVerificationViewController.h */, FCFD25811A154B3800F4C644 /* CodeVerificationViewController.m */, + FC4FA0311A1D46AE00DA100A /* InitialViewController.h */, + FC4FA0321A1D46AE00DA100A /* InitialViewController.m */, ); name = Signup; sourceTree = ""; @@ -3399,178 +3554,166 @@ buildActionMask = 2147483647; files = ( E148750018A06966002CC4F3 /* CallAudioManagerDemo.xib in Resources */, - E148750118A06966002CC4F3 /* CallLogViewController.xib in Resources */, - E148750218A06966002CC4F3 /* ContactBrowseViewController.xib in Resources */, + B633C5DC1A1D190B0059AC12 /* shred@2x.png in Resources */, + B633C5E91A1D190B0059AC12 /* spinner_connecting_flash.png in Resources */, + B633C5E61A1D190B0059AC12 /* speaker_on@2x.png in Resources */, + B633C5BB1A1D190B0059AC12 /* message_bubble.png in Resources */, E148750318A06966002CC4F3 /* ContactDetailTableViewCell.xib in Resources */, - FCAFC3341A0D656100AE5136 /* contacts_tab@2x.png in Resources */, + B633C5B51A1D190B0059AC12 /* lock@2x.png in Resources */, E148750418A06966002CC4F3 /* ContactDetailViewController.xib in Resources */, + B633C58E1A1D190B0059AC12 /* contacts.png in Resources */, + B633C5A41A1D190B0059AC12 /* favourite_true_icon@2x.png in Resources */, E148750518A06966002CC4F3 /* CountryCodeViewController.xib in Resources */, + B633C5C41A1D190B0059AC12 /* mute_on@2x.png in Resources */, + B633C5F41A1D190B0059AC12 /* tab_icon_inbox@2x.png in Resources */, E148750618A06966002CC4F3 /* DialerViewController.xib in Resources */, - E148750818A06966002CC4F3 /* FavouritesViewController.xib in Resources */, - E148750918A06966002CC4F3 /* InboxFeedViewController.xib in Resources */, + B633C5CE1A1D190B0059AC12 /* quit@2x.png in Resources */, E148750A18A06966002CC4F3 /* InCallViewController.xib in Resources */, - FCAFC32E1A0D46D500AE5136 /* settings_dark@2x.png in Resources */, - B6416FD2199A0478003C5699 /* Localizable.strings in Resources */, - E148750B18A06966002CC4F3 /* InviteContactsViewController.xib in Resources */, - FCB11D901A12A388002F93FB /* quit@2x.png in Resources */, - FC4FA00D1A18CC4300DA100A /* shred@2x.png in Resources */, - E148750C18A06966002CC4F3 /* LeftSideMenuViewController.xib in Resources */, + B633C5E71A1D190B0059AC12 /* spinner_connecting.png in Resources */, E148750D18A06966002CC4F3 /* PreferenceListViewController.xib in Resources */, - FCAFC3301A0D5E3000AE5136 /* share@2x.png in Resources */, - FC4F9FE51A16258C00DA100A /* logo_intro@2x.png in Resources */, + B633C5D01A1D190B0059AC12 /* red-delete@2x.png in Resources */, + B633C59D1A1D190B0059AC12 /* endcall@2x.png in Resources */, + B633C5C91A1D190B0059AC12 /* outgoing_call_icon.png in Resources */, E148750E18A06966002CC4F3 /* RegisterViewController.xib in Resources */, - E148750F18A06966002CC4F3 /* SettingsViewController.xib in Resources */, - E148751018A06966002CC4F3 /* TabBarParentViewController.xib in Resources */, - E14874F718A06951002CC4F3 /* CallLogTableViewCell.xib in Resources */, + B633C5EA1A1D190B0059AC12 /* spinner_connecting_flash@2x.png in Resources */, + B633C5E31A1D190B0059AC12 /* speaker_icon_selected.png in Resources */, + B633C5B01A1D190B0059AC12 /* incoming_call_icon.png in Resources */, + B633C5CF1A1D190B0059AC12 /* received.png in Resources */, + B633C5AD1A1D190B0059AC12 /* in_call_phone_icon@2x.png in Resources */, + B633C5FA1A1D190B0059AC12 /* trash_icon@2x.png in Resources */, + B633C5C11A1D190B0059AC12 /* mute_icon_selected.png in Resources */, + B633C5AA1A1D190B0059AC12 /* icon_keypad.png in Resources */, + B633C5B41A1D190B0059AC12 /* keypad@2x.png in Resources */, + B633C5FD1A1D190B0059AC12 /* volume_low.png in Resources */, + B633C5DA1A1D190B0059AC12 /* settings_dark@2x.png in Resources */, E14874F818A06951002CC4F3 /* ContactTableViewCell.xib in Resources */, + B633C5BC1A1D190B0059AC12 /* message_bubble@2x.png in Resources */, + B633C5EF1A1D190B0059AC12 /* tab_icon_contacts.png in Resources */, + B633C5D11A1D190B0059AC12 /* reply.png in Resources */, + B633C5EE1A1D190B0059AC12 /* spinner_ringing@2x.png in Resources */, + B633C6001A1D190B0059AC12 /* whisper_notification_icon@2x.png in Resources */, E14874F918A06951002CC4F3 /* CountryCodeTableViewCell.xib in Resources */, + B633C5BF1A1D190B0059AC12 /* mute_icon.png in Resources */, + B633C5ED1A1D190B0059AC12 /* spinner_ringing.png in Resources */, E14874FA18A06951002CC4F3 /* FavouriteTableViewCell.xib in Resources */, - FCAFC2EE1A0C472200AE5136 /* reply.png in Resources */, - E14874FB18A06951002CC4F3 /* InboxFeedFooterCell.xib in Resources */, - E14874FC18A06951002CC4F3 /* InboxFeedTableViewCell.xib in Resources */, + B633C5911A1D190B0059AC12 /* contacts_arrow@2x.png in Resources */, + B633C5871A1D190B0059AC12 /* call_dark@2x.png in Resources */, + B633C5FC1A1D190B0059AC12 /* volume_high@2x.png in Resources */, + B633C5BE1A1D190B0059AC12 /* missed.png in Resources */, E14874FD18A06951002CC4F3 /* LeftSideMenuCell.xib in Resources */, + B633C5AC1A1D190B0059AC12 /* in_call_phone_icon.png in Resources */, + B633C5851A1D190B0059AC12 /* blue-archive@2x.png in Resources */, + B633C5BD1A1D190B0059AC12 /* message_icon.png in Resources */, + B633C5AF1A1D190B0059AC12 /* in_call_phrase_icon@2x.png in Resources */, + B633C5D21A1D190B0059AC12 /* savephoto@2x.png in Resources */, E14874FE18A06951002CC4F3 /* PreferenceListTableViewCell.xib in Resources */, E14874FF18A06951002CC4F3 /* UnseenWhisperUserCell.xib in Resources */, - FC4F9FFF1A17A39E00DA100A /* photo@2x.png in Resources */, - E14874A218A0692F002CC4F3 /* archive_icon.png in Resources */, - FCAFC32A1A0D466F00AE5136 /* call_dark@2x.png in Resources */, - E14874A318A0692F002CC4F3 /* archive_icon@2x.png in Resources */, - E14874A418A0692F002CC4F3 /* backspace.png in Resources */, - E14874A518A0692F002CC4F3 /* backspace@2x.png in Resources */, - E14874A618A0692F002CC4F3 /* checkbox_checkmark.png in Resources */, - E14874A718A0692F002CC4F3 /* checkbox_checkmark@2x.png in Resources */, - E14874A818A0692F002CC4F3 /* checkbox_empty.png in Resources */, - E14874A918A0692F002CC4F3 /* checkbox_empty@2x.png in Resources */, - E14874AA18A0692F002CC4F3 /* contact_default_feed.png in Resources */, - E14874AB18A0692F002CC4F3 /* contacts_arrow.png in Resources */, - E14874AC18A0692F002CC4F3 /* contacts_arrow@2x.png in Resources */, - E14874AD18A0692F002CC4F3 /* DefaultContactImage.png in Resources */, - E14874AE18A0692F002CC4F3 /* dismiss_notification_icon.png in Resources */, - E14874AF18A0692F002CC4F3 /* dismiss_notification_icon@2x.png in Resources */, - E14874B018A0692F002CC4F3 /* drop_down_arrow_icon.png in Resources */, - FC4F9FF61A1664EA00DA100A /* mute_on@2x.png in Resources */, - FCAFC2F21A0C4ACF00AE5136 /* missed.png in Resources */, - FC4F9FF31A1664EA00DA100A /* mute_off@2x.png in Resources */, - E14874B118A0692F002CC4F3 /* drop_down_arrow_icon@2x.png in Resources */, - E14874B218A0692F002CC4F3 /* expanded_cell_icon.png in Resources */, - E14874B318A0692F002CC4F3 /* expanded_cell_icon@2x.png in Resources */, - E14874B418A0692F002CC4F3 /* favourite_false_icon.png in Resources */, - E14874B518A0692F002CC4F3 /* favourite_false_icon@2x.png in Resources */, - E14874B618A0692F002CC4F3 /* favourite_true_icon.png in Resources */, - E14874B718A0692F002CC4F3 /* favourite_true_icon@2x.png in Resources */, - FCAFC3211A0D394300AE5136 /* favourite.png in Resources */, - E14874B818A0692F002CC4F3 /* forward_button.png in Resources */, - B6416FD4199A0478003C5699 /* Localizable.strings in Resources */, - FCAFC2EC1A0C469C00AE5136 /* checkmark.png in Resources */, - E14874B918A0692F002CC4F3 /* forward_button@2x.png in Resources */, - FCAFC3281A0D466F00AE5136 /* delete_history@2x.png in Resources */, - E14874BA18A0692F002CC4F3 /* home_icon.png in Resources */, - E14874BB18A0692F002CC4F3 /* icon_contacts.png in Resources */, - FC4FA0071A18BDAE00DA100A /* info@2x.png in Resources */, - E14874BC18A0692F002CC4F3 /* icon_favourites.png in Resources */, - E14874BD18A0692F002CC4F3 /* icon_keypad.png in Resources */, - E14874BE18A0692F002CC4F3 /* icon_recents.png in Resources */, - E14874BF18A0692F002CC4F3 /* in_call_phone_icon.png in Resources */, - E14874C018A0692F002CC4F3 /* in_call_phone_icon@2x.png in Resources */, - E14874C118A0692F002CC4F3 /* in_call_phrase_icon.png in Resources */, - E16E5C1518AEDB5A00B7C403 /* phone_icon.png in Resources */, - E14874C218A0692F002CC4F3 /* in_call_phrase_icon@2x.png in Resources */, - E14874C318A0692F002CC4F3 /* incoming_call_icon.png in Resources */, - FC4F9FF51A1664EA00DA100A /* speaker_on@2x.png in Resources */, - E14874C418A0692F002CC4F3 /* incoming_call_icon@2x.png in Resources */, - E14874C518A0692F002CC4F3 /* menu_icon.png in Resources */, - E14874C618A0692F002CC4F3 /* menu_icon@2x.png in Resources */, - E14874C718A0692F002CC4F3 /* message_bubble.png in Resources */, - E14874C818A0692F002CC4F3 /* message_bubble@2x.png in Resources */, - E14874C918A0692F002CC4F3 /* mute_icon_selected.png in Resources */, - E14874CA18A0692F002CC4F3 /* mute_icon_selected@2x.png in Resources */, - E14874CB18A0692F002CC4F3 /* mute_icon.png in Resources */, - E14874CC18A0692F002CC4F3 /* mute_icon@2x.png in Resources */, - E14874CD18A0692F002CC4F3 /* notification_detail_icon.png in Resources */, - E14874CE18A0692F002CC4F3 /* notification_detail_icon@2x.png in Resources */, - E14874CF18A0692F002CC4F3 /* notification_mini_icon.png in Resources */, - E14874D018A0692F002CC4F3 /* notification_mini_icon@2x.png in Resources */, - E14874D118A0692F002CC4F3 /* outgoing_call_icon.png in Resources */, - E14874D218A0692F002CC4F3 /* outgoing_call_icon@2x.png in Resources */, + B633C5D41A1D190B0059AC12 /* search_cancel@2x.png in Resources */, + B633C5A51A1D190B0059AC12 /* forward_button.png in Resources */, + B633C5F11A1D190B0059AC12 /* tab_icon_favourites.png in Resources */, + B633C5D81A1D190B0059AC12 /* send_code_icon@2x.png in Resources */, + B633C5CC1A1D190B0059AC12 /* phone_icon@2x.png in Resources */, + B633C58C1A1D190B0059AC12 /* checkmark.png in Resources */, + B633C5921A1D190B0059AC12 /* contacts_tab@2x.png in Resources */, + B633C5AE1A1D190B0059AC12 /* in_call_phrase_icon.png in Resources */, + B633C5D51A1D190B0059AC12 /* search_icon.png in Resources */, + B633C5811A1D190B0059AC12 /* archive_icon.png in Resources */, B6416FB8199A0478003C5699 /* Localizable.strings in Resources */, - E14874D318A0692F002CC4F3 /* search_cancel.png in Resources */, - E14874D418A0692F002CC4F3 /* search_cancel@2x.png in Resources */, - E14874D518A0692F002CC4F3 /* search_icon.png in Resources */, - FC4F9FFD1A179FCF00DA100A /* lock@2x.png in Resources */, - E14874D618A0692F002CC4F3 /* search_icon@2x.png in Resources */, - E14874D718A0692F002CC4F3 /* send_code_icon.png in Resources */, - B6416FC8199A0478003C5699 /* Localizable.strings in Resources */, - FCAFC3361A0D680100AE5136 /* keypad@2x.png in Resources */, - E14874D818A0692F002CC4F3 /* send_code_icon@2x.png in Resources */, - E14874D918A0692F002CC4F3 /* speaker_icon_selected.png in Resources */, - FC4FA0191A1A180D00DA100A /* archive@2x.png in Resources */, - E14874DA18A0692F002CC4F3 /* speaker_icon_selected@2x.png in Resources */, - E14874DB18A0692F002CC4F3 /* speaker_icon.png in Resources */, - FC4FA0171A1A180D00DA100A /* red-delete@2x.png in Resources */, - E14874DC18A0692F002CC4F3 /* speaker_icon@2x.png in Resources */, - E14874DD18A0692F002CC4F3 /* spinner_connecting_flash.png in Resources */, - E14874DE18A0692F002CC4F3 /* spinner_connecting_flash@2x.png in Resources */, - E14874DF18A06930002CC4F3 /* spinner_connecting.png in Resources */, + B633C5F81A1D190B0059AC12 /* tab_icon_menu@2x.png in Resources */, + B633C5D91A1D190B0059AC12 /* settings.png in Resources */, + B633C5FB1A1D190B0059AC12 /* volume_high.png in Resources */, + B633C5971A1D190B0059AC12 /* delete@2x.png in Resources */, FCAC964119FEF99A0046DFC5 /* TableViewCell.xib in Resources */, - B6416FBF199A0478003C5699 /* Localizable.strings in Resources */, - B6416FB7199A0478003C5699 /* Localizable.strings in Resources */, + B633C5E21A1D190B0059AC12 /* speaker_icon@2x.png in Resources */, + B633C5A91A1D190B0059AC12 /* icon_favourites.png in Resources */, B66DBF4A19D5BBC8006EA940 /* Images.xcassets in Resources */, - E14874E218A06930002CC4F3 /* spinner_error@2x.png in Resources */, - E14874E318A06930002CC4F3 /* spinner_ringing.png in Resources */, - E14874E418A06930002CC4F3 /* spinner_ringing@2x.png in Resources */, - E14874E518A06930002CC4F3 /* tab_icon_contacts.png in Resources */, - E14874E618A06930002CC4F3 /* tab_icon_contacts@2x.png in Resources */, - FCAFC3291A0D466F00AE5136 /* signal@2x.png in Resources */, - E14874E718A06930002CC4F3 /* tab_icon_favourites.png in Resources */, - FCAFC30C1A0C560E00AE5136 /* signals.png in Resources */, - E14874E818A06930002CC4F3 /* tab_icon_favourites@2x.png in Resources */, - E14874E918A06930002CC4F3 /* tab_icon_inbox.png in Resources */, - FC4FA01A1A1A180D00DA100A /* blue-archive@2x.png in Resources */, - E14874EA18A06930002CC4F3 /* tab_icon_inbox@2x.png in Resources */, - E14874EB18A06930002CC4F3 /* tab_icon_keypad.png in Resources */, - E14874EC18A06930002CC4F3 /* tab_icon_keypad@2x.png in Resources */, - E14874ED18A06930002CC4F3 /* tab_icon_menu.png in Resources */, - E14874EE18A06930002CC4F3 /* tab_icon_menu@2x.png in Resources */, - E14874EF18A06930002CC4F3 /* trash_icon.png in Resources */, - E14874F018A06930002CC4F3 /* trash_icon@2x.png in Resources */, - E14874F118A06930002CC4F3 /* volume_high.png in Resources */, - E14874F218A06930002CC4F3 /* volume_high@2x.png in Resources */, + B633C58B1A1D190B0059AC12 /* checkbox_empty@2x.png in Resources */, 70B8FEE21909FE360042E3F0 /* 171756__nenadsimic__picked-coin-echo-2.wav in Resources */, - FC4F9FF71A1664EA00DA100A /* endcall@2x.png in Resources */, - E14874F318A06930002CC4F3 /* volume_low.png in Resources */, - E14874F418A06930002CC4F3 /* volume_low@2x.png in Resources */, - E14874F518A06930002CC4F3 /* whisper_notification_icon.png in Resources */, - E14874F618A06930002CC4F3 /* whisper_notification_icon@2x.png in Resources */, + B633C5881A1D190B0059AC12 /* checkbox_checkmark.png in Resources */, + B633C5E81A1D190B0059AC12 /* spinner_connecting@2x.png in Resources */, + B633C59B1A1D190B0059AC12 /* drop_down_arrow_icon.png in Resources */, + B633C5F71A1D190B0059AC12 /* tab_icon_menu.png in Resources */, + B633C5B91A1D190B0059AC12 /* menu_icon.png in Resources */, + B633C5E41A1D190B0059AC12 /* speaker_icon_selected@2x.png in Resources */, + B633C5801A1D190B0059AC12 /* archive@2x.png in Resources */, E1370BEA18A0689000826894 /* AppIcon29x29.jpg in Resources */, E1370BEB18A0689000826894 /* AppIcon29x29.png in Resources */, + B633C5E11A1D190B0059AC12 /* speaker_icon.png in Resources */, + B633C5A31A1D190B0059AC12 /* favourite_true_icon.png in Resources */, E1370BEC18A0689000826894 /* AppIcon29x29@2x.png in Resources */, + B633C5991A1D190B0059AC12 /* dismiss_notification_icon.png in Resources */, + B633C5F61A1D190B0059AC12 /* tab_icon_keypad@2x.png in Resources */, + B633C5F91A1D190B0059AC12 /* trash_icon.png in Resources */, E1370BED18A0689000826894 /* AppIcon40x40.png in Resources */, + B633C5C31A1D190B0059AC12 /* mute_off@2x.png in Resources */, E1370BEE18A0689000826894 /* AppIcon40x40@2x.png in Resources */, - E16E5C1418AEDB5A00B7C403 /* message_icon.png in Resources */, + B633C5FE1A1D190B0059AC12 /* volume_low@2x.png in Resources */, + B633C58A1A1D190B0059AC12 /* checkbox_empty.png in Resources */, + B633C59C1A1D190B0059AC12 /* drop_down_arrow_icon@2x.png in Resources */, + B633C5E01A1D190B0059AC12 /* signals.png in Resources */, E1370BEF18A0689000826894 /* AppIcon60x60.png in Resources */, - FC4F9FED1A1658EE00DA100A /* call@2x.png in Resources */, + B633C5FF1A1D190B0059AC12 /* whisper_notification_icon.png in Resources */, + B633C5901A1D190B0059AC12 /* contacts_arrow.png in Resources */, + B633C5BA1A1D190B0059AC12 /* menu_icon@2x.png in Resources */, E1370BF018A0689000826894 /* AppIcon60x60@2x.png in Resources */, - FC4FA0181A1A180D00DA100A /* delete@2x.png in Resources */, - FC4FA0091A18BF3100DA100A /* lock_white@2x.png in Resources */, + B633C5D71A1D190B0059AC12 /* send_code_icon.png in Resources */, + B633C59A1A1D190B0059AC12 /* dismiss_notification_icon@2x.png in Resources */, + B633C5821A1D190B0059AC12 /* archive_icon@2x.png in Resources */, + B633C5D31A1D190B0059AC12 /* search_cancel.png in Resources */, E1370BF118A0689000826894 /* AppIcon76x76.png in Resources */, E1370BF218A0689000826894 /* AppIcon76x76@2x.png in Resources */, E1370BE718A0688300826894 /* Default-568h@2x.png in Resources */, + B633C5F31A1D190B0059AC12 /* tab_icon_inbox.png in Resources */, + B633C5B61A1D190B0059AC12 /* lock_white@2x.png in Resources */, + B633C5DF1A1D190B0059AC12 /* signal@2x.png in Resources */, + B633C5CA1A1D190B0059AC12 /* outgoing_call_icon@2x.png in Resources */, E1370BE818A0688300826894 /* Default.png in Resources */, - FCAFC30D1A0C560E00AE5136 /* settings.png in Resources */, + B633C5A11A1D190B0059AC12 /* favourite_false_icon.png in Resources */, + B633C5F01A1D190B0059AC12 /* tab_icon_contacts@2x.png in Resources */, + B633C5831A1D190B0059AC12 /* backspace.png in Resources */, E1370BE918A0688300826894 /* Default@2x.png in Resources */, E1370BE018A0686600826894 /* busy.mp3 in Resources */, + B633C5A01A1D190B0059AC12 /* favourite.png in Resources */, E1370BE118A0686C00826894 /* completed.mp3 in Resources */, + B633C5EB1A1D190B0059AC12 /* spinner_error.png in Resources */, E1370BE218A0686C00826894 /* failure.mp3 in Resources */, - FCAFC2F11A0C4ACF00AE5136 /* received.png in Resources */, + B633C5C61A1D190B0059AC12 /* notification_detail_icon@2x.png in Resources */, + B633C5F51A1D190B0059AC12 /* tab_icon_keypad.png in Resources */, + B633C59F1A1D190B0059AC12 /* expanded_cell_icon@2x.png in Resources */, + B633C5D61A1D190B0059AC12 /* search_icon@2x.png in Resources */, + B633C5DB1A1D190B0059AC12 /* share@2x.png in Resources */, E1370BE318A0686C00826894 /* handshake.mp3 in Resources */, - B6416FCA199A0478003C5699 /* Localizable.strings in Resources */, + B633C58D1A1D190B0059AC12 /* contact_default_feed.png in Resources */, + B633C5C21A1D190B0059AC12 /* mute_icon_selected@2x.png in Resources */, + B633C5A71A1D190B0059AC12 /* home_icon.png in Resources */, + B633C5B11A1D190B0059AC12 /* incoming_call_icon@2x.png in Resources */, + B633C5B21A1D190B0059AC12 /* info@2x.png in Resources */, + B633C5AB1A1D190B0059AC12 /* icon_recents.png in Resources */, + B633C5CD1A1D190B0059AC12 /* photo@2x.png in Resources */, + B633C59E1A1D190B0059AC12 /* expanded_cell_icon.png in Resources */, + B633C5C51A1D190B0059AC12 /* notification_detail_icon.png in Resources */, + B633C5A81A1D190B0059AC12 /* icon_contacts.png in Resources */, + B633C5861A1D190B0059AC12 /* call@2x.png in Resources */, + B633C5C71A1D190B0059AC12 /* notification_mini_icon.png in Resources */, FCAC963519FEF4E20046DFC5 /* Storyboard.storyboard in Resources */, B67EBF5D19194AC60084CCFD /* Settings.bundle in Resources */, E1370BE418A0686C00826894 /* outring.mp3 in Resources */, - FC4F9FF41A1664EA00DA100A /* speaker_off@2x.png in Resources */, - FCB11D8F1A12A388002F93FB /* savephoto@2x.png in Resources */, + B633C5841A1D190B0059AC12 /* backspace@2x.png in Resources */, + B633C5CB1A1D190B0059AC12 /* phone_icon.png in Resources */, + B633C5A21A1D190B0059AC12 /* favourite_false_icon@2x.png in Resources */, + B633C5EC1A1D190B0059AC12 /* spinner_error@2x.png in Resources */, + B633C5F21A1D190B0059AC12 /* tab_icon_favourites@2x.png in Resources */, + B633C5B71A1D190B0059AC12 /* logo_intro@2x.png in Resources */, E1370BE518A0686C00826894 /* r.caf in Resources */, + B633C5C81A1D190B0059AC12 /* notification_mini_icon@2x.png in Resources */, + B633C5981A1D190B0059AC12 /* delete_history@2x.png in Resources */, + B633C5E51A1D190B0059AC12 /* speaker_off@2x.png in Resources */, + B633C5891A1D190B0059AC12 /* checkbox_checkmark@2x.png in Resources */, + B633C58F1A1D190B0059AC12 /* contacts@2x.png in Resources */, + B633C5C01A1D190B0059AC12 /* mute_icon@2x.png in Resources */, E1370BE618A0686C00826894 /* sonarping.mp3 in Resources */, + B633C5961A1D190B0059AC12 /* DefaultContactImage.png in Resources */, + B633C5A61A1D190B0059AC12 /* forward_button@2x.png in Resources */, E148751218A06AFD002CC4F3 /* HelveticaNeueLTStd-Bd.otf in Resources */, E148751318A06AFD002CC4F3 /* HelveticaNeueLTStd-Th.otf in Resources */, E148751418A06AFD002CC4F3 /* HelveticaNeueLTStd-Lt.otf in Resources */, @@ -3584,20 +3727,13 @@ buildActionMask = 2147483647; files = ( B96A3100187DA1B600648F3E /* HelveticaNeueLTStd-Bd.otf in Resources */, - 76EB067518170B34006006FC /* FavouritesViewController.xib in Resources */, - 76EB069718170B34006006FC /* InboxFeedTableViewCell.xib in Resources */, 765052AC18294C9F008313E1 /* HelveticaNeueLTStd-Md.otf in Resources */, 76EB060118170B33006006FC /* InitiateSignal.proto in Resources */, - 76EB066718170B34006006FC /* TabBarParentViewController.xib in Resources */, - 76C87F17181EE2EB00C4ACAB /* InboxFeedFooterCell.xib in Resources */, 765052AA18294C9F008313E1 /* HelveticaNeueLTStd-Lt.otf in Resources */, - B9CA51BD18809ACA007E204E /* InviteContactsViewController.xib in Resources */, B97CBFAB18860EA3008E0DE9 /* CountryCodeViewController.xib in Resources */, - 76EB067B18170B34006006FC /* LeftSideMenuViewController.xib in Resources */, B9EB5ACA1884D387007CBB57 /* UnseenWhisperUserCell.xib in Resources */, 76EB067118170B34006006FC /* DialerViewController.xib in Resources */, 76EB067918170B34006006FC /* InCallViewController.xib in Resources */, - 76EB068318170B34006006FC /* SettingsViewController.xib in Resources */, 76EB068118170B34006006FC /* RegisterViewController.xib in Resources */, B6850E5A1995A4710068E715 /* whisperFake.cer in Resources */, B97CBFB218861023008E0DE9 /* CountryCodeTableViewCell.xib in Resources */, @@ -3606,11 +3742,7 @@ 76D713EB182D3E5100C9C9C8 /* PreferenceListTableViewCell.xib in Resources */, 76EB066F18170B34006006FC /* ContactDetailViewController.xib in Resources */, 76EB069318170B34006006FC /* ContactTableViewCell.xib in Resources */, - 76EB067718170B34006006FC /* InboxFeedViewController.xib in Resources */, 76EB066918170B34006006FC /* CallAudioManagerDemo.xib in Resources */, - 76EB069D18170B34006006FC /* CallLogTableViewCell.xib in Resources */, - 76EB067D18170B34006006FC /* CallLogViewController.xib in Resources */, - B942EB10183AC467000887BB /* ContactBrowseViewController.xib in Resources */, 765052B3182BF839008313E1 /* HelveticaNeueLTStd-Th.otf in Resources */, 76B818A1182C39460088060E /* PreferenceListViewController.xib in Resources */, 76EB066D18170B34006006FC /* ContactDetailTableViewCell.xib in Resources */, @@ -3711,39 +3843,47 @@ 76EB062418170B33006006FC /* PriorityQueue.m in Sources */, 76EB061A18170B33006006FC /* DiscardingLog.m in Sources */, 76EB068418170B34006006FC /* ContactDetailTableViewCell.m in Sources */, - 76EB066218170B34006006FC /* SettingsViewController.m in Sources */, + B6B096621A1D25ED008BFAA6 /* TSNumberVerifier.m in Sources */, + B6B0968B1A1D25ED008BFAA6 /* TSStorageManager+SignedPreKeyStore.m in Sources */, + B6B0966E1A1D25ED008BFAA6 /* TSGroupMessageManager.m in Sources */, 76EB05AC18170B33006006FC /* SrtpSocket.m in Sources */, FCB11D931A12A4AA002F93FB /* FullImageViewController.m in Sources */, + B6B096871A1D25ED008BFAA6 /* TSStorageManager+IdentityKeyStore.m in Sources */, B60C16651988999D00E97A6C /* VersionMigrations.m in Sources */, 76EB062A18170B33006006FC /* BadState.m in Sources */, B97940271832BD2400BD66CB /* UIUtil.m in Sources */, + B6B096861A1D25ED008BFAA6 /* SecurityUtils.m in Sources */, 76EB05BE18170B33006006FC /* ConfirmPacket.m in Sources */, 76EB058618170B33006006FC /* PreferencesUtil.m in Sources */, 76EB05A818170B33006006FC /* RtpSocket.m in Sources */, - 70B80119190C55660042E3F0 /* TextFormat.m in Sources */, + B6B096911A1D25ED008BFAA6 /* NSData+Base64.m in Sources */, + B6B096751A1D25ED008BFAA6 /* TSOutgoingMessage.m in Sources */, E197B61818BBEC1A00F073E5 /* RemoteIOAudio.m in Sources */, - 70B8011C190C55660042E3F0 /* Utilities.m in Sources */, B67ADDC41989FF8700E1A773 /* RPServerRequestsManager.m in Sources */, 76EB059418170B33006006FC /* HttpManager.m in Sources */, 76EB05EC18170B33006006FC /* CallState.m in Sources */, + B6B096811A1D25ED008BFAA6 /* TSServerCodeVerificationRequest.m in Sources */, 76EB05D218170B33006006FC /* ZrtpInitiator.m in Sources */, 76EB05E018170B33006006FC /* NetworkStream.m in Sources */, + B6B0968A1A1D25ED008BFAA6 /* TSStorageManager+SessionStore.m in Sources */, + B6B096891A1D25ED008BFAA6 /* TSStorageManager+PreKeyStore.m in Sources */, + FC4FA0331A1D46AE00DA100A /* InitialViewController.m in Sources */, B6B9ECFC198B31BA00C620D3 /* PushManager.m in Sources */, 76EB05D618170B33006006FC /* ZrtpResponder.m in Sources */, - 70B8010E190C55660042E3F0 /* CodedInputStream.m in Sources */, 7095B7B018F46D35002C66E2 /* PhoneNumberUtil.m in Sources */, - 70B8010F190C55660042E3F0 /* CodedOutputStream.m in Sources */, - 70B8010C190C55660042E3F0 /* AbstractMessage.m in Sources */, + B6B096791A1D25ED008BFAA6 /* TSRecipientPrekeyRequest.m in Sources */, E197B61618BBEC1A00F073E5 /* StretchFactorController.m in Sources */, FCFD257F1A154B2C00F4C644 /* RegistrationViewController.m in Sources */, 76EB065018170B34006006FC /* DialerViewController.m in Sources */, 701231B518ECAA4500D456C4 /* EvpMessageDigest.m in Sources */, 76EB062218170B33006006FC /* CyclicalBuffer.m in Sources */, 76EB063C18170B33006006FC /* NumberUtil.m in Sources */, + B6B096691A1D25ED008BFAA6 /* TSThread.m in Sources */, + B6B096641A1D25ED008BFAA6 /* TSContactThread.m in Sources */, 76EB063A18170B33006006FC /* FunctionalUtil.m in Sources */, - 70B80117190C55660042E3F0 /* MutableExtensionRegistry.m in Sources */, 76EB060A18170B33006006FC /* SignalUtil.m in Sources */, 76EB062818170B33006006FC /* BadArgument.m in Sources */, + B6B096671A1D25ED008BFAA6 /* TSGroup.m in Sources */, 76EB062E18170B33006006FC /* SecurityFailure.m in Sources */, 76EB05F218170B33006006FC /* PhoneNumber.m in Sources */, E197B61718BBEC1A00F073E5 /* AnonymousAudioCallbackHandler.m in Sources */, @@ -3754,6 +3894,7 @@ E197B62718BBF63B00F073E5 /* SoundBoard.m in Sources */, 76EB058418170B33006006FC /* LocalizableText.m in Sources */, 76EB057A18170B33006006FC /* ContactsManager.m in Sources */, + B6B096611A1D25ED008BFAA6 /* TSAccountManager.m in Sources */, E197B61918BBEC1A00F073E5 /* RemoteIOBufferListWrapper.m in Sources */, 76EB05A618170B33006006FC /* RtpPacket.m in Sources */, 76EB064218170B33006006FC /* StringUtil.m in Sources */, @@ -3764,23 +3905,23 @@ 76EB063018170B33006006FC /* Conversions.m in Sources */, FCAFC33F1A0F948F00AE5136 /* ActionContactDetailCell.m in Sources */, 76EB065618170B34006006FC /* InCallViewController.m in Sources */, + B6B096681A1D25ED008BFAA6 /* TSRecipient.m in Sources */, 76EB05FE18170B33006006FC /* InitiateSignal.pb.m in Sources */, - 76EB064C18170B34006006FC /* ContactBrowseViewController.m in Sources */, 76EB05CA18170B33006006FC /* RecipientUnavailable.m in Sources */, - 70B80115190C55660042E3F0 /* GeneratedMessage.m in Sources */, + B6B0968D1A1D25ED008BFAA6 /* TSStorageManager+keyingMaterial.m in Sources */, E197B61418BBEC1A00F073E5 /* DropoutTracker.m in Sources */, 76EB062C18170B33006006FC /* OperationFailed.m in Sources */, FCAC963C19FEF9280046DFC5 /* SignalsViewController.m in Sources */, + B6B0967B1A1D25ED008BFAA6 /* TSRegisterPrekeysRequest.m in Sources */, 707E549218FF26E800C8649D /* SmsInvite.m in Sources */, 76EB05DA18170B33006006FC /* LowLatencyConnector.m in Sources */, 76EB05EE18170B33006006FC /* CallTermination.m in Sources */, E1CD329618BCFF9900B1A496 /* SoundInstance.m in Sources */, 76EB05B418170B33006006FC /* HashChain.m in Sources */, 76EB05E418170B33006006FC /* UdpSocket.m in Sources */, + B6B096931A1D25ED008BFAA6 /* NSData+messagePadding.m in Sources */, 76EB058218170B33006006FC /* Environment.m in Sources */, 76EB064418170B33006006FC /* ThreadManager.m in Sources */, - 70B8011A190C55660042E3F0 /* UnknownFieldSet.m in Sources */, - 70B80114190C55660042E3F0 /* Field.m in Sources */, E197B61E18BBEC6D00F073E5 /* AudioRouter.m in Sources */, E197B60D18BBEC1A00F073E5 /* AudioSocket.m in Sources */, FCF72A081A01A765006BC849 /* ContactsTableViewController.m in Sources */, @@ -3791,40 +3932,43 @@ 765052A1182945EF008313E1 /* LocalizableCustomFontLabel.m in Sources */, FC3196301A0814130094C78E /* SettingsTableViewController.m in Sources */, 7038632818F70C0700D4A43F /* EvpSymetricUtil.m in Sources */, - 76EB066418170B34006006FC /* TabBarParentViewController.m in Sources */, 76EB068618170B34006006FC /* ContactTableViewCell.m in Sources */, + B6B096921A1D25ED008BFAA6 /* NSData+hexString.m in Sources */, B63761ED19E1FBE8005735D1 /* HttpRequestOrResponse.m in Sources */, 76EB05A018170B33006006FC /* IpAddress.m in Sources */, - 70B8011B190C55660042E3F0 /* UnknownFieldSet_Builder.m in Sources */, B9A578B1183D60EE00C17105 /* FavouriteTableViewCell.m in Sources */, + B6B096651A1D25ED008BFAA6 /* TSGroupThread.m in Sources */, FCAC965119FF0A6E0046DFC5 /* MessagesViewController.m in Sources */, + B6B0966B1A1D25ED008BFAA6 /* TSAttachement.m in Sources */, + B6B096851A1D25ED008BFAA6 /* TSSocketManager.m in Sources */, 76EB057618170B33006006FC /* Contact.m in Sources */, - 70B80111190C55660042E3F0 /* ExtendableMessage.m in Sources */, + B6B0968F1A1D25ED008BFAA6 /* TSYapDatabaseObject.m in Sources */, FCAC964719FEFE1A0046DFC5 /* DemoDataModel.m in Sources */, E197B61118BBEC1A00F073E5 /* AudioProcessor.m in Sources */, - 76EB065818170B34006006FC /* LeftSideMenuViewController.m in Sources */, FCAC964019FEF99A0046DFC5 /* TableViewCell.m in Sources */, 76EB05EA18170B33006006FC /* CallProgress.m in Sources */, 76EB05C218170B33006006FC /* DhPacketSharedSecretHashes.m in Sources */, + B6B096701A1D25ED008BFAA6 /* TSInfoMessage.m in Sources */, B6C93C4E199567AD00EDF894 /* DebugLogger.m in Sources */, 76EB063218170B33006006FC /* Crc32.m in Sources */, E197B62418BBF5BB00F073E5 /* SoundPlayer.m in Sources */, E197B61018BBEC1A00F073E5 /* EncodedAudioPacket.m in Sources */, - 76C87F13181EE11C00C4ACAB /* InboxFeedFooterCell.m in Sources */, 76EB063618170B33006006FC /* DataUtil.m in Sources */, + B6B096771A1D25ED008BFAA6 /* TSContactsIntersectionRequest.m in Sources */, E197B60C18BBEC1A00F073E5 /* AudioPacker.m in Sources */, E197B61218BBEC1A00F073E5 /* AudioStretcher.m in Sources */, 76EB05A218170B33006006FC /* IpEndPoint.m in Sources */, - 70B8010D190C55660042E3F0 /* AbstractMessage_Builder.m in Sources */, FCFD25721A1524DB00F4C644 /* GroupModel.m in Sources */, E197B61A18BBEC1A00F073E5 /* SpeexCodec.m in Sources */, - 70B80118190C55660042E3F0 /* MutableField.m in Sources */, + B6B0967F1A1D25ED008BFAA6 /* TSRequestAttachmentId.m in Sources */, 762D9DCF18281C7400A5E418 /* SettingsTableHeaderView.m in Sources */, 76EB05F018170B33006006FC /* PhoneManager.m in Sources */, E197B60F18BBEC1A00F073E5 /* EncodedAudioFrame.m in Sources */, - 70B8011D190C55660042E3F0 /* WireFormat.m in Sources */, 76D713E7182D3E3F00C9C9C8 /* PreferenceListTableViewCell.m in Sources */, + B6B0966C1A1D25ED008BFAA6 /* TSCall.m in Sources */, + B6B096781A1D25ED008BFAA6 /* TSDeregisterAccountRequest.m in Sources */, 76EB061818170B33006006FC /* AnonymousValueLogger.m in Sources */, + B6B0967C1A1D25ED008BFAA6 /* TSRegisterWithTokenRequest.m in Sources */, 76EB05E618170B33006006FC /* CallController.m in Sources */, FC31962A1A067D8F0094C78E /* MessageComposeTableViewController.m in Sources */, E16E5BEE18AAC40200B7C403 /* EC25KeyAgreementParticipant.m in Sources */, @@ -3834,19 +3978,16 @@ 76EB05AA18170B33006006FC /* SequenceCounter.m in Sources */, 7038632718F70C0700D4A43F /* CryptoTools.m in Sources */, 76EB058C18170B33006006FC /* DnsManager.m in Sources */, + B6B096881A1D25ED008BFAA6 /* TSStorageManager+keyFromIntLong.m in Sources */, 76EB059018170B33006006FC /* IgnoredPacketFailure.m in Sources */, B942EB0E183A9633000887BB /* SearchBarTitleView.m in Sources */, 765052AF182AC9B5008313E1 /* DialerButtonView.m in Sources */, - 70B80110190C55660042E3F0 /* ConcreteExtensionField.m in Sources */, FCAC964419FEFD8B0046DFC5 /* DemoDataFactory.m in Sources */, - 70B80112190C55660042E3F0 /* ExtendableMessage_Builder.m in Sources */, 76EB05D418170B33006006FC /* ZrtpManager.m in Sources */, 76EB058E18170B33006006FC /* HostNameEndPoint.m in Sources */, + B6B096841A1D25ED008BFAA6 /* TSNetworkManager.m in Sources */, E19167A418A9687800B7A468 /* DH3KKeyAgreementParticipant.m in Sources */, - B9CA51BA18809ACA007E204E /* InviteContactsViewController.m in Sources */, - 76EB065218170B34006006FC /* FavouritesViewController.m in Sources */, E16E5BF018AAC40200B7C403 /* EvpKeyAgreement.m in Sources */, - 70B80113190C55660042E3F0 /* ExtensionRegistry.m in Sources */, FCFD25821A154B3800F4C644 /* CodeVerificationViewController.m in Sources */, FCF72A131A02D27F006BC849 /* ContactDetailTableViewController.m in Sources */, B9EB5AC61884D370007CBB57 /* UnseenWhisperUserCell.m in Sources */, @@ -3856,27 +3997,30 @@ 76EB064618170B33006006FC /* TimeUtil.m in Sources */, 70BAFD5D190584BE00FA5E0B /* NotificationTracker.m in Sources */, 76EB05A418170B33006006FC /* PacketHandler.m in Sources */, + B6B096951A1D25ED008BFAA6 /* NSURLSessionDataTask+StatusCode.m in Sources */, E197B62118BBF12700F073E5 /* AppAudioManager.m in Sources */, FC4FA0261A1B9DC600DA100A /* SignalsNavigationController.m in Sources */, - 76EB068C18170B34006006FC /* InboxFeedTableViewCell.m in Sources */, 76EB062018170B33006006FC /* BloomFilter.m in Sources */, 76EB063818170B33006006FC /* DictionaryUtil.m in Sources */, B9B89C54185A2B5F00A24465 /* LeftSideMenuCell.m in Sources */, - 76EB068E18170B34006006FC /* CallLogTableViewCell.m in Sources */, + B6B0967A1A1D25ED008BFAA6 /* TSRegisterForPushRequest.m in Sources */, 76EB05CE18170B33006006FC /* ZrtpHandshakeResult.m in Sources */, B63761EE19E1FBE8005735D1 /* HttpRequestUtil.m in Sources */, + B6B096631A1D25ED008BFAA6 /* TSPreKeyManager.m in Sources */, 76EB05B618170B33006006FC /* MasterSecret.m in Sources */, 76EB05F418170B33006006FC /* CallConnectResult.m in Sources */, FCFD256F1A151BCB00F4C644 /* NewGroupViewController.m in Sources */, 76EB059E18170B33006006FC /* HttpSocket.m in Sources */, E197B60E18BBEC1A00F073E5 /* CallAudioManager.m in Sources */, - 76EB065418170B34006006FC /* InboxFeedViewController.m in Sources */, FC4FA0231A1B8A8D00DA100A /* Socket.m in Sources */, 76EB054018170B33006006FC /* AppDelegate.m in Sources */, 76EB05D018170B33006006FC /* ZrtpHandshakeSocket.m in Sources */, B63761EF19E1FBE8005735D1 /* HttpResponse.m in Sources */, E197B61518BBEC1A00F073E5 /* JitterQueue.m in Sources */, + B6B0968C1A1D25ED008BFAA6 /* TSDatabaseView.m in Sources */, + B6B0966A1A1D25ED008BFAA6 /* IncomingPushMessageSignal.pb.m in Sources */, BFB074C919A5611000F2947C /* ObservableValue.m in Sources */, + B6B0968E1A1D25ED008BFAA6 /* TSStorageManager.m in Sources */, FCB11D8A1A1284BB002F93FB /* SettingsTableViewCell.m in Sources */, 76EB05C818170B33006006FC /* HelloPacket.m in Sources */, BFB074C719A5611000F2947C /* FutureUtil.m in Sources */, @@ -3884,33 +4028,45 @@ 76EB060418170B33006006FC /* PhoneNumberDirectoryFilter.m in Sources */, B97CBFA818860EA3008E0DE9 /* CountryCodeViewController.m in Sources */, B6B1013C196D213F007E3930 /* SGNKeychainUtil.m in Sources */, + B6B0967E1A1D25ED008BFAA6 /* TSRequestAttachment.m in Sources */, 76EB059218170B33006006FC /* UnrecognizedRequestFailure.m in Sources */, 76EB05F818170B33006006FC /* CallConnectUtil_Initiator.m in Sources */, + B6B096761A1D25ED008BFAA6 /* TSServerMessage.m in Sources */, B97CBFAE1886100E008E0DE9 /* CountryCodeTableViewCell.m in Sources */, B63761E319E1F487005735D1 /* AFHTTPSessionManager+SignalMethods.m in Sources */, 76EB05CC18170B33006006FC /* ShortAuthenticationStringGenerator.m in Sources */, E16E5BEF18AAC40200B7C403 /* EC25KeyAgreementProtocol.m in Sources */, + B6B096901A1D25ED008BFAA6 /* Cryptography.m in Sources */, 76EB064018170B33006006FC /* AnonymousTerminator.m in Sources */, - 707E548C18FF0B8A00C8649D /* InviteContactModal.m in Sources */, + B6B096721A1D25ED008BFAA6 /* TSMessage.m in Sources */, 76EB058818170B33006006FC /* PropertyListPreferences.m in Sources */, + B6B096821A1D25ED008BFAA6 /* TSSubmitMessageRequest.m in Sources */, 76EB05B218170B33006006FC /* DH3KKeyAgreementProtocol.m in Sources */, 76EB066018170B34006006FC /* RegisterViewController.m in Sources */, 76EB060618170B33006006FC /* PhoneNumberDirectoryFilterManager.m in Sources */, B63761EC19E1FBE8005735D1 /* HttpRequest.m in Sources */, + B6B096941A1D25ED008BFAA6 /* NSString+escape.m in Sources */, 76EB060818170B33006006FC /* ResponderSessionDescriptor.m in Sources */, B90418E6183E9DD40038554A /* DateUtil.m in Sources */, 76EB05C618170B33006006FC /* HelloAckPacket.m in Sources */, 76EB05E818170B33006006FC /* CallFailedServerMessage.m in Sources */, 76EB05FA18170B33006006FC /* CallConnectUtil_Responder.m in Sources */, 76EB05AE18170B33006006FC /* SrtpStream.m in Sources */, + B6B096831A1D25ED008BFAA6 /* TSUploadAttachment.m in Sources */, + B6B096711A1D25ED008BFAA6 /* TSInteraction.mm in Sources */, + B6B0966D1A1D25ED008BFAA6 /* TSErrorMessage.m in Sources */, E197B61318BBEC1A00F073E5 /* DesiredBufferDepthController.m in Sources */, 76EB064818170B33006006FC /* Zid.m in Sources */, + B6B096741A1D25ED008BFAA6 /* TSMessagesManager.m in Sources */, + B6B096801A1D25ED008BFAA6 /* TSRequestVerificationCodeRequest.m in Sources */, + B6B096661A1D25ED008BFAA6 /* TSContact.m in Sources */, + B6B0967D1A1D25ED008BFAA6 /* TSRequest.m in Sources */, 76EB05E218170B33006006FC /* SecureEndPoint.m in Sources */, 76EB05DE18170B33006006FC /* Certificate.m in Sources */, 76EB05B818170B33006006FC /* NegotiationFailed.m in Sources */, + B6B096731A1D25ED008BFAA6 /* TSMessagesManager+sendMessages.m in Sources */, 76EB05D818170B33006006FC /* LowLatencyCandidate.m in Sources */, - 76EB065C18170B34006006FC /* CallLogViewController.m in Sources */, - 70B80116190C55660042E3F0 /* GeneratedMessage_Builder.m in Sources */, + B6B0966F1A1D25ED008BFAA6 /* TSIncomingMessage.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3932,6 +4088,7 @@ 76EB057718170B33006006FC /* Contact.m in Sources */, B9EB5AC71884D370007CBB57 /* UnseenWhisperUserCell.m in Sources */, 76EB05FB18170B33006006FC /* CallConnectUtil_Responder.m in Sources */, + B6B095E61A1D25C5008BFAA6 /* TSMessageStorageTests.m in Sources */, 76EB063718170B33006006FC /* DataUtil.m in Sources */, 76EB05C918170B33006006FC /* HelloPacket.m in Sources */, B90418E7183E9DD40038554A /* DateUtil.m in Sources */, @@ -3955,12 +4112,10 @@ 76EB063F18170B33006006FC /* Operation.m in Sources */, 76EB05AB18170B33006006FC /* SequenceCounter.m in Sources */, 76EB061D18170B33006006FC /* ArrayUtil.m in Sources */, - 76EB064D18170B34006006FC /* ContactBrowseViewController.m in Sources */, 76EB05E318170B33006006FC /* SecureEndPoint.m in Sources */, 76EB060D18170B33006006FC /* CategorizingLogger.m in Sources */, A157075817F0CD6D007C2BD6 /* AudioRemoteIOTest.m in Sources */, 76EB05DD18170B33006006FC /* StreamPair.m in Sources */, - 76EB065318170B34006006FC /* FavouritesViewController.m in Sources */, 76EB059518170B33006006FC /* HttpManager.m in Sources */, 76EB05A318170B33006006FC /* IpEndPoint.m in Sources */, 76EB054118170B33006006FC /* AppDelegate.m in Sources */, @@ -3990,14 +4145,13 @@ A157076317F0CD6D007C2BD6 /* SequenceCounterTest.m in Sources */, 76EB062318170B33006006FC /* CyclicalBuffer.m in Sources */, A157076517F0CD6D007C2BD6 /* HandshakePacketTest.m in Sources */, - 76EB066518170B34006006FC /* TabBarParentViewController.m in Sources */, + B6B095E81A1D25C5008BFAA6 /* TSStoragePreKeyStoreTests.m in Sources */, A157076617F0CD6D007C2BD6 /* HashChainTest.m in Sources */, 76EB063118170B33006006FC /* Conversions.m in Sources */, 76EB05F918170B33006006FC /* CallConnectUtil_Initiator.m in Sources */, A157076717F0CD6D007C2BD6 /* MasterSecretTest.m in Sources */, 76EB05CF18170B33006006FC /* ZrtpHandshakeResult.m in Sources */, 76EB060518170B33006006FC /* PhoneNumberDirectoryFilter.m in Sources */, - 76EB065D18170B34006006FC /* CallLogViewController.m in Sources */, A157076817F0CD6D007C2BD6 /* ShortAuthenticationStringGeneratorTest.m in Sources */, 76EB065718170B34006006FC /* InCallViewController.m in Sources */, A157076917F0CD6D007C2BD6 /* PregeneratedKeyAgreementParticipantProtocol.m in Sources */, @@ -4007,7 +4161,7 @@ 76EB061718170B33006006FC /* AnonymousOccurrenceLogger.m in Sources */, 76EB05F118170B33006006FC /* PhoneManager.m in Sources */, 76EB05F718170B33006006FC /* CallConnectUtil.m in Sources */, - 76EB066318170B34006006FC /* SettingsViewController.m in Sources */, + B6B095E51A1D25C5008BFAA6 /* TextSecureKitTests.m in Sources */, 76EB063318170B33006006FC /* Crc32.m in Sources */, BFB074C819A5611000F2947C /* FutureUtil.m in Sources */, 76EB062718170B33006006FC /* Queue.m in Sources */, @@ -4016,6 +4170,7 @@ A157076C17F0CD6D007C2BD6 /* NetworkStreamTest.m in Sources */, 76EB065B18170B34006006FC /* NextResponderScrollView.m in Sources */, 76EB05BB18170B33006006FC /* CommitPacket.m in Sources */, + B6B095E41A1D25C5008BFAA6 /* CryptographyTests.mm in Sources */, A157076D17F0CD6D007C2BD6 /* SecureEndPointTest.m in Sources */, A157076E17F0CD6D007C2BD6 /* UdpSocketTest.m in Sources */, 76EB05C318170B33006006FC /* DhPacketSharedSecretHashes.m in Sources */, @@ -4023,7 +4178,6 @@ 76EB05C718170B33006006FC /* HelloAckPacket.m in Sources */, A157076F17F0CD6D007C2BD6 /* PhoneNumberTest.m in Sources */, 76EB05B518170B33006006FC /* HashChain.m in Sources */, - 76C87F14181EE11C00C4ACAB /* InboxFeedFooterCell.m in Sources */, A157077017F0CD6D007C2BD6 /* SessionDescriptorTest.m in Sources */, 76EB05B318170B33006006FC /* DH3KKeyAgreementProtocol.m in Sources */, 76EB05AD18170B33006006FC /* SrtpSocket.m in Sources */, @@ -4045,7 +4199,6 @@ 76EB062518170B33006006FC /* PriorityQueue.m in Sources */, A157077917F0CD6D007C2BD6 /* CryptoToolsTest.m in Sources */, 76EB066118170B34006006FC /* RegisterViewController.m in Sources */, - 76EB068D18170B34006006FC /* InboxFeedTableViewCell.m in Sources */, BFB074C119A4BCA400F2947C /* FutureUtilTest.m in Sources */, B684A46D19C3446200B11029 /* PushManagerTest.m in Sources */, 76EB05A918170B33006006FC /* RtpSocket.m in Sources */, @@ -4062,9 +4215,8 @@ 76EB05FF18170B33006006FC /* InitiateSignal.pb.m in Sources */, 76EB057518170B33006006FC /* RecentCallManager.m in Sources */, 76EB059F18170B33006006FC /* HttpSocket.m in Sources */, + B6B095E91A1D25C5008BFAA6 /* TSStorageSignedPreKeyStore.m in Sources */, 76EB062D18170B33006006FC /* OperationFailed.m in Sources */, - 76EB068F18170B34006006FC /* CallLogTableViewCell.m in Sources */, - B9CA51BB18809ACA007E204E /* InviteContactsViewController.m in Sources */, 76EB05EB18170B33006006FC /* CallProgress.m in Sources */, 76EB063918170B33006006FC /* DictionaryUtil.m in Sources */, 76EB059118170B33006006FC /* IgnoredPacketFailure.m in Sources */, @@ -4079,15 +4231,14 @@ 76EB05E118170B33006006FC /* NetworkStream.m in Sources */, A157077C17F0CD6D007C2BD6 /* FunctionalUtilTest.m in Sources */, A157077D17F0CD6D007C2BD6 /* PriorityQueueTest.m in Sources */, + B6B095E71A1D25C5008BFAA6 /* TSStorageIdentityKeyStoreTests.m in Sources */, 76EB064718170B33006006FC /* TimeUtil.m in Sources */, - 76EB065918170B34006006FC /* LeftSideMenuViewController.m in Sources */, 76EB065118170B34006006FC /* DialerViewController.m in Sources */, A157077E17F0CD6D007C2BD6 /* QueueTest.m in Sources */, E16E5BF918AAF02100B7C403 /* EC25AgreerTest.m in Sources */, A157077F17F0CD6D007C2BD6 /* UtilTest.m in Sources */, 76EB05D718170B33006006FC /* ZrtpResponder.m in Sources */, 76EB05EF18170B33006006FC /* CallTermination.m in Sources */, - 76EB065518170B34006006FC /* InboxFeedViewController.m in Sources */, BFB074CA19A5611000F2947C /* ObservableValue.m in Sources */, B97940281832BD2400BD66CB /* UIUtil.m in Sources */, ); diff --git a/Signal/archive@2x.png b/Signal/Images/archive@2x.png similarity index 100% rename from Signal/archive@2x.png rename to Signal/Images/archive@2x.png diff --git a/Signal/blue-archive@2x.png b/Signal/Images/blue-archive@2x.png similarity index 100% rename from Signal/blue-archive@2x.png rename to Signal/Images/blue-archive@2x.png diff --git a/Signal/call@2x.png b/Signal/Images/call@2x.png similarity index 100% rename from Signal/call@2x.png rename to Signal/Images/call@2x.png diff --git a/Signal/call_dark@2x.png b/Signal/Images/call_dark@2x.png similarity index 100% rename from Signal/call_dark@2x.png rename to Signal/Images/call_dark@2x.png diff --git a/Signal/checkmark.png b/Signal/Images/checkmark.png similarity index 100% rename from Signal/checkmark.png rename to Signal/Images/checkmark.png diff --git a/Signal/contacts.png b/Signal/Images/contacts.png similarity index 100% rename from Signal/contacts.png rename to Signal/Images/contacts.png diff --git a/Signal/contacts@2x.png b/Signal/Images/contacts@2x.png similarity index 100% rename from Signal/contacts@2x.png rename to Signal/Images/contacts@2x.png diff --git a/Signal/contacts_tab@2x.png b/Signal/Images/contacts_tab@2x.png similarity index 100% rename from Signal/contacts_tab@2x.png rename to Signal/Images/contacts_tab@2x.png diff --git a/Signal/delete@2x.png b/Signal/Images/delete@2x.png similarity index 100% rename from Signal/delete@2x.png rename to Signal/Images/delete@2x.png diff --git a/Signal/delete_history@2x.png b/Signal/Images/delete_history@2x.png similarity index 100% rename from Signal/delete_history@2x.png rename to Signal/Images/delete_history@2x.png diff --git a/Signal/endcall@2x.png b/Signal/Images/endcall@2x.png similarity index 100% rename from Signal/endcall@2x.png rename to Signal/Images/endcall@2x.png diff --git a/Signal/favourite.png b/Signal/Images/favourite.png similarity index 100% rename from Signal/favourite.png rename to Signal/Images/favourite.png diff --git a/Signal/info@2x.png b/Signal/Images/info@2x.png similarity index 100% rename from Signal/info@2x.png rename to Signal/Images/info@2x.png diff --git a/Signal/keypad@2x.png b/Signal/Images/keypad@2x.png similarity index 100% rename from Signal/keypad@2x.png rename to Signal/Images/keypad@2x.png diff --git a/Signal/lock@2x.png b/Signal/Images/lock@2x.png similarity index 100% rename from Signal/lock@2x.png rename to Signal/Images/lock@2x.png diff --git a/Signal/lock_white@2x.png b/Signal/Images/lock_white@2x.png similarity index 100% rename from Signal/lock_white@2x.png rename to Signal/Images/lock_white@2x.png diff --git a/Signal/logo_intro@2x.png b/Signal/Images/logo_intro@2x.png similarity index 100% rename from Signal/logo_intro@2x.png rename to Signal/Images/logo_intro@2x.png diff --git a/Signal/missed.png b/Signal/Images/missed.png similarity index 100% rename from Signal/missed.png rename to Signal/Images/missed.png diff --git a/Signal/mute_off@2x.png b/Signal/Images/mute_off@2x.png similarity index 100% rename from Signal/mute_off@2x.png rename to Signal/Images/mute_off@2x.png diff --git a/Signal/mute_on@2x.png b/Signal/Images/mute_on@2x.png similarity index 100% rename from Signal/mute_on@2x.png rename to Signal/Images/mute_on@2x.png diff --git a/Signal/photo@2x.png b/Signal/Images/photo@2x.png similarity index 100% rename from Signal/photo@2x.png rename to Signal/Images/photo@2x.png diff --git a/Signal/quit@2x.png b/Signal/Images/quit@2x.png similarity index 100% rename from Signal/quit@2x.png rename to Signal/Images/quit@2x.png diff --git a/Signal/received.png b/Signal/Images/received.png similarity index 100% rename from Signal/received.png rename to Signal/Images/received.png diff --git a/Signal/red-delete@2x.png b/Signal/Images/red-delete@2x.png similarity index 100% rename from Signal/red-delete@2x.png rename to Signal/Images/red-delete@2x.png diff --git a/Signal/reply.png b/Signal/Images/reply.png similarity index 100% rename from Signal/reply.png rename to Signal/Images/reply.png diff --git a/Signal/savephoto@2x.png b/Signal/Images/savephoto@2x.png similarity index 100% rename from Signal/savephoto@2x.png rename to Signal/Images/savephoto@2x.png diff --git a/Signal/settings.png b/Signal/Images/settings.png similarity index 100% rename from Signal/settings.png rename to Signal/Images/settings.png diff --git a/Signal/settings_dark@2x.png b/Signal/Images/settings_dark@2x.png similarity index 100% rename from Signal/settings_dark@2x.png rename to Signal/Images/settings_dark@2x.png diff --git a/Signal/share@2x.png b/Signal/Images/share@2x.png similarity index 100% rename from Signal/share@2x.png rename to Signal/Images/share@2x.png diff --git a/Signal/shred@2x.png b/Signal/Images/shred@2x.png similarity index 100% rename from Signal/shred@2x.png rename to Signal/Images/shred@2x.png diff --git a/Signal/signal@2x.png b/Signal/Images/signal@2x.png similarity index 100% rename from Signal/signal@2x.png rename to Signal/Images/signal@2x.png diff --git a/Signal/signals.png b/Signal/Images/signals.png similarity index 100% rename from Signal/signals.png rename to Signal/Images/signals.png diff --git a/Signal/speaker_off@2x.png b/Signal/Images/speaker_off@2x.png similarity index 100% rename from Signal/speaker_off@2x.png rename to Signal/Images/speaker_off@2x.png diff --git a/Signal/speaker_on@2x.png b/Signal/Images/speaker_on@2x.png similarity index 100% rename from Signal/speaker_on@2x.png rename to Signal/Images/speaker_on@2x.png diff --git a/Signal/Signal-Info.plist b/Signal/Signal-Info.plist index e2e1b395f..ed13b0722 100644 --- a/Signal/Signal-Info.plist +++ b/Signal/Signal-Info.plist @@ -50,8 +50,6 @@ UILaunchStoryboardName Storyboard - UIMainStoryboardFile - Storyboard UIRequiredDeviceCapabilities armv7 diff --git a/Signal/src/AppDelegate.m b/Signal/src/AppDelegate.m index 084fa24db..5078140aa 100644 --- a/Signal/src/AppDelegate.m +++ b/Signal/src/AppDelegate.m @@ -1,25 +1,23 @@ #import "AppDelegate.h" #import "AppAudioManager.h" -#import "CallLogViewController.h" #import "CategorizingLogger.h" #import "DebugLogger.h" #import "DialerViewController.h" #import "DiscardingLog.h" #import "Environment.h" #import "InCallViewController.h" -#import "LeftSideMenuViewController.h" -#import "MMDrawerController.h" #import "PreferencesUtil.h" #import "NotificationTracker.h" #import "PushManager.h" #import "PriorityQueue.h" #import "RecentCallManager.h" #import "Release.h" -#import "SettingsViewController.h" -#import "TabBarParentViewController.h" #import "Util.h" #import "VersionMigrations.h" +#import "InitialViewController.h" + + #import #define kSignalVersionKey @"SignalUpdateVersionKey" @@ -31,7 +29,6 @@ @interface AppDelegate () @property (nonatomic, retain) UIWindow *blankWindow; -@property (nonatomic, strong) MMDrawerController *drawerController; @property (nonatomic, strong) NotificationTracker *notificationTracker; @property (nonatomic) TOCFutureSource *callPickUpFuture; @@ -139,12 +136,6 @@ [Environment.getCurrent.contactsManager doAfterEnvironmentInitSetup]; [UIApplication.sharedApplication setStatusBarStyle:UIStatusBarStyleDefault]; - LeftSideMenuViewController *leftSideMenuViewController = [LeftSideMenuViewController new]; - - self.drawerController = [[MMDrawerController alloc] initWithCenterViewController:leftSideMenuViewController.centerTabBarViewController leftDrawerViewController:leftSideMenuViewController]; - //self.window.rootViewController = _drawerController; - //[self.window makeKeyAndVisible]; - //Accept push notification when app is not open NSDictionary *remoteNotif = launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey]; if (remoteNotif) { @@ -169,10 +160,24 @@ } }]; } - [_drawerController.centerViewController presentViewController:callViewController animated:YES completion:nil]; - + } onThread:NSThread.mainThread untilCancelled:nil]; + UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Storyboard" bundle:nil]; + + InitialViewController *viewControllerForNewUser = [storyboard instantiateViewControllerWithIdentifier:@"UserInitialViewController"]; + + UITabBarController *viewController = [storyboard instantiateViewControllerWithIdentifier:@"UserInitialViewController"]; + + BOOL isNewUser = NO; + if (isNewUser) { + self.window.rootViewController = viewControllerForNewUser; + } else { + self.window.rootViewController = viewController; + } + + [self.window makeKeyAndVisible]; + return YES; } diff --git a/Signal/src/Storyboard/Storyboard.storyboard b/Signal/src/Storyboard/Storyboard.storyboard index 2a69adc4b..620a591b3 100644 --- a/Signal/src/Storyboard/Storyboard.storyboard +++ b/Signal/src/Storyboard/Storyboard.storyboard @@ -15,7 +15,7 @@ - + @@ -35,6 +35,9 @@ + + + @@ -114,7 +117,7 @@ - + @@ -273,14 +276,14 @@ FA 9C E3 A0 09 9A FF A8 8A 09 99 - + - + @@ -389,31 +392,23 @@ Lorem ipsum : Quick explanation of Fingerprints - - - - - - - - - - - - - - + + + + + + - - - + + + @@ -422,6 +417,14 @@ Lorem ipsum : Quick explanation of Fingerprints + + + + + + + + @@ -438,31 +441,23 @@ Lorem ipsum : Quick explanation of Fingerprints - - - - - - - - - - - - - - + + + + + + - - - + + + @@ -471,6 +466,14 @@ Lorem ipsum : Quick explanation of Fingerprints + + + + + + + + @@ -492,6 +495,7 @@ Lorem ipsum : Quick explanation of Fingerprints + @@ -499,7 +503,6 @@ Lorem ipsum : Quick explanation of Fingerprints - @@ -507,6 +510,7 @@ Lorem ipsum : Quick explanation of Fingerprints + @@ -514,7 +518,6 @@ Lorem ipsum : Quick explanation of Fingerprints - @@ -535,10 +538,10 @@ Lorem ipsum : Quick explanation of Fingerprints - + - + @@ -689,9 +692,6 @@ Lorem ipsum : Quick explanation of Fingerprints - - - @@ -747,28 +747,28 @@ Lorem ipsum : Quick explanation of Fingerprints + + + + + + + + + + + + + + - - - - - - - - - - - - - - @@ -789,35 +789,35 @@ Lorem ipsum : Quick explanation of Fingerprints + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + @@ -1073,36 +1073,36 @@ Lorem ipsum : Quick explanation of Fingerprints + + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - @@ -1119,36 +1119,36 @@ Lorem ipsum : Quick explanation of Fingerprints + + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - @@ -1270,14 +1270,14 @@ Lorem ipsum : Quick explanation of Fingerprints - + - + @@ -1345,20 +1345,20 @@ Lorem ipsum : Quick explanation of Fingerprints - - + + + + + + - - - - @@ -1375,20 +1375,20 @@ Lorem ipsum : Quick explanation of Fingerprints - - + + + + + + - - - - @@ -1404,7 +1404,7 @@ Lorem ipsum : Quick explanation of Fingerprints - + @@ -1428,7 +1428,7 @@ Lorem ipsum : Quick explanation of Fingerprints - + @@ -1456,7 +1456,7 @@ Lorem ipsum : Quick explanation of Fingerprints - + @@ -1804,14 +1804,14 @@ Lorem ipsum : Quick explanation of Fingerprints - + - + @@ -1884,51 +1884,51 @@ Lorem ipsum : Quick explanation of Fingerprints + + + + + - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + @@ -1946,51 +1946,51 @@ Lorem ipsum : Quick explanation of Fingerprints + + + + + - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + @@ -2435,11 +2435,11 @@ Lorem ipsum : Quick explanation of Fingerprints - + - + @@ -2586,6 +2589,9 @@ Licensed under the GPLv3 + + + @@ -2593,9 +2599,6 @@ Licensed under the GPLv3 - - - @@ -2609,6 +2612,9 @@ Licensed under the GPLv3 + + + @@ -2616,9 +2622,6 @@ Licensed under the GPLv3 - - - @@ -3338,7 +3341,8 @@ Licensed under the GPLv3 - + + @@ -3392,6 +3396,9 @@ Licensed under the GPLv3 + + + @@ -3476,6 +3483,6 @@ Licensed under the GPLv3 - + diff --git a/Signal/src/environment/PreferencesUtil.h b/Signal/src/environment/PreferencesUtil.h index 300dc1773..88c4f6f02 100644 --- a/Signal/src/environment/PreferencesUtil.h +++ b/Signal/src/environment/PreferencesUtil.h @@ -1,7 +1,6 @@ #import #import "PhoneNumberDirectoryFilter.h" #import "PropertyListPreferences.h" -#import "CallLogViewController.h" #import "Zid.h" @class PhoneNumber; diff --git a/Signal/src/network/PushManager.m b/Signal/src/network/PushManager.m index f168b5984..4da5b3bc1 100644 --- a/Signal/src/network/PushManager.m +++ b/Signal/src/network/PushManager.m @@ -58,22 +58,12 @@ return; } - if (SYSTEM_VERSION_LESS_THAN(_iOS_8_0)) { - - // On iOS7, we just need to register for Push Notifications (user notifications are enabled with them) - [self registrationForPushWithSuccess:success failure:failure]; - - } else{ - - // On iOS 8+, both Push Notifications and User Notfications need to be registered. - - [self registrationForPushWithSuccess:^{ - [self registrationForUserNotificationWithSuccess:success failure:^{ - [self.missingPermissionsAlertView show]; - failure(); - }]; - } failure:failure]; - } + [self registrationForPushWithSuccess:^{ + [self registrationForUserNotificationWithSuccess:success failure:^{ + [self.missingPermissionsAlertView show]; + failure(); + }]; + } failure:failure]; } @@ -108,15 +98,8 @@ -(TOCFuture*)registerPushNotificationFuture{ self.pushNotificationFutureSource = [TOCFutureSource new]; + [UIApplication.sharedApplication registerForRemoteNotifications]; - if (SYSTEM_VERSION_LESS_THAN(_iOS_8_0)) { - [UIApplication.sharedApplication registerForRemoteNotificationTypes:(UIRemoteNotificationType)self.mandatoryNotificationTypes]; - if ([self isMissingMandatoryNotificationTypes]) { - [self.pushNotificationFutureSource trySetFailure:@"Missing Types"]; - } - } else { - [UIApplication.sharedApplication registerForRemoteNotifications]; - } return self.pushNotificationFutureSource.future; } @@ -173,11 +156,7 @@ } -(BOOL) needToRegisterForRemoteNotifications { - if (SYSTEM_VERSION_LESS_THAN(_iOS_8_0)) { - return self.wantRemoteNotifications; - } else{ - return self.wantRemoteNotifications && (!UIApplication.sharedApplication.isRegisteredForRemoteNotifications); - } + return self.wantRemoteNotifications && (!UIApplication.sharedApplication.isRegisteredForRemoteNotifications); } -(BOOL) wantRemoteNotifications { @@ -216,29 +195,17 @@ -(BOOL)isMissingMandatoryNotificationTypes { int mandatoryTypes = self.mandatoryNotificationTypes; - int currentTypes; - if (SYSTEM_VERSION_LESS_THAN(_iOS_8_0)) { - currentTypes = UIApplication.sharedApplication.enabledRemoteNotificationTypes; - } else { - currentTypes = UIApplication.sharedApplication.currentUserNotificationSettings.types; - } + int currentTypes = UIApplication.sharedApplication.currentUserNotificationSettings.types; + return (mandatoryTypes & currentTypes) != mandatoryTypes; } -(int)allNotificationTypes{ - if (SYSTEM_VERSION_LESS_THAN(_iOS_8_0)) { - return UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeBadge; - } else { - return UIUserNotificationTypeAlert | UIUserNotificationTypeSound | UIUserNotificationTypeBadge; - } + return UIUserNotificationTypeAlert | UIUserNotificationTypeSound | UIUserNotificationTypeBadge; } -(int)mandatoryNotificationTypes{ - if (SYSTEM_VERSION_LESS_THAN(_iOS_8_0)) { - return UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound; - } else { - return UIUserNotificationTypeAlert | UIUserNotificationTypeSound; - } + return UIUserNotificationTypeAlert | UIUserNotificationTypeSound; } @end diff --git a/Signal/src/network/http/RPServerRequestsManager.m b/Signal/src/network/http/RPServerRequestsManager.m index 8d74aa8f8..8c9b2ac73 100644 --- a/Signal/src/network/http/RPServerRequestsManager.m +++ b/Signal/src/network/http/RPServerRequestsManager.m @@ -37,12 +37,12 @@ MacrosSingletonImplemention NSURLSessionConfiguration *sessionConf = NSURLSessionConfiguration.ephemeralSessionConfiguration; self.operationManager = [[AFHTTPSessionManager alloc] initWithBaseURL:endPointURL sessionConfiguration:sessionConf]; self.operationManager.responseSerializer = [AFJSONResponseSerializer serializer]; + self.operationManager.securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeCertificate]; self.operationManager.securityPolicy.allowInvalidCertificates = YES; NSString *certPath = [NSBundle.mainBundle pathForResource:@"whisperReal" ofType:@"cer"]; NSData *certData = [NSData dataWithContentsOfFile:certPath]; SecCertificateRef cert = SecCertificateCreateWithData(NULL, (__bridge CFDataRef)(certData)); self.operationManager.securityPolicy.pinnedCertificates = @[(__bridge_transfer NSData *)SecCertificateCopyData(cert)]; - self.operationManager.securityPolicy.SSLPinningMode = AFSSLPinningModeCertificate; } return self; } diff --git a/Signal/src/phone/signaling/InitiateSignal.pb.h b/Signal/src/phone/signaling/InitiateSignal.pb.h index 44e0acb82..a12a168b2 100644 --- a/Signal/src/phone/signaling/InitiateSignal.pb.h +++ b/Signal/src/phone/signaling/InitiateSignal.pb.h @@ -2,8 +2,22 @@ #import "ProtocolBuffers.h" +// @@protoc_insertion_point(imports) + @class InitiateSignal; -@class InitiateSignal_Builder; +@class InitiateSignalBuilder; +#ifndef __has_feature + #define __has_feature(x) 0 // Compatibility with non-clang compilers. +#endif // __has_feature + +#ifndef NS_RETURNS_NOT_RETAINED + #if __has_feature(attribute_ns_returns_not_retained) + #define NS_RETURNS_NOT_RETAINED __attribute__((ns_returns_not_retained)) + #else + #define NS_RETURNS_NOT_RETAINED + #endif +#endif + @interface InitiateSignalRoot : NSObject { } @@ -18,31 +32,32 @@ BOOL hasServerName_:1; BOOL hasPort_:1; BOOL hasVersion_:1; - int64_t sessionId; + UInt64 sessionId; NSString* initiator; NSString* serverName; - int32_t port; - int32_t version; + UInt32 port; + UInt32 version; } - (BOOL) hasInitiator; - (BOOL) hasSessionId; - (BOOL) hasPort; - (BOOL) hasServerName; - (BOOL) hasVersion; -@property (readonly, retain) NSString* initiator; -@property (readonly) int64_t sessionId; -@property (readonly) int32_t port; -@property (readonly, retain) NSString* serverName; -@property (readonly) int32_t version; +@property (readonly, strong) NSString* initiator; +@property (readonly) UInt64 sessionId; +@property (readonly) UInt32 port; +@property (readonly, strong) NSString* serverName; +@property (readonly) UInt32 version; + (InitiateSignal*) defaultInstance; - (InitiateSignal*) defaultInstance; - (BOOL) isInitialized; - (void) writeToCodedOutputStream:(PBCodedOutputStream*) output; -- (InitiateSignal_Builder*) builder; -+ (InitiateSignal_Builder*) builder; -+ (InitiateSignal_Builder*) builderWithPrototype:(InitiateSignal*) prototype; +- (InitiateSignalBuilder*) builder; ++ (InitiateSignalBuilder*) builder; ++ (InitiateSignalBuilder*) builderWithPrototype:(InitiateSignal*) prototype; +- (InitiateSignalBuilder*) toBuilder; + (InitiateSignal*) parseFromData:(NSData*) data; + (InitiateSignal*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry; @@ -52,46 +67,48 @@ + (InitiateSignal*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; @end -@interface InitiateSignal_Builder : PBGeneratedMessage_Builder { +@interface InitiateSignalBuilder : PBGeneratedMessageBuilder { @private InitiateSignal* result; } - (InitiateSignal*) defaultInstance; -- (InitiateSignal_Builder*) clear; -- (InitiateSignal_Builder*) clone; +- (InitiateSignalBuilder*) clear; +- (InitiateSignalBuilder*) clone; - (InitiateSignal*) build; - (InitiateSignal*) buildPartial; -- (InitiateSignal_Builder*) mergeFrom:(InitiateSignal*) other; -- (InitiateSignal_Builder*) mergeFromCodedInputStream:(PBCodedInputStream*) input; -- (InitiateSignal_Builder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; +- (InitiateSignalBuilder*) mergeFrom:(InitiateSignal*) other; +- (InitiateSignalBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input; +- (InitiateSignalBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; - (BOOL) hasInitiator; - (NSString*) initiator; -- (InitiateSignal_Builder*) setInitiator:(NSString*) value; -- (InitiateSignal_Builder*) clearInitiator; +- (InitiateSignalBuilder*) setInitiator:(NSString*) value; +- (InitiateSignalBuilder*) clearInitiator; - (BOOL) hasSessionId; -- (int64_t) sessionId; -- (InitiateSignal_Builder*) setSessionId:(int64_t) value; -- (InitiateSignal_Builder*) clearSessionId; +- (UInt64) sessionId; +- (InitiateSignalBuilder*) setSessionId:(UInt64) value; +- (InitiateSignalBuilder*) clearSessionId; - (BOOL) hasPort; -- (int32_t) port; -- (InitiateSignal_Builder*) setPort:(int32_t) value; -- (InitiateSignal_Builder*) clearPort; +- (UInt32) port; +- (InitiateSignalBuilder*) setPort:(UInt32) value; +- (InitiateSignalBuilder*) clearPort; - (BOOL) hasServerName; - (NSString*) serverName; -- (InitiateSignal_Builder*) setServerName:(NSString*) value; -- (InitiateSignal_Builder*) clearServerName; +- (InitiateSignalBuilder*) setServerName:(NSString*) value; +- (InitiateSignalBuilder*) clearServerName; - (BOOL) hasVersion; -- (int32_t) version; -- (InitiateSignal_Builder*) setVersion:(int32_t) value; -- (InitiateSignal_Builder*) clearVersion; +- (UInt32) version; +- (InitiateSignalBuilder*) setVersion:(UInt32) value; +- (InitiateSignalBuilder*) clearVersion; @end + +// @@protoc_insertion_point(global_scope) diff --git a/Signal/src/phone/signaling/InitiateSignal.pb.m b/Signal/src/phone/signaling/InitiateSignal.pb.m index e1bf35881..2bb4e1636 100644 --- a/Signal/src/phone/signaling/InitiateSignal.pb.m +++ b/Signal/src/phone/signaling/InitiateSignal.pb.m @@ -1,6 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! #import "InitiateSignal.pb.h" +// @@protoc_insertion_point(imports) @implementation InitiateSignalRoot static PBExtensionRegistry* extensionRegistry = nil; @@ -20,11 +21,11 @@ static PBExtensionRegistry* extensionRegistry = nil; @end @interface InitiateSignal () -@property (retain) NSString* initiator; -@property int64_t sessionId; -@property int32_t port; -@property (retain) NSString* serverName; -@property int32_t version; +@property (strong) NSString* initiator; +@property UInt64 sessionId; +@property UInt32 port; +@property (strong) NSString* serverName; +@property UInt32 version; @end @implementation InitiateSignal @@ -32,42 +33,38 @@ static PBExtensionRegistry* extensionRegistry = nil; - (BOOL) hasInitiator { return !!hasInitiator_; } -- (void) setHasInitiator:(BOOL) value { - hasInitiator_ = !!value; +- (void) setHasInitiator:(BOOL) value_ { + hasInitiator_ = !!value_; } @synthesize initiator; - (BOOL) hasSessionId { return !!hasSessionId_; } -- (void) setHasSessionId:(BOOL) value { - hasSessionId_ = !!value; +- (void) setHasSessionId:(BOOL) value_ { + hasSessionId_ = !!value_; } @synthesize sessionId; - (BOOL) hasPort { return !!hasPort_; } -- (void) setHasPort:(BOOL) value { - hasPort_ = !!value; +- (void) setHasPort:(BOOL) value_ { + hasPort_ = !!value_; } @synthesize port; - (BOOL) hasServerName { return !!hasServerName_; } -- (void) setHasServerName:(BOOL) value { - hasServerName_ = !!value; +- (void) setHasServerName:(BOOL) value_ { + hasServerName_ = !!value_; } @synthesize serverName; - (BOOL) hasVersion { return !!hasVersion_; } -- (void) setHasVersion:(BOOL) value { - hasVersion_ = !!value; +- (void) setHasVersion:(BOOL) value_ { + hasVersion_ = !!value_; } @synthesize version; -- (void) dealloc { - self.initiator = nil; - self.serverName = nil; -} - (id) init { if ((self = [super init])) { self.initiator = @""; @@ -111,31 +108,31 @@ static InitiateSignal* defaultInitiateSignalInstance = nil; } [self.unknownFields writeToCodedOutputStream:output]; } -- (int32_t) serializedSize { - int32_t size = memoizedSerializedSize; - if (size != -1) { - return size; +- (SInt32) serializedSize { + __block SInt32 size_ = memoizedSerializedSize; + if (size_ != -1) { + return size_; } - size = 0; + size_ = 0; if (self.hasInitiator) { - size += computeStringSize(1, self.initiator); + size_ += computeStringSize(1, self.initiator); } if (self.hasSessionId) { - size += computeUInt64Size(2, self.sessionId); + size_ += computeUInt64Size(2, self.sessionId); } if (self.hasPort) { - size += computeUInt32Size(3, self.port); + size_ += computeUInt32Size(3, self.port); } if (self.hasServerName) { - size += computeStringSize(4, self.serverName); + size_ += computeStringSize(4, self.serverName); } if (self.hasVersion) { - size += computeUInt32Size(5, self.version); + size_ += computeUInt32Size(5, self.version); } - size += self.unknownFields.serializedSize; - memoizedSerializedSize = size; - return size; + size_ += self.unknownFields.serializedSize; + memoizedSerializedSize = size_; + return size_; } + (InitiateSignal*) parseFromData:(NSData*) data { return (InitiateSignal*)[[[InitiateSignal builder] mergeFromData:data] build]; @@ -155,26 +152,85 @@ static InitiateSignal* defaultInitiateSignalInstance = nil; + (InitiateSignal*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { return (InitiateSignal*)[[[InitiateSignal builder] mergeFromCodedInputStream:input extensionRegistry:extensionRegistry] build]; } -+ (InitiateSignal_Builder*) builder { - return [[InitiateSignal_Builder alloc] init]; ++ (InitiateSignalBuilder*) builder { + return [[InitiateSignalBuilder alloc] init]; } -+ (InitiateSignal_Builder*) builderWithPrototype:(InitiateSignal*) prototype { ++ (InitiateSignalBuilder*) builderWithPrototype:(InitiateSignal*) prototype { return [[InitiateSignal builder] mergeFrom:prototype]; } -- (InitiateSignal_Builder*) builder { +- (InitiateSignalBuilder*) builder { return [InitiateSignal builder]; } -@end - -@interface InitiateSignal_Builder() -@property (retain) InitiateSignal* result; -@end - -@implementation InitiateSignal_Builder -@synthesize result; -- (void) dealloc { - self.result = nil; +- (InitiateSignalBuilder*) toBuilder { + return [InitiateSignal builderWithPrototype:self]; } +- (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent { + if (self.hasInitiator) { + [output appendFormat:@"%@%@: %@\n", indent, @"initiator", self.initiator]; + } + if (self.hasSessionId) { + [output appendFormat:@"%@%@: %@\n", indent, @"sessionId", [NSNumber numberWithLongLong:self.sessionId]]; + } + if (self.hasPort) { + [output appendFormat:@"%@%@: %@\n", indent, @"port", [NSNumber numberWithInteger:self.port]]; + } + if (self.hasServerName) { + [output appendFormat:@"%@%@: %@\n", indent, @"serverName", self.serverName]; + } + if (self.hasVersion) { + [output appendFormat:@"%@%@: %@\n", indent, @"version", [NSNumber numberWithInteger:self.version]]; + } + [self.unknownFields writeDescriptionTo:output withIndent:indent]; +} +- (BOOL) isEqual:(id)other { + if (other == self) { + return YES; + } + if (![other isKindOfClass:[InitiateSignal class]]) { + return NO; + } + InitiateSignal *otherMessage = other; + return + self.hasInitiator == otherMessage.hasInitiator && + (!self.hasInitiator || [self.initiator isEqual:otherMessage.initiator]) && + self.hasSessionId == otherMessage.hasSessionId && + (!self.hasSessionId || self.sessionId == otherMessage.sessionId) && + self.hasPort == otherMessage.hasPort && + (!self.hasPort || self.port == otherMessage.port) && + self.hasServerName == otherMessage.hasServerName && + (!self.hasServerName || [self.serverName isEqual:otherMessage.serverName]) && + self.hasVersion == otherMessage.hasVersion && + (!self.hasVersion || self.version == otherMessage.version) && + (self.unknownFields == otherMessage.unknownFields || (self.unknownFields != nil && [self.unknownFields isEqual:otherMessage.unknownFields])); +} +- (NSUInteger) hash { + __block NSUInteger hashCode = 7; + if (self.hasInitiator) { + hashCode = hashCode * 31 + [self.initiator hash]; + } + if (self.hasSessionId) { + hashCode = hashCode * 31 + [[NSNumber numberWithLongLong:self.sessionId] hash]; + } + if (self.hasPort) { + hashCode = hashCode * 31 + [[NSNumber numberWithInteger:self.port] hash]; + } + if (self.hasServerName) { + hashCode = hashCode * 31 + [self.serverName hash]; + } + if (self.hasVersion) { + hashCode = hashCode * 31 + [[NSNumber numberWithInteger:self.version] hash]; + } + hashCode = hashCode * 31 + [self.unknownFields hash]; + return hashCode; +} +@end + +@interface InitiateSignalBuilder() +@property (strong) InitiateSignal* result; +@end + +@implementation InitiateSignalBuilder +@synthesize result; - (id) init { if ((self = [super init])) { self.result = [[InitiateSignal alloc] init]; @@ -184,11 +240,11 @@ static InitiateSignal* defaultInitiateSignalInstance = nil; - (PBGeneratedMessage*) internalGetResult { return result; } -- (InitiateSignal_Builder*) clear { +- (InitiateSignalBuilder*) clear { self.result = [[InitiateSignal alloc] init]; return self; } -- (InitiateSignal_Builder*) clone { +- (InitiateSignalBuilder*) clone { return [InitiateSignal builderWithPrototype:result]; } - (InitiateSignal*) defaultInstance { @@ -203,7 +259,7 @@ static InitiateSignal* defaultInitiateSignalInstance = nil; self.result = nil; return returnMe; } -- (InitiateSignal_Builder*) mergeFrom:(InitiateSignal*) other { +- (InitiateSignalBuilder*) mergeFrom:(InitiateSignal*) other { if (other == [InitiateSignal defaultInstance]) { return self; } @@ -225,13 +281,13 @@ static InitiateSignal* defaultInitiateSignalInstance = nil; [self mergeUnknownFields:other.unknownFields]; return self; } -- (InitiateSignal_Builder*) mergeFromCodedInputStream:(PBCodedInputStream*) input { +- (InitiateSignalBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input { return [self mergeFromCodedInputStream:input extensionRegistry:[PBExtensionRegistry emptyRegistry]]; } -- (InitiateSignal_Builder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - PBUnknownFieldSet_Builder* unknownFields = [PBUnknownFieldSet builderWithUnknownFields:self.unknownFields]; +- (InitiateSignalBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + PBUnknownFieldSetBuilder* unknownFields = [PBUnknownFieldSet builderWithUnknownFields:self.unknownFields]; while (YES) { - int32_t tag = [input readTag]; + SInt32 tag = [input readTag]; switch (tag) { case 0: [self setUnknownFields:[unknownFields build]]; @@ -272,12 +328,12 @@ static InitiateSignal* defaultInitiateSignalInstance = nil; - (NSString*) initiator { return result.initiator; } -- (InitiateSignal_Builder*) setInitiator:(NSString*) value { +- (InitiateSignalBuilder*) setInitiator:(NSString*) value { result.hasInitiator = YES; result.initiator = value; return self; } -- (InitiateSignal_Builder*) clearInitiator { +- (InitiateSignalBuilder*) clearInitiator { result.hasInitiator = NO; result.initiator = @""; return self; @@ -285,15 +341,15 @@ static InitiateSignal* defaultInitiateSignalInstance = nil; - (BOOL) hasSessionId { return result.hasSessionId; } -- (int64_t) sessionId { +- (UInt64) sessionId { return result.sessionId; } -- (InitiateSignal_Builder*) setSessionId:(int64_t) value { +- (InitiateSignalBuilder*) setSessionId:(UInt64) value { result.hasSessionId = YES; result.sessionId = value; return self; } -- (InitiateSignal_Builder*) clearSessionId { +- (InitiateSignalBuilder*) clearSessionId { result.hasSessionId = NO; result.sessionId = 0L; return self; @@ -301,15 +357,15 @@ static InitiateSignal* defaultInitiateSignalInstance = nil; - (BOOL) hasPort { return result.hasPort; } -- (int32_t) port { +- (UInt32) port { return result.port; } -- (InitiateSignal_Builder*) setPort:(int32_t) value { +- (InitiateSignalBuilder*) setPort:(UInt32) value { result.hasPort = YES; result.port = value; return self; } -- (InitiateSignal_Builder*) clearPort { +- (InitiateSignalBuilder*) clearPort { result.hasPort = NO; result.port = 0; return self; @@ -320,12 +376,12 @@ static InitiateSignal* defaultInitiateSignalInstance = nil; - (NSString*) serverName { return result.serverName; } -- (InitiateSignal_Builder*) setServerName:(NSString*) value { +- (InitiateSignalBuilder*) setServerName:(NSString*) value { result.hasServerName = YES; result.serverName = value; return self; } -- (InitiateSignal_Builder*) clearServerName { +- (InitiateSignalBuilder*) clearServerName { result.hasServerName = NO; result.serverName = @""; return self; @@ -333,18 +389,20 @@ static InitiateSignal* defaultInitiateSignalInstance = nil; - (BOOL) hasVersion { return result.hasVersion; } -- (int32_t) version { +- (UInt32) version { return result.version; } -- (InitiateSignal_Builder*) setVersion:(int32_t) value { +- (InitiateSignalBuilder*) setVersion:(UInt32) value { result.hasVersion = YES; result.version = value; return self; } -- (InitiateSignal_Builder*) clearVersion { +- (InitiateSignalBuilder*) clearVersion { result.hasVersion = NO; result.version = 0; return self; } @end + +// @@protoc_insertion_point(global_scope) diff --git a/Signal/src/phone/signaling/ResponderSessionDescriptor.m b/Signal/src/phone/signaling/ResponderSessionDescriptor.m index b5a36f774..602f1f68f 100644 --- a/Signal/src/phone/signaling/ResponderSessionDescriptor.m +++ b/Signal/src/phone/signaling/ResponderSessionDescriptor.m @@ -72,8 +72,8 @@ checkOperation(parsedPayload.initiator != nil); checkOperation(parsedPayload.serverName != nil); - int32_t interopVersion = parsedPayload.version; - int64_t sessionId = parsedPayload.sessionId; + unsigned int interopVersion = parsedPayload.version; + unsigned long long sessionId = parsedPayload.sessionId; in_port_t relayUdpPort = (in_port_t)parsedPayload.port; NSString* relayServerName = parsedPayload.serverName; PhoneNumber* phoneNumber = [PhoneNumber phoneNumberFromE164:parsedPayload.initiator]; diff --git a/Signal/src/textsecure/Account/TSAccountManager.h b/Signal/src/textsecure/Account/TSAccountManager.h new file mode 100644 index 000000000..c71ee3478 --- /dev/null +++ b/Signal/src/textsecure/Account/TSAccountManager.h @@ -0,0 +1,71 @@ +// +// TSAccountManagement.h +// TextSecureKit +// +// Created by Frederic Jacobs on 27/10/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import +#import "TSConstants.h" +#import "TSNumberVerifier.h" + +typedef void(^codeVerifierBlock)(TSNumberVerifier *numberVerifier); + +@interface TSAccountManager : NSObject + +/** + * Returns if a user is registered or not + * + * @return registered or not + */ + ++ (BOOL)isRegistered; + +/** + * Returns registered number + * + * @return E164 formatted phone number + */ + ++ (NSString*)registeredNumber; + +/** + * The registration ID is unique to an installation of TextSecure, it allows to know if the app was reinstalled + * + * @return registrationID; + */ + ++ (int)getOrGenerateRegistrationId; + +/** + * Sets the user as registered + * + */ + ++ (void)setRegistered:(BOOL)registered; + +#if TARGET_OS_IPHONE + +/** + * Request a verification challenge + * + * @param phoneNumber phone number to send verification challenge to + * @param transport sms or voice call + * @param successBlock block to execute on success of request + * @param failureBlock block to execute on failure of request + */ + ++ (void)registerWithPhoneNumber:(NSString*)phoneNumber overTransport:(VerificationTransportType)transport success:(codeVerifierBlock)success failure:(failedRegistrationRequestBlock)failureBlock; + +/** + * Register's the device's push notification token with the server + * + * @param pushToken Apple's Push Token + */ + ++ (void)registerForPushNotifications:(NSData*)pushToken success:(successCompletionBlock)success failure:(failedVerificationBlock)failureBlock; + +#endif + +@end diff --git a/Signal/src/textsecure/Account/TSAccountManager.m b/Signal/src/textsecure/Account/TSAccountManager.m new file mode 100644 index 000000000..b7c501850 --- /dev/null +++ b/Signal/src/textsecure/Account/TSAccountManager.m @@ -0,0 +1,124 @@ +// +// TSAccountManagement.m +// TextSecureKit +// +// Created by Frederic Jacobs on 27/10/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "NSData+Base64.h" +#import "NSData+hexString.h" +#import "NSURLSessionDataTask+StatusCode.h" + +#import "SecurityUtils.h" +#import "TSNetworkManager.h" +#import "TSAccountManager.h" +#import "TSRequestVerificationCodeRequest.h" +#import "TSStorageManager+keyingMaterial.h" +#import "TSNumberVerifier.h" +#import "TSRegisterForPushRequest.h" +#import "TSRegisterWithTokenRequest.h" + +typedef void(^succesfullPushRegistrationBlock)(NSData *pushToken); + + +@interface TSAccountManager () + +@property (nonatomic, retain) NSString *phoneNumberAwaitingVerification; + +@end + +@interface TSNumberVerifier () + ++ (instancetype)verifierWithPhoneNumber:(NSString*)phoneNumber; + +@end + +@implementation TSAccountManager + ++ (BOOL)isRegistered { + return [[TSStorageManager sharedManager] boolForKey:TSStorageIsRegistered inCollection:TSStorageInternalSettingsCollection]; +} + ++ (void)setRegistered:(BOOL)registered{ + [[TSStorageManager sharedManager] setObject:registered?@YES:@NO forKey:TSStorageIsRegistered inCollection:TSStorageInternalSettingsCollection]; +} + ++ (NSString *)registeredNumber { + YapDatabaseConnection *dbConn = [[TSStorageManager sharedManager] databaseConnection]; + __block NSString *phoneNumber; + + [dbConn readWithBlock:^(YapDatabaseReadTransaction *transaction) { + phoneNumber = [transaction objectForKey:TSStorageRegisteredNumberKey inCollection:TSStorageUserAccountCollection]; + }]; + + return phoneNumber; +} + ++ (int)getOrGenerateRegistrationId { + YapDatabaseConnection *dbConn = [[TSStorageManager sharedManager] databaseConnection]; + __block int registrationID; + + [dbConn readWithBlock:^(YapDatabaseReadTransaction *transaction) { + registrationID = [[transaction objectForKey:TSStorageLocalRegistrationId inCollection:TSStorageUserAccountCollection] intValue]; + }]; + + if (!registrationID) { + YapDatabaseConnection *dbConn = [[TSStorageManager sharedManager] databaseConnection]; + + int localIdentifier = random()%16380; + + [dbConn readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) { + [transaction setObject:[NSNumber numberWithInt:localIdentifier] + forKey:TSStorageLocalRegistrationId + inCollection:TSStorageUserAccountCollection]; + }]; + } + + return registrationID; +} + +#if TARGET_OS_IPHONE + ++ (void)registerWithPhoneNumber:(NSString*)phoneNumber overTransport:(VerificationTransportType)transport success:(codeVerifierBlock)successBlock failure:(failedRegistrationRequestBlock)failureBlock{ + + [[TSNetworkManager sharedManager] queueAuthenticatedRequest:[[TSRequestVerificationCodeRequest alloc] + initRequestForPhoneNumber:phoneNumber transport:transport] + success:^(NSURLSessionDataTask *task, id responseObject) { + long statuscode = task.statusCode; + + if (statuscode == 200 || statuscode == 204) { + successBlock([TSNumberVerifier verifierWithPhoneNumber:phoneNumber]); + } else{ + failureBlock(); + } + + } failure:^(NSURLSessionDataTask *task, NSError *error) { + failureBlock(); + }]; +} + ++ (void)registerForPushNotifications:(NSData *)pushToken success:(successCompletionBlock)success failure:(failedVerificationBlock)failureBlock{ + + NSString *stringToken = [[pushToken description] stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"<> "]]; + + [[TSNetworkManager sharedManager] queueAuthenticatedRequest:[[TSRegisterForPushRequest alloc] initWithPushIdentifier:stringToken] success:^(NSURLSessionDataTask *task, id responseObject) { + success(); + } failure:^(NSURLSessionDataTask *task, NSError *error) { + switch ([task statusCode]) { + case 401: + failureBlock(kTSRegistrationFailureAuthentication); + break; + case 415: + failureBlock(kTSRegistrationFailureRequest); + break; + default: + failureBlock(kTSRegistrationFailureNetwork); + break; + } + }]; +} + +#endif + +@end diff --git a/Signal/src/textsecure/Account/TSNumberVerifier.h b/Signal/src/textsecure/Account/TSNumberVerifier.h new file mode 100644 index 000000000..1a1cf176b --- /dev/null +++ b/Signal/src/textsecure/Account/TSNumberVerifier.h @@ -0,0 +1,39 @@ +// +// TSNumberVerifier.h +// TextSecureKit +// +// Created by Frederic Jacobs on 31/10/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import +#import "TSConstants.h" + +typedef NS_ENUM(NSUInteger, TSRegistrationFailure) { + kTSRegistrationFailureAuthentication, + kTSRegistrationFailureNetwork, + kTSRegistrationFailureRateLimit, + kTSRegistrationFailureWrongCode, + kTSRegistrationFailureAlreadyRegistered, + kTSRegistrationFailurePrekeys, + kTSRegistrationFailurePushID, + kTSRegistrationFailureRequest +}; + +typedef void(^failedVerificationBlock)(TSRegistrationFailure failureType); + +@interface TSNumberVerifier : NSObject + +/** + * Verify verification challenge code. To be called only after registerWithPhoneNumber succeeded + * + * @param verificationCode the verification code received + * @param successBlock block to execute on success of request + * @param failureBlock block to execute on failure of request + */ + +- (void)verifyCode:(NSString*)verificationCode success:(successCompletionBlock)successBlock failure:(failedVerificationBlock)failureBlock; + ++ (void)registerPhoneNumber:(NSString*)phoneNumber withRedPhoneToken:(NSString*)registrationToken success:(successCompletionBlock)successBlock failure:(failedVerificationBlock)failureBlock; + +@end diff --git a/Signal/src/textsecure/Account/TSNumberVerifier.m b/Signal/src/textsecure/Account/TSNumberVerifier.m new file mode 100644 index 000000000..6cfcd02f4 --- /dev/null +++ b/Signal/src/textsecure/Account/TSNumberVerifier.m @@ -0,0 +1,149 @@ +// +// TSNumberVerifier.m +// TextSecureKit +// +// Created by Frederic Jacobs on 31/10/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "NSData+Base64.h" +#import "NSData+hexString.h" + +#import "SecurityUtils.h" +#import "TSAccountManager.h" +#import "TSRegisterWithTokenRequest.h" +#import "TSServerCodeVerificationRequest.h" +#import "TSStorageManager+keyingMaterial.h" +#import "TSNetworkManager.h" +#import "TSNumberVerifier.h" + +#import "TSPrekeyManager.h" + +@interface TSNumberVerifier () + +@property (nonatomic, readonly) NSString *phoneNumber; + +@end + +@implementation TSNumberVerifier + +- (instancetype)initWithNumber:(NSString*)string { + self = [super init]; + + if (self) { + _phoneNumber = string; + } + + return self; +} + ++ (instancetype)verifierWithPhoneNumber:(NSString*)phoneNumber { + TSNumberVerifier *verifier = [[TSNumberVerifier alloc] initWithNumber:phoneNumber]; + return verifier; +} + ++ (void)registerPhoneNumber:(NSString*)phoneNumber withRedPhoneToken:(NSString*)registrationToken success:(successCompletionBlock)successBlock failure:(failedVerificationBlock)failureBlock{ + NSString *authToken = [self generateNewAccountAuthenticationToken]; + NSString *signalingKey = [self generateNewSignalingKeyToken]; + + TSRegisterWithTokenRequest *request = [[TSRegisterWithTokenRequest alloc] initWithVerificationToken:registrationToken signalingKey:signalingKey authKey:authToken]; + + [[TSNetworkManager sharedManager] queueAuthenticatedRequest:request success:^(NSURLSessionDataTask *task, id responseObject) { + + NSHTTPURLResponse *response = (NSHTTPURLResponse *)task.response; + long statuscode = response.statusCode; + + if (statuscode == 200 || statuscode == 204) { + + [TSStorageManager storeServerToken:authToken signalingKey:signalingKey phoneNumber:phoneNumber]; + + [[self class] registerPushIdWithSuccess:successBlock failure:failureBlock]; + + } else{ + failureBlock(kTSRegistrationFailureNetwork); + } + + } failure:^(NSURLSessionDataTask *task, NSError *error) { + + }]; + + +} + +- (void)verifyCode:(NSString*)verificationCode success:(successCompletionBlock)successBlock failure:(failedVerificationBlock)failureBlock { + NSString *authToken = [[self class] generateNewAccountAuthenticationToken]; + NSString *signalingKey = [[self class] generateNewSignalingKeyToken]; + NSString *phoneNumber = self.phoneNumber; + + TSServerCodeVerificationRequest *request = [[TSServerCodeVerificationRequest alloc] initWithVerificationCode:verificationCode signalingKey:signalingKey authKey:authToken]; + request.numberToValidate = phoneNumber; + + [[TSNetworkManager sharedManager] queueAuthenticatedRequest:request success:^(NSURLSessionDataTask *task, id responseObject) { + + NSHTTPURLResponse *response = (NSHTTPURLResponse *)task.response; + long statuscode = response.statusCode; + + if (statuscode == 200 || statuscode == 204) { + + [TSStorageManager storeServerToken:authToken signalingKey:signalingKey phoneNumber:phoneNumber]; + + [[self class] registerPushIdWithSuccess:successBlock failure:failureBlock]; + + } else{ + failureBlock(kTSRegistrationFailureNetwork); + } + + } failure:^(NSURLSessionDataTask *task, NSError *error) { + NSHTTPURLResponse *response = (NSHTTPURLResponse *)task.response; + long statuscode = response.statusCode; + + switch (statuscode) { + case 403: // Wrong verification code + failureBlock(kTSRegistrationFailureWrongCode); + break; + case 413: // Rate limit exceeded + failureBlock(kTSRegistrationFailureRateLimit); + break; + case 417: // Number already registered + [[self class] registerPushIdWithSuccess:successBlock failure:failureBlock]; + break; + default: + failureBlock(kTSRegistrationFailureNetwork); + break; + } + }]; +} + + + ++ (void)registerPushIdWithSuccess:(successCompletionBlock)successBlock failure:(failedVerificationBlock)failureBlock { + [TSAccountManager registerForPushNotifications:[@"A FAKE TOKEN" dataUsingEncoding:NSUTF8StringEncoding] success:^{ + [self registerPreKeys:successBlock failure:failureBlock]; + } failure:failureBlock];; + +} + ++ (void)registerPreKeys:(successCompletionBlock)successBlock failure:(failedVerificationBlock)failureBlock { + [TSPreKeyManager registerPreKeysWithSuccess:^{ + [TSAccountManager setRegistered:YES]; + successBlock(); + } failure:failureBlock]; +} + + +#pragma mark Server keying material + ++ (NSString*)generateNewAccountAuthenticationToken { + NSData *authToken = [SecurityUtils generateRandomBytes:16]; + NSString *authTokenPrint = [[NSData dataWithData:authToken] hexadecimalString]; + return authTokenPrint; +} + ++ (NSString*)generateNewSignalingKeyToken { + /*The signalingKey is 32 bytes of AES material (256bit AES) and 20 bytes of Hmac key material (HmacSHA1) concatenated into a 52 byte slug that is base64 encoded. */ + NSData *signalingKeyToken = [SecurityUtils generateRandomBytes:52]; + NSString *signalingKeyTokenPrint = [[NSData dataWithData:signalingKeyToken] base64EncodedString]; + return signalingKeyTokenPrint; +} + +@end diff --git a/Signal/src/textsecure/Account/TSPreKeyManager.h b/Signal/src/textsecure/Account/TSPreKeyManager.h new file mode 100644 index 000000000..49f592b2d --- /dev/null +++ b/Signal/src/textsecure/Account/TSPreKeyManager.h @@ -0,0 +1,17 @@ +// +// TSPrekeyManager.h +// TextSecureKit +// +// Created by Frederic Jacobs on 07/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import +#import "TSConstants.h" +#import "TSNumberVerifier.h" + +@interface TSPreKeyManager : NSObject + ++ (void)registerPreKeysWithSuccess:(successCompletionBlock)success failure:(failedVerificationBlock)failureBlock; + +@end diff --git a/Signal/src/textsecure/Account/TSPreKeyManager.m b/Signal/src/textsecure/Account/TSPreKeyManager.m new file mode 100644 index 000000000..43b68c560 --- /dev/null +++ b/Signal/src/textsecure/Account/TSPreKeyManager.m @@ -0,0 +1,50 @@ +// +// TSPrekeyManager.m +// TextSecureKit +// +// Created by Frederic Jacobs on 07/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSPreKeyManager.h" +#import "TSStorageManager.h" +#import "TSStorageManager+PreKeyStore.h" +#import "TSStorageManager+SignedPreKeyStore.h" +#import "TSStorageManager+IdentityKeyStore.h" +#import "TSNetworkManager.h" +#import "TSRegisterPrekeysRequest.h" + +@implementation TSPreKeyManager + ++ (void)registerPreKeysWithSuccess:(successCompletionBlock)success failure:(failedVerificationBlock)failureBlock{ + TSStorageManager *storageManager = [TSStorageManager sharedManager]; + ECKeyPair *identityKeyPair = [storageManager identityKeyPair]; + + if (!identityKeyPair) { + [storageManager generateNewIdentityKey]; + identityKeyPair = [storageManager identityKeyPair]; + } + + PreKeyRecord *lastResortPreKey = [storageManager getOrGenerateLastResortKey]; + SignedPreKeyRecord *signedPreKey = [storageManager generateRandomSignedRecord]; + + NSArray *preKeys = [storageManager generatePreKeyRecords]; + + TSRegisterPrekeysRequest *request = [[TSRegisterPrekeysRequest alloc] initWithPrekeyArray:preKeys + identityKey:[storageManager identityKeyPair].publicKey + signedPreKeyRecord:signedPreKey + preKeyLastResort:lastResortPreKey]; + + [[TSNetworkManager sharedManager] queueAuthenticatedRequest:request success:^(NSURLSessionDataTask *task, id responseObject) { + [storageManager storePreKeyRecords:preKeys]; + [storageManager storeSignedPreKey:signedPreKey.Id signedPreKeyRecord:signedPreKey]; + + success(); + + } failure:^(NSURLSessionDataTask *task, NSError *error) { + failureBlock(kTSRegistrationFailureNetwork); + }]; + +} + +@end diff --git a/Signal/src/textsecure/Contacts/TSContact.h b/Signal/src/textsecure/Contacts/TSContact.h new file mode 100644 index 000000000..c61f46725 --- /dev/null +++ b/Signal/src/textsecure/Contacts/TSContact.h @@ -0,0 +1,42 @@ +// +// TSContact.h +// TextSecureKit +// +// Created by Frederic Jacobs on 12/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import +#import + +#if TARGET_OS_IPHONE +#import +#import +#endif + +#import "TSInteraction.h" +#import "TSYapDatabaseObject.h" + +typedef NS_OPTIONS(NSInteger, TSServicesAvailable){ + TSServiceRedPhone, + TSServiceTextSecure +}; + +/** + * TSContacts always have one property, the identifier they are registered with on TextSecure. All the rest is optional. + */ + +@interface TSContact : TSYapDatabaseObject + +- (instancetype)initWithRecipientId:(NSString*)recipientId; + +- (TSServicesAvailable)availableServices; +- (TSInteraction*)lastMessageWithTransaction:(YapDatabaseReadTransaction *)transaction; + +#if TARGET_OS_IPHONE +- (ABRecordID*)addressBookID; +- (NSString*)firstName; +- (NSString*)lastName; +#endif + +@end diff --git a/Signal/src/textsecure/Contacts/TSContact.m b/Signal/src/textsecure/Contacts/TSContact.m new file mode 100644 index 000000000..469321e0a --- /dev/null +++ b/Signal/src/textsecure/Contacts/TSContact.m @@ -0,0 +1,31 @@ +// +// TSContact.m +// TextSecureKit +// +// Created by Frederic Jacobs on 12/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSContact.h" + +static NSString *recipientKey = @"TSIdentifierRecipientIdKey"; + +@implementation TSContact + ++ (BOOL)supportsSecureCoding{ + return YES; +} + +- (id)initWithCoder:(NSCoder *)aDecoder{ + NSString *recipientId = [aDecoder decodeObjectOfClass:[NSString class] forKey:recipientKey]; + return [self initWithRecipientId:recipientId]; +} + + ++ (NSString*)collection{ + return @"TSContactCollection"; +} + +# pragma mark AddressBook Lookups + +@end diff --git a/Signal/src/textsecure/Contacts/TSGroup.h b/Signal/src/textsecure/Contacts/TSGroup.h new file mode 100644 index 000000000..ed514b705 --- /dev/null +++ b/Signal/src/textsecure/Contacts/TSGroup.h @@ -0,0 +1,27 @@ +// +// TSGroup.h +// TextSecureKit +// +// Created by Frederic Jacobs on 12/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import +#import "TSAttachement.h" + +#import "TSYapDatabaseObject.h" + +@interface TSGroup : TSYapDatabaseObject + +@property (nonatomic) NSString *name; // Name of the group +@property (nonatomic) TSAttachement *avatar; // Link to the attachement object (group picture) +@property (nonatomic) NSSet *members; // Each member of the discussion is a TSUser + +- (NSData*)groupIdentifier; + ++ (TSGroup*)groupWithId:(NSData*)id; + +- (NSSet*)membersIdentifier; + + +@end diff --git a/Signal/src/textsecure/Contacts/TSGroup.m b/Signal/src/textsecure/Contacts/TSGroup.m new file mode 100644 index 000000000..fe55422ef --- /dev/null +++ b/Signal/src/textsecure/Contacts/TSGroup.m @@ -0,0 +1,17 @@ +// +// TSGroup.m +// TextSecureKit +// +// Created by Frederic Jacobs on 12/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSGroup.h" + +@implementation TSGroup + ++ (NSString*)collection{ + return @"TSGroup"; +} + +@end diff --git a/Signal/src/textsecure/Contacts/TSRecipient.h b/Signal/src/textsecure/Contacts/TSRecipient.h new file mode 100644 index 000000000..88a8d2c78 --- /dev/null +++ b/Signal/src/textsecure/Contacts/TSRecipient.h @@ -0,0 +1,31 @@ +// +// TSRecipient.h +// TextSecureKit +// +// Created by Frederic Jacobs on 17/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSYapDatabaseObject.h" + +@interface TSRecipient : TSYapDatabaseObject + +- (instancetype)initWithTextSecureIdentifier:(NSString*)textSecureIdentifier relay:(NSString*)relay; + ++ (instancetype)recipientWithTextSecureIdentifier:(NSString*)textSecureIdentifier withTransaction:(YapDatabaseReadTransaction*)transaction; + +- (NSSet*)devices; //NSNumbers + +- (void)addDevices:(NSSet *)set; + +- (void)removeDevices:(NSSet *)set; + +#pragma mark Fingerprint verification + +- (BOOL)hasVerifiedFingerprint; + +- (void)setFingerPrintVerified:(BOOL)verified transaction:(YapDatabaseReadTransaction*)transaction; + +@property (nonatomic, readonly) NSString *relay; + +@end diff --git a/Signal/src/textsecure/Contacts/TSRecipient.m b/Signal/src/textsecure/Contacts/TSRecipient.m new file mode 100644 index 000000000..a4f6a7b0d --- /dev/null +++ b/Signal/src/textsecure/Contacts/TSRecipient.m @@ -0,0 +1,84 @@ +// +// TSRecipient.m +// TextSecureKit +// +// Created by Frederic Jacobs on 17/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSStorageManager+IdentityKeyStore.h" +#import "TSRecipient.h" + +@interface TSRecipient (){ + NSMutableSet *devices; + NSData *verifiedKey; +} + +@end + +@implementation TSRecipient + ++ (NSString*)collection{ + return @"TSRecipient"; +} + +- (instancetype)initWithTextSecureIdentifier:(NSString*)textSecureIdentifier{ + self = [super initWithUniqueId:textSecureIdentifier]; + + if (self) { + devices = [NSMutableSet setWithObject:[NSNumber numberWithInt:1]]; + verifiedKey = nil; + } + + return self; +} + ++ (instancetype)recipientWithTextSecureIdentifier:(NSString*)textSecureIdentifier withTransaction:(YapDatabaseReadTransaction*)transaction{ + TSRecipient *recipient = [self fetchObjectWithUniqueID:textSecureIdentifier transaction:transaction]; + + if (!recipient) { + recipient = [[self alloc] initWithTextSecureIdentifier:textSecureIdentifier]; + } + return recipient; +} + +- (NSSet*)devices{ + return [devices copy]; +} + +- (void)addDevices:(NSSet *)set{ + [devices unionSet:set]; +} + +- (void)removeDevices:(NSSet *)set{ + [devices minusSet:set]; +} + +#pragma mark Fingerprint verification + +- (BOOL)hasVerifiedFingerprint{ + if (verifiedKey) { + BOOL equalsStoredValue = [verifiedKey isEqualToData:[[TSStorageManager sharedManager] identityKeyForRecipientId:self.uniqueId]]; + + if (equalsStoredValue) { + return YES; + } else{ + verifiedKey = nil; + return NO; + } + + } else{ + return NO; + } +} + +- (void)setFingerPrintVerified:(BOOL)verified transaction:(YapDatabaseReadTransaction*)transaction{ + if (verified) { + verifiedKey = [[TSStorageManager sharedManager] identityKeyForRecipientId:self.uniqueId]; + } else{ + verifiedKey = nil; + } +} + + +@end diff --git a/Signal/src/textsecure/Contacts/TSThread.h b/Signal/src/textsecure/Contacts/TSThread.h new file mode 100644 index 000000000..e483d037c --- /dev/null +++ b/Signal/src/textsecure/Contacts/TSThread.h @@ -0,0 +1,31 @@ +// +// TSThread.h +// TextSecureKit +// +// Created by Frederic Jacobs on 16/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import +#import + +#import "TSYapDatabaseObject.h" + +/** + * TSThread is the superclass of TSContactThread and TSGroupThread + */ + +@interface TSThread : TSYapDatabaseObject + +/** + * Returns whether the object is a group thread or not + * + * @return Is a group + */ + +- (BOOL)isGroupThread; + +@property (getter=isBlocked) BOOL blocked; +@property (nonatomic, copy) NSDate *lastMessageDate; + +@end diff --git a/Signal/src/textsecure/Contacts/TSThread.m b/Signal/src/textsecure/Contacts/TSThread.m new file mode 100644 index 000000000..56f705e62 --- /dev/null +++ b/Signal/src/textsecure/Contacts/TSThread.m @@ -0,0 +1,35 @@ +// +// TSThread.m +// TextSecureKit +// +// Created by Frederic Jacobs on 16/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSThread.h" + +#import "TSContact.h" +#import "TSGroup.h" + +@implementation TSThread + ++ (NSString *)collection{ + return @"TSThread"; +} + +- (instancetype)initWithUniqueId:(NSString *)uniqueId{ + self = [super initWithUniqueId:uniqueId]; + + if (self) { + _blocked = NO; + } + + return self; +} + +- (BOOL)isGroupThread{ + NSAssert(false, @"An abstract method on TSThread was called."); + return FALSE; +} + +@end diff --git a/Signal/src/textsecure/Contacts/Threads/TSContactThread.h b/Signal/src/textsecure/Contacts/Threads/TSContactThread.h new file mode 100644 index 000000000..887ad15f9 --- /dev/null +++ b/Signal/src/textsecure/Contacts/Threads/TSContactThread.h @@ -0,0 +1,20 @@ +// +// TSContactThread.h +// TextSecureKit +// +// Created by Frederic Jacobs on 16/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import + +#import "TSThread.h" +#import "TSRecipient.h" + +@interface TSContactThread : TSThread + ++ (instancetype)threadWithContactId:(NSString*)contactId; + +- (TSRecipient*)recipient; + +@end diff --git a/Signal/src/textsecure/Contacts/Threads/TSContactThread.m b/Signal/src/textsecure/Contacts/Threads/TSContactThread.m new file mode 100644 index 000000000..b9660f325 --- /dev/null +++ b/Signal/src/textsecure/Contacts/Threads/TSContactThread.m @@ -0,0 +1,54 @@ +// +// TSContactThread.m +// TextSecureKit +// +// Created by Frederic Jacobs on 16/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSContactThread.h" + +#import "TSStorageManager.h" + +#define TSContactThreadPrefix @"c" + +@implementation TSContactThread + +- (instancetype)initWithContactId:(NSString*)contactId{ + + NSString *uniqueIdentifier = [[self class] threadIdFromContactId:contactId]; + + self = [super initWithUniqueId:uniqueIdentifier]; + + return self; +} + ++ (instancetype)threadWithContactId:(NSString*)contactId{ + + TSContactThread *thread = [self fetchObjectWithUniqueID:[self threadIdFromContactId:contactId]]; + + if (!thread) { + thread = [[TSContactThread alloc] initWithContactId:contactId]; + [thread save]; + } + + return thread; +} + +- (NSString *)contactIdentifier{ + return [[self class]contactIdFromThreadId:self.uniqueId]; +} + +- (BOOL)isGroupThread{ + return false; +} + ++ (NSString*)threadIdFromContactId:(NSString*)contactId{ + return [TSContactThreadPrefix stringByAppendingString:contactId]; +} + ++ (NSString*)contactIdFromThreadId:(NSString*)threadId{ + return [threadId substringWithRange:NSMakeRange(1, threadId.length-1)]; +} + +@end diff --git a/Signal/src/textsecure/Contacts/Threads/TSGroupThread.h b/Signal/src/textsecure/Contacts/Threads/TSGroupThread.h new file mode 100644 index 000000000..03c2475da --- /dev/null +++ b/Signal/src/textsecure/Contacts/Threads/TSGroupThread.h @@ -0,0 +1,17 @@ +// +// TSGroupThread.h +// TextSecureKit +// +// Created by Frederic Jacobs on 16/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSThread.h" + +@interface TSGroupThread : TSThread + ++ (instancetype)threadWithGroupId:(NSData*)groupId; + +- (NSData*)groupId; + +@end diff --git a/Signal/src/textsecure/Contacts/Threads/TSGroupThread.m b/Signal/src/textsecure/Contacts/Threads/TSGroupThread.m new file mode 100644 index 000000000..9ed0dfa65 --- /dev/null +++ b/Signal/src/textsecure/Contacts/Threads/TSGroupThread.m @@ -0,0 +1,53 @@ +// +// TSGroupThread.m +// TextSecureKit +// +// Created by Frederic Jacobs on 16/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSGroupThread.h" +#import "NSData+Base64.h" + +@implementation TSGroupThread + +#define TSGroupThreadPrefix @"g" + +- (instancetype)initWithGroupId:(NSData*)groupId{ + + NSString *uniqueIdentifier = [[self class] threadIdFromGroupId:groupId]; + + self = [super initWithUniqueId:uniqueIdentifier]; + + return self; +} + ++ (instancetype)threadWithGroupId:(NSData *)groupId{ + + TSGroupThread *thread = [self fetchObjectWithUniqueID:[self threadIdFromGroupId:groupId]]; + + if (!thread) { + thread = [[TSGroupThread alloc] initWithGroupId:groupId]; + [thread save]; + } + + return thread; +} + +- (BOOL)isGroupThread{ + return true; +} + +- (NSData *)groupId{ + return [[self class] groupIdFromThreadId:self.uniqueId]; +} + ++ (NSString*)threadIdFromGroupId:(NSData*)groupId{ + return [TSGroupThreadPrefix stringByAppendingString:[groupId base64EncodedString]]; +} + ++ (NSData*)groupIdFromThreadId:(NSString*)threadId{ + return [NSData dataFromBase64String:[threadId substringWithRange:NSMakeRange(1, threadId.length-1)]]; +} + +@end diff --git a/Signal/src/textsecure/Messages/IncomingPushMessageSignal.pb.h b/Signal/src/textsecure/Messages/IncomingPushMessageSignal.pb.h new file mode 100644 index 000000000..f97b85082 --- /dev/null +++ b/Signal/src/textsecure/Messages/IncomingPushMessageSignal.pb.h @@ -0,0 +1,387 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! + +#import "ProtocolBuffers.h" + +// @@protoc_insertion_point(imports) + +@class IncomingPushMessageSignal; +@class IncomingPushMessageSignalBuilder; +@class PushMessageContent; +@class PushMessageContentAttachmentPointer; +@class PushMessageContentAttachmentPointerBuilder; +@class PushMessageContentBuilder; +@class PushMessageContentGroupContext; +@class PushMessageContentGroupContextBuilder; +#ifndef __has_feature + #define __has_feature(x) 0 // Compatibility with non-clang compilers. +#endif // __has_feature + +#ifndef NS_RETURNS_NOT_RETAINED + #if __has_feature(attribute_ns_returns_not_retained) + #define NS_RETURNS_NOT_RETAINED __attribute__((ns_returns_not_retained)) + #else + #define NS_RETURNS_NOT_RETAINED + #endif +#endif + +typedef enum { + IncomingPushMessageSignalTypeUnknown = 0, + IncomingPushMessageSignalTypeCiphertext = 1, + IncomingPushMessageSignalTypeKeyExchange = 2, + IncomingPushMessageSignalTypePrekeyBundle = 3, + IncomingPushMessageSignalTypePlaintext = 4, + IncomingPushMessageSignalTypeReceipt = 5, +} IncomingPushMessageSignalType; + +BOOL IncomingPushMessageSignalTypeIsValidValue(IncomingPushMessageSignalType value); + +typedef enum { + PushMessageContentFlagsEndSession = 1, +} PushMessageContentFlags; + +BOOL PushMessageContentFlagsIsValidValue(PushMessageContentFlags value); + +typedef enum { + PushMessageContentGroupContextTypeUnknown = 0, + PushMessageContentGroupContextTypeUpdate = 1, + PushMessageContentGroupContextTypeDeliver = 2, + PushMessageContentGroupContextTypeQuit = 3, +} PushMessageContentGroupContextType; + +BOOL PushMessageContentGroupContextTypeIsValidValue(PushMessageContentGroupContextType value); + + +@interface IncomingPushMessageSignalRoot : NSObject { +} ++ (PBExtensionRegistry*) extensionRegistry; ++ (void) registerAllExtensions:(PBMutableExtensionRegistry*) registry; +@end + +@interface IncomingPushMessageSignal : PBGeneratedMessage { +@private + BOOL hasTimestamp_:1; + BOOL hasSource_:1; + BOOL hasRelay_:1; + BOOL hasMessage_:1; + BOOL hasSourceDevice_:1; + BOOL hasType_:1; + UInt64 timestamp; + NSString* source; + NSString* relay; + NSData* message; + UInt32 sourceDevice; + IncomingPushMessageSignalType type; +} +- (BOOL) hasType; +- (BOOL) hasSource; +- (BOOL) hasSourceDevice; +- (BOOL) hasRelay; +- (BOOL) hasTimestamp; +- (BOOL) hasMessage; +@property (readonly) IncomingPushMessageSignalType type; +@property (readonly, strong) NSString* source; +@property (readonly) UInt32 sourceDevice; +@property (readonly, strong) NSString* relay; +@property (readonly) UInt64 timestamp; +@property (readonly, strong) NSData* message; + ++ (IncomingPushMessageSignal*) defaultInstance; +- (IncomingPushMessageSignal*) defaultInstance; + +- (BOOL) isInitialized; +- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output; +- (IncomingPushMessageSignalBuilder*) builder; ++ (IncomingPushMessageSignalBuilder*) builder; ++ (IncomingPushMessageSignalBuilder*) builderWithPrototype:(IncomingPushMessageSignal*) prototype; +- (IncomingPushMessageSignalBuilder*) toBuilder; + ++ (IncomingPushMessageSignal*) parseFromData:(NSData*) data; ++ (IncomingPushMessageSignal*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry; ++ (IncomingPushMessageSignal*) parseFromInputStream:(NSInputStream*) input; ++ (IncomingPushMessageSignal*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; ++ (IncomingPushMessageSignal*) parseFromCodedInputStream:(PBCodedInputStream*) input; ++ (IncomingPushMessageSignal*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; +@end + +@interface IncomingPushMessageSignalBuilder : PBGeneratedMessageBuilder { +@private + IncomingPushMessageSignal* result; +} + +- (IncomingPushMessageSignal*) defaultInstance; + +- (IncomingPushMessageSignalBuilder*) clear; +- (IncomingPushMessageSignalBuilder*) clone; + +- (IncomingPushMessageSignal*) build; +- (IncomingPushMessageSignal*) buildPartial; + +- (IncomingPushMessageSignalBuilder*) mergeFrom:(IncomingPushMessageSignal*) other; +- (IncomingPushMessageSignalBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input; +- (IncomingPushMessageSignalBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; + +- (BOOL) hasType; +- (IncomingPushMessageSignalType) type; +- (IncomingPushMessageSignalBuilder*) setType:(IncomingPushMessageSignalType) value; +- (IncomingPushMessageSignalBuilder*) clearType; + +- (BOOL) hasSource; +- (NSString*) source; +- (IncomingPushMessageSignalBuilder*) setSource:(NSString*) value; +- (IncomingPushMessageSignalBuilder*) clearSource; + +- (BOOL) hasSourceDevice; +- (UInt32) sourceDevice; +- (IncomingPushMessageSignalBuilder*) setSourceDevice:(UInt32) value; +- (IncomingPushMessageSignalBuilder*) clearSourceDevice; + +- (BOOL) hasRelay; +- (NSString*) relay; +- (IncomingPushMessageSignalBuilder*) setRelay:(NSString*) value; +- (IncomingPushMessageSignalBuilder*) clearRelay; + +- (BOOL) hasTimestamp; +- (UInt64) timestamp; +- (IncomingPushMessageSignalBuilder*) setTimestamp:(UInt64) value; +- (IncomingPushMessageSignalBuilder*) clearTimestamp; + +- (BOOL) hasMessage; +- (NSData*) message; +- (IncomingPushMessageSignalBuilder*) setMessage:(NSData*) value; +- (IncomingPushMessageSignalBuilder*) clearMessage; +@end + +@interface PushMessageContent : PBGeneratedMessage { +@private + BOOL hasBody_:1; + BOOL hasGroup_:1; + BOOL hasFlags_:1; + NSString* body; + PushMessageContentGroupContext* group; + UInt32 flags; + NSMutableArray * attachmentsArray; +} +- (BOOL) hasBody; +- (BOOL) hasGroup; +- (BOOL) hasFlags; +@property (readonly, strong) NSString* body; +@property (readonly, strong) NSArray * attachments; +@property (readonly, strong) PushMessageContentGroupContext* group; +@property (readonly) UInt32 flags; +- (PushMessageContentAttachmentPointer*)attachmentsAtIndex:(NSUInteger)index; + ++ (PushMessageContent*) defaultInstance; +- (PushMessageContent*) defaultInstance; + +- (BOOL) isInitialized; +- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output; +- (PushMessageContentBuilder*) builder; ++ (PushMessageContentBuilder*) builder; ++ (PushMessageContentBuilder*) builderWithPrototype:(PushMessageContent*) prototype; +- (PushMessageContentBuilder*) toBuilder; + ++ (PushMessageContent*) parseFromData:(NSData*) data; ++ (PushMessageContent*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry; ++ (PushMessageContent*) parseFromInputStream:(NSInputStream*) input; ++ (PushMessageContent*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; ++ (PushMessageContent*) parseFromCodedInputStream:(PBCodedInputStream*) input; ++ (PushMessageContent*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; +@end + +@interface PushMessageContentAttachmentPointer : PBGeneratedMessage { +@private + BOOL hasId_:1; + BOOL hasContentType_:1; + BOOL hasKey_:1; + UInt64 id; + NSString* contentType; + NSData* key; +} +- (BOOL) hasId; +- (BOOL) hasContentType; +- (BOOL) hasKey; +@property (readonly) UInt64 id; +@property (readonly, strong) NSString* contentType; +@property (readonly, strong) NSData* key; + ++ (PushMessageContentAttachmentPointer*) defaultInstance; +- (PushMessageContentAttachmentPointer*) defaultInstance; + +- (BOOL) isInitialized; +- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output; +- (PushMessageContentAttachmentPointerBuilder*) builder; ++ (PushMessageContentAttachmentPointerBuilder*) builder; ++ (PushMessageContentAttachmentPointerBuilder*) builderWithPrototype:(PushMessageContentAttachmentPointer*) prototype; +- (PushMessageContentAttachmentPointerBuilder*) toBuilder; + ++ (PushMessageContentAttachmentPointer*) parseFromData:(NSData*) data; ++ (PushMessageContentAttachmentPointer*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry; ++ (PushMessageContentAttachmentPointer*) parseFromInputStream:(NSInputStream*) input; ++ (PushMessageContentAttachmentPointer*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; ++ (PushMessageContentAttachmentPointer*) parseFromCodedInputStream:(PBCodedInputStream*) input; ++ (PushMessageContentAttachmentPointer*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; +@end + +@interface PushMessageContentAttachmentPointerBuilder : PBGeneratedMessageBuilder { +@private + PushMessageContentAttachmentPointer* result; +} + +- (PushMessageContentAttachmentPointer*) defaultInstance; + +- (PushMessageContentAttachmentPointerBuilder*) clear; +- (PushMessageContentAttachmentPointerBuilder*) clone; + +- (PushMessageContentAttachmentPointer*) build; +- (PushMessageContentAttachmentPointer*) buildPartial; + +- (PushMessageContentAttachmentPointerBuilder*) mergeFrom:(PushMessageContentAttachmentPointer*) other; +- (PushMessageContentAttachmentPointerBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input; +- (PushMessageContentAttachmentPointerBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; + +- (BOOL) hasId; +- (UInt64) id; +- (PushMessageContentAttachmentPointerBuilder*) setId:(UInt64) value; +- (PushMessageContentAttachmentPointerBuilder*) clearId; + +- (BOOL) hasContentType; +- (NSString*) contentType; +- (PushMessageContentAttachmentPointerBuilder*) setContentType:(NSString*) value; +- (PushMessageContentAttachmentPointerBuilder*) clearContentType; + +- (BOOL) hasKey; +- (NSData*) key; +- (PushMessageContentAttachmentPointerBuilder*) setKey:(NSData*) value; +- (PushMessageContentAttachmentPointerBuilder*) clearKey; +@end + +@interface PushMessageContentGroupContext : PBGeneratedMessage { +@private + BOOL hasName_:1; + BOOL hasAvatar_:1; + BOOL hasId_:1; + BOOL hasType_:1; + NSString* name; + PushMessageContentAttachmentPointer* avatar; + NSData* id; + PushMessageContentGroupContextType type; + NSMutableArray * membersArray; +} +- (BOOL) hasId; +- (BOOL) hasType; +- (BOOL) hasName; +- (BOOL) hasAvatar; +@property (readonly, strong) NSData* id; +@property (readonly) PushMessageContentGroupContextType type; +@property (readonly, strong) NSString* name; +@property (readonly, strong) PushMessageContentAttachmentPointer* avatar; +- (NSArray *)members; +- (NSString*)membersAtIndex:(NSUInteger)index; + ++ (PushMessageContentGroupContext*) defaultInstance; +- (PushMessageContentGroupContext*) defaultInstance; + +- (BOOL) isInitialized; +- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output; +- (PushMessageContentGroupContextBuilder*) builder; ++ (PushMessageContentGroupContextBuilder*) builder; ++ (PushMessageContentGroupContextBuilder*) builderWithPrototype:(PushMessageContentGroupContext*) prototype; +- (PushMessageContentGroupContextBuilder*) toBuilder; + ++ (PushMessageContentGroupContext*) parseFromData:(NSData*) data; ++ (PushMessageContentGroupContext*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry; ++ (PushMessageContentGroupContext*) parseFromInputStream:(NSInputStream*) input; ++ (PushMessageContentGroupContext*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; ++ (PushMessageContentGroupContext*) parseFromCodedInputStream:(PBCodedInputStream*) input; ++ (PushMessageContentGroupContext*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; +@end + +@interface PushMessageContentGroupContextBuilder : PBGeneratedMessageBuilder { +@private + PushMessageContentGroupContext* result; +} + +- (PushMessageContentGroupContext*) defaultInstance; + +- (PushMessageContentGroupContextBuilder*) clear; +- (PushMessageContentGroupContextBuilder*) clone; + +- (PushMessageContentGroupContext*) build; +- (PushMessageContentGroupContext*) buildPartial; + +- (PushMessageContentGroupContextBuilder*) mergeFrom:(PushMessageContentGroupContext*) other; +- (PushMessageContentGroupContextBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input; +- (PushMessageContentGroupContextBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; + +- (BOOL) hasId; +- (NSData*) id; +- (PushMessageContentGroupContextBuilder*) setId:(NSData*) value; +- (PushMessageContentGroupContextBuilder*) clearId; + +- (BOOL) hasType; +- (PushMessageContentGroupContextType) type; +- (PushMessageContentGroupContextBuilder*) setType:(PushMessageContentGroupContextType) value; +- (PushMessageContentGroupContextBuilder*) clearType; + +- (BOOL) hasName; +- (NSString*) name; +- (PushMessageContentGroupContextBuilder*) setName:(NSString*) value; +- (PushMessageContentGroupContextBuilder*) clearName; + +- (NSMutableArray *)members; +- (NSString*)membersAtIndex:(NSUInteger)index; +- (PushMessageContentGroupContextBuilder *)addMembers:(NSString*)value; +- (PushMessageContentGroupContextBuilder *)setMembersArray:(NSArray *)array; +- (PushMessageContentGroupContextBuilder *)clearMembers; + +- (BOOL) hasAvatar; +- (PushMessageContentAttachmentPointer*) avatar; +- (PushMessageContentGroupContextBuilder*) setAvatar:(PushMessageContentAttachmentPointer*) value; +- (PushMessageContentGroupContextBuilder*) setAvatarBuilder:(PushMessageContentAttachmentPointerBuilder*) builderForValue; +- (PushMessageContentGroupContextBuilder*) mergeAvatar:(PushMessageContentAttachmentPointer*) value; +- (PushMessageContentGroupContextBuilder*) clearAvatar; +@end + +@interface PushMessageContentBuilder : PBGeneratedMessageBuilder { +@private + PushMessageContent* result; +} + +- (PushMessageContent*) defaultInstance; + +- (PushMessageContentBuilder*) clear; +- (PushMessageContentBuilder*) clone; + +- (PushMessageContent*) build; +- (PushMessageContent*) buildPartial; + +- (PushMessageContentBuilder*) mergeFrom:(PushMessageContent*) other; +- (PushMessageContentBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input; +- (PushMessageContentBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; + +- (BOOL) hasBody; +- (NSString*) body; +- (PushMessageContentBuilder*) setBody:(NSString*) value; +- (PushMessageContentBuilder*) clearBody; + +- (NSMutableArray *)attachments; +- (PushMessageContentAttachmentPointer*)attachmentsAtIndex:(NSUInteger)index; +- (PushMessageContentBuilder *)addAttachments:(PushMessageContentAttachmentPointer*)value; +- (PushMessageContentBuilder *)setAttachmentsArray:(NSArray *)array; +- (PushMessageContentBuilder *)clearAttachments; + +- (BOOL) hasGroup; +- (PushMessageContentGroupContext*) group; +- (PushMessageContentBuilder*) setGroup:(PushMessageContentGroupContext*) value; +- (PushMessageContentBuilder*) setGroupBuilder:(PushMessageContentGroupContextBuilder*) builderForValue; +- (PushMessageContentBuilder*) mergeGroup:(PushMessageContentGroupContext*) value; +- (PushMessageContentBuilder*) clearGroup; + +- (BOOL) hasFlags; +- (UInt32) flags; +- (PushMessageContentBuilder*) setFlags:(UInt32) value; +- (PushMessageContentBuilder*) clearFlags; +@end + + +// @@protoc_insertion_point(global_scope) diff --git a/Signal/src/textsecure/Messages/IncomingPushMessageSignal.pb.m b/Signal/src/textsecure/Messages/IncomingPushMessageSignal.pb.m new file mode 100644 index 000000000..f3c13466b --- /dev/null +++ b/Signal/src/textsecure/Messages/IncomingPushMessageSignal.pb.m @@ -0,0 +1,1580 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! + +#import "IncomingPushMessageSignal.pb.h" +// @@protoc_insertion_point(imports) + +@implementation IncomingPushMessageSignalRoot +static PBExtensionRegistry* extensionRegistry = nil; ++ (PBExtensionRegistry*) extensionRegistry { + return extensionRegistry; +} + ++ (void) initialize { + if (self == [IncomingPushMessageSignalRoot class]) { + PBMutableExtensionRegistry* registry = [PBMutableExtensionRegistry registry]; + [self registerAllExtensions:registry]; + extensionRegistry = registry; + } +} ++ (void) registerAllExtensions:(PBMutableExtensionRegistry*) registry { +} +@end + +@interface IncomingPushMessageSignal () +@property IncomingPushMessageSignalType type; +@property (strong) NSString* source; +@property UInt32 sourceDevice; +@property (strong) NSString* relay; +@property UInt64 timestamp; +@property (strong) NSData* message; +@end + +@implementation IncomingPushMessageSignal + +- (BOOL) hasType { + return !!hasType_; +} +- (void) setHasType:(BOOL) value_ { + hasType_ = !!value_; +} +@synthesize type; +- (BOOL) hasSource { + return !!hasSource_; +} +- (void) setHasSource:(BOOL) value_ { + hasSource_ = !!value_; +} +@synthesize source; +- (BOOL) hasSourceDevice { + return !!hasSourceDevice_; +} +- (void) setHasSourceDevice:(BOOL) value_ { + hasSourceDevice_ = !!value_; +} +@synthesize sourceDevice; +- (BOOL) hasRelay { + return !!hasRelay_; +} +- (void) setHasRelay:(BOOL) value_ { + hasRelay_ = !!value_; +} +@synthesize relay; +- (BOOL) hasTimestamp { + return !!hasTimestamp_; +} +- (void) setHasTimestamp:(BOOL) value_ { + hasTimestamp_ = !!value_; +} +@synthesize timestamp; +- (BOOL) hasMessage { + return !!hasMessage_; +} +- (void) setHasMessage:(BOOL) value_ { + hasMessage_ = !!value_; +} +@synthesize message; +- (id) init { + if ((self = [super init])) { + self.type = IncomingPushMessageSignalTypeUnknown; + self.source = @""; + self.sourceDevice = 0; + self.relay = @""; + self.timestamp = 0L; + self.message = [NSData data]; + } + return self; +} +static IncomingPushMessageSignal* defaultIncomingPushMessageSignalInstance = nil; ++ (void) initialize { + if (self == [IncomingPushMessageSignal class]) { + defaultIncomingPushMessageSignalInstance = [[IncomingPushMessageSignal alloc] init]; + } +} ++ (IncomingPushMessageSignal*) defaultInstance { + return defaultIncomingPushMessageSignalInstance; +} +- (IncomingPushMessageSignal*) defaultInstance { + return defaultIncomingPushMessageSignalInstance; +} +- (BOOL) isInitialized { + return YES; +} +- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output { + if (self.hasType) { + [output writeEnum:1 value:self.type]; + } + if (self.hasSource) { + [output writeString:2 value:self.source]; + } + if (self.hasRelay) { + [output writeString:3 value:self.relay]; + } + if (self.hasTimestamp) { + [output writeUInt64:5 value:self.timestamp]; + } + if (self.hasMessage) { + [output writeData:6 value:self.message]; + } + if (self.hasSourceDevice) { + [output writeUInt32:7 value:self.sourceDevice]; + } + [self.unknownFields writeToCodedOutputStream:output]; +} +- (SInt32) serializedSize { + __block SInt32 size_ = memoizedSerializedSize; + if (size_ != -1) { + return size_; + } + + size_ = 0; + if (self.hasType) { + size_ += computeEnumSize(1, self.type); + } + if (self.hasSource) { + size_ += computeStringSize(2, self.source); + } + if (self.hasRelay) { + size_ += computeStringSize(3, self.relay); + } + if (self.hasTimestamp) { + size_ += computeUInt64Size(5, self.timestamp); + } + if (self.hasMessage) { + size_ += computeDataSize(6, self.message); + } + if (self.hasSourceDevice) { + size_ += computeUInt32Size(7, self.sourceDevice); + } + size_ += self.unknownFields.serializedSize; + memoizedSerializedSize = size_; + return size_; +} ++ (IncomingPushMessageSignal*) parseFromData:(NSData*) data { + return (IncomingPushMessageSignal*)[[[IncomingPushMessageSignal builder] mergeFromData:data] build]; +} ++ (IncomingPushMessageSignal*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (IncomingPushMessageSignal*)[[[IncomingPushMessageSignal builder] mergeFromData:data extensionRegistry:extensionRegistry] build]; +} ++ (IncomingPushMessageSignal*) parseFromInputStream:(NSInputStream*) input { + return (IncomingPushMessageSignal*)[[[IncomingPushMessageSignal builder] mergeFromInputStream:input] build]; +} ++ (IncomingPushMessageSignal*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (IncomingPushMessageSignal*)[[[IncomingPushMessageSignal builder] mergeFromInputStream:input extensionRegistry:extensionRegistry] build]; +} ++ (IncomingPushMessageSignal*) parseFromCodedInputStream:(PBCodedInputStream*) input { + return (IncomingPushMessageSignal*)[[[IncomingPushMessageSignal builder] mergeFromCodedInputStream:input] build]; +} ++ (IncomingPushMessageSignal*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (IncomingPushMessageSignal*)[[[IncomingPushMessageSignal builder] mergeFromCodedInputStream:input extensionRegistry:extensionRegistry] build]; +} ++ (IncomingPushMessageSignalBuilder*) builder { + return [[IncomingPushMessageSignalBuilder alloc] init]; +} ++ (IncomingPushMessageSignalBuilder*) builderWithPrototype:(IncomingPushMessageSignal*) prototype { + return [[IncomingPushMessageSignal builder] mergeFrom:prototype]; +} +- (IncomingPushMessageSignalBuilder*) builder { + return [IncomingPushMessageSignal builder]; +} +- (IncomingPushMessageSignalBuilder*) toBuilder { + return [IncomingPushMessageSignal builderWithPrototype:self]; +} +- (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent { + if (self.hasType) { + [output appendFormat:@"%@%@: %d\n", indent, @"type", self.type]; + } + if (self.hasSource) { + [output appendFormat:@"%@%@: %@\n", indent, @"source", self.source]; + } + if (self.hasRelay) { + [output appendFormat:@"%@%@: %@\n", indent, @"relay", self.relay]; + } + if (self.hasTimestamp) { + [output appendFormat:@"%@%@: %@\n", indent, @"timestamp", [NSNumber numberWithLongLong:self.timestamp]]; + } + if (self.hasMessage) { + [output appendFormat:@"%@%@: %@\n", indent, @"message", self.message]; + } + if (self.hasSourceDevice) { + [output appendFormat:@"%@%@: %@\n", indent, @"sourceDevice", [NSNumber numberWithInteger:self.sourceDevice]]; + } + [self.unknownFields writeDescriptionTo:output withIndent:indent]; +} +- (BOOL) isEqual:(id)other { + if (other == self) { + return YES; + } + if (![other isKindOfClass:[IncomingPushMessageSignal class]]) { + return NO; + } + IncomingPushMessageSignal *otherMessage = other; + return + self.hasType == otherMessage.hasType && + (!self.hasType || self.type == otherMessage.type) && + self.hasSource == otherMessage.hasSource && + (!self.hasSource || [self.source isEqual:otherMessage.source]) && + self.hasRelay == otherMessage.hasRelay && + (!self.hasRelay || [self.relay isEqual:otherMessage.relay]) && + self.hasTimestamp == otherMessage.hasTimestamp && + (!self.hasTimestamp || self.timestamp == otherMessage.timestamp) && + self.hasMessage == otherMessage.hasMessage && + (!self.hasMessage || [self.message isEqual:otherMessage.message]) && + self.hasSourceDevice == otherMessage.hasSourceDevice && + (!self.hasSourceDevice || self.sourceDevice == otherMessage.sourceDevice) && + (self.unknownFields == otherMessage.unknownFields || (self.unknownFields != nil && [self.unknownFields isEqual:otherMessage.unknownFields])); +} +- (NSUInteger) hash { + __block NSUInteger hashCode = 7; + if (self.hasType) { + hashCode = hashCode * 31 + self.type; + } + if (self.hasSource) { + hashCode = hashCode * 31 + [self.source hash]; + } + if (self.hasRelay) { + hashCode = hashCode * 31 + [self.relay hash]; + } + if (self.hasTimestamp) { + hashCode = hashCode * 31 + [[NSNumber numberWithLongLong:self.timestamp] hash]; + } + if (self.hasMessage) { + hashCode = hashCode * 31 + [self.message hash]; + } + if (self.hasSourceDevice) { + hashCode = hashCode * 31 + [[NSNumber numberWithInteger:self.sourceDevice] hash]; + } + hashCode = hashCode * 31 + [self.unknownFields hash]; + return hashCode; +} +@end + +BOOL IncomingPushMessageSignalTypeIsValidValue(IncomingPushMessageSignalType value) { + switch (value) { + case IncomingPushMessageSignalTypeUnknown: + case IncomingPushMessageSignalTypeCiphertext: + case IncomingPushMessageSignalTypeKeyExchange: + case IncomingPushMessageSignalTypePrekeyBundle: + case IncomingPushMessageSignalTypePlaintext: + case IncomingPushMessageSignalTypeReceipt: + return YES; + default: + return NO; + } +} +@interface IncomingPushMessageSignalBuilder() +@property (strong) IncomingPushMessageSignal* result; +@end + +@implementation IncomingPushMessageSignalBuilder +@synthesize result; +- (id) init { + if ((self = [super init])) { + self.result = [[IncomingPushMessageSignal alloc] init]; + } + return self; +} +- (PBGeneratedMessage*) internalGetResult { + return result; +} +- (IncomingPushMessageSignalBuilder*) clear { + self.result = [[IncomingPushMessageSignal alloc] init]; + return self; +} +- (IncomingPushMessageSignalBuilder*) clone { + return [IncomingPushMessageSignal builderWithPrototype:result]; +} +- (IncomingPushMessageSignal*) defaultInstance { + return [IncomingPushMessageSignal defaultInstance]; +} +- (IncomingPushMessageSignal*) build { + [self checkInitialized]; + return [self buildPartial]; +} +- (IncomingPushMessageSignal*) buildPartial { + IncomingPushMessageSignal* returnMe = result; + self.result = nil; + return returnMe; +} +- (IncomingPushMessageSignalBuilder*) mergeFrom:(IncomingPushMessageSignal*) other { + if (other == [IncomingPushMessageSignal defaultInstance]) { + return self; + } + if (other.hasType) { + [self setType:other.type]; + } + if (other.hasSource) { + [self setSource:other.source]; + } + if (other.hasSourceDevice) { + [self setSourceDevice:other.sourceDevice]; + } + if (other.hasRelay) { + [self setRelay:other.relay]; + } + if (other.hasTimestamp) { + [self setTimestamp:other.timestamp]; + } + if (other.hasMessage) { + [self setMessage:other.message]; + } + [self mergeUnknownFields:other.unknownFields]; + return self; +} +- (IncomingPushMessageSignalBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input { + return [self mergeFromCodedInputStream:input extensionRegistry:[PBExtensionRegistry emptyRegistry]]; +} +- (IncomingPushMessageSignalBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + PBUnknownFieldSetBuilder* unknownFields = [PBUnknownFieldSet builderWithUnknownFields:self.unknownFields]; + while (YES) { + SInt32 tag = [input readTag]; + switch (tag) { + case 0: + [self setUnknownFields:[unknownFields build]]; + return self; + default: { + if (![self parseUnknownField:input unknownFields:unknownFields extensionRegistry:extensionRegistry tag:tag]) { + [self setUnknownFields:[unknownFields build]]; + return self; + } + break; + } + case 8: { + IncomingPushMessageSignalType value = (IncomingPushMessageSignalType)[input readEnum]; + if (IncomingPushMessageSignalTypeIsValidValue(value)) { + [self setType:value]; + } else { + [unknownFields mergeVarintField:1 value:value]; + } + break; + } + case 18: { + [self setSource:[input readString]]; + break; + } + case 26: { + [self setRelay:[input readString]]; + break; + } + case 40: { + [self setTimestamp:[input readUInt64]]; + break; + } + case 50: { + [self setMessage:[input readData]]; + break; + } + case 56: { + [self setSourceDevice:[input readUInt32]]; + break; + } + } + } +} +- (BOOL) hasType { + return result.hasType; +} +- (IncomingPushMessageSignalType) type { + return result.type; +} +- (IncomingPushMessageSignalBuilder*) setType:(IncomingPushMessageSignalType) value { + result.hasType = YES; + result.type = value; + return self; +} +- (IncomingPushMessageSignalBuilder*) clearType { + result.hasType = NO; + result.type = IncomingPushMessageSignalTypeUnknown; + return self; +} +- (BOOL) hasSource { + return result.hasSource; +} +- (NSString*) source { + return result.source; +} +- (IncomingPushMessageSignalBuilder*) setSource:(NSString*) value { + result.hasSource = YES; + result.source = value; + return self; +} +- (IncomingPushMessageSignalBuilder*) clearSource { + result.hasSource = NO; + result.source = @""; + return self; +} +- (BOOL) hasSourceDevice { + return result.hasSourceDevice; +} +- (UInt32) sourceDevice { + return result.sourceDevice; +} +- (IncomingPushMessageSignalBuilder*) setSourceDevice:(UInt32) value { + result.hasSourceDevice = YES; + result.sourceDevice = value; + return self; +} +- (IncomingPushMessageSignalBuilder*) clearSourceDevice { + result.hasSourceDevice = NO; + result.sourceDevice = 0; + return self; +} +- (BOOL) hasRelay { + return result.hasRelay; +} +- (NSString*) relay { + return result.relay; +} +- (IncomingPushMessageSignalBuilder*) setRelay:(NSString*) value { + result.hasRelay = YES; + result.relay = value; + return self; +} +- (IncomingPushMessageSignalBuilder*) clearRelay { + result.hasRelay = NO; + result.relay = @""; + return self; +} +- (BOOL) hasTimestamp { + return result.hasTimestamp; +} +- (UInt64) timestamp { + return result.timestamp; +} +- (IncomingPushMessageSignalBuilder*) setTimestamp:(UInt64) value { + result.hasTimestamp = YES; + result.timestamp = value; + return self; +} +- (IncomingPushMessageSignalBuilder*) clearTimestamp { + result.hasTimestamp = NO; + result.timestamp = 0L; + return self; +} +- (BOOL) hasMessage { + return result.hasMessage; +} +- (NSData*) message { + return result.message; +} +- (IncomingPushMessageSignalBuilder*) setMessage:(NSData*) value { + result.hasMessage = YES; + result.message = value; + return self; +} +- (IncomingPushMessageSignalBuilder*) clearMessage { + result.hasMessage = NO; + result.message = [NSData data]; + return self; +} +@end + +@interface PushMessageContent () +@property (strong) NSString* body; +@property (strong) NSMutableArray * attachmentsArray; +@property (strong) PushMessageContentGroupContext* group; +@property UInt32 flags; +@end + +@implementation PushMessageContent + +- (BOOL) hasBody { + return !!hasBody_; +} +- (void) setHasBody:(BOOL) value_ { + hasBody_ = !!value_; +} +@synthesize body; +@synthesize attachmentsArray; +@dynamic attachments; +- (BOOL) hasGroup { + return !!hasGroup_; +} +- (void) setHasGroup:(BOOL) value_ { + hasGroup_ = !!value_; +} +@synthesize group; +- (BOOL) hasFlags { + return !!hasFlags_; +} +- (void) setHasFlags:(BOOL) value_ { + hasFlags_ = !!value_; +} +@synthesize flags; +- (id) init { + if ((self = [super init])) { + self.body = @""; + self.group = [PushMessageContentGroupContext defaultInstance]; + self.flags = 0; + } + return self; +} +static PushMessageContent* defaultPushMessageContentInstance = nil; ++ (void) initialize { + if (self == [PushMessageContent class]) { + defaultPushMessageContentInstance = [[PushMessageContent alloc] init]; + } +} ++ (PushMessageContent*) defaultInstance { + return defaultPushMessageContentInstance; +} +- (PushMessageContent*) defaultInstance { + return defaultPushMessageContentInstance; +} +- (NSArray *)attachments { + return attachmentsArray; +} +- (PushMessageContentAttachmentPointer*)attachmentsAtIndex:(NSUInteger)index { + return [attachmentsArray objectAtIndex:index]; +} +- (BOOL) isInitialized { + return YES; +} +- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output { + if (self.hasBody) { + [output writeString:1 value:self.body]; + } + [self.attachmentsArray enumerateObjectsUsingBlock:^(PushMessageContentAttachmentPointer *element, NSUInteger idx, BOOL *stop) { + [output writeMessage:2 value:element]; + }]; + if (self.hasGroup) { + [output writeMessage:3 value:self.group]; + } + if (self.hasFlags) { + [output writeUInt32:4 value:self.flags]; + } + [self.unknownFields writeToCodedOutputStream:output]; +} +- (SInt32) serializedSize { + __block SInt32 size_ = memoizedSerializedSize; + if (size_ != -1) { + return size_; + } + + size_ = 0; + if (self.hasBody) { + size_ += computeStringSize(1, self.body); + } + [self.attachmentsArray enumerateObjectsUsingBlock:^(PushMessageContentAttachmentPointer *element, NSUInteger idx, BOOL *stop) { + size_ += computeMessageSize(2, element); + }]; + if (self.hasGroup) { + size_ += computeMessageSize(3, self.group); + } + if (self.hasFlags) { + size_ += computeUInt32Size(4, self.flags); + } + size_ += self.unknownFields.serializedSize; + memoizedSerializedSize = size_; + return size_; +} ++ (PushMessageContent*) parseFromData:(NSData*) data { + return (PushMessageContent*)[[[PushMessageContent builder] mergeFromData:data] build]; +} ++ (PushMessageContent*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (PushMessageContent*)[[[PushMessageContent builder] mergeFromData:data extensionRegistry:extensionRegistry] build]; +} ++ (PushMessageContent*) parseFromInputStream:(NSInputStream*) input { + return (PushMessageContent*)[[[PushMessageContent builder] mergeFromInputStream:input] build]; +} ++ (PushMessageContent*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (PushMessageContent*)[[[PushMessageContent builder] mergeFromInputStream:input extensionRegistry:extensionRegistry] build]; +} ++ (PushMessageContent*) parseFromCodedInputStream:(PBCodedInputStream*) input { + return (PushMessageContent*)[[[PushMessageContent builder] mergeFromCodedInputStream:input] build]; +} ++ (PushMessageContent*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (PushMessageContent*)[[[PushMessageContent builder] mergeFromCodedInputStream:input extensionRegistry:extensionRegistry] build]; +} ++ (PushMessageContentBuilder*) builder { + return [[PushMessageContentBuilder alloc] init]; +} ++ (PushMessageContentBuilder*) builderWithPrototype:(PushMessageContent*) prototype { + return [[PushMessageContent builder] mergeFrom:prototype]; +} +- (PushMessageContentBuilder*) builder { + return [PushMessageContent builder]; +} +- (PushMessageContentBuilder*) toBuilder { + return [PushMessageContent builderWithPrototype:self]; +} +- (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent { + if (self.hasBody) { + [output appendFormat:@"%@%@: %@\n", indent, @"body", self.body]; + } + [self.attachmentsArray enumerateObjectsUsingBlock:^(PushMessageContentAttachmentPointer *element, NSUInteger idx, BOOL *stop) { + [output appendFormat:@"%@%@ {\n", indent, @"attachments"]; + [element writeDescriptionTo:output + withIndent:[NSString stringWithFormat:@"%@ ", indent]]; + [output appendFormat:@"%@}\n", indent]; + }]; + if (self.hasGroup) { + [output appendFormat:@"%@%@ {\n", indent, @"group"]; + [self.group writeDescriptionTo:output + withIndent:[NSString stringWithFormat:@"%@ ", indent]]; + [output appendFormat:@"%@}\n", indent]; + } + if (self.hasFlags) { + [output appendFormat:@"%@%@: %@\n", indent, @"flags", [NSNumber numberWithInteger:self.flags]]; + } + [self.unknownFields writeDescriptionTo:output withIndent:indent]; +} +- (BOOL) isEqual:(id)other { + if (other == self) { + return YES; + } + if (![other isKindOfClass:[PushMessageContent class]]) { + return NO; + } + PushMessageContent *otherMessage = other; + return + self.hasBody == otherMessage.hasBody && + (!self.hasBody || [self.body isEqual:otherMessage.body]) && + [self.attachmentsArray isEqualToArray:otherMessage.attachmentsArray] && + self.hasGroup == otherMessage.hasGroup && + (!self.hasGroup || [self.group isEqual:otherMessage.group]) && + self.hasFlags == otherMessage.hasFlags && + (!self.hasFlags || self.flags == otherMessage.flags) && + (self.unknownFields == otherMessage.unknownFields || (self.unknownFields != nil && [self.unknownFields isEqual:otherMessage.unknownFields])); +} +- (NSUInteger) hash { + __block NSUInteger hashCode = 7; + if (self.hasBody) { + hashCode = hashCode * 31 + [self.body hash]; + } + [self.attachmentsArray enumerateObjectsUsingBlock:^(PushMessageContentAttachmentPointer *element, NSUInteger idx, BOOL *stop) { + hashCode = hashCode * 31 + [element hash]; + }]; + if (self.hasGroup) { + hashCode = hashCode * 31 + [self.group hash]; + } + if (self.hasFlags) { + hashCode = hashCode * 31 + [[NSNumber numberWithInteger:self.flags] hash]; + } + hashCode = hashCode * 31 + [self.unknownFields hash]; + return hashCode; +} +@end + +BOOL PushMessageContentFlagsIsValidValue(PushMessageContentFlags value) { + switch (value) { + case PushMessageContentFlagsEndSession: + return YES; + default: + return NO; + } +} +@interface PushMessageContentAttachmentPointer () +@property UInt64 id; +@property (strong) NSString* contentType; +@property (strong) NSData* key; +@end + +@implementation PushMessageContentAttachmentPointer + +- (BOOL) hasId { + return !!hasId_; +} +- (void) setHasId:(BOOL) value_ { + hasId_ = !!value_; +} +@synthesize id; +- (BOOL) hasContentType { + return !!hasContentType_; +} +- (void) setHasContentType:(BOOL) value_ { + hasContentType_ = !!value_; +} +@synthesize contentType; +- (BOOL) hasKey { + return !!hasKey_; +} +- (void) setHasKey:(BOOL) value_ { + hasKey_ = !!value_; +} +@synthesize key; +- (id) init { + if ((self = [super init])) { + self.id = 0L; + self.contentType = @""; + self.key = [NSData data]; + } + return self; +} +static PushMessageContentAttachmentPointer* defaultPushMessageContentAttachmentPointerInstance = nil; ++ (void) initialize { + if (self == [PushMessageContentAttachmentPointer class]) { + defaultPushMessageContentAttachmentPointerInstance = [[PushMessageContentAttachmentPointer alloc] init]; + } +} ++ (PushMessageContentAttachmentPointer*) defaultInstance { + return defaultPushMessageContentAttachmentPointerInstance; +} +- (PushMessageContentAttachmentPointer*) defaultInstance { + return defaultPushMessageContentAttachmentPointerInstance; +} +- (BOOL) isInitialized { + return YES; +} +- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output { + if (self.hasId) { + [output writeFixed64:1 value:self.id]; + } + if (self.hasContentType) { + [output writeString:2 value:self.contentType]; + } + if (self.hasKey) { + [output writeData:3 value:self.key]; + } + [self.unknownFields writeToCodedOutputStream:output]; +} +- (SInt32) serializedSize { + __block SInt32 size_ = memoizedSerializedSize; + if (size_ != -1) { + return size_; + } + + size_ = 0; + if (self.hasId) { + size_ += computeFixed64Size(1, self.id); + } + if (self.hasContentType) { + size_ += computeStringSize(2, self.contentType); + } + if (self.hasKey) { + size_ += computeDataSize(3, self.key); + } + size_ += self.unknownFields.serializedSize; + memoizedSerializedSize = size_; + return size_; +} ++ (PushMessageContentAttachmentPointer*) parseFromData:(NSData*) data { + return (PushMessageContentAttachmentPointer*)[[[PushMessageContentAttachmentPointer builder] mergeFromData:data] build]; +} ++ (PushMessageContentAttachmentPointer*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (PushMessageContentAttachmentPointer*)[[[PushMessageContentAttachmentPointer builder] mergeFromData:data extensionRegistry:extensionRegistry] build]; +} ++ (PushMessageContentAttachmentPointer*) parseFromInputStream:(NSInputStream*) input { + return (PushMessageContentAttachmentPointer*)[[[PushMessageContentAttachmentPointer builder] mergeFromInputStream:input] build]; +} ++ (PushMessageContentAttachmentPointer*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (PushMessageContentAttachmentPointer*)[[[PushMessageContentAttachmentPointer builder] mergeFromInputStream:input extensionRegistry:extensionRegistry] build]; +} ++ (PushMessageContentAttachmentPointer*) parseFromCodedInputStream:(PBCodedInputStream*) input { + return (PushMessageContentAttachmentPointer*)[[[PushMessageContentAttachmentPointer builder] mergeFromCodedInputStream:input] build]; +} ++ (PushMessageContentAttachmentPointer*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (PushMessageContentAttachmentPointer*)[[[PushMessageContentAttachmentPointer builder] mergeFromCodedInputStream:input extensionRegistry:extensionRegistry] build]; +} ++ (PushMessageContentAttachmentPointerBuilder*) builder { + return [[PushMessageContentAttachmentPointerBuilder alloc] init]; +} ++ (PushMessageContentAttachmentPointerBuilder*) builderWithPrototype:(PushMessageContentAttachmentPointer*) prototype { + return [[PushMessageContentAttachmentPointer builder] mergeFrom:prototype]; +} +- (PushMessageContentAttachmentPointerBuilder*) builder { + return [PushMessageContentAttachmentPointer builder]; +} +- (PushMessageContentAttachmentPointerBuilder*) toBuilder { + return [PushMessageContentAttachmentPointer builderWithPrototype:self]; +} +- (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent { + if (self.hasId) { + [output appendFormat:@"%@%@: %@\n", indent, @"id", [NSNumber numberWithLongLong:self.id]]; + } + if (self.hasContentType) { + [output appendFormat:@"%@%@: %@\n", indent, @"contentType", self.contentType]; + } + if (self.hasKey) { + [output appendFormat:@"%@%@: %@\n", indent, @"key", self.key]; + } + [self.unknownFields writeDescriptionTo:output withIndent:indent]; +} +- (BOOL) isEqual:(id)other { + if (other == self) { + return YES; + } + if (![other isKindOfClass:[PushMessageContentAttachmentPointer class]]) { + return NO; + } + PushMessageContentAttachmentPointer *otherMessage = other; + return + self.hasId == otherMessage.hasId && + (!self.hasId || self.id == otherMessage.id) && + self.hasContentType == otherMessage.hasContentType && + (!self.hasContentType || [self.contentType isEqual:otherMessage.contentType]) && + self.hasKey == otherMessage.hasKey && + (!self.hasKey || [self.key isEqual:otherMessage.key]) && + (self.unknownFields == otherMessage.unknownFields || (self.unknownFields != nil && [self.unknownFields isEqual:otherMessage.unknownFields])); +} +- (NSUInteger) hash { + __block NSUInteger hashCode = 7; + if (self.hasId) { + hashCode = hashCode * 31 + [[NSNumber numberWithLongLong:self.id] hash]; + } + if (self.hasContentType) { + hashCode = hashCode * 31 + [self.contentType hash]; + } + if (self.hasKey) { + hashCode = hashCode * 31 + [self.key hash]; + } + hashCode = hashCode * 31 + [self.unknownFields hash]; + return hashCode; +} +@end + +@interface PushMessageContentAttachmentPointerBuilder() +@property (strong) PushMessageContentAttachmentPointer* result; +@end + +@implementation PushMessageContentAttachmentPointerBuilder +@synthesize result; +- (id) init { + if ((self = [super init])) { + self.result = [[PushMessageContentAttachmentPointer alloc] init]; + } + return self; +} +- (PBGeneratedMessage*) internalGetResult { + return result; +} +- (PushMessageContentAttachmentPointerBuilder*) clear { + self.result = [[PushMessageContentAttachmentPointer alloc] init]; + return self; +} +- (PushMessageContentAttachmentPointerBuilder*) clone { + return [PushMessageContentAttachmentPointer builderWithPrototype:result]; +} +- (PushMessageContentAttachmentPointer*) defaultInstance { + return [PushMessageContentAttachmentPointer defaultInstance]; +} +- (PushMessageContentAttachmentPointer*) build { + [self checkInitialized]; + return [self buildPartial]; +} +- (PushMessageContentAttachmentPointer*) buildPartial { + PushMessageContentAttachmentPointer* returnMe = result; + self.result = nil; + return returnMe; +} +- (PushMessageContentAttachmentPointerBuilder*) mergeFrom:(PushMessageContentAttachmentPointer*) other { + if (other == [PushMessageContentAttachmentPointer defaultInstance]) { + return self; + } + if (other.hasId) { + [self setId:other.id]; + } + if (other.hasContentType) { + [self setContentType:other.contentType]; + } + if (other.hasKey) { + [self setKey:other.key]; + } + [self mergeUnknownFields:other.unknownFields]; + return self; +} +- (PushMessageContentAttachmentPointerBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input { + return [self mergeFromCodedInputStream:input extensionRegistry:[PBExtensionRegistry emptyRegistry]]; +} +- (PushMessageContentAttachmentPointerBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + PBUnknownFieldSetBuilder* unknownFields = [PBUnknownFieldSet builderWithUnknownFields:self.unknownFields]; + while (YES) { + SInt32 tag = [input readTag]; + switch (tag) { + case 0: + [self setUnknownFields:[unknownFields build]]; + return self; + default: { + if (![self parseUnknownField:input unknownFields:unknownFields extensionRegistry:extensionRegistry tag:tag]) { + [self setUnknownFields:[unknownFields build]]; + return self; + } + break; + } + case 9: { + [self setId:[input readFixed64]]; + break; + } + case 18: { + [self setContentType:[input readString]]; + break; + } + case 26: { + [self setKey:[input readData]]; + break; + } + } + } +} +- (BOOL) hasId { + return result.hasId; +} +- (UInt64) id { + return result.id; +} +- (PushMessageContentAttachmentPointerBuilder*) setId:(UInt64) value { + result.hasId = YES; + result.id = value; + return self; +} +- (PushMessageContentAttachmentPointerBuilder*) clearId { + result.hasId = NO; + result.id = 0L; + return self; +} +- (BOOL) hasContentType { + return result.hasContentType; +} +- (NSString*) contentType { + return result.contentType; +} +- (PushMessageContentAttachmentPointerBuilder*) setContentType:(NSString*) value { + result.hasContentType = YES; + result.contentType = value; + return self; +} +- (PushMessageContentAttachmentPointerBuilder*) clearContentType { + result.hasContentType = NO; + result.contentType = @""; + return self; +} +- (BOOL) hasKey { + return result.hasKey; +} +- (NSData*) key { + return result.key; +} +- (PushMessageContentAttachmentPointerBuilder*) setKey:(NSData*) value { + result.hasKey = YES; + result.key = value; + return self; +} +- (PushMessageContentAttachmentPointerBuilder*) clearKey { + result.hasKey = NO; + result.key = [NSData data]; + return self; +} +@end + +@interface PushMessageContentGroupContext () +@property (strong) NSData* id; +@property PushMessageContentGroupContextType type; +@property (strong) NSString* name; +@property (strong) NSMutableArray * membersArray; +@property (strong) PushMessageContentAttachmentPointer* avatar; +@end + +@implementation PushMessageContentGroupContext + +- (BOOL) hasId { + return !!hasId_; +} +- (void) setHasId:(BOOL) value_ { + hasId_ = !!value_; +} +@synthesize id; +- (BOOL) hasType { + return !!hasType_; +} +- (void) setHasType:(BOOL) value_ { + hasType_ = !!value_; +} +@synthesize type; +- (BOOL) hasName { + return !!hasName_; +} +- (void) setHasName:(BOOL) value_ { + hasName_ = !!value_; +} +@synthesize name; +@synthesize membersArray; +- (BOOL) hasAvatar { + return !!hasAvatar_; +} +- (void) setHasAvatar:(BOOL) value_ { + hasAvatar_ = !!value_; +} +@synthesize avatar; +- (id) init { + if ((self = [super init])) { + self.id = [NSData data]; + self.type = PushMessageContentGroupContextTypeUnknown; + self.name = @""; + self.avatar = [PushMessageContentAttachmentPointer defaultInstance]; + } + return self; +} +static PushMessageContentGroupContext* defaultPushMessageContentGroupContextInstance = nil; ++ (void) initialize { + if (self == [PushMessageContentGroupContext class]) { + defaultPushMessageContentGroupContextInstance = [[PushMessageContentGroupContext alloc] init]; + } +} ++ (PushMessageContentGroupContext*) defaultInstance { + return defaultPushMessageContentGroupContextInstance; +} +- (PushMessageContentGroupContext*) defaultInstance { + return defaultPushMessageContentGroupContextInstance; +} +- (NSArray *)members { + return membersArray; +} +- (NSString*)membersAtIndex:(NSUInteger)index { + return [membersArray objectAtIndex:index]; +} +- (BOOL) isInitialized { + return YES; +} +- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output { + if (self.hasId) { + [output writeData:1 value:self.id]; + } + if (self.hasType) { + [output writeEnum:2 value:self.type]; + } + if (self.hasName) { + [output writeString:3 value:self.name]; + } + [self.membersArray enumerateObjectsUsingBlock:^(NSString *element, NSUInteger idx, BOOL *stop) { + [output writeString:4 value:element]; + }]; + if (self.hasAvatar) { + [output writeMessage:5 value:self.avatar]; + } + [self.unknownFields writeToCodedOutputStream:output]; +} +- (SInt32) serializedSize { + __block SInt32 size_ = memoizedSerializedSize; + if (size_ != -1) { + return size_; + } + + size_ = 0; + if (self.hasId) { + size_ += computeDataSize(1, self.id); + } + if (self.hasType) { + size_ += computeEnumSize(2, self.type); + } + if (self.hasName) { + size_ += computeStringSize(3, self.name); + } + { + __block SInt32 dataSize = 0; + const NSUInteger count = self.membersArray.count; + [self.membersArray enumerateObjectsUsingBlock:^(NSString *element, NSUInteger idx, BOOL *stop) { + dataSize += computeStringSizeNoTag(element); + }]; + size_ += dataSize; + size_ += (SInt32)(1 * count); + } + if (self.hasAvatar) { + size_ += computeMessageSize(5, self.avatar); + } + size_ += self.unknownFields.serializedSize; + memoizedSerializedSize = size_; + return size_; +} ++ (PushMessageContentGroupContext*) parseFromData:(NSData*) data { + return (PushMessageContentGroupContext*)[[[PushMessageContentGroupContext builder] mergeFromData:data] build]; +} ++ (PushMessageContentGroupContext*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (PushMessageContentGroupContext*)[[[PushMessageContentGroupContext builder] mergeFromData:data extensionRegistry:extensionRegistry] build]; +} ++ (PushMessageContentGroupContext*) parseFromInputStream:(NSInputStream*) input { + return (PushMessageContentGroupContext*)[[[PushMessageContentGroupContext builder] mergeFromInputStream:input] build]; +} ++ (PushMessageContentGroupContext*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (PushMessageContentGroupContext*)[[[PushMessageContentGroupContext builder] mergeFromInputStream:input extensionRegistry:extensionRegistry] build]; +} ++ (PushMessageContentGroupContext*) parseFromCodedInputStream:(PBCodedInputStream*) input { + return (PushMessageContentGroupContext*)[[[PushMessageContentGroupContext builder] mergeFromCodedInputStream:input] build]; +} ++ (PushMessageContentGroupContext*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (PushMessageContentGroupContext*)[[[PushMessageContentGroupContext builder] mergeFromCodedInputStream:input extensionRegistry:extensionRegistry] build]; +} ++ (PushMessageContentGroupContextBuilder*) builder { + return [[PushMessageContentGroupContextBuilder alloc] init]; +} ++ (PushMessageContentGroupContextBuilder*) builderWithPrototype:(PushMessageContentGroupContext*) prototype { + return [[PushMessageContentGroupContext builder] mergeFrom:prototype]; +} +- (PushMessageContentGroupContextBuilder*) builder { + return [PushMessageContentGroupContext builder]; +} +- (PushMessageContentGroupContextBuilder*) toBuilder { + return [PushMessageContentGroupContext builderWithPrototype:self]; +} +- (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent { + if (self.hasId) { + [output appendFormat:@"%@%@: %@\n", indent, @"id", self.id]; + } + if (self.hasType) { + [output appendFormat:@"%@%@: %d\n", indent, @"type", self.type]; + } + if (self.hasName) { + [output appendFormat:@"%@%@: %@\n", indent, @"name", self.name]; + } + [self.membersArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { + [output appendFormat:@"%@%@: %@\n", indent, @"members", obj]; + }]; + if (self.hasAvatar) { + [output appendFormat:@"%@%@ {\n", indent, @"avatar"]; + [self.avatar writeDescriptionTo:output + withIndent:[NSString stringWithFormat:@"%@ ", indent]]; + [output appendFormat:@"%@}\n", indent]; + } + [self.unknownFields writeDescriptionTo:output withIndent:indent]; +} +- (BOOL) isEqual:(id)other { + if (other == self) { + return YES; + } + if (![other isKindOfClass:[PushMessageContentGroupContext class]]) { + return NO; + } + PushMessageContentGroupContext *otherMessage = other; + return + self.hasId == otherMessage.hasId && + (!self.hasId || [self.id isEqual:otherMessage.id]) && + self.hasType == otherMessage.hasType && + (!self.hasType || self.type == otherMessage.type) && + self.hasName == otherMessage.hasName && + (!self.hasName || [self.name isEqual:otherMessage.name]) && + [self.membersArray isEqualToArray:otherMessage.membersArray] && + self.hasAvatar == otherMessage.hasAvatar && + (!self.hasAvatar || [self.avatar isEqual:otherMessage.avatar]) && + (self.unknownFields == otherMessage.unknownFields || (self.unknownFields != nil && [self.unknownFields isEqual:otherMessage.unknownFields])); +} +- (NSUInteger) hash { + __block NSUInteger hashCode = 7; + if (self.hasId) { + hashCode = hashCode * 31 + [self.id hash]; + } + if (self.hasType) { + hashCode = hashCode * 31 + self.type; + } + if (self.hasName) { + hashCode = hashCode * 31 + [self.name hash]; + } + [self.membersArray enumerateObjectsUsingBlock:^(id element, NSUInteger idx, BOOL *stop) { + hashCode = hashCode * 31 + [element hash]; + }]; + if (self.hasAvatar) { + hashCode = hashCode * 31 + [self.avatar hash]; + } + hashCode = hashCode * 31 + [self.unknownFields hash]; + return hashCode; +} +@end + +BOOL PushMessageContentGroupContextTypeIsValidValue(PushMessageContentGroupContextType value) { + switch (value) { + case PushMessageContentGroupContextTypeUnknown: + case PushMessageContentGroupContextTypeUpdate: + case PushMessageContentGroupContextTypeDeliver: + case PushMessageContentGroupContextTypeQuit: + return YES; + default: + return NO; + } +} +@interface PushMessageContentGroupContextBuilder() +@property (strong) PushMessageContentGroupContext* result; +@end + +@implementation PushMessageContentGroupContextBuilder +@synthesize result; +- (id) init { + if ((self = [super init])) { + self.result = [[PushMessageContentGroupContext alloc] init]; + } + return self; +} +- (PBGeneratedMessage*) internalGetResult { + return result; +} +- (PushMessageContentGroupContextBuilder*) clear { + self.result = [[PushMessageContentGroupContext alloc] init]; + return self; +} +- (PushMessageContentGroupContextBuilder*) clone { + return [PushMessageContentGroupContext builderWithPrototype:result]; +} +- (PushMessageContentGroupContext*) defaultInstance { + return [PushMessageContentGroupContext defaultInstance]; +} +- (PushMessageContentGroupContext*) build { + [self checkInitialized]; + return [self buildPartial]; +} +- (PushMessageContentGroupContext*) buildPartial { + PushMessageContentGroupContext* returnMe = result; + self.result = nil; + return returnMe; +} +- (PushMessageContentGroupContextBuilder*) mergeFrom:(PushMessageContentGroupContext*) other { + if (other == [PushMessageContentGroupContext defaultInstance]) { + return self; + } + if (other.hasId) { + [self setId:other.id]; + } + if (other.hasType) { + [self setType:other.type]; + } + if (other.hasName) { + [self setName:other.name]; + } + if (other.membersArray.count > 0) { + if (result.membersArray == nil) { + result.membersArray = [[NSMutableArray alloc] initWithArray:other.membersArray]; + } else { + [result.membersArray addObjectsFromArray:other.membersArray]; + } + } + if (other.hasAvatar) { + [self mergeAvatar:other.avatar]; + } + [self mergeUnknownFields:other.unknownFields]; + return self; +} +- (PushMessageContentGroupContextBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input { + return [self mergeFromCodedInputStream:input extensionRegistry:[PBExtensionRegistry emptyRegistry]]; +} +- (PushMessageContentGroupContextBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + PBUnknownFieldSetBuilder* unknownFields = [PBUnknownFieldSet builderWithUnknownFields:self.unknownFields]; + while (YES) { + SInt32 tag = [input readTag]; + switch (tag) { + case 0: + [self setUnknownFields:[unknownFields build]]; + return self; + default: { + if (![self parseUnknownField:input unknownFields:unknownFields extensionRegistry:extensionRegistry tag:tag]) { + [self setUnknownFields:[unknownFields build]]; + return self; + } + break; + } + case 10: { + [self setId:[input readData]]; + break; + } + case 16: { + PushMessageContentGroupContextType value = (PushMessageContentGroupContextType)[input readEnum]; + if (PushMessageContentGroupContextTypeIsValidValue(value)) { + [self setType:value]; + } else { + [unknownFields mergeVarintField:2 value:value]; + } + break; + } + case 26: { + [self setName:[input readString]]; + break; + } + case 34: { + [self addMembers:[input readString]]; + break; + } + case 42: { + PushMessageContentAttachmentPointerBuilder* subBuilder = [PushMessageContentAttachmentPointer builder]; + if (self.hasAvatar) { + [subBuilder mergeFrom:self.avatar]; + } + [input readMessage:subBuilder extensionRegistry:extensionRegistry]; + [self setAvatar:[subBuilder buildPartial]]; + break; + } + } + } +} +- (BOOL) hasId { + return result.hasId; +} +- (NSData*) id { + return result.id; +} +- (PushMessageContentGroupContextBuilder*) setId:(NSData*) value { + result.hasId = YES; + result.id = value; + return self; +} +- (PushMessageContentGroupContextBuilder*) clearId { + result.hasId = NO; + result.id = [NSData data]; + return self; +} +- (BOOL) hasType { + return result.hasType; +} +- (PushMessageContentGroupContextType) type { + return result.type; +} +- (PushMessageContentGroupContextBuilder*) setType:(PushMessageContentGroupContextType) value { + result.hasType = YES; + result.type = value; + return self; +} +- (PushMessageContentGroupContextBuilder*) clearType { + result.hasType = NO; + result.type = PushMessageContentGroupContextTypeUnknown; + return self; +} +- (BOOL) hasName { + return result.hasName; +} +- (NSString*) name { + return result.name; +} +- (PushMessageContentGroupContextBuilder*) setName:(NSString*) value { + result.hasName = YES; + result.name = value; + return self; +} +- (PushMessageContentGroupContextBuilder*) clearName { + result.hasName = NO; + result.name = @""; + return self; +} +- (NSMutableArray *)members { + return result.membersArray; +} +- (NSString*)membersAtIndex:(NSUInteger)index { + return [result membersAtIndex:index]; +} +- (PushMessageContentGroupContextBuilder *)addMembers:(NSString*)value { + if (result.membersArray == nil) { + result.membersArray = [[NSMutableArray alloc]init]; + } + [result.membersArray addObject:value]; + return self; +} +- (PushMessageContentGroupContextBuilder *)setMembersArray:(NSArray *)array { + result.membersArray = [[NSMutableArray alloc] initWithArray:array]; + return self; +} +- (PushMessageContentGroupContextBuilder *)clearMembers { + result.membersArray = nil; + return self; +} +- (BOOL) hasAvatar { + return result.hasAvatar; +} +- (PushMessageContentAttachmentPointer*) avatar { + return result.avatar; +} +- (PushMessageContentGroupContextBuilder*) setAvatar:(PushMessageContentAttachmentPointer*) value { + result.hasAvatar = YES; + result.avatar = value; + return self; +} +- (PushMessageContentGroupContextBuilder*) setAvatarBuilder:(PushMessageContentAttachmentPointerBuilder*) builderForValue { + return [self setAvatar:[builderForValue build]]; +} +- (PushMessageContentGroupContextBuilder*) mergeAvatar:(PushMessageContentAttachmentPointer*) value { + if (result.hasAvatar && + result.avatar != [PushMessageContentAttachmentPointer defaultInstance]) { + result.avatar = + [[[PushMessageContentAttachmentPointer builderWithPrototype:result.avatar] mergeFrom:value] buildPartial]; + } else { + result.avatar = value; + } + result.hasAvatar = YES; + return self; +} +- (PushMessageContentGroupContextBuilder*) clearAvatar { + result.hasAvatar = NO; + result.avatar = [PushMessageContentAttachmentPointer defaultInstance]; + return self; +} +@end + +@interface PushMessageContentBuilder() +@property (strong) PushMessageContent* result; +@end + +@implementation PushMessageContentBuilder +@synthesize result; +- (id) init { + if ((self = [super init])) { + self.result = [[PushMessageContent alloc] init]; + } + return self; +} +- (PBGeneratedMessage*) internalGetResult { + return result; +} +- (PushMessageContentBuilder*) clear { + self.result = [[PushMessageContent alloc] init]; + return self; +} +- (PushMessageContentBuilder*) clone { + return [PushMessageContent builderWithPrototype:result]; +} +- (PushMessageContent*) defaultInstance { + return [PushMessageContent defaultInstance]; +} +- (PushMessageContent*) build { + [self checkInitialized]; + return [self buildPartial]; +} +- (PushMessageContent*) buildPartial { + PushMessageContent* returnMe = result; + self.result = nil; + return returnMe; +} +- (PushMessageContentBuilder*) mergeFrom:(PushMessageContent*) other { + if (other == [PushMessageContent defaultInstance]) { + return self; + } + if (other.hasBody) { + [self setBody:other.body]; + } + if (other.attachmentsArray.count > 0) { + if (result.attachmentsArray == nil) { + result.attachmentsArray = [[NSMutableArray alloc] initWithArray:other.attachmentsArray]; + } else { + [result.attachmentsArray addObjectsFromArray:other.attachmentsArray]; + } + } + if (other.hasGroup) { + [self mergeGroup:other.group]; + } + if (other.hasFlags) { + [self setFlags:other.flags]; + } + [self mergeUnknownFields:other.unknownFields]; + return self; +} +- (PushMessageContentBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input { + return [self mergeFromCodedInputStream:input extensionRegistry:[PBExtensionRegistry emptyRegistry]]; +} +- (PushMessageContentBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + PBUnknownFieldSetBuilder* unknownFields = [PBUnknownFieldSet builderWithUnknownFields:self.unknownFields]; + while (YES) { + SInt32 tag = [input readTag]; + switch (tag) { + case 0: + [self setUnknownFields:[unknownFields build]]; + return self; + default: { + if (![self parseUnknownField:input unknownFields:unknownFields extensionRegistry:extensionRegistry tag:tag]) { + [self setUnknownFields:[unknownFields build]]; + return self; + } + break; + } + case 10: { + [self setBody:[input readString]]; + break; + } + case 18: { + PushMessageContentAttachmentPointerBuilder* subBuilder = [PushMessageContentAttachmentPointer builder]; + [input readMessage:subBuilder extensionRegistry:extensionRegistry]; + [self addAttachments:[subBuilder buildPartial]]; + break; + } + case 26: { + PushMessageContentGroupContextBuilder* subBuilder = [PushMessageContentGroupContext builder]; + if (self.hasGroup) { + [subBuilder mergeFrom:self.group]; + } + [input readMessage:subBuilder extensionRegistry:extensionRegistry]; + [self setGroup:[subBuilder buildPartial]]; + break; + } + case 32: { + [self setFlags:[input readUInt32]]; + break; + } + } + } +} +- (BOOL) hasBody { + return result.hasBody; +} +- (NSString*) body { + return result.body; +} +- (PushMessageContentBuilder*) setBody:(NSString*) value { + result.hasBody = YES; + result.body = value; + return self; +} +- (PushMessageContentBuilder*) clearBody { + result.hasBody = NO; + result.body = @""; + return self; +} +- (NSMutableArray *)attachments { + return result.attachmentsArray; +} +- (PushMessageContentAttachmentPointer*)attachmentsAtIndex:(NSUInteger)index { + return [result attachmentsAtIndex:index]; +} +- (PushMessageContentBuilder *)addAttachments:(PushMessageContentAttachmentPointer*)value { + if (result.attachmentsArray == nil) { + result.attachmentsArray = [[NSMutableArray alloc]init]; + } + [result.attachmentsArray addObject:value]; + return self; +} +- (PushMessageContentBuilder *)setAttachmentsArray:(NSArray *)array { + result.attachmentsArray = [[NSMutableArray alloc]initWithArray:array]; + return self; +} +- (PushMessageContentBuilder *)clearAttachments { + result.attachmentsArray = nil; + return self; +} +- (BOOL) hasGroup { + return result.hasGroup; +} +- (PushMessageContentGroupContext*) group { + return result.group; +} +- (PushMessageContentBuilder*) setGroup:(PushMessageContentGroupContext*) value { + result.hasGroup = YES; + result.group = value; + return self; +} +- (PushMessageContentBuilder*) setGroupBuilder:(PushMessageContentGroupContextBuilder*) builderForValue { + return [self setGroup:[builderForValue build]]; +} +- (PushMessageContentBuilder*) mergeGroup:(PushMessageContentGroupContext*) value { + if (result.hasGroup && + result.group != [PushMessageContentGroupContext defaultInstance]) { + result.group = + [[[PushMessageContentGroupContext builderWithPrototype:result.group] mergeFrom:value] buildPartial]; + } else { + result.group = value; + } + result.hasGroup = YES; + return self; +} +- (PushMessageContentBuilder*) clearGroup { + result.hasGroup = NO; + result.group = [PushMessageContentGroupContext defaultInstance]; + return self; +} +- (BOOL) hasFlags { + return result.hasFlags; +} +- (UInt32) flags { + return result.flags; +} +- (PushMessageContentBuilder*) setFlags:(UInt32) value { + result.hasFlags = YES; + result.flags = value; + return self; +} +- (PushMessageContentBuilder*) clearFlags { + result.hasFlags = NO; + result.flags = 0; + return self; +} +@end + + +// @@protoc_insertion_point(global_scope) diff --git a/Signal/src/textsecure/Messages/TSAttachement.h b/Signal/src/textsecure/Messages/TSAttachement.h new file mode 100644 index 000000000..d0a6f4d9c --- /dev/null +++ b/Signal/src/textsecure/Messages/TSAttachement.h @@ -0,0 +1,27 @@ +// +// TSAttachement.h +// TextSecureKit +// +// Created by Frederic Jacobs on 12/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import +#import "TSYapDatabaseObject.h" + +/** + * TSAttachements are stored by attachement id; + */ + +@interface TSAttachement : TSYapDatabaseObject + +@property (nonatomic, readonly) NSString *contentType; +@property (nonatomic, readonly) NSURL *url; +@property (nonatomic, readonly) NSData *encryptionKey; + +- (BOOL)expired; +- (NSString*)attachementId; + +- (instancetype)initWithAttachementId:(NSString*)attachementId url:(NSURL*)url encryptionKey:(NSData*)encryptionKey; + +@end diff --git a/Signal/src/textsecure/Messages/TSAttachement.m b/Signal/src/textsecure/Messages/TSAttachement.m new file mode 100644 index 000000000..85d28868c --- /dev/null +++ b/Signal/src/textsecure/Messages/TSAttachement.m @@ -0,0 +1,13 @@ +// +// TSAttachement.m +// TextSecureKit +// +// Created by Frederic Jacobs on 12/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSAttachement.h" + +@implementation TSAttachement + +@end diff --git a/Signal/src/textsecure/Messages/TSCall.h b/Signal/src/textsecure/Messages/TSCall.h new file mode 100644 index 000000000..7200224ad --- /dev/null +++ b/Signal/src/textsecure/Messages/TSCall.h @@ -0,0 +1,31 @@ +// +// TSCall.h +// TextSecureKit +// +// Created by Frederic Jacobs on 12/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import + +#import "TSInteraction.h" +#import "TSContact.h" + +@interface TSCall : TSInteraction + +typedef NS_ENUM(NSInteger, TSCallType) { + TSCallTypeSuccess, + TSCallTypeMissed, + TSCallTypeBusy, + TSCallTypeFailed +}; + +@property (nonatomic, readonly) NSNumber *duration; +@property (nonatomic, readonly) BOOL wasCaller; +@property (nonatomic, readonly) TSCallType callType; + +- (instancetype)initWithTimestamp:(uint64_t)timeStamp inThread:(TSThread*)thread + wasCaller:(BOOL)caller callType:(TSCallType)callType + duration:(NSNumber*)duration; + +@end diff --git a/Signal/src/textsecure/Messages/TSCall.m b/Signal/src/textsecure/Messages/TSCall.m new file mode 100644 index 000000000..400e979e0 --- /dev/null +++ b/Signal/src/textsecure/Messages/TSCall.m @@ -0,0 +1,27 @@ +// +// TSCall.m +// TextSecureKit +// +// Created by Frederic Jacobs on 12/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSCall.h" + +@implementation TSCall + +- (instancetype)initWithTimestamp:(uint64_t)timeStamp inThread:(TSThread*)thread + wasCaller:(BOOL)caller callType:(TSCallType)callType + duration:(NSNumber*)duration{ + self = [super initWithTimestamp:timeStamp inThread:thread]; + + if (self) { + _wasCaller = caller; + _callType = callType; + _duration = duration; + } + + return self; +} + +@end diff --git a/Signal/src/textsecure/Messages/TSErrorMessage.h b/Signal/src/textsecure/Messages/TSErrorMessage.h new file mode 100644 index 000000000..2c2a0171b --- /dev/null +++ b/Signal/src/textsecure/Messages/TSErrorMessage.h @@ -0,0 +1,40 @@ +// +// TSErrorMessage.h +// TextSecureKit +// +// Created by Frederic Jacobs on 12/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSMessage.h" + +#import "IncomingPushMessageSignal.pb.h" + +@interface TSErrorMessage : TSMessage + +typedef NS_ENUM(int32_t, TSErrorMessageType){ + TSErrorMessageNoSession, + TSErrorMessageWrongTrustedIdentityKey, + TSErrorMessageInvalidKeyException, + TSErrorMessageMissingKeyId, + TSErrorMessageInvalidMessage, + TSErrorMessageDuplicateMessage, + TSErrorMessageInvalidVersion +}; + ++ (instancetype)invalidProtocolBufferWithSignal:(IncomingPushMessageSignal*)preKeyMessage; ++ (instancetype)duplicateMessageWithSignal:(IncomingPushMessageSignal*)preKeyMessage; ++ (instancetype)invalidVersionWithSignal:(IncomingPushMessageSignal*)preKeyMessage; ++ (instancetype)missingKeyIdWithSignal:(IncomingPushMessageSignal*)preKeyMessage; ++ (instancetype)invalidKeyExceptionWithSignal:(IncomingPushMessageSignal*)preKeyMessage; ++ (instancetype)untrustedKeyWithSignal:(IncomingPushMessageSignal*)preKeyMessage; ++ (instancetype)missingSessionWithSignal:(IncomingPushMessageSignal*)preKeyMessage; + +- (instancetype)initWithTimestamp:(uint64_t)timestamp inThread:(TSThread *)thread failedMessageType:(TSErrorMessageType)errorMessageType; + +- (NSData*)retryBody; +- (BOOL)supportsRetry; + +@property (nonatomic, readonly) TSErrorMessageType errorType; + +@end diff --git a/Signal/src/textsecure/Messages/TSErrorMessage.m b/Signal/src/textsecure/Messages/TSErrorMessage.m new file mode 100644 index 000000000..1715819de --- /dev/null +++ b/Signal/src/textsecure/Messages/TSErrorMessage.m @@ -0,0 +1,13 @@ +// +// TSErrorMessage.m +// TextSecureKit +// +// Created by Frederic Jacobs on 12/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSErrorMessage.h" + +@implementation TSErrorMessage + +@end diff --git a/Signal/src/textsecure/Messages/TSGroupMessageManager.h b/Signal/src/textsecure/Messages/TSGroupMessageManager.h new file mode 100644 index 000000000..315a5fe98 --- /dev/null +++ b/Signal/src/textsecure/Messages/TSGroupMessageManager.h @@ -0,0 +1,17 @@ +// +// TSGroupMessageManager.h +// TextSecureKit +// +// Created by Frederic Jacobs on 15/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import + +#import "IncomingPushMessageSignal.pb.h" + +@interface TSGroupMessageManager : NSObject + ++ (void)processGroupMessage:(IncomingPushMessageSignal*)pushMessage content:(PushMessageContent*)content; + +@end diff --git a/Signal/src/textsecure/Messages/TSGroupMessageManager.m b/Signal/src/textsecure/Messages/TSGroupMessageManager.m new file mode 100644 index 000000000..000b97960 --- /dev/null +++ b/Signal/src/textsecure/Messages/TSGroupMessageManager.m @@ -0,0 +1,88 @@ +// +// TSGroupMessageManager.m +// TextSecureKit +// +// Created by Frederic Jacobs on 15/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import + +#import "TSGroup.h" +#import "TSGroupMessageManager.h" + +#define ddLogLevel LOG_LEVEL_VERBOSE + + +@implementation TSGroupMessageManager + ++ (void)processGroupMessage:(IncomingPushMessageSignal*)pushMessage content:(PushMessageContent*)content{ + if (!content.group.id) { + DDLogInfo(@"Received group message with no id! Ignoring..."); + return; + } + + PushMessageContentGroupContext *group = content.group; + NSData *id = group.id; + int type = group.type; + TSGroup *record = [TSGroup groupWithId:id]; + + if (record != nil && type == PushMessageContentGroupContextTypeUpdate) { + //TODO: [self handleGroupUpdate:pushMessage group:group record:record]; + } else if (record == nil && type == PushMessageContentGroupContextTypeUpdate) { + [self handleGroupCreate:pushMessage group:group record:record]; + } else if (record != nil && type == PushMessageContentGroupContextTypeQuit) { + [self handleGroupLeave:pushMessage group:group record:record]; + } else if (type == PushMessageContentGroupContextTypeUnknown) { + DDLogInfo(@"Received unknown type, ignoring..."); + } +} + ++ (void)handleGroupCreate:(IncomingPushMessageSignal*)message group:(PushMessageContentGroupContext*)group record:(TSGroup*)record{ + //TODO +} + ++ (void)handleGroupLeave:(IncomingPushMessageSignal*)pushMessage group:(PushMessageContentGroupContext*)group record:(TSGroup*)record{ + //TODO +} + + +//+ (void)handleGroupUpdate:(IncomingPushMessageSignal*)pushMessage group:(PushMessageContentGroupContext*)group record:(TSGroup*)record{ +// NSData *identifier = group.id; +// NSArray *messageMembersIds = group.members; +// +// NSSet *recordMembers = record.membersIdentifier; +// NSSet *messageMembers = [NSSet setWithArray:messageMembersIds]; +// +// NSMutableSet *addedMembers = [messageMembers mutableCopy]; +// [addedMembers minusSet:recordMembers]; +// +// NSMutableSet missingMembers = [recordMembers mutableCopy]; +// [missingMembers minusSet:messageMembers]; +// +// if (addedMembers.count > 0) { +// Set unionMembers = new HashSet(recordMembers); +// unionMembers.addAll(messageMembers); +// database.updateMembers(id, new LinkedList(unionMembers)); +// +// group = group.toBuilder().clearMembers().addAllMembers(addedMembers).build(); +// +// } else { +// group = group.toBuilder().clearMembers().build(); +// } +// +// if (missingMembers > 0) { +// +// } +// +// if (group.hasName || group.hasAvatar) { +// record.avatar = group.avatar; +// record.name = group.name; +// [record save]; +// } +// +// // TO-DO: Implement +// +//} + +@end diff --git a/Signal/src/textsecure/Messages/TSIncomingMessage.h b/Signal/src/textsecure/Messages/TSIncomingMessage.h new file mode 100644 index 000000000..1a2eb7847 --- /dev/null +++ b/Signal/src/textsecure/Messages/TSIncomingMessage.h @@ -0,0 +1,50 @@ +// +// TSIncomingMessage.h +// TextSecureKit +// +// Created by Frederic Jacobs on 15/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSMessage.h" + +@interface TSIncomingMessage : TSMessage + +/** + * Initiates an incoming message + * + * @param timestamp timestamp of the message in milliseconds since epoch + * @param thread thread to which the message belongs + * @param body body of the message + * @param attachements attachements of the message + * + * @return initiated incoming message + */ + +- (instancetype)initWithTimestamp:(uint64_t)timestamp + inThread:(TSContactThread*)thread + messageBody:(NSString*)body + attachements:(NSArray*)attachements; + +/** + * Initiates an incoming group message + * + * @param timestamp timestamp of the message in milliseconds since epoch + * @param thread thread to which the message belongs + * @param authorId author identifier of the user in the group that sent the message + * @param body body of the message + * @param attachements attachements of the message + * + * @return initiated incoming group message + */ + +- (instancetype)initWithTimestamp:(uint64_t)timestamp + inThread:(TSGroupThread*)thread + authorId:(NSString*)authorId + messageBody:(NSString*)body + attachements:(NSArray*)attachements; + +@property (nonatomic, readonly) NSString *authorId; +@property (nonatomic, getter = wasRead) BOOL read; + +@end diff --git a/Signal/src/textsecure/Messages/TSIncomingMessage.m b/Signal/src/textsecure/Messages/TSIncomingMessage.m new file mode 100644 index 000000000..2eed31ead --- /dev/null +++ b/Signal/src/textsecure/Messages/TSIncomingMessage.m @@ -0,0 +1,44 @@ +// +// TSIncomingMessage.m +// TextSecureKit +// +// Created by Frederic Jacobs on 15/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSIncomingMessage.h" + +@implementation TSIncomingMessage + +- (instancetype)initWithTimestamp:(uint64_t)timestamp + inThread:(TSGroupThread*)thread + authorId:(NSString*)authorId + messageBody:(NSString*)body + attachements:(NSArray *)attachements +{ + self = [super initWithTimestamp:timestamp inThread:thread messageBody:body attachements:attachements]; + + if (self) { + _authorId = authorId; + _read = false; + } + + return self; +} + +- (instancetype)initWithTimestamp:(uint64_t)timestamp + inThread:(TSContactThread *)thread + messageBody:(NSString *)body + attachements:(NSArray *)attachements +{ + self = [super initWithTimestamp:timestamp inThread:thread messageBody:body attachements:attachements]; + + if (self) { + _authorId = nil; + _read = false; + } + + return self; +} + +@end diff --git a/Signal/src/textsecure/Messages/TSInfoMessage.h b/Signal/src/textsecure/Messages/TSInfoMessage.h new file mode 100644 index 000000000..c2cb93f83 --- /dev/null +++ b/Signal/src/textsecure/Messages/TSInfoMessage.h @@ -0,0 +1,22 @@ +// +// TSInfoMessage.h +// TextSecureKit +// +// Created by Frederic Jacobs on 15/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSMessage.h" + +@interface TSInfoMessage : TSMessage + +typedef NS_ENUM(NSInteger, TSInfoMessageType){ + TSInfoMessageTypeSessionDidEnd +}; + +@property TSInfoMessageType messageType; + +- (instancetype)initWithTimestamp:(uint64_t)timestamp inThread:(TSContactThread *)contact messageType:(TSInfoMessageType)infoMessage; +- (instancetype)initWithTimestamp:(uint64_t)timestamp inThread:(TSGroupThread *)thread authorId:(NSString *)authorId messageType:(TSInfoMessageType)infoMessage; + +@end diff --git a/Signal/src/textsecure/Messages/TSInfoMessage.m b/Signal/src/textsecure/Messages/TSInfoMessage.m new file mode 100644 index 000000000..b92a59f5f --- /dev/null +++ b/Signal/src/textsecure/Messages/TSInfoMessage.m @@ -0,0 +1,13 @@ +// +// TSInfoMessage.m +// TextSecureKit +// +// Created by Frederic Jacobs on 15/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSInfoMessage.h" + +@implementation TSInfoMessage + +@end diff --git a/Signal/src/textsecure/Messages/TSInteraction.h b/Signal/src/textsecure/Messages/TSInteraction.h new file mode 100644 index 000000000..ca4cd39d6 --- /dev/null +++ b/Signal/src/textsecure/Messages/TSInteraction.h @@ -0,0 +1,38 @@ +// +// TSInteraction.h +// TextSecureKit +// +// Created by Frederic Jacobs on 12/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import +#import + +#import "TSYapDatabaseObject.h" + +#import "TSContactThread.h" +#import "TSGroupThread.h" + +extern const struct TSMessageRelationships { + __unsafe_unretained NSString *threadUniqueId; +} TSMessageRelationships; + +extern const struct TSMessageEdges { + __unsafe_unretained NSString *thread; +} TSMessageEdges; + +@interface TSInteraction : TSYapDatabaseObject + +- (instancetype)initWithTimestamp:(uint64_t)timestamp inThread:(TSThread*)thread; + +@property (nonatomic, readonly) NSString *uniqueThreadId; + +- (NSDate*)date; +- (uint64_t)timeStamp; + +#pragma mark Utility Method + ++ (NSString*)stringFromTimeStamp:(uint64_t)timestamp; + +@end diff --git a/Signal/src/textsecure/Messages/TSInteraction.mm b/Signal/src/textsecure/Messages/TSInteraction.mm new file mode 100644 index 000000000..6d4270d24 --- /dev/null +++ b/Signal/src/textsecure/Messages/TSInteraction.mm @@ -0,0 +1,82 @@ +// +// TSInteraction.m +// TextSecureKit +// +// Created by Frederic Jacobs on 12/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import + +#import "TSInteraction.h" + +const struct TSMessageRelationships TSMessageRelationships = { + .threadUniqueId = @"threadUniqueId", +}; + +const struct TSMessageEdges TSMessageEdges = { + .thread = @"thread", +}; + +@implementation TSInteraction + +- (instancetype)initWithTimestamp:(uint64_t)timestamp inThread:(TSThread*)thread{ + self = [super initWithUniqueId:[[self class] stringFromTimeStamp:timestamp]]; + + if (self) { + _uniqueThreadId = thread.uniqueId; + } + + return self; +} + + +#pragma - mark YapDatabaseRelationshipNode + +- (NSArray *)yapDatabaseRelationshipEdges +{ + NSArray *edges = nil; + if (self.uniqueThreadId) { + YapDatabaseRelationshipEdge *threadEdge = [YapDatabaseRelationshipEdge edgeWithName:TSMessageEdges.thread + destinationKey:self.uniqueThreadId + collection:[TSThread collection] + nodeDeleteRules:YDB_DeleteSourceIfDestinationDeleted]; + edges = @[threadEdge]; + } + + return edges; +} + ++ (NSString*)collection{ + return @"TSInteraction"; +} + +#pragma mark Date operations + +- (int64_t)identifierToTimestamp{ + NSNumberFormatter * f = [[NSNumberFormatter alloc] init]; + [f setNumberStyle:NSNumberFormatterNoStyle]; + NSNumber * myNumber = [f numberFromString:self.uniqueId]; + return [myNumber unsignedLongLongValue]; +} + +- (NSDate*)date{ + int64_t milliseconds = [self identifierToTimestamp]; + int64_t seconds = milliseconds/1000; + return [NSDate dateWithTimeIntervalSince1970:seconds]; +} + +- (uint64_t)timeStamp{ + return [self identifierToTimestamp]; +} + ++ (NSString*)stringFromTimeStamp:(uint64_t)timestamp{ + return [[NSNumber numberWithUnsignedLongLong:timestamp] stringValue]; +} + +- (NSNumber*)nowTimeStamp{ + double milliseconds = std::chrono::system_clock::now().time_since_epoch()/std::chrono::milliseconds(1); + return [NSNumber numberWithDouble:milliseconds]; +} + +@end diff --git a/Signal/src/textsecure/Messages/TSMessage.h b/Signal/src/textsecure/Messages/TSMessage.h new file mode 100644 index 000000000..1fea71401 --- /dev/null +++ b/Signal/src/textsecure/Messages/TSMessage.h @@ -0,0 +1,28 @@ +// +// TSMessage.h +// TextSecureKit +// +// Created by Frederic Jacobs on 12/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSInteraction.h" +#import + +/** + * Abstract message class. Is instantiated by either + */ + +@interface TSMessage : TSInteraction + +@property (nonatomic, readonly) NSArray *attachements;// contains TSAttachements +@property (nonatomic, readonly) NSString *body; + +- (instancetype)initWithTimestamp:(uint64_t)timestamp + inThread:(TSThread*)thread + messageBody:(NSString*)body + attachements:(NSArray*)attachements; + +- (BOOL)hasAttachements; + +@end diff --git a/Signal/src/textsecure/Messages/TSMessage.m b/Signal/src/textsecure/Messages/TSMessage.m new file mode 100644 index 000000000..89051f3ae --- /dev/null +++ b/Signal/src/textsecure/Messages/TSMessage.m @@ -0,0 +1,33 @@ +// +// TSMessage.m +// TextSecureKit +// +// Created by Frederic Jacobs on 12/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSMessage.h" + + +@implementation TSMessage + +- (instancetype)initWithTimestamp:(uint64_t)timestamp + inThread:(TSThread*)thread + messageBody:(NSString*)body + attachements:(NSArray*)attachements +{ + self = [super initWithTimestamp:timestamp inThread:thread]; + + if (self) { + _body = body; + _attachements = attachements; + } + return self; +} + +- (BOOL)hasAttachements{ + return self.attachements?(self.attachements.count>0):false; +} + + +@end diff --git a/Signal/src/textsecure/Messages/TSMessagesManager+sendMessages.h b/Signal/src/textsecure/Messages/TSMessagesManager+sendMessages.h new file mode 100644 index 000000000..08bf64243 --- /dev/null +++ b/Signal/src/textsecure/Messages/TSMessagesManager+sendMessages.h @@ -0,0 +1,15 @@ +// +// TSMessagesManager+sendMessages.h +// TextSecureKit +// +// Created by Frederic Jacobs on 17/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSMessagesManager.h" + +@interface TSMessagesManager (sendMessages) + +- (void)sendMessage:(TSOutgoingMessage*)message inThread:(TSThread*)thread; + +@end diff --git a/Signal/src/textsecure/Messages/TSMessagesManager+sendMessages.m b/Signal/src/textsecure/Messages/TSMessagesManager+sendMessages.m new file mode 100644 index 000000000..736f0c850 --- /dev/null +++ b/Signal/src/textsecure/Messages/TSMessagesManager+sendMessages.m @@ -0,0 +1,150 @@ +// +// TSMessagesManager+sendMessages.m +// TextSecureKit +// +// Created by Frederic Jacobs on 17/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSMessagesManager+sendMessages.h" + +#import + +#import "IncomingPushMessageSignal.pb.h" +#import "TSStorageManager.h" +#import "TSStorageManager+SessionStore.h" +#import "TSStorageManager+IdentityKeyStore.h" +#import "TSStorageManager+PreKeyStore.h" +#import "TSStorageManager+SignedPreKeyStore.h" + +#import "TSNetworkManager.h" +#import "TSServerMessage.h" +#import "TSSubmitMessageRequest.h" + +#import "TSContactThread.h" +#import "TSGroupThread.h" +#import "TSRecipient.h" + +@implementation TSMessagesManager (sendMessages) + +- (void)sendMessage:(TSOutgoingMessage*)message inThread:(TSThread*)thread{ + if ([thread isKindOfClass:[TSGroupThread class]]) { + NSLog(@"Currently unsupported"); + } else if([thread isKindOfClass:[TSContactThread class]]){ + TSContactThread *contactThread = (TSContactThread*)thread; + [self sendMessage:message + toRecipient:contactThread.recipient + inThread:thread + withAttemps:3]; + } +} + + +- (void)sendMessage:(TSOutgoingMessage*)message + toRecipient:(TSRecipient*)recipient + inThread:(TSThread*)thread + withAttemps:(int)remainingAttempts{ + + if (remainingAttempts > 0) { + remainingAttempts -= 1; + + NSArray *outgoingMessages = [self outgoingMessages:message toRecipient:recipient]; + + TSSubmitMessageRequest *request = [[TSSubmitMessageRequest alloc] initWithRecipient:recipient.uniqueId messages:outgoingMessages relay:recipient.relay timeStamp:message.timeStamp]; + + [[TSNetworkManager sharedManager] queueAuthenticatedRequest:request success:^(NSURLSessionDataTask *task, id responseObject) { + + [self handleMessageSent:message inThread:thread]; + + } failure:^(NSURLSessionDataTask *task, NSError *error) { + NSHTTPURLResponse *response = (NSHTTPURLResponse *)task.response; + long statuscode = response.statusCode; + + //TODO: Handle failures + + switch (statuscode) { + case 404: + // Recipient not found + break; + case 409: + // Mismatched devices + + break; + case 410: + // staledevices + break; + default: + break; + } + + + }]; + } +} + +- (void)handleMessageSent:(TSOutgoingMessage*)message inThread:(TSThread*)thread{ + [self.dbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) { + [message setMessageState:TSOutgoingMessageStateSent]; + [message saveWithTransaction:transaction]; + }]; +} + +- (NSArray*)outgoingMessages:(TSOutgoingMessage*)message toRecipient:(TSRecipient*)recipient{ + + NSMutableArray *messagesArray = [NSMutableArray arrayWithCapacity:recipient.devices.count]; + TSStorageManager *storage = [TSStorageManager sharedManager]; + NSData *plainText = [self plainTextForMessage:message]; + + for (NSNumber *deviceNumber in recipient.devices) { + if (![storage containsSession:recipient.uniqueId deviceId:[deviceNumber intValue]]) { + // Needs to fetch prekey; + } + + @try{ + SessionCipher *cipher = [[SessionCipher alloc] initWithSessionStore:storage + preKeyStore:storage + signedPreKeyStore:storage + identityKeyStore:storage + recipientId:recipient.uniqueId + deviceId:[deviceNumber intValue]]; + + id encryptedMessage = [cipher encryptMessage:plainText]; + NSData *serializedMessage = encryptedMessage.serialized; + TSWhisperMessageType messageType = [self messageTypeForCipherMessage:encryptedMessage]; + + + TSServerMessage *serverMessage = [[TSServerMessage alloc] initWithType:messageType + destination:recipient.uniqueId + device:[deviceNumber intValue] + body:serializedMessage]; + [messagesArray addObject:serverMessage]; + + }@catch (NSException *exception) { + [self processException:exception outgoingMessage:message]; + } + } + + return messagesArray; +} + +- (TSWhisperMessageType)messageTypeForCipherMessage:(id)cipherMessage{ + + if ([cipherMessage isKindOfClass:[PreKeyWhisperMessage class]]) { + return TSPreKeyWhisperMessageType; + } else if ([cipherMessage isKindOfClass:[WhisperMessage class]]){ + return TSEncryptedWhisperMessageType; + } + return TSUnknownMessageType; +} + +- (NSData*)plainTextForMessage:(TSOutgoingMessage*)message{ + + PushMessageContentBuilder *builder = [PushMessageContentBuilder new]; + [builder setBody:message.body]; + + return [builder.build data]; + + //TO-DO: DEAL WITH ATTACHEMENTS AND GROUPS STUFF +} + +@end diff --git a/Signal/src/textsecure/Messages/TSMessagesManager.h b/Signal/src/textsecure/Messages/TSMessagesManager.h new file mode 100644 index 000000000..2fd86f3c4 --- /dev/null +++ b/Signal/src/textsecure/Messages/TSMessagesManager.h @@ -0,0 +1,24 @@ +// +// TSMessagesHandler.h +// TextSecureKit +// +// Created by Frederic Jacobs on 11/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import + +#import "TSOutgoingMessage.h" + +@interface TSMessagesManager : NSObject + ++ (instancetype)sharedManager; + +@property (readonly) YapDatabaseConnection *dbConnection; + +- (void)handleBase64MessageSignal:(NSString*)base64EncodedMessage; + + +- (void)processException:(NSException*)exception outgoingMessage:(TSOutgoingMessage*)message; + +@end diff --git a/Signal/src/textsecure/Messages/TSMessagesManager.m b/Signal/src/textsecure/Messages/TSMessagesManager.m new file mode 100644 index 000000000..92b950ec3 --- /dev/null +++ b/Signal/src/textsecure/Messages/TSMessagesManager.m @@ -0,0 +1,252 @@ +// +// TSMessagesHandler.m +// TextSecureKit +// +// Created by Frederic Jacobs on 11/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSMessagesManager.h" + +#import + +#import "Cryptography.h" +#import "IncomingPushMessageSignal.pb.h" +#import "NSData+Base64.h" + +#import "TSContact.h" + +#import "TSIncomingMessage.h" +#import "TSErrorMessage.h" +#import "TSInfoMessage.h" + +#import "TSStorageManager+keyingMaterial.h" +#import "TSStorageManager+IdentityKeyStore.h" +#import "TSStorageManager+SessionStore.h" +#import "TSStorageManager+SignedPreKeyStore.h" +#import "TSStorageManager+PreKeyStore.h" +#import "TSNetworkManager.h" +#import "TSSubmitMessageRequest.h" + +#import "NSData+messagePadding.h" + +#import + +#define ddLogLevel LOG_LEVEL_DEBUG + +@implementation TSMessagesManager + ++ (instancetype)sharedManager { + static TSMessagesManager *sharedMyManager = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedMyManager = [[self alloc] init]; + }); + return sharedMyManager; +} + +- (instancetype)init{ + self = [super init]; + + if (self) { + _dbConnection = [TSStorageManager sharedManager].databaseConnection; + } + + return self; +} + +- (void)handleBase64MessageSignal:(NSString*)base64EncodedMessage{ + NSData *decryptedPayload = [Cryptography decryptAppleMessagePayload:[NSData dataFromBase64String:base64EncodedMessage] withSignalingKey:TSStorageManager.signalingKey]; + + if (!decryptedPayload) { + return; + } + + IncomingPushMessageSignal *messageSignal = [IncomingPushMessageSignal parseFromData:decryptedPayload]; + + switch (messageSignal.type) { + case IncomingPushMessageSignalTypeCiphertext: + [self handleSecureMessage:messageSignal]; + break; + + case IncomingPushMessageSignalTypePrekeyBundle: + [self handlePreKeyBundle:messageSignal]; + break; + + // Other messages are just dismissed for now. + + case IncomingPushMessageSignalTypeKeyExchange: + NSLog(@"Key exchange!"); + break; + case IncomingPushMessageSignalTypePlaintext: + NSLog(@"Plaintext"); + break; + case IncomingPushMessageSignalTypeReceipt: + NSLog(@"Receipt"); + break; + case IncomingPushMessageSignalTypeUnknown: + NSLog(@"Unknown"); + break; + default: + break; + } +} + +- (void)handleSecureMessage:(IncomingPushMessageSignal*)secureMessage{ + @synchronized(self){ + TSStorageManager *storageManager = [TSStorageManager sharedManager]; + NSString *recipientId = secureMessage.source; + int deviceId = secureMessage.sourceDevice; + + if (![storageManager containsSession:recipientId deviceId:deviceId]) { + // Deal with failure + } + + WhisperMessage *message = [[WhisperMessage alloc] initWithData:secureMessage.message]; + + if (!message) { + [self failedProtocolBufferDeserialization:secureMessage]; + return; + } + + NSData *plaintext; + + @try { + SessionCipher *cipher = [[SessionCipher alloc] initWithSessionStore:storageManager + preKeyStore:storageManager + signedPreKeyStore:storageManager + identityKeyStore:storageManager + recipientId:recipientId + deviceId:deviceId]; + + plaintext = [[cipher decrypt:message] removePadding]; + } + @catch (NSException *exception) { + [self processException:exception pushSignal:secureMessage]; + return; + } + + PushMessageContent *content = [PushMessageContent parseFromData:plaintext]; + + if (!content) { + [self failedProtocolBufferDeserialization:secureMessage]; + return; + } + + [self handleIncomingMessage:secureMessage withPushContent:content]; + } +} + +- (void)handlePreKeyBundle:(IncomingPushMessageSignal*)preKeyMessage{ + @synchronized(self){ + TSStorageManager *storageManager = [TSStorageManager sharedManager]; + NSString *recipientId = preKeyMessage.source; + int deviceId = preKeyMessage.sourceDevice; + + PreKeyWhisperMessage *message = [[PreKeyWhisperMessage alloc] initWithData:preKeyMessage.message]; + + if (!message) { + [self failedProtocolBufferDeserialization:preKeyMessage]; + return; + } + + + NSData *plaintext; + @try { + SessionCipher *cipher = [[SessionCipher alloc] initWithSessionStore:storageManager + preKeyStore:storageManager + signedPreKeyStore:storageManager + identityKeyStore:storageManager + recipientId:recipientId + deviceId:deviceId]; + + plaintext = [[cipher decrypt:message] removePadding]; + } + @catch (NSException *exception) { + [self processException:exception pushSignal:preKeyMessage]; + return; + } + + PushMessageContent *content = [PushMessageContent parseFromData:plaintext]; + + if (!content) { + [self failedProtocolBufferDeserialization:preKeyMessage]; + return; + } + + [self handleIncomingMessage:preKeyMessage withPushContent:content]; + } + +} + +- (void)handleIncomingMessage:(IncomingPushMessageSignal*)incomingMessage withPushContent:(PushMessageContent*)content{ + if ((content.flags & PushMessageContentFlagsEndSession) != 0) { + DDLogVerbose(@"Received end session message..."); + [self handleEndSessionMessage:incomingMessage withContent:content]; + } else if (content.hasGroup && (content.group.type != PushMessageContentGroupContextTypeDeliver)) { + DDLogVerbose(@"Received push group update message..."); + [self handleGroupMessage:incomingMessage withContent:content]; + } else if (content.attachments.count > 0) { + DDLogVerbose(@"Received push media message (attachement) ..."); + [self handleReceivedMediaMessage:incomingMessage withContent:content]; + } else { + DDLogVerbose(@"Received push text message..."); + [self handleReceivedTextMessage:incomingMessage withContent:content]; + } +} + +- (void)handleEndSessionMessage:(IncomingPushMessageSignal*)message withContent:(PushMessageContent*)content{ + TSContactThread *thread = [TSContactThread threadWithContactId:message.source]; + uint64_t timeStamp = message.timestamp; + + if (thread){ + [[[TSInfoMessage alloc] initWithTimestamp:timeStamp inThread:thread messageType:TSInfoMessageTypeSessionDidEnd] save]; + } + + [[TSStorageManager sharedManager] deleteAllSessionsForContact:message.source]; +} + +- (void)handleGroupMessage:(IncomingPushMessageSignal*)message withContent:(PushMessageContent*)content{ + // TO DO +} + +- (void)handleReceivedMediaMessage:(IncomingPushMessageSignal*)message withContent:(PushMessageContent*)content{ + // TO DO +} + +- (void)handleReceivedTextMessage:(IncomingPushMessageSignal*)message withContent:(PushMessageContent*)content{ + uint64_t timeStamp = message.timestamp; + NSString *body = content.body; + NSData *groupId = content.hasGroup?content.group.id:nil; + + TSIncomingMessage *incomingMessage; + + if (groupId) { + TSGroupThread *thread = [TSGroupThread threadWithGroupId:groupId]; + incomingMessage = [[TSIncomingMessage alloc] initWithTimestamp:timeStamp inThread:thread authorId:message.source messageBody:body attachements:nil]; + } else{ + TSContactThread *thread = [TSContactThread threadWithContactId:message.source]; + incomingMessage = [[TSIncomingMessage alloc] initWithTimestamp:timeStamp inThread:thread messageBody:body attachements:nil]; + } + + NSLog(@"Incoming message: %@", incomingMessage.body); + [incomingMessage save]; +} + +- (void)failedProtocolBufferDeserialization:(IncomingPushMessageSignal*)signal{ + NSLog(@"Failed Protocol buffer deserialization"); + TSErrorMessage *errorMessage = [TSErrorMessage invalidProtocolBufferWithSignal:signal]; + [errorMessage save]; + return; +} + +- (void)processException:(NSException*)exception pushSignal:(IncomingPushMessageSignal*)signal{ + NSLog(@"Got exception: %@", exception.description); +} + + +- (void)processException:(NSException*)exception outgoingMessage:(TSOutgoingMessage*)message{ + NSLog(@"Got exception: %@", exception.description); +} + +@end diff --git a/Signal/src/textsecure/Messages/TSOutgoingMessage.h b/Signal/src/textsecure/Messages/TSOutgoingMessage.h new file mode 100644 index 000000000..33127659e --- /dev/null +++ b/Signal/src/textsecure/Messages/TSOutgoingMessage.h @@ -0,0 +1,22 @@ +// +// TSOutgoingMessage.h +// TextSecureKit +// +// Created by Frederic Jacobs on 15/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSMessage.h" + +@interface TSOutgoingMessage : TSMessage + +typedef NS_ENUM(NSInteger, TSOutgoingMessageState){ + TSOutgoingMessageStateAttemptingOut, + TSOutgoingMessageStateUnsent, + TSOutgoingMessageStateSent, + TSOutgoingMessageStateDelivered +}; + +@property (nonatomic) TSOutgoingMessageState messageState; + +@end diff --git a/Signal/src/textsecure/Messages/TSOutgoingMessage.m b/Signal/src/textsecure/Messages/TSOutgoingMessage.m new file mode 100644 index 000000000..17956ca6b --- /dev/null +++ b/Signal/src/textsecure/Messages/TSOutgoingMessage.m @@ -0,0 +1,28 @@ +// +// TSOutgoingMessage.m +// TextSecureKit +// +// Created by Frederic Jacobs on 15/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSOutgoingMessage.h" + +@implementation TSOutgoingMessage + +- (instancetype)initWithTimestamp:(uint64_t)timestamp + inThread:(TSThread *)thread + messageBody:(NSString *)body + attachements:(NSArray *)attachements +{ + self = [super initWithTimestamp:timestamp inThread:thread + messageBody:body attachements:attachements]; + + if (self) { + _messageState = TSOutgoingMessageStateAttemptingOut; + } + + return self; +} + +@end diff --git a/Signal/src/textsecure/Messages/TSServerMessage.h b/Signal/src/textsecure/Messages/TSServerMessage.h new file mode 100644 index 000000000..fb4f41447 --- /dev/null +++ b/Signal/src/textsecure/Messages/TSServerMessage.h @@ -0,0 +1,18 @@ +// +// TSServerMessage.h +// TextSecureKit +// +// Created by Frederic Jacobs on 18/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import + +@interface TSServerMessage : MTLModel + +- (instancetype)initWithType:(TSWhisperMessageType)type + destination:(NSString*)destination + device:(int)deviceId + body:(NSData*)data; + +@end diff --git a/Signal/src/textsecure/Messages/TSServerMessage.m b/Signal/src/textsecure/Messages/TSServerMessage.m new file mode 100644 index 000000000..5d380056c --- /dev/null +++ b/Signal/src/textsecure/Messages/TSServerMessage.m @@ -0,0 +1,46 @@ +// +// TSServerMessage.m +// TextSecureKit +// +// Created by Frederic Jacobs on 18/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSConstants.h" +#import "TSServerMessage.h" + +#import "NSData+Base64.h" + +@interface TSServerMessage () + +@property int type; +@property NSString *destination; +@property int destinationDeviceId; +@property NSString *body; + +@end + +@implementation TSServerMessage + ++ (NSDictionary *)JSONKeyPathsByPropertyKey{ + return @{}; +} + +- (instancetype)initWithType:(TSWhisperMessageType)type + destination:(NSString*)destination + device:(int)deviceId + body:(NSData*)body +{ + self = [super init]; + + if (self) { + _type = type; + _destination = destination; + _destinationDeviceId = deviceId; + _body = [body base64EncodedString]; + } + + return self; +} + +@end diff --git a/Signal/src/textsecure/Network/Requests/TSContactsIntersectionRequest.h b/Signal/src/textsecure/Network/Requests/TSContactsIntersectionRequest.h new file mode 100644 index 000000000..36b187ddd --- /dev/null +++ b/Signal/src/textsecure/Network/Requests/TSContactsIntersectionRequest.h @@ -0,0 +1,15 @@ +// +// TSContactsIntersection.h +// TextSecureiOS +// +// Created by Frederic Jacobs on 10/12/13. +// Copyright (c) 2013 Open Whisper Systems. All rights reserved. +// + +#import "TSRequest.h" + +@interface TSContactsIntersectionRequest : TSRequest + +- (id)initWithHashesArray:(NSArray*)hashes; + +@end \ No newline at end of file diff --git a/Signal/src/textsecure/Network/Requests/TSContactsIntersectionRequest.m b/Signal/src/textsecure/Network/Requests/TSContactsIntersectionRequest.m new file mode 100644 index 000000000..844d7721a --- /dev/null +++ b/Signal/src/textsecure/Network/Requests/TSContactsIntersectionRequest.m @@ -0,0 +1,26 @@ +// +// TSContactsIntersection.m +// TextSecureiOS +// +// Created by Frederic Jacobs on 10/12/13. +// Copyright (c) 2013 Open Whisper Systems. All rights reserved. +// + +#import "TSConstants.h" + +#import "TSContactsIntersectionRequest.h" + +@implementation TSContactsIntersectionRequest + +- (id)initWithHashesArray:(NSArray*)hashes{ + self = [self initWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/%@", textSecureDirectoryAPI, @"tokens"]]]; + + self.HTTPMethod = @"PUT"; + + [self.parameters addEntriesFromDictionary:@{@"contacts": hashes}]; + + return self; + +} + +@end diff --git a/Signal/src/textsecure/Network/Requests/TSDeregisterAccountRequest.h b/Signal/src/textsecure/Network/Requests/TSDeregisterAccountRequest.h new file mode 100644 index 000000000..7ea157b8f --- /dev/null +++ b/Signal/src/textsecure/Network/Requests/TSDeregisterAccountRequest.h @@ -0,0 +1,13 @@ +// +// TSDeregisterAccountRequest.h +// TextSecureiOS +// +// Created by Christine Corbett Moran on 3/16/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSRequest.h" + +@interface TSDeregisterAccountRequest : TSRequest +- (id)initWithUser:(NSString*)user; +@end diff --git a/Signal/src/textsecure/Network/Requests/TSDeregisterAccountRequest.m b/Signal/src/textsecure/Network/Requests/TSDeregisterAccountRequest.m new file mode 100644 index 000000000..daa6a0338 --- /dev/null +++ b/Signal/src/textsecure/Network/Requests/TSDeregisterAccountRequest.m @@ -0,0 +1,22 @@ +// +// TSDeregisterAccountRequest.m +// TextSecureiOS +// +// Created by Christine Corbett Moran on 3/16/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSConstants.h" +#import "TSDeregisterAccountRequest.h" + +@implementation TSDeregisterAccountRequest + + +- (id)initWithUser:(NSString*)userPushId { + self = [super initWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/%@", textSecureAccountsAPI, @"apn"]]]; + self.HTTPMethod = @"DELETE"; + self.parameters = [NSMutableDictionary dictionaryWithObjects:@[userPushId] forKeys:@[@"apnRegistrationId"]]; + return self; + +} +@end diff --git a/Signal/src/textsecure/Network/Requests/TSRecipientPrekeyRequest.h b/Signal/src/textsecure/Network/Requests/TSRecipientPrekeyRequest.h new file mode 100644 index 000000000..2a8e21d8a --- /dev/null +++ b/Signal/src/textsecure/Network/Requests/TSRecipientPrekeyRequest.h @@ -0,0 +1,13 @@ +// +// TSGetRecipientPrekey.h +// TextSecureiOS +// +// Created by Christine Corbett Moran on 11/30/13. +// Copyright (c) 2013 Open Whisper Systems. All rights reserved. +// + +#import "TSRequest.h" +@class TSContact; +@interface TSRecipientPrekeyRequest : TSRequest +-(TSRequest*) initWithRecipient:(TSContact*) contact; +@end diff --git a/Signal/src/textsecure/Network/Requests/TSRecipientPrekeyRequest.m b/Signal/src/textsecure/Network/Requests/TSRecipientPrekeyRequest.m new file mode 100644 index 000000000..de7592f46 --- /dev/null +++ b/Signal/src/textsecure/Network/Requests/TSRecipientPrekeyRequest.m @@ -0,0 +1,24 @@ +// +// TSGetRecipientPrekey.m +// TextSecureiOS +// +// Created by Christine Corbett Moran on 11/30/13. +// Copyright (c) 2013 Open Whisper Systems. All rights reserved. +// + +#import "TSConstants.h" +#import "TSRecipientPrekeyRequest.h" + +@implementation TSRecipientPrekeyRequest + +-(TSRequest*) initWithRecipient:(NSString*)recipientNumber { + NSString* recipientInformation = recipientNumber; + + self = [super initWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/%@/*", textSecureKeysAPI, recipientInformation]]]; + + [self setHTTPMethod:@"GET"]; + + return self; +} + +@end diff --git a/Signal/src/textsecure/Network/Requests/TSRegisterForPushRequest.h b/Signal/src/textsecure/Network/Requests/TSRegisterForPushRequest.h new file mode 100644 index 000000000..a5d6dd4cb --- /dev/null +++ b/Signal/src/textsecure/Network/Requests/TSRegisterForPushRequest.h @@ -0,0 +1,13 @@ +// +// TSRegisterForPushRequest.h +// TextSecureiOS +// +// Created by Frederic Jacobs on 10/13/13. +// Copyright (c) 2013 Open Whisper Systems. All rights reserved. +// + +#import "TSRequest.h" + +@interface TSRegisterForPushRequest : TSRequest +- (id) initWithPushIdentifier:(NSString*)identifier; +@end diff --git a/Signal/src/textsecure/Network/Requests/TSRegisterForPushRequest.m b/Signal/src/textsecure/Network/Requests/TSRegisterForPushRequest.m new file mode 100644 index 000000000..bb698c89d --- /dev/null +++ b/Signal/src/textsecure/Network/Requests/TSRegisterForPushRequest.m @@ -0,0 +1,25 @@ +// +// TSRegisterForPushRequest.m +// TextSecureiOS +// +// Created by Frederic Jacobs on 10/13/13. +// Copyright (c) 2013 Open Whisper Systems. All rights reserved. +// + +#import "TSConstants.h" + +#import "TSRegisterForPushRequest.h" + +@implementation TSRegisterForPushRequest + +- (id) initWithPushIdentifier:(NSString*)identifier{ + self = [super initWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/%@", textSecureAccountsAPI, @"apn"]]]; + + self.HTTPMethod = @"PUT"; + + self.parameters = [NSMutableDictionary dictionaryWithObjects:@[identifier] forKeys:@[@"apnRegistrationId"]]; + + return self; +} + +@end diff --git a/Signal/src/textsecure/Network/Requests/TSRegisterPrekeysRequest.h b/Signal/src/textsecure/Network/Requests/TSRegisterPrekeysRequest.h new file mode 100644 index 000000000..b90afd082 --- /dev/null +++ b/Signal/src/textsecure/Network/Requests/TSRegisterPrekeysRequest.h @@ -0,0 +1,18 @@ +// +// TSRegisterPrekeys.h +// TextSecureiOS +// +// Created by Christine Corbett Moran on 10/17/13. +// Copyright (c) 2013 Open Whisper Systems. All rights reserved. +// + +#import "TSRequest.h" +@class TSECKeyPair; +@class SignedPreKeyRecord; +@class PreKeyRecord; + +@interface TSRegisterPrekeysRequest : TSRequest + +- (id)initWithPrekeyArray:(NSArray*)prekeys identityKey:(NSData*)identityKeyPublic signedPreKeyRecord:(SignedPreKeyRecord*)signedRecord preKeyLastResort:(PreKeyRecord*)lastResort; + +@end diff --git a/Signal/src/textsecure/Network/Requests/TSRegisterPrekeysRequest.m b/Signal/src/textsecure/Network/Requests/TSRegisterPrekeysRequest.m new file mode 100644 index 000000000..fe964eaaa --- /dev/null +++ b/Signal/src/textsecure/Network/Requests/TSRegisterPrekeysRequest.m @@ -0,0 +1,51 @@ +// +// TSRegisterPrekeys.m +// TextSecureiOS +// +// Created by Christine Corbett Moran on 10/17/13. +// Copyright (c) 2013 Open Whisper Systems. All rights reserved. +// + +#import "TSConstants.h" +#import "TSRegisterPrekeysRequest.h" + +#import <25519/Curve25519.h> +#import +#import +#import + +@implementation TSRegisterPrekeysRequest + +- (id)initWithPrekeyArray:(NSArray*)prekeys identityKey:(NSData*)identityKeyPublic signedPreKeyRecord:(SignedPreKeyRecord*)signedRecord preKeyLastResort:(PreKeyRecord*)lastResort { + self = [super initWithURL:[NSURL URLWithString:textSecureKeysAPI]]; + self.HTTPMethod = @"PUT"; + + NSString *publicIdentityKey = [[identityKeyPublic prependKeyType] base64EncodedStringWithOptions:0]; + NSMutableArray *serializedPrekeyList = [NSMutableArray array]; + + for (PreKeyRecord *preKey in prekeys) { + [serializedPrekeyList addObject:[self dictionaryFromPreKey:preKey]]; + } + + NSDictionary *serializedKeyRegistrationParameters = @{@"preKeys": serializedPrekeyList, @"lastResortKey":[self dictionaryFromPreKey:lastResort], @"signedPreKey":[self dictionaryFromSignedPreKey:signedRecord] , @"identityKey":publicIdentityKey}; + + self.parameters = [serializedKeyRegistrationParameters mutableCopy]; + + return self; +} + + +- (NSDictionary*)dictionaryFromPreKey:(PreKeyRecord*)preKey { + return @{@"keyId":[NSNumber numberWithInt:preKey.Id], + @"publicKey":[[preKey.keyPair.publicKey prependKeyType] base64EncodedStringWithOptions:0], + }; +} + +- (NSDictionary*)dictionaryFromSignedPreKey:(SignedPreKeyRecord*)preKey { + return @{@"keyId":[NSNumber numberWithInt:preKey.Id], + @"publicKey":[[preKey.keyPair.publicKey prependKeyType] base64EncodedStringWithOptions:0], + @"signature":[preKey.signature base64EncodedStringWithOptions:0] + }; +} + +@end diff --git a/Signal/src/textsecure/Network/Requests/TSRegisterWithTokenRequest.h b/Signal/src/textsecure/Network/Requests/TSRegisterWithTokenRequest.h new file mode 100644 index 000000000..9fc58dae4 --- /dev/null +++ b/Signal/src/textsecure/Network/Requests/TSRegisterWithTokenRequest.h @@ -0,0 +1,15 @@ +// +// TSRegisterWithTokenRequest.h +// TextSecureKit +// +// Created by Frederic Jacobs on 14/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSRequest.h" + +@interface TSRegisterWithTokenRequest : TSRequest + +- (TSRequest*) initWithVerificationToken:(NSString*)verificationCode signalingKey:(NSString*)signalingKey authKey:(NSString*)authKey; + +@end diff --git a/Signal/src/textsecure/Network/Requests/TSRegisterWithTokenRequest.m b/Signal/src/textsecure/Network/Requests/TSRegisterWithTokenRequest.m new file mode 100644 index 000000000..9a2ff544b --- /dev/null +++ b/Signal/src/textsecure/Network/Requests/TSRegisterWithTokenRequest.m @@ -0,0 +1,27 @@ +// +// TSRegisterWithTokenRequest.m +// TextSecureKit +// +// Created by Frederic Jacobs on 14/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSConstants.h" +#import "TSAccountManager.h" +#import "TSRegisterWithTokenRequest.h" + +@implementation TSRegisterWithTokenRequest + +- (TSRequest*) initWithVerificationToken:(NSString*)verificationToken signalingKey:(NSString*)signalingKey authKey:(NSString*)authKey{ + self = [super initWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/token/%@", textSecureAccountsAPI, verificationToken]]]; + + [self.parameters addEntriesFromDictionary:@{@"signalingKey": signalingKey, @"AuthKey": authKey, @"supportsSMS": @FALSE, @"registrationId": [NSString stringWithFormat:@"%i",[TSAccountManager getOrGenerateRegistrationId]]}]; + + [self setHTTPMethod:@"PUT"]; + + return self; + +} + +@end + diff --git a/Signal/src/textsecure/Network/Requests/TSRequest.h b/Signal/src/textsecure/Network/Requests/TSRequest.h new file mode 100644 index 000000000..2f9573bfd --- /dev/null +++ b/Signal/src/textsecure/Network/Requests/TSRequest.h @@ -0,0 +1,17 @@ +// +// TSRequest.h +// TextSecureiOS +// +// Created by Frederic Jacobs on 9/27/13. +// Copyright (c) 2013 Open Whisper Systems. All rights reserved. +// + +#import + +@interface TSRequest : NSMutableURLRequest + +@property (nonatomic,retain) NSMutableDictionary *parameters; + +- (void) makeAuthenticatedRequest; + +@end diff --git a/Signal/src/textsecure/Network/Requests/TSRequest.m b/Signal/src/textsecure/Network/Requests/TSRequest.m new file mode 100644 index 000000000..0cdcf8634 --- /dev/null +++ b/Signal/src/textsecure/Network/Requests/TSRequest.m @@ -0,0 +1,42 @@ +// +// TSRequest.m +// TextSecureiOS +// +// Created by Frederic Jacobs on 9/27/13. +// Copyright (c) 2013 Open Whisper Systems. All rights reserved. +// + +#import "TSRequest.h" + +#import "TSStorageManager+keyingMaterial.h" +#import "TSConstants.h" + +@implementation TSRequest + +- (id)initWithURL:(NSURL *)URL{ + self = [super initWithURL:URL cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval:textSecureHTTPTimeOut]; + self.parameters = [NSMutableDictionary dictionary]; + + return self; +} + +- (id)init{ + [NSException raise:NSInternalInconsistencyException + format:@"You must use the initWithURL: method"]; + return nil; +} + +- (id)initWithURL:(NSURL *)URL cachePolicy:(NSURLRequestCachePolicy)cachePolicy timeoutInterval:(NSTimeInterval)timeoutInterval{ + [NSException raise:NSInternalInconsistencyException + format:@"You must use the initWithURL method"]; + return nil; +} + +- (void) makeAuthenticatedRequest{ + [self.parameters addEntriesFromDictionary:@{@"Authorization":[TSStorageManager serverAuthToken]}]; +} + +- (BOOL) usingExternalServer { + return NO; +} +@end diff --git a/Signal/src/textsecure/Network/Requests/TSRequestAttachment.h b/Signal/src/textsecure/Network/Requests/TSRequestAttachment.h new file mode 100644 index 000000000..6b7be1415 --- /dev/null +++ b/Signal/src/textsecure/Network/Requests/TSRequestAttachment.h @@ -0,0 +1,13 @@ +// +// TSRequestAttachment.h +// TextSecureiOS +// +// Created by Christine Corbett Moran on 12/1/13. +// Copyright (c) 2013 Open Whisper Systems. All rights reserved. +// + +#import "TSRequest.h" + +@interface TSRequestAttachment : TSRequest +-(TSRequest*) initWithId:(NSNumber*) attachmentId; +@end diff --git a/Signal/src/textsecure/Network/Requests/TSRequestAttachment.m b/Signal/src/textsecure/Network/Requests/TSRequestAttachment.m new file mode 100644 index 000000000..acaf81f54 --- /dev/null +++ b/Signal/src/textsecure/Network/Requests/TSRequestAttachment.m @@ -0,0 +1,20 @@ +// +// TSRequestAttachment.m +// TextSecureiOS +// +// Created by Christine Corbett Moran on 12/1/13. +// Copyright (c) 2013 Open Whisper Systems. All rights reserved. +// + +#import "TSRequestAttachment.h" +#import "Constants.h" +@implementation TSRequestAttachment +-(TSRequest*) initWithId:(NSNumber*) attachmentId { + + //self = [super initWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/%@",textSecureAttachmentsAPI,attachmentId]]]; + self.HTTPMethod = @"GET"; + return self; +} + + +@end diff --git a/Signal/src/textsecure/Network/Requests/TSRequestAttachmentId.h b/Signal/src/textsecure/Network/Requests/TSRequestAttachmentId.h new file mode 100644 index 000000000..6e4236bdc --- /dev/null +++ b/Signal/src/textsecure/Network/Requests/TSRequestAttachmentId.h @@ -0,0 +1,13 @@ +// +// TSRequestAttachmentId.h +// TextSecureiOS +// +// Created by Christine Corbett Moran on 12/1/13. +// Copyright (c) 2013 Open Whisper Systems. All rights reserved. +// + +#import "TSRequest.h" + +@interface TSRequestAttachmentId : TSRequest + +@end diff --git a/Signal/src/textsecure/Network/Requests/TSRequestAttachmentId.m b/Signal/src/textsecure/Network/Requests/TSRequestAttachmentId.m new file mode 100644 index 000000000..0b745ca13 --- /dev/null +++ b/Signal/src/textsecure/Network/Requests/TSRequestAttachmentId.m @@ -0,0 +1,20 @@ +// +// TSRequestAttachmentId.m +// TextSecureiOS +// +// Created by Christine Corbett Moran on 12/1/13. +// Copyright (c) 2013 Open Whisper Systems. All rights reserved. +// + +#import "TSConstants.h" +#import "TSRequestAttachmentId.h" + +@implementation TSRequestAttachmentId +-(TSRequest*) init { + + self = [super initWithURL:[NSURL URLWithString:textSecureAttachmentsAPI]]; + self.HTTPMethod = @"GET"; + return self; +} + +@end diff --git a/Signal/src/textsecure/Network/Requests/TSRequestVerificationCodeRequest.h b/Signal/src/textsecure/Network/Requests/TSRequestVerificationCodeRequest.h new file mode 100644 index 000000000..58dd52971 --- /dev/null +++ b/Signal/src/textsecure/Network/Requests/TSRequestVerificationCodeRequest.h @@ -0,0 +1,16 @@ +// +// TSSendSMSVerificationRequest.h +// TextSecureiOS +// +// Created by Frederic Jacobs on 9/29/13. +// Copyright (c) 2013 Open Whisper Systems. All rights reserved. +// + +#import "TSConstants.h" +#import "TSRequest.h" + +@interface TSRequestVerificationCodeRequest : TSRequest + +- (TSRequest*)initRequestForPhoneNumber:(NSString*)phoneNumber transport:(VerificationTransportType)transport; + +@end diff --git a/Signal/src/textsecure/Network/Requests/TSRequestVerificationCodeRequest.m b/Signal/src/textsecure/Network/Requests/TSRequestVerificationCodeRequest.m new file mode 100644 index 000000000..a33ef99b2 --- /dev/null +++ b/Signal/src/textsecure/Network/Requests/TSRequestVerificationCodeRequest.m @@ -0,0 +1,25 @@ +// +// TSSendSMSVerificationRequest.m +// TextSecureiOS +// +// Created by Frederic Jacobs on 9/29/13. +// Copyright (c) 2013 Open Whisper Systems. All rights reserved. +// + +#import "TSConstants.h" +#import "NSString+escape.h" + +#import "TSRequestVerificationCodeRequest.h" + +@implementation TSRequestVerificationCodeRequest + +- (TSRequest*)initRequestForPhoneNumber:(NSString*)phoneNumber transport:(VerificationTransportType)transport{ + + self = [super initWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/%@/code/%@", textSecureAccountsAPI, (transport == kSMSVerification)? @"sms" : @"voice", [phoneNumber escape]]]]; + + [self setHTTPMethod:@"GET"]; + + return self; +} + +@end diff --git a/Signal/src/textsecure/Network/Requests/TSServerCodeVerificationRequest.h b/Signal/src/textsecure/Network/Requests/TSServerCodeVerificationRequest.h new file mode 100644 index 000000000..c0f0d8edf --- /dev/null +++ b/Signal/src/textsecure/Network/Requests/TSServerCodeVerificationRequest.h @@ -0,0 +1,18 @@ +// +// TSServerCodeVerificationRequest.h +// TextSecureiOS +// +// Created by Frederic Jacobs on 10/12/13. +// Copyright (c) 2013 Open Whisper Systems. All rights reserved. +// + +#import "TSRequest.h" + +@interface TSServerCodeVerificationRequest : TSRequest + +- (TSRequest*) initWithVerificationCode:(NSString*)verificationCode signalingKey:(NSString*)signalingKey authKey:(NSString*)authKey; + +@property (nonatomic, copy) NSString *numberToValidate; + +@end + diff --git a/Signal/src/textsecure/Network/Requests/TSServerCodeVerificationRequest.m b/Signal/src/textsecure/Network/Requests/TSServerCodeVerificationRequest.m new file mode 100644 index 000000000..6d3ac34d2 --- /dev/null +++ b/Signal/src/textsecure/Network/Requests/TSServerCodeVerificationRequest.m @@ -0,0 +1,27 @@ +// +// TSServerCodeVerificationRequest.m +// TextSecureiOS +// +// Created by Frederic Jacobs on 10/12/13. +// Copyright (c) 2013 Open Whisper Systems. All rights reserved. +// + +#import "TSConstants.h" +#import "TSAccountManager.h" +#import "TSServerCodeVerificationRequest.h" + +@implementation TSServerCodeVerificationRequest + +- (TSRequest*) initWithVerificationCode:(NSString*)verificationCode signalingKey:(NSString*)signalingKey authKey:(NSString*)authKey { + self = [super initWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/%@/%@", textSecureAccountsAPI, @"code", verificationCode]]]; + + [self.parameters addEntriesFromDictionary:@{@"signalingKey": signalingKey, @"AuthKey": authKey, @"supportsSMS": @FALSE, @"registrationId": [NSString stringWithFormat:@"%i",[TSAccountManager getOrGenerateRegistrationId]]}]; + + [self setHTTPMethod:@"PUT"]; + + return self; +} + + + +@end diff --git a/Signal/src/textsecure/Network/Requests/TSSubmitMessageRequest.h b/Signal/src/textsecure/Network/Requests/TSSubmitMessageRequest.h new file mode 100644 index 000000000..ecbf70695 --- /dev/null +++ b/Signal/src/textsecure/Network/Requests/TSSubmitMessageRequest.h @@ -0,0 +1,19 @@ +// +// TSSubmitMessageRequest.h +// TextSecureiOS +// +// Created by Christine Corbett Moran on 11/30/13. +// Copyright (c) 2013 Open Whisper Systems. All rights reserved. +// + +#import "TSRequest.h" +#import "TSConstants.h" + +@interface TSSubmitMessageRequest : TSRequest + +-(TSRequest*) initWithRecipient:(NSString*)contactRegisteredID + messages:(NSArray*)messages + relay:(NSString*)relay + timeStamp:(uint64_t)timeStamp; + +@end diff --git a/Signal/src/textsecure/Network/Requests/TSSubmitMessageRequest.m b/Signal/src/textsecure/Network/Requests/TSSubmitMessageRequest.m new file mode 100644 index 000000000..ed6dad025 --- /dev/null +++ b/Signal/src/textsecure/Network/Requests/TSSubmitMessageRequest.m @@ -0,0 +1,34 @@ +// +// TSSubmitMessageRequest.m +// TextSecureiOS +// +// Created by Christine Corbett Moran on 11/30/13. +// Copyright (c) 2013 Open Whisper Systems. All rights reserved. +// + +#import "TSConstants.h" + +#import "TSSubmitMessageRequest.h" + +@implementation TSSubmitMessageRequest + +-(TSRequest*) initWithRecipient:(NSString*)contactRegisteredID + messages:(NSArray*)messages + relay:(NSString*)relay + timeStamp:(uint64_t)timeStamp +{ + self = [super initWithURL:[NSURL URLWithString:[textSecureMessagesAPI stringByAppendingString:contactRegisteredID]]]; + + NSMutableDictionary *allMessages = [@{@"messages":messages, @"timestamp":[NSNumber numberWithUnsignedLongLong:timeStamp]} mutableCopy]; + + if (relay) { + [allMessages setObject:relay forKey:@"relay"]; + } + + [self setHTTPMethod:@"PUT"]; + [self setParameters:allMessages]; + return self; +} + +@end + diff --git a/Signal/src/textsecure/Network/Requests/TSUploadAttachment.h b/Signal/src/textsecure/Network/Requests/TSUploadAttachment.h new file mode 100644 index 000000000..a5498fa8b --- /dev/null +++ b/Signal/src/textsecure/Network/Requests/TSUploadAttachment.h @@ -0,0 +1,15 @@ +// +// TSUploadAttachment.h +// TextSecureiOS +// +// Created by Christine Corbett Moran on 12/3/13. +// Copyright (c) 2013 Open Whisper Systems. All rights reserved. +// + +#import "TSRequest.h" +@class TSAttachment; +@interface TSUploadAttachment : TSRequest +@property(nonatomic,strong) TSAttachment* attachment; +-(TSRequest*) initWithAttachment:(TSAttachment*) attachment ; + +@end diff --git a/Signal/src/textsecure/Network/Requests/TSUploadAttachment.m b/Signal/src/textsecure/Network/Requests/TSUploadAttachment.m new file mode 100644 index 000000000..02f9e3274 --- /dev/null +++ b/Signal/src/textsecure/Network/Requests/TSUploadAttachment.m @@ -0,0 +1,33 @@ +// +// TSUploadAttachment.m +// TextSecureiOS +// +// Created by Christine Corbett Moran on 12/3/13. +// Copyright (c) 2013 Open Whisper Systems. All rights reserved. +// + +#import "TSUploadAttachment.h" +#import +@implementation TSUploadAttachment + +//-(TSRequest*) initWithAttachment:(TSAttachment*) attachment{ +// +// self = [super initWithURL:attachment.attachmentURL]; +// self.HTTPMethod = @"PUT"; +// self.attachment = attachment; +// +// [self setHTTPBody:[self.attachment getData]]; +// [self setAllHTTPHeaderFields: @{@"Content-Type": @"application/octet-stream"}]; +// +// return self; +// +//} + + + + + + + + +@end diff --git a/Signal/src/textsecure/Network/TSNetworkManager.h b/Signal/src/textsecure/Network/TSNetworkManager.h new file mode 100644 index 000000000..0ce5673f3 --- /dev/null +++ b/Signal/src/textsecure/Network/TSNetworkManager.h @@ -0,0 +1,23 @@ +// +// TSNetworkManager.h +// TextSecureiOS +// +// Created by Frederic Jacobs on 9/27/13. +// Copyright (c) 2013 Open Whisper Systems. All rights reserved. +// + +#import +#import +#import "TSRequest.h" +#import "TSRequestVerificationCodeRequest.h" + +@interface TSNetworkManager : NSObject + ++ (id)sharedManager; +/* requests outside of the TS Server */ +- (void) queueUnauthenticatedRequest:(TSRequest*) request success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))successCompletionBlock failure: (void (^)(AFHTTPRequestOperation *operation, NSError *error)) failureCompletionBlock; + +/* requests inside the TS Server */ +- (void) queueAuthenticatedRequest:(TSRequest*) request success:(void (^)(NSURLSessionDataTask *task, id responseObject))success failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure; + +@end diff --git a/Signal/src/textsecure/Network/TSNetworkManager.m b/Signal/src/textsecure/Network/TSNetworkManager.m new file mode 100644 index 000000000..ca919fdab --- /dev/null +++ b/Signal/src/textsecure/Network/TSNetworkManager.m @@ -0,0 +1,98 @@ +// +// TSNetworkManager.m +// TextSecureiOS +// +// Created by Frederic Jacobs on 9/27/13. +// Copyright (c) 2013 Open Whisper Systems. All rights reserved. +// + +#import + +#import "TSAccountManager.h" +#import "TSConstants.h" +#import "TSNetworkManager.h" +#import "TSRequest.h" +#import "TSServerCodeVerificationRequest.h" +#import "TSStorageManager+keyingMaterial.h" +#import "TSUploadAttachment.h" + +@interface TSNetworkManager () + +@property AFHTTPSessionManager *operationManager; + +@end + +@implementation TSNetworkManager + +#pragma mark Singleton implementation + ++ (id)sharedManager { + static TSNetworkManager *sharedMyManager = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedMyManager = [[self alloc] init]; + }); + return sharedMyManager; +} + +- (id)init { + if (self = [super init]) { + NSURLSessionConfiguration *sessionConf = NSURLSessionConfiguration.ephemeralSessionConfiguration; + self.operationManager = [[AFHTTPSessionManager alloc] initWithBaseURL:[[NSURL alloc] initWithString:textSecureServerURL] sessionConfiguration:sessionConf]; + //self.operationManager.responseSerializer = [AFJSONResponseSerializer serializer]; + self.operationManager.securityPolicy.allowInvalidCertificates = YES; + // NSString *certPath = [NSBundle.mainBundle pathForResource:@"whisperReal" ofType:@"cer"]; + // NSData *certData = [NSData dataWithContentsOfFile:certPath]; + // SecCertificateRef cert = SecCertificateCreateWithData(NULL, (__bridge CFDataRef)(certData)); + // self.operationManager.securityPolicy.pinnedCertificates = @[(__bridge_transfer NSData *)SecCertificateCopyData(cert)]; + // self.operationManager.securityPolicy.SSLPinningMode = AFSSLPinningModeCertificate; + } + return self; +} + +#pragma mark Manager Methods + +- (void) queueUnauthenticatedRequest:(TSRequest*) request success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))successCompletionBlock failure: (void (^)(AFHTTPRequestOperation *operation, NSError *error)) failureCompletionBlock{ + AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request]; + + [operation setCompletionBlockWithSuccess:successCompletionBlock failure:failureCompletionBlock]; + [self.operationManager.operationQueue addOperation:operation]; +} + +- (void) queueAuthenticatedRequest:(TSRequest*) request success:(void (^)(NSURLSessionDataTask *task, id responseObject))success failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure { + if ([request isKindOfClass:[TSRequestVerificationCodeRequest class]]) { + // The only unauthenticated request is the initial request for a verification code + self.operationManager.requestSerializer = [AFJSONRequestSerializer serializer]; + [self.operationManager GET:[textSecureServerURL stringByAppendingString:request.URL.absoluteString] parameters:request.parameters success:success failure:failure]; + + } else if ([request isKindOfClass:[TSServerCodeVerificationRequest class]]){ + // We plant the Authorization parameter ourselves, no need to double add. + self.operationManager.requestSerializer = [AFJSONRequestSerializer serializer]; + [self.operationManager.requestSerializer setAuthorizationHeaderFieldWithUsername:((TSServerCodeVerificationRequest*)request).numberToValidate password:[request.parameters objectForKey:@"AuthKey"]]; + + [request.parameters removeObjectForKey:@"AuthKey"]; + + [self.operationManager PUT:[textSecureServerURL stringByAppendingString:request.URL.absoluteString] parameters:request.parameters success:success failure:failure]; + } + else{ + // For all other equests, we do add an authorization header + self.operationManager.requestSerializer = [AFJSONRequestSerializer serializer]; + self.operationManager.responseSerializer = [AFJSONResponseSerializer serializer]; + + [self.operationManager.requestSerializer setAuthorizationHeaderFieldWithUsername:[TSAccountManager registeredNumber] password:[TSStorageManager serverAuthToken]]; + + if ([request.HTTPMethod isEqualToString:@"GET"]) { + [self.operationManager GET:[textSecureServerURL stringByAppendingString:request.URL.absoluteString] parameters:request.parameters success:success failure:failure]; + } else if ([request.HTTPMethod isEqualToString:@"POST"]){ + [self.operationManager POST:[textSecureServerURL stringByAppendingString:request.URL.absoluteString] parameters:request.parameters success:success failure:failure]; + } else if ([request.HTTPMethod isEqualToString:@"PUT"]){ + [self.operationManager PUT:[textSecureServerURL stringByAppendingString:request.URL.absoluteString] parameters:request.parameters success:success failure:failure]; + } + else if ([request.HTTPMethod isEqualToString:@"DELETE"]){ + [self.operationManager DELETE:[textSecureServerURL stringByAppendingString:request.URL.absoluteString] parameters:request.parameters success:success failure:failure]; + } + } +} + + +@end diff --git a/Signal/src/textsecure/Network/TSSocketManager.h b/Signal/src/textsecure/Network/TSSocketManager.h new file mode 100644 index 000000000..841398d3d --- /dev/null +++ b/Signal/src/textsecure/Network/TSSocketManager.h @@ -0,0 +1,17 @@ +// +// TSSocketManager.h +// TextSecureiOS +// +// Created by Frederic Jacobs on 17/05/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import +#import + +@interface TSSocketManager : NSObject + ++ (void)becomeActive; ++ (void)resignActivity; + +@end diff --git a/Signal/src/textsecure/Network/TSSocketManager.m b/Signal/src/textsecure/Network/TSSocketManager.m new file mode 100644 index 000000000..65931d920 --- /dev/null +++ b/Signal/src/textsecure/Network/TSSocketManager.m @@ -0,0 +1,125 @@ +// +// TSSocketManager.m +// TextSecureiOS +// +// Created by Frederic Jacobs on 17/05/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSConstants.h" +#import "TSAccountManager.h" +#import "TSMessagesManager.h" +#import "TSSocketManager.h" +#import "TSStorageManager+keyingMaterial.h" +#import + +#define kWebSocketHeartBeat 15 +#define ddLogLevel LOG_LEVEL_DEBUG + +@interface TSSocketManager () +@property (nonatomic, retain) NSTimer *timer; +@property (nonatomic, retain) SRWebSocket *websocket; +@end + +@implementation TSSocketManager + +- (id)init{ + self = [super init]; + + if (self) { + self.websocket = nil; + } + + return self; +} + ++ (id)sharedManager { + static TSSocketManager *sharedMyManager = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedMyManager = [[self alloc] init]; + }); + return sharedMyManager; +} + +#pragma mark - Manage Socket + ++ (void)becomeActive{ + SRWebSocket *socket =[[self sharedManager] websocket]; + + if (socket) { + switch ([socket readyState]) { + case SR_OPEN: + DDLogVerbose(@"WebSocket already open on connection request"); + return; + case SR_CONNECTING: + DDLogVerbose(@"WebSocket is already connecting"); + return; + default: + [socket close]; + socket.delegate = nil; + socket = nil; + break; + } + } + + NSString *webSocketConnect = [textSecureWebSocketAPI stringByAppendingString:[[self sharedManager] webSocketAuthenticationString]]; + NSURL *webSocketConnectURL = [NSURL URLWithString:webSocketConnect]; + socket = [[SRWebSocket alloc] initWithURL:webSocketConnectURL]; + socket.delegate = [self sharedManager]; + [socket open]; + [[self sharedManager] setWebsocket:socket]; +} + ++ (void)resignActivity{ + SRWebSocket *socket =[[self sharedManager] websocket]; + [socket close]; +} + +#pragma mark - Delegate methods + +- (void) webSocketDidOpen:(SRWebSocket *)webSocket{ + NSLog(@"WebSocket was sucessfully opened"); + self.timer = [NSTimer scheduledTimerWithTimeInterval:kWebSocketHeartBeat target:self selector:@selector(webSocketHeartBeat) userInfo:nil repeats:YES]; +} + +- (void) webSocket:(SRWebSocket *)webSocket didFailWithError:(NSError *)error{ + NSLog(@"Error connecting to socket %@", error); + [self.timer invalidate]; +} + +- (void) webSocket:(SRWebSocket *)webSocket didReceiveMessage:(id)message{ + NSData *data = [message dataUsingEncoding:NSUTF8StringEncoding]; + NSError *error = nil; + + NSDictionary *serializedMessage = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error]; + NSString *base64message = [serializedMessage objectForKey:@"message"]; + + + if (!base64message || error) { + NSLog(@"WTF?!"); + return; + } + + [[TSMessagesManager sharedManager] handleBase64MessageSignal:base64message]; + + + NSString *ackedId = [serializedMessage objectForKey:@"id"]; + [self.websocket send:[[NSString alloc] initWithData:[NSJSONSerialization dataWithJSONObject:@{@"type":@"1", @"id":ackedId} options:0 error:nil] encoding:NSUTF8StringEncoding]]; +} + +- (void)webSocket:(SRWebSocket *)webSocket didCloseWithCode:(NSInteger)code reason:(NSString *)reason wasClean:(BOOL)wasClean{ + DDLogVerbose(@"WebSocket did close"); + [self.timer invalidate]; +} + +- (void)webSocketHeartBeat{ + DDLogVerbose(@"WebSocket sent ping"); + [self.websocket sendPing:nil]; +} + +- (NSString*)webSocketAuthenticationString{ + return [NSString stringWithFormat:@"?login=%@&password=%@", [[TSAccountManager registeredNumber] stringByReplacingOccurrencesOfString:@"+" withString:@"%2B"],[TSStorageManager serverAuthToken]]; +} + +@end diff --git a/Signal/src/textsecure/Security/SecurityUtils.h b/Signal/src/textsecure/Security/SecurityUtils.h new file mode 100644 index 000000000..7eb91c9b9 --- /dev/null +++ b/Signal/src/textsecure/Security/SecurityUtils.h @@ -0,0 +1,15 @@ +// +// SecurityUtils.h +// TextSecureKit +// +// Created by Frederic Jacobs on 28/10/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import + +@interface SecurityUtils : NSObject + ++ (NSData*)generateRandomBytes:(int)numberBytes; + +@end diff --git a/Signal/src/textsecure/Security/SecurityUtils.m b/Signal/src/textsecure/Security/SecurityUtils.m new file mode 100644 index 000000000..369582ddb --- /dev/null +++ b/Signal/src/textsecure/Security/SecurityUtils.m @@ -0,0 +1,24 @@ +// +// SecurityUtils.m +// TextSecureKit +// +// Created by Frederic Jacobs on 28/10/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "SecurityUtils.h" +#import + +@implementation SecurityUtils + ++ (NSData*)generateRandomBytes:(int)numberBytes { + NSMutableData* randomBytes = [NSMutableData dataWithLength:(NSUInteger)numberBytes]; + int err = 0; + err = SecRandomCopyBytes(kSecRandomDefault,(size_t)numberBytes,[randomBytes mutableBytes]); + if(err != noErr) { + @throw [NSException exceptionWithName:@"random problem" reason:@"problem generating the random " userInfo:nil]; + } + return randomBytes; +} + +@end diff --git a/Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+IdentityKeyStore.h b/Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+IdentityKeyStore.h new file mode 100644 index 000000000..65080ed3f --- /dev/null +++ b/Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+IdentityKeyStore.h @@ -0,0 +1,17 @@ +// +// TSStorageManager+IdentityKeyStore.h +// TextSecureKit +// +// Created by Frederic Jacobs on 06/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSStorageManager.h" +#import + +@interface TSStorageManager (IdentityKeyStore) + +- (void)generateNewIdentityKey; +- (NSData*)identityKeyForRecipientId:(NSString*)recipientId; + +@end diff --git a/Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+IdentityKeyStore.m b/Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+IdentityKeyStore.m new file mode 100644 index 000000000..17b852bbf --- /dev/null +++ b/Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+IdentityKeyStore.m @@ -0,0 +1,52 @@ +// +// TSStorageManager+IdentityKeyStore.m +// TextSecureKit +// +// Created by Frederic Jacobs on 06/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSStorageManager+IdentityKeyStore.h" +#import "TSAccountManager.h" + +#import <25519/Curve25519.h> + +#define TSStorageManagerIdentityKeyStoreIdentityKey @"TSStorageManagerIdentityKeyStoreIdentityKey" +#define TSStorageManagerIdentityKeyStoreCollection @"TSStorageManagerIdentityKeyStoreCollection" +#define TSStorageManagerTrustedKeysCollection @"TSStorageManagerTrustedKeysCollection" + + + +@implementation TSStorageManager (IdentityKeyStore) + +- (void)generateNewIdentityKey { + [self setObject:[Curve25519 generateKeyPair] forKey:TSStorageManagerIdentityKeyStoreIdentityKey + inCollection:TSStorageManagerIdentityKeyStoreCollection]; +} + + +- (NSData*)identityKeyForRecipientId:(NSString*)recipientId{ + return [self dataForKey:recipientId inCollection:TSStorageManagerTrustedKeysCollection]; +} + + +- (ECKeyPair*)identityKeyPair { + return [self keyPairForKey:TSStorageManagerIdentityKeyStoreIdentityKey + inCollection:TSStorageManagerIdentityKeyStoreCollection]; +} + +- (int)localRegistrationId { + return [TSAccountManager getOrGenerateRegistrationId]; +} + +- (void)saveRemoteIdentity:(NSData*)identityKey recipientId:(NSString*)recipientId { + [self setObject:identityKey forKey:recipientId inCollection:TSStorageManagerTrustedKeysCollection]; +} + +- (BOOL)isTrustedIdentityKey:(NSData*)identityKey recipientId:(NSString*)recipientId { + NSData *trusted = [self dataForKey:recipientId inCollection:TSStorageManagerTrustedKeysCollection]; + + return (trusted == nil || [trusted isEqualToData:identityKey]); +} + +@end diff --git a/Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+PreKeyStore.h b/Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+PreKeyStore.h new file mode 100644 index 000000000..2ce93e8cf --- /dev/null +++ b/Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+PreKeyStore.h @@ -0,0 +1,18 @@ +// +// TSStorageManager+PreKeyStore.h +// TextSecureKit +// +// Created by Frederic Jacobs on 06/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSStorageManager.h" +#import + +@interface TSStorageManager (PreKeyStore) + +- (NSArray*)generatePreKeyRecords; +- (PreKeyRecord*)getOrGenerateLastResortKey; +- (void)storePreKeyRecords:(NSArray*)preKeyRecords; + +@end diff --git a/Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+PreKeyStore.m b/Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+PreKeyStore.m new file mode 100644 index 000000000..2798b5312 --- /dev/null +++ b/Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+PreKeyStore.m @@ -0,0 +1,89 @@ +// +// TSStorageManager+PreKeyStore.m +// TextSecureKit +// +// Created by Frederic Jacobs on 06/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSStorageManager+PreKeyStore.h" +#import +#import "TSStorageManager+keyFromIntLong.h" + +#define TSStorageManagerPreKeyStoreCollection @"TSStorageManagerPreKeyStoreCollection" +#define TSNextPrekeyIdKey @"TSStorageInternalSettingsNextPreKeyId" +#define BATCH_SIZE 100 +#define MAX_VALUE_LASTRESORT 0xFFFFFF + +@implementation TSStorageManager (PreKeyStore) + +- (PreKeyRecord*)getOrGenerateLastResortKey { + if ([self containsPreKey:MAX_VALUE_LASTRESORT]) { + return [self loadPreKey:MAX_VALUE_LASTRESORT]; + } else{ + PreKeyRecord *lastResort = [[PreKeyRecord alloc] initWithId:MAX_VALUE_LASTRESORT keyPair:[Curve25519 generateKeyPair]]; + [self storePreKey:MAX_VALUE_LASTRESORT preKeyRecord:lastResort]; + return lastResort; + } +} + +- (NSArray*)generatePreKeyRecords { + NSMutableArray *preKeyRecords = [NSMutableArray array]; + + @synchronized(self){ + + int preKeyId = [self nextPreKeyId]; + for (int i = 0; i < BATCH_SIZE; i++) { + ECKeyPair *keyPair = [Curve25519 generateKeyPair]; + PreKeyRecord *record = [[PreKeyRecord alloc] initWithId:preKeyId keyPair:keyPair]; + + [preKeyRecords addObject:record]; + preKeyId++; + } + + [self setInt:preKeyId forKey:TSNextPrekeyIdKey inCollection:TSStorageInternalSettingsCollection]; + } + return preKeyRecords; +} + +- (void)storePreKeyRecords:(NSArray*)preKeyRecords { + for (PreKeyRecord *record in preKeyRecords) { + [self setObject:record forKey:[self keyFromInt:record.Id] inCollection:TSStorageManagerPreKeyStoreCollection]; + } +} + +- (PreKeyRecord*)loadPreKey:(int)preKeyId { + PreKeyRecord *preKeyRecord = [self preKeyRecordForKey:[self keyFromInt:preKeyId] inCollection:TSStorageManagerPreKeyStoreCollection]; + + if (!preKeyRecord) { + @throw [NSException exceptionWithName:InvalidKeyIdException reason:@"No key found matching key id" userInfo:@{}]; + } else { + return preKeyRecord; + } +} + +- (void)storePreKey:(int)preKeyId preKeyRecord:(PreKeyRecord*)record { + [self setObject:record forKey:[self keyFromInt:preKeyId] inCollection:TSStorageManagerPreKeyStoreCollection]; +} + +- (BOOL)containsPreKey:(int)preKeyId { + PreKeyRecord *preKeyRecord = [self preKeyRecordForKey:[self keyFromInt:preKeyId] + inCollection:TSStorageManagerPreKeyStoreCollection]; + return (preKeyRecord != nil); +} + +- (void)removePreKey:(int)preKeyId { + [self removeObjectForKey:[self keyFromInt:preKeyId] inCollection:TSStorageManagerPreKeyStoreCollection]; +} + +- (int)nextPreKeyId { + int lastPreKeyId = [self intForKey:TSNextPrekeyIdKey inCollection:TSStorageInternalSettingsCollection]; + + while (lastPreKeyId < 1 || (lastPreKeyId > (MAX_VALUE_LASTRESORT - BATCH_SIZE))) { + lastPreKeyId = rand(); + } + + return lastPreKeyId; +} + +@end diff --git a/Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+SessionStore.h b/Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+SessionStore.h new file mode 100644 index 000000000..d6a2a8e0c --- /dev/null +++ b/Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+SessionStore.h @@ -0,0 +1,14 @@ +// +// TSStorageManager+SessionStore.h +// TextSecureKit +// +// Created by Frederic Jacobs on 06/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSStorageManager.h" +#import + +@interface TSStorageManager (SessionStore) + +@end diff --git a/Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+SessionStore.m b/Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+SessionStore.m new file mode 100644 index 000000000..7814e5f4e --- /dev/null +++ b/Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+SessionStore.m @@ -0,0 +1,89 @@ +// +// TSStorageManager+SessionStore.m +// TextSecureKit +// +// Created by Frederic Jacobs on 06/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSStorageManager+SessionStore.h" + +#define TSStorageManagerSessionStoreCollection @"TSStorageManagerSessionStoreCollection" + +@implementation TSStorageManager (SessionStore) + +- (SessionRecord*)loadSession:(NSString*)contactIdentifier deviceId:(int)deviceId { + NSDictionary *dictionary = [self dictionaryForKey:contactIdentifier + inCollection:TSStorageManagerSessionStoreCollection]; + + SessionRecord *record; + + if (dictionary) { + record = [dictionary objectForKey:[self keyForInt:deviceId]]; + } + + if (!record) { + return [SessionRecord new]; + } + + return record; +} + +- (NSArray*)subDevicesSessions:(NSString*)contactIdentifier { + NSDictionary *dictionary = [self objectForKey:contactIdentifier inCollection:TSStorageManagerSessionStoreCollection]; + + NSMutableArray *subDevicesSessions = [NSMutableArray array]; + + if (dictionary) { + for (NSString *key in [dictionary allKeys]) { + NSNumber *number = @([key doubleValue]); + + [subDevicesSessions addObject:number]; + } + } + + return subDevicesSessions; +} + +- (void)storeSession:(NSString*)contactIdentifier deviceId:(int)deviceId session:(SessionRecord*)session { + NSMutableDictionary *dictionary = [[self dictionaryForKey:contactIdentifier + inCollection:TSStorageManagerSessionStoreCollection] mutableCopy]; + + if (!dictionary) { + dictionary = [NSMutableDictionary dictionary]; + } + + [dictionary setObject:session forKey:[self keyForInt:deviceId]]; + + [self setObject:dictionary forKey:contactIdentifier + inCollection:TSStorageManagerSessionStoreCollection]; +} + +- (BOOL)containsSession:(NSString*)contactIdentifier deviceId:(int)deviceId { + return [self loadSession:contactIdentifier deviceId:deviceId].sessionState.hasSenderChain; +} + +- (void)deleteSessionForContact:(NSString*)contactIdentifier deviceId:(int)deviceId { + NSMutableDictionary *dictionary = [[self dictionaryForKey:contactIdentifier + inCollection:TSStorageManagerSessionStoreCollection] mutableCopy]; + + if (!dictionary) { + dictionary = [NSMutableDictionary dictionary]; + } + + [dictionary removeObjectForKey:[self keyForInt:deviceId]]; + + [self setObject:dictionary forKey:contactIdentifier + inCollection:TSStorageManagerSessionStoreCollection]; +} + +- (void)deleteAllSessionsForContact:(NSString*)contactIdentifier { + [self removeObjectForKey:contactIdentifier + inCollection:TSStorageManagerSessionStoreCollection]; +} + +- (NSNumber*)keyForInt:(int)number { + return [NSNumber numberWithInt:number]; +} + +@end diff --git a/Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+SignedPreKeyStore.h b/Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+SignedPreKeyStore.h new file mode 100644 index 000000000..9baa54513 --- /dev/null +++ b/Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+SignedPreKeyStore.h @@ -0,0 +1,16 @@ +// +// TSStorageManager+SignedPreKeyStore.h +// TextSecureKit +// +// Created by Frederic Jacobs on 06/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSStorageManager.h" +#import + +@interface TSStorageManager (SignedPreKeyStore) + +- (SignedPreKeyRecord*)generateRandomSignedRecord; + +@end diff --git a/Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+SignedPreKeyStore.m b/Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+SignedPreKeyStore.m new file mode 100644 index 000000000..75364a727 --- /dev/null +++ b/Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+SignedPreKeyStore.m @@ -0,0 +1,68 @@ +// +// TSStorageManager+SignedPreKeyStore.m +// TextSecureKit +// +// Created by Frederic Jacobs on 06/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// +#import "TSStorageManager+IdentityKeyStore.h" +#import "TSStorageManager+SignedPreKeyStore.h" +#import +#import <25519/Ed25519.h> +#import +#import "TSStorageManager+keyFromIntLong.h" + +#define TSStorageManagerSignedPreKeyStoreCollection @"TSStorageManagerSignedPreKeyStoreCollection" + +@implementation TSStorageManager (SignedPreKeyStore) + +- (SignedPreKeyRecord*)generateRandomSignedRecord { + ECKeyPair *keyPair = [Curve25519 generateKeyPair]; + return [[SignedPreKeyRecord alloc] initWithId:rand() keyPair:keyPair signature:[Ed25519 sign:keyPair.publicKey.prependKeyType withKeyPair:[self identityKeyPair]] generatedAt:[NSDate date]]; +} + +- (SignedPreKeyRecord*)loadSignedPrekey:(int)signedPreKeyId { + SignedPreKeyRecord *preKeyRecord = [self signedPreKeyRecordForKey:[self keyFromInt:signedPreKeyId] + inCollection:TSStorageManagerSignedPreKeyStoreCollection]; + + if (!preKeyRecord) { + @throw [NSException exceptionWithName:InvalidKeyIdException + reason:@"No key found matching key id" + userInfo:@{}]; + } else { + return preKeyRecord; + } +} + +- (NSArray*)loadSignedPreKeys { + NSMutableArray *signedPreKeyRecords = [NSMutableArray array]; + + YapDatabaseConnection *conn = [self databaseConnection]; + + [conn readWithBlock:^(YapDatabaseReadTransaction *transaction) { + [transaction enumerateRowsInCollection:TSStorageManagerSignedPreKeyStoreCollection + usingBlock:^(NSString *key, id object, id metadata, BOOL *stop) { + [signedPreKeyRecords addObject:object]; + }]; + }]; + + return signedPreKeyRecords; +} + +- (void)storeSignedPreKey:(int)signedPreKeyId signedPreKeyRecord:(SignedPreKeyRecord*)signedPreKeyRecord { + [self setObject:signedPreKeyRecord forKey:[self keyFromInt:signedPreKeyId] + inCollection:TSStorageManagerSignedPreKeyStoreCollection]; +} + +- (BOOL)containsSignedPreKey:(int)signedPreKeyId { + PreKeyRecord *preKeyRecord = [self signedPreKeyRecordForKey:[self keyFromInt:signedPreKeyId] + inCollection:TSStorageManagerSignedPreKeyStoreCollection]; + return (preKeyRecord != nil); +} + +- (void)removeSignedPreKey:(int)signedPrekeyId { + [self removeObjectForKey:[self keyFromInt:signedPrekeyId] + inCollection:TSStorageManagerSignedPreKeyStoreCollection]; +} + +@end diff --git a/Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+keyFromIntLong.h b/Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+keyFromIntLong.h new file mode 100644 index 000000000..6a44339bc --- /dev/null +++ b/Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+keyFromIntLong.h @@ -0,0 +1,15 @@ +// +// TSStorageManager+keyFromIntLong.h +// TextSecureKit +// +// Created by Frederic Jacobs on 08/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSStorageManager.h" + +@interface TSStorageManager (keyFromIntLong) + +- (NSString*)keyFromInt:(int)integer; + +@end diff --git a/Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+keyFromIntLong.m b/Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+keyFromIntLong.m new file mode 100644 index 000000000..6bf2eb5f3 --- /dev/null +++ b/Signal/src/textsecure/Storage/AxolotlStore/TSStorageManager+keyFromIntLong.m @@ -0,0 +1,17 @@ +// +// TSStorageManager+keyFromIntLong.m +// TextSecureKit +// +// Created by Frederic Jacobs on 08/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSStorageManager+keyFromIntLong.h" + +@implementation TSStorageManager (keyFromIntLong) + +- (NSString*)keyFromInt:(int)integer { + return [[NSNumber numberWithInteger:integer] stringValue]; +} + +@end diff --git a/Signal/src/textsecure/Storage/TSDatabaseView.h b/Signal/src/textsecure/Storage/TSDatabaseView.h new file mode 100644 index 000000000..833311ff7 --- /dev/null +++ b/Signal/src/textsecure/Storage/TSDatabaseView.h @@ -0,0 +1,13 @@ +// +// TSDatabaseView.h +// TextSecureKit +// +// Created by Frederic Jacobs on 17/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import + +@interface TSDatabaseView : NSObject + +@end diff --git a/Signal/src/textsecure/Storage/TSDatabaseView.m b/Signal/src/textsecure/Storage/TSDatabaseView.m new file mode 100644 index 000000000..a1e03be9e --- /dev/null +++ b/Signal/src/textsecure/Storage/TSDatabaseView.m @@ -0,0 +1,100 @@ +// +// TSDatabaseView.m +// TextSecureKit +// +// Created by Frederic Jacobs on 17/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSDatabaseView.h" + +#import + +#import "TSThread.h" +#import "TSStorageManager.h" +#import "TSInteraction.h" + +NSString *TSThreadGroup = @"TSThreadGroup"; + +NSString *TSThreadDatabaseViewExtensionName = @"TSThreadDatabaseViewExtensionName"; +NSString *TSMessageDatabaseViewExtensionName = @"TSMessageDatabaseViewExtensionName"; + +@implementation TSDatabaseView + ++ (BOOL)registerThreadDatabaseView{ + YapDatabaseView *threadView = [[TSStorageManager sharedManager].database registeredExtension:TSThreadDatabaseViewExtensionName]; + if (threadView) { + return YES; + } + + YapDatabaseViewGrouping *viewGrouping = [YapDatabaseViewGrouping withObjectBlock:^NSString *(NSString *collection, NSString *key, id object) { + if ([object isKindOfClass:[TSThread class]]){ + TSThread *thread = (TSThread*)object; + if (thread.lastMessageDate) { + return TSThreadGroup; + } + } + return nil; + }]; + + YapDatabaseViewSorting *viewSorting = [YapDatabaseViewSorting withObjectBlock:^NSComparisonResult(NSString *group, NSString *collection1, NSString *key1, id object1, NSString *collection2, NSString *key2, id object2) { + if ([group isEqualToString:TSThreadGroup]) { + if ([object1 isKindOfClass:[TSThread class]] && [object2 isKindOfClass:[TSThread class]]){ + TSThread *thread1 = (TSThread*)object1; + TSThread *thread2 = (TSThread*)object2; + + return [thread2.lastMessageDate compare:thread1.lastMessageDate]; + } + } + return NSOrderedSame; + }]; + + YapDatabaseViewOptions *options = [[YapDatabaseViewOptions alloc] init]; + options.isPersistent = YES; + options.allowedCollections = [[YapWhitelistBlacklist alloc] initWithWhitelist:[NSSet setWithObject:[TSThread collection]]]; + + YapDatabaseView *databaseView = [[YapDatabaseView alloc] initWithGrouping:viewGrouping + sorting:viewSorting + versionTag:@"1" + options:options]; + + return [[TSStorageManager sharedManager].database registerExtension:databaseView withName:TSThreadDatabaseViewExtensionName]; +} + ++ (BOOL)registerBuddyConversationDatabaseView{ + if ([[TSStorageManager sharedManager].database registeredExtension:TSMessageDatabaseViewExtensionName]) { + return YES; + } + + YapDatabaseViewGrouping *viewGrouping = [YapDatabaseViewGrouping withObjectBlock:^NSString *(NSString *collection, NSString *key, id object) { + if ([object isKindOfClass:[TSInteraction class]]){ + return ((TSInteraction *)object).uniqueThreadId; + } + return nil; + }]; + + YapDatabaseViewSorting *viewSorting = [YapDatabaseViewSorting withObjectBlock:^NSComparisonResult(NSString *group, NSString *collection1, NSString *key1, id object1, NSString *collection2, NSString *key2, id object2) { + + if ([object1 isKindOfClass:[TSInteraction class]] && [object2 isKindOfClass:[TSInteraction class]]) { + TSInteraction *message1 = (TSInteraction*)object1; + TSInteraction *message2 = (TSInteraction*)object2; + + return [message1.date compare:message2.date]; + } + + return NSOrderedSame; + }]; + + YapDatabaseViewOptions *options = [[YapDatabaseViewOptions alloc] init]; + options.isPersistent = YES; + options.allowedCollections = [[YapWhitelistBlacklist alloc] initWithWhitelist:[NSSet setWithObject:[TSInteraction collection]]]; + + YapDatabaseView *view = [[YapDatabaseView alloc] initWithGrouping:viewGrouping + sorting:viewSorting + versionTag:@"1" + options:options]; + + return [[TSStorageManager sharedManager].database registerExtension:view withName:TSMessageDatabaseViewExtensionName]; +} + +@end diff --git a/Signal/src/textsecure/Storage/TSStorageKeys.h b/Signal/src/textsecure/Storage/TSStorageKeys.h new file mode 100644 index 000000000..524423f8c --- /dev/null +++ b/Signal/src/textsecure/Storage/TSStorageKeys.h @@ -0,0 +1,40 @@ +// +// TSStorageKeys.h +// TextSecureKit +// +// Created by Frederic Jacobs on 28/10/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#ifndef TextSecureKit_TSStorageKeys_h +#define TextSecureKit_TSStorageKeys_h + +#pragma mark User Account Keys + +#define TSStorageUserAccountCollection @"TSStorageUserAccountCollection" + +#define TSStorageRegisteredNumberKey @"TSStorageRegisteredNumberKey" +#define TSStorageServerAuthToken @"TSStorageServerAuthToken" +#define TSStorageServerSignalingKey @"TSStorageServerSignalingKey" +#define TSStorageLocalRegistrationId @"TSStorageLocalRegistrationId" + +/** + * Preferences exposed to the user + */ + +#pragma mark User Preferences + +#define TSStorageUserPreferencesCollection @"TSStorageUserPreferencesCollection" + + +/** + * Internal settings of the application, not exposed to the user. + */ + +#pragma mark Internal Settings + +#define TSStorageInternalSettingsCollection @"TSStorageInternalSettingsCollection" +#define TSStorageIsRegistered @"TSStorageIsRegistered" +#define TSStorageInternalSettingsVersion @"TSLastLaunchedVersion" + +#endif diff --git a/Signal/src/textsecure/Storage/TSStorageManager+keyingMaterial.h b/Signal/src/textsecure/Storage/TSStorageManager+keyingMaterial.h new file mode 100644 index 000000000..87143fc62 --- /dev/null +++ b/Signal/src/textsecure/Storage/TSStorageManager+keyingMaterial.h @@ -0,0 +1,33 @@ +// +// TSStorageManager+keyingMaterial.h +// TextSecureKit +// +// Created by Frederic Jacobs on 06/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSStorageManager.h" + +@interface TSStorageManager (keyingMaterial) + +#pragma mark Server Credentials + +/** + * The server signaling key that's used to encrypt push payloads + * + * @return signaling key + */ + ++ (NSString*)signalingKey; + +/** + * The server auth token allows the TextSecure client to connect to the server + * + * @return server authentication token + */ + ++ (NSString*)serverAuthToken; + ++ (void)storeServerToken:(NSString*)authToken signalingKey:(NSString*)signalingKey phoneNumber:(NSString*)phoneNumber; + +@end diff --git a/Signal/src/textsecure/Storage/TSStorageManager+keyingMaterial.m b/Signal/src/textsecure/Storage/TSStorageManager+keyingMaterial.m new file mode 100644 index 000000000..49c9c2002 --- /dev/null +++ b/Signal/src/textsecure/Storage/TSStorageManager+keyingMaterial.m @@ -0,0 +1,34 @@ +// +// TSStorageManager+keyingMaterial.m +// TextSecureKit +// +// Created by Frederic Jacobs on 06/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSStorageManager+keyingMaterial.h" + +@implementation TSStorageManager (keyingMaterial) + + ++ (NSString*)signalingKey{ + return [[self sharedManager] stringForKey:TSStorageServerSignalingKey + inCollection:TSStorageUserAccountCollection]; +} + ++ (NSString*)serverAuthToken{ + return [[self sharedManager] stringForKey:TSStorageServerAuthToken + inCollection:TSStorageUserAccountCollection]; +} + ++ (void)storeServerToken:(NSString*)authToken signalingKey:(NSString*)signalingKey phoneNumber:(NSString*)phoneNumber { + YapDatabaseConnection *dbConn = [[self sharedManager] databaseConnection]; + + [dbConn readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) { + [transaction setObject:authToken forKey:TSStorageServerAuthToken inCollection:TSStorageUserAccountCollection]; + [transaction setObject:signalingKey forKey:TSStorageServerSignalingKey inCollection:TSStorageUserAccountCollection]; + [transaction setObject:phoneNumber forKey:TSStorageRegisteredNumberKey inCollection:TSStorageUserAccountCollection]; + }]; +} + +@end diff --git a/Signal/src/textsecure/Storage/TSStorageManager.h b/Signal/src/textsecure/Storage/TSStorageManager.h new file mode 100644 index 000000000..af26df20e --- /dev/null +++ b/Signal/src/textsecure/Storage/TSStorageManager.h @@ -0,0 +1,41 @@ +// +// TSStorageManager.h +// TextSecureKit +// +// Created by Frederic Jacobs on 27/10/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSStorageKeys.h" + +#import +#import + +@class ECKeyPair; +@class PreKeyRecord; +@class SignedPreKeyRecord; + +@interface TSStorageManager : NSObject + ++ (instancetype)sharedManager; + +- (YapDatabase*)database; +- (YapDatabaseConnection*)databaseConnection; + +- (void)setObject:(id)object forKey:(NSString*)key inCollection:(NSString*)collection; +- (void)removeObjectForKey:(NSString*)string inCollection:(NSString *)collection; + + +- (BOOL)boolForKey:(NSString*)key inCollection:(NSString*)collection; +- (int)intForKey:(NSString*)key inCollection:(NSString*)collection; +- (void)setInt:(int)integer forKey:(NSString*)key inCollection:(NSString*)collection; +- (id)objectForKey:(NSString*)key inCollection:(NSString *)collection; +- (NSDictionary*)dictionaryForKey:(NSString*)key inCollection:(NSString *)collection; +- (NSString*)stringForKey:(NSString*)key inCollection:(NSString*)collection; +- (NSData*)dataForKey:(NSString*)key inCollection:(NSString*)collection; +- (ECKeyPair*)keyPairForKey:(NSString*)key inCollection:(NSString*)collection; +- (PreKeyRecord*)preKeyRecordForKey:(NSString*)key inCollection:(NSString*)collection; +- (SignedPreKeyRecord*)signedPreKeyRecordForKey:(NSString*)key inCollection:(NSString*)collection; +- (void)purgeCollection:(NSString*)collection; + +@end diff --git a/Signal/src/textsecure/Storage/TSStorageManager.m b/Signal/src/textsecure/Storage/TSStorageManager.m new file mode 100644 index 000000000..1bc41ab17 --- /dev/null +++ b/Signal/src/textsecure/Storage/TSStorageManager.m @@ -0,0 +1,221 @@ +// +// TSStorageManager.m +// TextSecureKit +// +// Created by Frederic Jacobs on 27/10/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSStorageManager.h" +#import +#import +#import +#import "CryptoTools.h" +#import "NSData+Base64.h" + +static const NSString *const databaseName = @"Signal.sqlite"; +static NSString * keychainService = @"TSKeyChainService"; +static NSString * keychainDBPassAccount = @"TSDatabasePass"; + +@interface TSStorageManager () + +@property YapDatabase *database; + +@end + +@implementation TSStorageManager + ++ (instancetype)sharedManager { + static TSStorageManager *sharedMyManager = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedMyManager = [[self alloc] init]; + }); + return sharedMyManager; +} + +- (BOOL)userSetPassword { + return FALSE; +} + +- (BOOL)dbExists { + return [[NSFileManager defaultManager] fileExistsAtPath:[self dbPath]]; +} + +- (NSString*)dbPath { + + NSString *databasePath; + + NSFileManager* fileManager = [NSFileManager defaultManager]; +#if TARGET_OS_IPHONE + NSURL *fileURL = [[fileManager URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]; + NSString *path = [fileURL path]; + databasePath = [path stringByAppendingFormat:@"/%@", databaseName]; +#elif TARGET_OS_MAC + + NSString* bundleID = [[NSBundle mainBundle] bundleIdentifier]; + NSArray* urlPaths = [fileManager URLsForDirectory:NSApplicationSupportDirectory + inDomains:NSUserDomainMask]; + + NSURL* appDirectory = [[urlPaths objectAtIndex:0] URLByAppendingPathComponent:bundleID isDirectory:YES]; + + if (![fileManager fileExistsAtPath:[appDirectory path]]) { + [fileManager createDirectoryAtURL:appDirectory withIntermediateDirectories:NO attributes:nil error:nil]; + } + + databasePath = [appDirectory.filePathURL.absoluteString stringByAppendingFormat:@"/%@", databaseName]; +#endif + + return databasePath; +} + +- (NSString*)databasePassword { + NSString *dbPassword = [UICKeyChainStore stringForKey:keychainDBPassAccount]; + + if (!dbPassword) { + dbPassword = [[CryptoTools generateSecureRandomData:30] base64EncodedString]; + [UICKeyChainStore setString:dbPassword forKey:keychainDBPassAccount]; + } + + return dbPassword; +} + +- (instancetype)init { + self = [super init]; + + if (self) { + self.database = [self newDatabaseInit]; + } + + return self; +} + +- (YapDatabase*)newDatabaseInit{ + YapDatabaseOptions *options = [[YapDatabaseOptions alloc] init]; + options.corruptAction = YapDatabaseCorruptAction_Fail; + options.passphraseBlock = ^{ + return [self databasePassword]; + }; + + return [[YapDatabase alloc] initWithPath:[self dbPath] + objectSerializer:NULL + objectDeserializer:NULL + metadataSerializer:NULL + metadataDeserializer:NULL + objectSanitizer:NULL + metadataSanitizer:NULL + options:options]; + + +} + +- (YapDatabaseConnection *)databaseConnection { + return self.database.newConnection; +} + +#pragma mark convenience methods + +- (void)purgeCollection:(NSString*)collection { + YapDatabaseConnection *dbConn = [self databaseConnection]; + + [dbConn readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) { + [transaction removeAllObjectsInCollection:collection]; + }]; +} + +- (void)setObject:(id)object forKey:(NSString*)key inCollection:(NSString*)collection { + YapDatabaseConnection *dbConn = [self databaseConnection]; + + [dbConn readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) { + [transaction setObject:object forKey:key inCollection:collection]; + }]; +} + +- (void)removeObjectForKey:(NSString*)string inCollection:(NSString *)collection{ + YapDatabaseConnection *dbConn = [self databaseConnection]; + + [dbConn readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) { + [transaction removeObjectForKey:string inCollection:collection]; + }]; +} + +- (id)objectForKey:(NSString*)key inCollection:(NSString *)collection { + YapDatabaseConnection *dbConn = [self databaseConnection]; + __block NSString *object; + + [dbConn readWithBlock:^(YapDatabaseReadTransaction *transaction) { + object = [transaction objectForKey:key inCollection:collection]; + }]; + + return object; +} + +- (NSDictionary*)dictionaryForKey:(NSString*)key inCollection:(NSString *)collection { + YapDatabaseConnection *dbConn = [self databaseConnection]; + __block NSDictionary *object; + + [dbConn readWithBlock:^(YapDatabaseReadTransaction *transaction) { + object = [transaction objectForKey:key inCollection:collection]; + }]; + + return object; +} + +- (NSString*)stringForKey:(NSString*)key inCollection:(NSString*)collection { + NSString *string = [self objectForKey:key inCollection:collection]; + + return string; +} + +- (BOOL)boolForKey:(NSString*)key inCollection:(NSString*)collection { + NSNumber *boolNum = [self objectForKey:key inCollection:collection]; + + return [boolNum boolValue]; +} + +- (NSData*)dataForKey:(NSString*)key inCollection:(NSString*)collection { + NSData *data = [self objectForKey:key inCollection:collection]; + return data; +} + +- (ECKeyPair*)keyPairForKey:(NSString*)key inCollection:(NSString*)collection { + ECKeyPair *keyPair = [self objectForKey:key inCollection:collection]; + + return keyPair; +} + +- (PreKeyRecord*)preKeyRecordForKey:(NSString*)key inCollection:(NSString*)collection { + PreKeyRecord *preKeyRecord = [self objectForKey:key inCollection:collection]; + + return preKeyRecord; +} + +- (SignedPreKeyRecord*)signedPreKeyRecordForKey:(NSString*)key inCollection:(NSString*)collection { + SignedPreKeyRecord *preKeyRecord = [self objectForKey:key inCollection:collection]; + + return preKeyRecord; +} + +- (int)intForKey:(NSString*)key inCollection:(NSString*)collection { + int integer = [[self objectForKey:key inCollection:collection] intValue]; + + return integer; +} + +- (void)setInt:(int)integer forKey:(NSString*)key inCollection:(NSString*)collection { + [self setObject:[NSNumber numberWithInt:integer] forKey:key inCollection:collection]; +} + +- (void)wipe{ + self.database = nil; + NSError *error; + [[NSFileManager defaultManager] removeItemAtPath:[self dbPath] error:&error]; + + if (error) { + DDLogError(@"Failed to delete database: %@", error.description); + } + + self.database = [self newDatabaseInit]; +} + +@end diff --git a/Signal/src/textsecure/Storage/TSYapDatabaseObject.h b/Signal/src/textsecure/Storage/TSYapDatabaseObject.h new file mode 100644 index 000000000..0945b6e4a --- /dev/null +++ b/Signal/src/textsecure/Storage/TSYapDatabaseObject.h @@ -0,0 +1,73 @@ +// +// TSYapDatabaseObject.h +// TextSecureKit +// +// Created by Frederic Jacobs on 16/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import + +#import "YapDatabaseRelationshipNode.h" +#import "YapDatabaseTransaction.h" +#import + +@interface TSYapDatabaseObject : MTLModel + +/** + * Initializes a new database object with a unique identifier + * + * @param uniqueId Key used for the key-value store + * + * @return Initialized object + */ + +- (instancetype)initWithUniqueId:(NSString*)uniqueId; + +/** + * Returns the collection to which the object belongs. + * + * @return Key (string) identifying the collection + */ + ++ (NSString*)collection; + +/** + * Fetches the object with the provided identifier + * + * @param uniqueID Unique identifier of the entry in a collection + * @param transaction Transaction used for fetching the object + * + * @return Returns and instance of the object or nil if non-existent + */ + ++ (instancetype)fetchObjectWithUniqueID:(NSString*)uniqueID transaction:(YapDatabaseReadTransaction*)transaction; + ++ (instancetype) fetchObjectWithUniqueID:(NSString *)uniqueID; + +/** + * Saves the object with a new YapDatabaseConnection + */ + +- (void)save; + +/** + * Saves the object with the provided transaction + * + * @param transaction Database transaction + */ + +- (void)saveWithTransaction:(YapDatabaseReadWriteTransaction*)transaction; + + +/** + * The unique identifier of the stored object + */ + +@property (nonatomic, readonly) NSString *uniqueId; + + +- (void)removeWithTransaction:(YapDatabaseReadWriteTransaction*)transaction; +- (void)remove; + +@end diff --git a/Signal/src/textsecure/Storage/TSYapDatabaseObject.m b/Signal/src/textsecure/Storage/TSYapDatabaseObject.m new file mode 100644 index 000000000..4ed440fc6 --- /dev/null +++ b/Signal/src/textsecure/Storage/TSYapDatabaseObject.m @@ -0,0 +1,72 @@ +// +// TSYapDatabaseObject.m +// TextSecureKit +// +// Created by Frederic Jacobs on 16/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSYapDatabaseObject.h" +#import "TSStorageManager.h" + +@implementation TSYapDatabaseObject + +- (id)init{ + if (self = [super init]) + { + _uniqueId = [[NSUUID UUID] UUIDString]; + } + return self; +} + +- (instancetype)initWithUniqueId:(NSString *)uniqueId{ + if (self = [super init]) { + _uniqueId = uniqueId; + } + return self; +} + +- (void)saveWithTransaction:(YapDatabaseReadWriteTransaction *)transaction{ + [transaction setObject:self forKey:self.uniqueId inCollection:[[self class] collection]]; +} + +- (void)save{ + [[TSStorageManager sharedManager].databaseConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) { + [self saveWithTransaction:transaction]; + }]; +} + +- (void)removeWithTransaction:(YapDatabaseReadWriteTransaction *)transaction +{ + [transaction removeObjectForKey:self.uniqueId inCollection:[[self class] collection]]; +} + + +- (void)remove{ + [[TSStorageManager sharedManager].databaseConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) { + [self removeWithTransaction:transaction]; + }]; +} + + +#pragma - mark Class Methods + ++ (NSString *)collection{ + return NSStringFromClass([self class]); +} + ++ (instancetype) fetchObjectWithUniqueID:(NSString *)uniqueID transaction:(YapDatabaseReadTransaction *)transaction { + return [transaction objectForKey:uniqueID inCollection:[self collection]]; +} + ++ (instancetype) fetchObjectWithUniqueID:(NSString *)uniqueID{ + __block id object; + + [[TSStorageManager sharedManager].databaseConnection readWithBlock:^(YapDatabaseReadTransaction *transaction) { + object = [transaction objectForKey:uniqueID inCollection:[self collection]]; + }]; + + return object; +} + +@end diff --git a/Signal/src/textsecure/TSConstants.h b/Signal/src/textsecure/TSConstants.h new file mode 100644 index 000000000..005ab0759 --- /dev/null +++ b/Signal/src/textsecure/TSConstants.h @@ -0,0 +1,57 @@ +// +// Constants.h +// TextSecureKit +// +// Created by Frederic Jacobs on 28/10/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import +@class TSNumberVerifier; + +#ifndef TextSecureKit_Constants_h +#define TextSecureKit_Constants_h + +typedef NS_ENUM(NSInteger, TSWhisperMessageType) { + TSUnknownMessageType =0, + TSEncryptedWhisperMessageType = 1, + TSIgnoreOnIOSWhisperMessageType=2, // on droid this is the prekey bundle message irrelevant for us + TSPreKeyWhisperMessageType = 3, + TSUnencryptedWhisperMessageType = 4, +}; + +typedef enum { + kSMSVerification, + kPhoneNumberVerification +} VerificationTransportType; + +#pragma mark Server Address + +#define textSecureHTTPTimeOut 10 + +#define textSecureWebSocketAPI @"wss://textsecure-service.whispersystems.org/v1/websocket/" +#define textSecureServerURL @"https://textsecure-service.whispersystems.org/" + +#define textSecureGeneralAPI @"v1" +#define textSecureAccountsAPI @"v1/accounts" +#define textSecureMessagesAPI @"v1/messages/" +#define textSecureKeysAPI @"v2/keys" +#define textSecureDirectoryAPI @"v1/directory" +#define textSecureAttachmentsAPI @"v1/attachments" + +typedef void(^successCompletionBlock)(void); +typedef void(^failedRegistrationRequestBlock)(void); + + +#pragma mark Push RegistrationSpecific Constants +typedef NS_ENUM(NSInteger, TSPushRegistrationError){ + TSPushRegistrationErrorNetwork, + TSPushRegistrationErrorAuthentication, + TSPushRegistrationErrorRequest +}; + +typedef void(^failedPushRegistrationRequestBlock)(TSPushRegistrationError error); + + + +#endif diff --git a/Signal/src/textsecure/Util/Cryptography.h b/Signal/src/textsecure/Util/Cryptography.h new file mode 100755 index 000000000..a875a7675 --- /dev/null +++ b/Signal/src/textsecure/Util/Cryptography.h @@ -0,0 +1,37 @@ +// +// Cryptography.h +// TextSecureiOS +// +// Created by Christine Corbett Moran on 3/26/13. +// Copyright (c) 2013 Open Whisper Systems. All rights reserved. +// + +#import + +@interface Cryptography : NSObject + +typedef NS_ENUM(NSInteger, TSMACType) { + TSHMACSHA1Truncated10Bytes = 1, + TSHMACSHA256Truncated10Bytes = 2 +}; + ++(NSMutableData*) generateRandomBytes:(int)numberBytes; + +#pragma mark SHA and HMAC methods + ++(NSData*) computeSHA256:(NSData *)data truncatedToBytes:(int)truncatedBytes; ++(NSString*)truncatedSHA1Base64EncodedWithoutPadding:(NSString*)string; ++(NSString*)computeSHA1DigestForString:(NSString*)input; + ++(NSData*) computeSHA256HMAC:(NSData*)dataToHMAC withHMACKey:(NSData*)HMACKey; ++(NSData*) computeSHA1HMAC:(NSData*)dataToHMAC withHMACKey:(NSData*)HMACKey; ++(NSData*) truncatedSHA1HMAC:(NSData*)dataToHMAC withHMACKey:(NSData*)HMACKey truncation:(int)bytes; + ++(NSData*) decryptAppleMessagePayload:(NSData*)payload withSignalingKey:(NSString*)signalingKeyString; + +#pragma mark encrypt and decrypt attachment data ++(NSData*) decryptAttachment:(NSData*)dataToDecrypt withKey:(NSData*)key ; ++(NSData*) encryptAttachment:(NSData*)attachment withRandomKey:(NSData**)key; + + +@end diff --git a/Signal/src/textsecure/Util/Cryptography.m b/Signal/src/textsecure/Util/Cryptography.m new file mode 100755 index 000000000..789e11303 --- /dev/null +++ b/Signal/src/textsecure/Util/Cryptography.m @@ -0,0 +1,255 @@ +// +// Cryptography.m +// TextSecureiOS +// +// Created by Christine Corbett Moran on 3/26/13. +// Copyright (c) 2013 Open Whisper Systems. All rights reserved. +// + +#import "Cryptography.h" +#import +#import +#import + +#include "NSData+Base64.h" + + +@implementation Cryptography + + +#pragma mark random bytes methods ++(NSMutableData*) generateRandomBytes:(int)numberBytes { + /* used to generate db master key, and to generate signaling key, both at install */ + NSMutableData* randomBytes = [NSMutableData dataWithLength:numberBytes]; + int err = 0; + err = SecRandomCopyBytes(kSecRandomDefault,numberBytes,[randomBytes mutableBytes]); + if(err != noErr) { + @throw [NSException exceptionWithName:@"random problem" reason:@"problem generating the random " userInfo:nil]; + } + return randomBytes; +} + + + + +#pragma mark SHA1 + ++(NSString*)truncatedSHA1Base64EncodedWithoutPadding:(NSString*)string{ + /* used by TSContactManager to send hashed/truncated contact list to server */ + NSMutableData *hashData = [NSMutableData dataWithLength:20]; + + CC_SHA1([string dataUsingEncoding:NSUTF8StringEncoding].bytes, + (unsigned int)[string dataUsingEncoding:NSUTF8StringEncoding].length, + hashData.mutableBytes); + + NSData *truncatedData = [hashData subdataWithRange:NSMakeRange(0, 10)]; + + return [[truncatedData base64EncodedString] stringByReplacingOccurrencesOfString:@"=" withString:@""]; +} + ++ (NSString*)computeSHA1DigestForString:(NSString*)input { + // Here we are taking in our string hash, placing that inside of a C Char Array, then parsing it through the SHA1 encryption method. + const char *cstr = [input cStringUsingEncoding:NSUTF8StringEncoding]; + NSData *data = [NSData dataWithBytes:cstr length:input.length]; + uint8_t digest[CC_SHA1_DIGEST_LENGTH]; + + CC_SHA1(data.bytes, (unsigned int)data.length, digest); + + NSMutableString* output = [NSMutableString stringWithCapacity:CC_SHA1_DIGEST_LENGTH * 2]; + + for(int i = 0; i < CC_SHA1_DIGEST_LENGTH; i++) { + [output appendFormat:@"%02x", digest[i]]; + } + + return output; +} + +#pragma makr SHA256 ++(NSData*) computeSHA256:(NSData *)data truncatedToBytes:(int)truncatedBytes { + uint8_t digest[CC_SHA256_DIGEST_LENGTH]; + CC_SHA256(data.bytes, (unsigned int)data.length, digest); + return [[NSData dataWithBytes:digest length:CC_SHA256_DIGEST_LENGTH] subdataWithRange:NSMakeRange(0, truncatedBytes)]; +} + + +#pragma mark HMAC/SHA256 ++(NSData*) computeSHA256HMAC:(NSData*)dataToHMAC withHMACKey:(NSData*)HMACKey{ + uint8_t ourHmac[CC_SHA256_DIGEST_LENGTH] = {0}; + CCHmac(kCCHmacAlgSHA256, + [HMACKey bytes], + [HMACKey length], + [dataToHMAC bytes], + [dataToHMAC length], + ourHmac); + return [NSData dataWithBytes:ourHmac length:CC_SHA256_DIGEST_LENGTH]; +} + ++(NSData*) computeSHA1HMAC:(NSData*)dataToHMAC withHMACKey:(NSData*)HMACKey{ + uint8_t ourHmac[CC_SHA256_DIGEST_LENGTH] = {0}; + CCHmac(kCCHmacAlgSHA1, + [HMACKey bytes], + [HMACKey length], + [dataToHMAC bytes], + [dataToHMAC length], + ourHmac); + return [NSData dataWithBytes:ourHmac length:CC_SHA256_DIGEST_LENGTH]; +} + + ++(NSData*) truncatedSHA1HMAC:(NSData*)dataToHMAC withHMACKey:(NSData*)HMACKey truncation:(int)bytes{ + return [[Cryptography computeSHA1HMAC:dataToHMAC withHMACKey:HMACKey] subdataWithRange:NSMakeRange(0, bytes)]; +} + ++(NSData*) truncatedSHA256HMAC:(NSData*)dataToHMAC withHMACKey:(NSData*)HMACKey truncation:(int)bytes{ + return [[Cryptography computeSHA256HMAC:dataToHMAC withHMACKey:HMACKey] subdataWithRange:NSMakeRange(0, bytes)]; +} + + +#pragma mark AES CBC Mode ++(NSData*)encryptCBCMode:(NSData*) dataToEncrypt withKey:(NSData*) key withIV:(NSData*) iv withVersion:(NSData*)version withHMACKey:(NSData*) hmacKey withHMACType:(TSMACType)hmacType computedHMAC:(NSData**)hmac { + /* AES256 CBC encrypt then mac + Returns nil if encryption fails + */ + size_t bufferSize = [dataToEncrypt length] + kCCBlockSizeAES128; + void* buffer = malloc(bufferSize); + + size_t bytesEncrypted = 0; + CCCryptorStatus cryptStatus = CCCrypt(kCCEncrypt, kCCAlgorithmAES128, kCCOptionPKCS7Padding, + [key bytes], [key length], + [iv bytes], + [dataToEncrypt bytes], [dataToEncrypt length], + buffer, bufferSize, + &bytesEncrypted); + + if (cryptStatus == kCCSuccess){ + NSData* encryptedData= [NSData dataWithBytesNoCopy:buffer length:bytesEncrypted]; + //compute hmac of version||encrypted data||iv + NSMutableData *dataToHmac = [NSMutableData data]; + if(version!=nil) { + [dataToHmac appendData:version]; + } + [dataToHmac appendData:iv]; + [dataToHmac appendData:encryptedData]; + + if(hmacType == TSHMACSHA1Truncated10Bytes) { + *hmac = [Cryptography truncatedSHA1HMAC:dataToHmac withHMACKey:hmacKey truncation:10]; + } + else if (hmacType == TSHMACSHA256Truncated10Bytes) { + *hmac = [Cryptography truncatedSHA256HMAC:dataToHmac withHMACKey:hmacKey truncation:10]; + } + + return encryptedData; + } + free(buffer); + return nil; + +} + + + ++(NSData*) decryptCBCMode:(NSData*) dataToDecrypt withKey:(NSData*) key withIV:(NSData*) iv withVersion:(NSData*)version withHMACKey:(NSData*) hmacKey withHMACType:(TSMACType)hmacType forHMAC:(NSData *)hmac { + /* AES256 CBC encrypt then mac + + Returns nil if hmac invalid or decryption fails + */ + //verify hmac of version||encrypted data||iv + NSMutableData *dataToHmac = [NSMutableData data ]; + if(version!=nil) { + [dataToHmac appendData:version]; + } + [dataToHmac appendData:iv]; + [dataToHmac appendData:dataToDecrypt]; + + // verify hmac + NSData* ourHmacData; + if(hmacType == TSHMACSHA1Truncated10Bytes) { + ourHmacData = [Cryptography truncatedSHA1HMAC:dataToHmac withHMACKey:hmacKey truncation:10]; + } + else if (hmacType == TSHMACSHA256Truncated10Bytes) { + ourHmacData = [Cryptography truncatedSHA256HMAC:dataToHmac withHMACKey:hmacKey truncation:10]; + } + + if(hmac == nil || ![ourHmacData isEqualToData:hmac] ) { + return nil; + } + + // decrypt + size_t bufferSize = [dataToDecrypt length] + kCCBlockSizeAES128; + void* buffer = malloc(bufferSize); + + size_t bytesDecrypted = 0; + CCCryptorStatus cryptStatus = CCCrypt(kCCDecrypt, kCCAlgorithmAES128, kCCOptionPKCS7Padding, + [key bytes], [key length], + [iv bytes], + [dataToDecrypt bytes], [dataToDecrypt length], + buffer, bufferSize, + &bytesDecrypted); + if (cryptStatus == kCCSuccess) { + return [NSData dataWithBytesNoCopy:buffer length:bytesDecrypted]; + } + + free(buffer); + return nil; + + +} + +#pragma mark methods which use AES CBC ++(NSData*) decryptAppleMessagePayload:(NSData*)payload withSignalingKey:(NSString*)signalingKeyString{ + unsigned char version[1]; + unsigned char iv[16]; + NSUInteger ciphertext_length = ([payload length]-10-17)*sizeof(char); + unsigned char *ciphertext = (unsigned char*)malloc(ciphertext_length); + unsigned char mac[10]; + [payload getBytes:version range:NSMakeRange(0, 1)]; + [payload getBytes:iv range:NSMakeRange(1, 16)]; + [payload getBytes:ciphertext range:NSMakeRange(17, [payload length]-10-17)]; + [payload getBytes:mac range:NSMakeRange([payload length]-10, 10)]; + + NSData* signalingKey = [NSData dataFromBase64String:signalingKeyString]; + NSData* signalingKeyAESKeyMaterial = [signalingKey subdataWithRange:NSMakeRange(0, 32)]; + NSData* signalingKeyHMACKeyMaterial = [signalingKey subdataWithRange:NSMakeRange(32, 20)]; + return [Cryptography decryptCBCMode:[NSData dataWithBytesNoCopy:ciphertext length:ciphertext_length freeWhenDone:YES] withKey:signalingKeyAESKeyMaterial withIV:[NSData dataWithBytes:iv length:16] withVersion:[NSData dataWithBytes:version length:1] withHMACKey:signalingKeyHMACKeyMaterial withHMACType:TSHMACSHA256Truncated10Bytes forHMAC:[NSData dataWithBytes:mac length:10]]; + +} + ++(NSData*) decryptAttachment:(NSData*) dataToDecrypt withKey:(NSData*) key { + // key: 32 byte AES key || 32 byte Hmac-SHA256 key. + NSData *encryptionKey = [key subdataWithRange:NSMakeRange(0, 32)]; + NSData *hmacKey = [key subdataWithRange:NSMakeRange(32, 32)]; + // dataToDecrypt: IV || Ciphertext || truncated MAC(IV||Ciphertext) + NSData *iv = [dataToDecrypt subdataWithRange:NSMakeRange(0, 10)]; + NSData *encryptedAttachment = [dataToDecrypt subdataWithRange:NSMakeRange(10, [dataToDecrypt length]-10-10)]; + NSData *hmac = [dataToDecrypt subdataWithRange:NSMakeRange([dataToDecrypt length]-10, 10)]; + return [Cryptography decryptCBCMode:encryptedAttachment withKey:encryptionKey withIV:iv withVersion:nil withHMACKey:hmacKey withHMACType:TSHMACSHA256Truncated10Bytes forHMAC:hmac]; +} + + + + ++(NSData*) encryptAttachment:(NSData*) attachment withRandomKey:(NSData**)key{ + // generate + // random 10 byte IV + // key: 32 byte AES key || 32 byte Hmac-SHA256 key. + // returns: IV || Ciphertext || truncated MAC(IV||Ciphertext) + NSData* iv = [Cryptography generateRandomBytes:10]; + NSData* encryptionKey = [Cryptography generateRandomBytes:32]; + NSData* hmacKey = [Cryptography generateRandomBytes:32]; + + // The concatenated key for storage + NSMutableData *outKey = [NSMutableData data]; + [outKey appendData:encryptionKey]; + [outKey appendData:hmacKey]; + *key = [NSData dataWithData:outKey]; + + NSData* computedHMAC; + NSData* ciphertext = [Cryptography encryptCBCMode:attachment withKey:encryptionKey withIV:iv withVersion:nil withHMACKey:hmacKey withHMACType:TSHMACSHA256Truncated10Bytes computedHMAC:&computedHMAC]; + + NSMutableData* encryptedAttachment = [NSMutableData data]; + [encryptedAttachment appendData:iv]; + [encryptedAttachment appendData:ciphertext]; + [encryptedAttachment appendData:computedHMAC]; + return encryptedAttachment; +} + +@end diff --git a/Signal/src/textsecure/Util/NSData+Base64.h b/Signal/src/textsecure/Util/NSData+Base64.h new file mode 100644 index 000000000..7fc864bd7 --- /dev/null +++ b/Signal/src/textsecure/Util/NSData+Base64.h @@ -0,0 +1,9 @@ +#import + +@interface NSData (Base64) + ++ (NSData *)dataFromBase64String:(NSString *)aString; + +- (NSString *)base64EncodedString; + +@end diff --git a/Signal/src/textsecure/Util/NSData+Base64.m b/Signal/src/textsecure/Util/NSData+Base64.m new file mode 100644 index 000000000..e62d9eea3 --- /dev/null +++ b/Signal/src/textsecure/Util/NSData+Base64.m @@ -0,0 +1,35 @@ + +#import "NSData+Base64.h" + + +@implementation NSData (Base64) + +// +// dataFromBase64String: +// +// Creates an NSData object containing the base64 decoded representation of +// the base64 string 'aString' +// +// Parameters: +// aString - the base64 string to decode +// +// returns the NSData representation of the base64 string +// ++ (NSData *)dataFromBase64String:(NSString *)aString { + return [[NSData alloc] initWithBase64EncodedString:aString options:NSDataBase64DecodingIgnoreUnknownCharacters]; +} + +// +// base64EncodedString +// +// Creates an NSString object that contains the base 64 encoding of the +// receiver's data. Lines are broken at 64 characters long. +// +// returns an NSString being the base 64 representation of the +// receiver. +// +- (NSString *)base64EncodedString { + return [self base64EncodedStringWithOptions:0]; +} + +@end diff --git a/Signal/src/textsecure/Util/NSData+hexString.h b/Signal/src/textsecure/Util/NSData+hexString.h new file mode 100644 index 000000000..b39fe3820 --- /dev/null +++ b/Signal/src/textsecure/Util/NSData+hexString.h @@ -0,0 +1,15 @@ +// +// NSData+hexString.h +// TextSecureKit +// +// Created by Frederic Jacobs on 28/10/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import + +@interface NSData (hexString) + +-(NSString *)hexadecimalString; + +@end diff --git a/Signal/src/textsecure/Util/NSData+hexString.m b/Signal/src/textsecure/Util/NSData+hexString.m new file mode 100644 index 000000000..a8e743aec --- /dev/null +++ b/Signal/src/textsecure/Util/NSData+hexString.m @@ -0,0 +1,28 @@ +// +// NSData+hexString.m +// TextSecureKit +// +// Created by Frederic Jacobs on 28/10/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "NSData+hexString.h" + +@implementation NSData (hexString) + +-(NSString *)hexadecimalString { + /* Returns hexadecimal string of NSData. Empty string if data is empty. */ + const unsigned char *dataBuffer = (const unsigned char *)[self bytes]; + if (!dataBuffer) + return [NSString string]; + + NSUInteger dataLength = [self length]; + NSMutableString *hexString = [NSMutableString stringWithCapacity:(dataLength * 2)]; + + for (NSUInteger i = 0; i < dataLength; ++i) { + [hexString appendFormat:@"%02x", dataBuffer[i]]; + } + return [NSString stringWithString:hexString]; +} + +@end diff --git a/Signal/src/textsecure/Util/NSData+messagePadding.h b/Signal/src/textsecure/Util/NSData+messagePadding.h new file mode 100644 index 000000000..18fb78154 --- /dev/null +++ b/Signal/src/textsecure/Util/NSData+messagePadding.h @@ -0,0 +1,15 @@ +// +// NSData+messagePadding.h +// TextSecureKit +// +// Created by Frederic Jacobs on 15/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import + +@interface NSData (messagePadding) + +- (NSData*)removePadding; + +@end diff --git a/Signal/src/textsecure/Util/NSData+messagePadding.m b/Signal/src/textsecure/Util/NSData+messagePadding.m new file mode 100644 index 000000000..20646c774 --- /dev/null +++ b/Signal/src/textsecure/Util/NSData+messagePadding.m @@ -0,0 +1,32 @@ +// +// NSData+messagePadding.m +// TextSecureKit +// +// Created by Frederic Jacobs on 15/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "NSData+messagePadding.h" + +@implementation NSData (messagePadding) + +- (NSData*)removePadding{ + unsigned long paddingStart = self.length; + + Byte data[self.length]; + [self getBytes:data length:self.length]; + + + for (long i = (long)self.length-1; i >= 0; i--) { + if (data[i] == (Byte)0x80) { + paddingStart = (unsigned long) i; + break; + } else if (data[i] != (Byte)0x00) { + return self; + } + } + + return [self subdataWithRange:NSMakeRange(0, paddingStart)]; +} + +@end diff --git a/Signal/src/textsecure/Util/NSString+escape.h b/Signal/src/textsecure/Util/NSString+escape.h new file mode 100644 index 000000000..42f7614d6 --- /dev/null +++ b/Signal/src/textsecure/Util/NSString+escape.h @@ -0,0 +1,13 @@ +// +// NSString+escape.h +// TextSecureiOS +// +// Created by Frederic Jacobs on 9/29/13. +// Copyright (c) 2013 Open Whisper Systems. All rights reserved. +// + +#import + +@interface NSString (escape) +- (NSString*) escape; +@end diff --git a/Signal/src/textsecure/Util/NSString+escape.m b/Signal/src/textsecure/Util/NSString+escape.m new file mode 100644 index 000000000..ba9c41a5a --- /dev/null +++ b/Signal/src/textsecure/Util/NSString+escape.m @@ -0,0 +1,18 @@ +// +// NSString+escape.m +// TextSecureiOS +// +// Created by Frederic Jacobs on 9/29/13. +// Copyright (c) 2013 Open Whisper Systems. All rights reserved. +// + +#import "NSString+escape.h" + +@implementation NSString (escape) + +- (NSString*) escape{ + return [self stringByAddingPercentEscapesUsingEncoding: + NSASCIIStringEncoding]; +} + +@end diff --git a/Signal/src/textsecure/Util/NSURLSessionDataTask+StatusCode.h b/Signal/src/textsecure/Util/NSURLSessionDataTask+StatusCode.h new file mode 100644 index 000000000..5eeff97f3 --- /dev/null +++ b/Signal/src/textsecure/Util/NSURLSessionDataTask+StatusCode.h @@ -0,0 +1,15 @@ +// +// NSURLSessionDataTask+StatusCode.h +// TextSecureKit +// +// Created by Frederic Jacobs on 04/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import + +@interface NSURLSessionTask (StatusCode) + +- (long)statusCode; + +@end diff --git a/Signal/src/textsecure/Util/NSURLSessionDataTask+StatusCode.m b/Signal/src/textsecure/Util/NSURLSessionDataTask+StatusCode.m new file mode 100644 index 000000000..82d4de438 --- /dev/null +++ b/Signal/src/textsecure/Util/NSURLSessionDataTask+StatusCode.m @@ -0,0 +1,18 @@ +// +// NSURLSessionDataTask+StatusCode.m +// TextSecureKit +// +// Created by Frederic Jacobs on 04/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "NSURLSessionDataTask+StatusCode.h" + +@implementation NSURLSessionTask (StatusCode) + +- (long)statusCode { + NSHTTPURLResponse *response = (NSHTTPURLResponse *)self.response; + return response.statusCode; +} + +@end diff --git a/Signal/src/view controllers/CallLogViewController.h b/Signal/src/view controllers/CallLogViewController.h deleted file mode 100644 index a48a9eb82..000000000 --- a/Signal/src/view controllers/CallLogViewController.h +++ /dev/null @@ -1,12 +0,0 @@ -#import - -#import "ContactsManager.h" -#import "CallLogTableViewCell.h" -#import "SearchBarTitleView.h" - -@interface CallLogViewController : UIViewController - -@property (nonatomic, strong) IBOutlet SearchBarTitleView *searchBarTitleView; -@property (nonatomic, strong) IBOutlet UITableView *recentCallsTableView; - -@end diff --git a/Signal/src/view controllers/CallLogViewController.m b/Signal/src/view controllers/CallLogViewController.m deleted file mode 100644 index d01d7c23e..000000000 --- a/Signal/src/view controllers/CallLogViewController.m +++ /dev/null @@ -1,178 +0,0 @@ -#import "Environment.h" -#import "LocalizableText.h" -#import "PreferencesUtil.h" -#import "CallLogViewController.h" -#import "RecentCall.h" -#import "TabBarParentViewController.h" -#import "RecentCallManager.h" - -#import - -#define RECENT_CALL_TABLE_CELL_HEIGHT 43 - -static NSString *const RECENT_CALL_TABLE_CELL_IDENTIFIER = @"CallLogTableViewCell"; - -typedef NSComparisonResult (^CallComparator)(RecentCall*, RecentCall*); - -@interface CallLogViewController () { - NSArray *_recents; - BOOL _tableViewContentMutating; - NSString *_searchTerm; -} - -@end - -@implementation CallLogViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - [self observeRecentCalls]; - [self observeKeyboardNotifications]; - _searchBarTitleView.titleLabel.text = RECENT_NAV_BAR_TITLE; - _recentCallsTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero]; -} - -- (void)viewWillAppear:(BOOL)animated { - [self.navigationController setNavigationBarHidden:YES animated:NO]; - [super viewWillAppear:animated]; -} - -- (void)viewWillDisappear:(BOOL)animated { - [super viewWillDisappear:animated]; - [self.navigationController setNavigationBarHidden:NO animated:YES]; -} - -- (void)observeKeyboardNotifications { - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(keyboardWillShow:) - name:UIKeyboardWillShowNotification - object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(keyboardWillHide:) - name:UIKeyboardWillHideNotification - object:nil]; -} - -- (void)observeRecentCalls { - ObservableValue *observableRecents = Environment.getCurrent.recentCallManager.getObservableRecentCalls; - - [observableRecents watchLatestValue:^(NSArray *latestRecents) { - if (_searchTerm) { - _recents = [Environment.getCurrent.recentCallManager recentsForSearchString:_searchTerm - andExcludeArchived:NO]; - } else { - _recents = latestRecents; - } - - if (!_tableViewContentMutating) { - [_recentCallsTableView reloadData]; - } - } onThread:NSThread.mainThread untilCancelled:nil]; -} - -- (void)deleteRecentCallAtIndexPath:(NSIndexPath *)indexPath { - [_recentCallsTableView beginUpdates]; - [_recentCallsTableView deleteRowsAtIndexPaths:@[indexPath] - withRowAnimation:UITableViewRowAnimationLeft]; - - RecentCall *recent; - - - [Environment.getCurrent.recentCallManager removeRecentCall:recent]; - - [_recentCallsTableView endUpdates]; -} - -#pragma mark - UITableViewDelegate - -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return (NSInteger)_recents.count; -} - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - CallLogTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:RECENT_CALL_TABLE_CELL_IDENTIFIER]; - if (!cell) { - cell = [[CallLogTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault - reuseIdentifier:RECENT_CALL_TABLE_CELL_IDENTIFIER]; - cell.delegate = self; - } - RecentCall *recent = _recents[(NSUInteger)indexPath.row]; - [cell configureWithRecentCall:recent]; - - return cell; -} - -- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { - return RECENT_CALL_TABLE_CELL_HEIGHT; -} - -#pragma mark - RecentCallTableViewCellDelegate - -- (void)recentCallTableViewCellTappedDelete:(CallLogTableViewCell *)cell { - _tableViewContentMutating = YES; - NSIndexPath *indexPath = [_recentCallsTableView indexPathForCell:cell]; - - [_recentCallsTableView beginUpdates]; - [_recentCallsTableView deleteRowsAtIndexPaths:@[indexPath] - withRowAnimation:UITableViewRowAnimationLeft]; - - RecentCall *recent = _recents[(NSUInteger)indexPath.row]; - [Environment.getCurrent.recentCallManager removeRecentCall:recent]; - - [_recentCallsTableView endUpdates]; - _tableViewContentMutating = NO; -} - -- (void)recentCallTableViewCellTappedCall:(CallLogTableViewCell *)cell { - NSIndexPath *indexPath = [_recentCallsTableView indexPathForCell:cell]; - RecentCall *recent = _recents[(NSUInteger)indexPath.row]; - [(TabBarParentViewController *)self.mm_drawerController.centerViewController showDialerViewControllerWithNumber:recent.phoneNumber]; -} - -#pragma mark - SearchBarTitleViewDelegate - -- (void)searchBarTitleView:(SearchBarTitleView *)view didSearchForTerm:(NSString *)term { - _searchTerm = term; - _recents = [Environment.getCurrent.recentCallManager recentsForSearchString:term - andExcludeArchived:NO]; - [_recentCallsTableView reloadData]; -} - -- (void)searchBarTitleViewDidTapMenu:(SearchBarTitleView *)view { - [self.mm_drawerController openDrawerSide:MMDrawerSideLeft - animated:YES - completion:nil]; -} - -- (void)searchBarTitleViewDidEndSearching:(SearchBarTitleView *)view { - _searchTerm = nil; - _recents = [Environment.getCurrent.recentCallManager recentsForSearchString:nil - andExcludeArchived:NO]; - [_recentCallsTableView reloadData]; -} - -#pragma mark - Keyboard - -- (void)keyboardWillShow:(NSNotification *)notification { - double duration = [[notification userInfo][UIKeyboardAnimationDurationUserInfoKey] doubleValue]; - [UIView animateWithDuration:duration animations:^{ - CGSize keyboardSize = [[notification userInfo][UIKeyboardFrameBeginUserInfoKey] CGRectValue].size; - CGFloat height = CGRectGetHeight(_recentCallsTableView.frame) - (keyboardSize.height-BOTTOM_TAB_BAR_HEIGHT); - _recentCallsTableView.frame = CGRectMake(CGRectGetMinX(_recentCallsTableView.frame), - CGRectGetMinY(_recentCallsTableView.frame), - CGRectGetWidth(_recentCallsTableView.frame), - height); - }]; -} - -- (void)keyboardWillHide:(NSNotification *)notification { - CGSize keyboardSize = [[notification userInfo][UIKeyboardFrameEndUserInfoKey] CGRectValue].size; - CGFloat height = CGRectGetHeight(_recentCallsTableView.frame) + (keyboardSize.height-BOTTOM_TAB_BAR_HEIGHT); - _recentCallsTableView.frame = CGRectMake(CGRectGetMinX(_recentCallsTableView.frame), - CGRectGetMinY(_recentCallsTableView.frame), - CGRectGetWidth(_recentCallsTableView.frame), - height); -} - -@end diff --git a/Signal/src/view controllers/ContactBrowseViewController.h b/Signal/src/view controllers/ContactBrowseViewController.h deleted file mode 100644 index bb7a390e4..000000000 --- a/Signal/src/view controllers/ContactBrowseViewController.h +++ /dev/null @@ -1,21 +0,0 @@ -#import -#import "SearchBarTitleView.h" - -/** - * - * ContactBrowseViewController displays contacts from ContactsManager inside of a table view. - * This class subscibes to addressbook updates to refresh information and/or add new contacts. - * - */ - -@interface ContactBrowseViewController : UIViewController - -@property (nonatomic, strong) IBOutlet UITableView *contactTableView; -@property (nonatomic, strong) IBOutlet SearchBarTitleView *searchBarTitleView; -@property (nonatomic, strong) IBOutlet UIView *notificationView; -@property (nonatomic, retain) UIRefreshControl *refreshControl; - -- (IBAction)notificationViewTapped:(id)sender; -- (void)showNotificationForNewWhisperUsers:(NSArray *)users; - -@end diff --git a/Signal/src/view controllers/ContactBrowseViewController.m b/Signal/src/view controllers/ContactBrowseViewController.m deleted file mode 100644 index f0b49e18d..000000000 --- a/Signal/src/view controllers/ContactBrowseViewController.m +++ /dev/null @@ -1,268 +0,0 @@ -#import "Contact.h" -#import "ContactBrowseViewController.h" -#import "ContactDetailViewController.h" -#import "ContactsManager.h" -#import "ContactTableViewCell.h" -#import "InCallViewController.h" -#import "LocalizableText.h" -#import "PreferencesUtil.h" -#import "TabBarParentViewController.h" -#import "NotificationManifest.h" -#import "PhoneNumberDirectoryFilterManager.h" - -#import -#import - -#define NOTIFICATION_VIEW_ANIMATION_DURATION 0.5f -#define REFRESH_TIMEOUT 20 - -static NSString *const CONTACT_BROWSE_TABLE_CELL_IDENTIFIER = @"ContactTableViewCell"; - -@interface ContactBrowseViewController () { - NSDictionary *_latestAlphabeticalContacts; - NSArray *_latestSortedAlphabeticalContactKeys; - NSArray *_latestContacts; - NSArray *_newWhisperUsers; - CGRect _originalTableViewFrame; - BOOL _showingNotificationView; -} - -@end - -@implementation ContactBrowseViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(contactsDidRefresh) name:NOTIFICATION_DIRECTORY_WAS_UPDATED object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(contactRefreshFailed) name:NOTIFICATION_DIRECTORY_FAILED object:nil]; - UIRefreshControl *refreshControl = [[UIRefreshControl alloc] - init]; - [refreshControl addTarget:self action:@selector(refreshContacts) forControlEvents:UIControlEventValueChanged]; - self.refreshControl = refreshControl; - [self.contactTableView addSubview:self.refreshControl]; - - [self setupContacts]; - [self observeKeyboardNotifications]; - _originalTableViewFrame = _contactTableView.frame; -} - -- (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; - [self.navigationController setNavigationBarHidden:YES animated:NO]; - [_contactTableView reloadData]; - [_searchBarTitleView updateAutoCorrectionType]; - [Environment.getCurrent.contactsManager enableNewUserNotifications]; - - BOOL showNotificationView = _newWhisperUsers != nil; - if (showNotificationView) { - [self showNotificationViewAnimated:NO]; - } else { - [self hideNotificationView]; - } -} - -- (void)viewWillDisappear:(BOOL)animated { - [super viewWillDisappear:animated]; - self.navigationController.navigationBarHidden = NO; -} - -- (void)didReceiveMemoryWarning { - [super didReceiveMemoryWarning]; -} - -- (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; -} - -- (void)onSearchOrContactChange:(NSString *)searchTerm { - if (_latestContacts) { - _latestAlphabeticalContacts = [ContactsManager groupContactsByFirstLetter:_latestContacts - matchingSearchString:searchTerm]; - - NSArray *contactKeys = [_latestAlphabeticalContacts allKeys]; - _latestSortedAlphabeticalContactKeys = [contactKeys sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)]; - [_contactTableView reloadData]; - } -} - -- (void)observeKeyboardNotifications { - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(keyboardWillShow:) - name:UIKeyboardWillShowNotification - object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(keyboardWillHide:) - name:UIKeyboardWillHideNotification - object:nil]; -} - -- (void)notificationViewTapped:(id)sender { - [(TabBarParentViewController *)self.mm_drawerController.centerViewController presentInviteContactsViewController]; -} - -- (void)showNotificationForNewWhisperUsers:(NSArray *)users { - - _newWhisperUsers = users; - - BOOL isViewVisible = self.isViewLoaded && self.view.window; - - if (isViewVisible) { - [self showNotificationViewAnimated:YES]; - } -} - -- (void)showNotificationViewAnimated:(BOOL)animated { - - if (_showingNotificationView) { - return; - } - - CGFloat animationTime = animated ? NOTIFICATION_VIEW_ANIMATION_DURATION : 0.0f; - - [UIView animateWithDuration:animationTime animations:^{ - _notificationView.frame = CGRectMake(CGRectGetMinX(_notificationView.frame), - CGRectGetHeight(_searchBarTitleView.frame), - CGRectGetWidth(_notificationView.frame), - CGRectGetHeight(_notificationView.frame)); - - CGFloat tableViewYOrigin = CGRectGetMinY(_originalTableViewFrame) + CGRectGetHeight(_notificationView.frame); - _contactTableView.frame = CGRectMake(CGRectGetMinX(_contactTableView.frame), - tableViewYOrigin, - CGRectGetWidth(_contactTableView.frame), - CGRectGetHeight(_contactTableView.frame)); - - }]; - - _showingNotificationView = YES; -} - -- (void)hideNotificationView { - if (!_showingNotificationView) { - return; - } - - _notificationView.frame = CGRectMake(CGRectGetMinX(_notificationView.frame), - 0, - CGRectGetWidth(_notificationView.frame), - CGRectGetHeight(_notificationView.frame)); - _contactTableView.frame = _originalTableViewFrame; - _showingNotificationView = NO; -} - -#pragma mark - Contact functions - -- (void)setupContacts { - ObservableValue *observableContacts = Environment.getCurrent.contactsManager.getObservableWhisperUsers; - - [observableContacts watchLatestValue:^(NSArray *latestContacts) { - _latestContacts = latestContacts; - [self onSearchOrContactChange:nil]; - } onThread:NSThread.mainThread untilCancelled:nil]; -} - -- (NSArray *)contactsForSectionIndex:(NSUInteger)index { - return [_latestAlphabeticalContacts valueForKey:_latestSortedAlphabeticalContactKeys[index]]; -} - -- (void)pushContactViewControllerForContactIndexPath:(NSIndexPath *)indexPath { - NSArray *contactSection = [self contactsForSectionIndex:(NSUInteger)indexPath.section]; - Contact *contact = contactSection[(NSUInteger)indexPath.row]; - ContactDetailViewController *vc = [ContactDetailViewController contactDetailViewControllerWithContact:contact]; - [self.navigationController pushViewController:vc animated:YES]; -} - -#pragma mark - UITableViewDelegate - -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return (NSInteger)[[self contactsForSectionIndex:(NSUInteger)section] count]; -} - -- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { - return _latestSortedAlphabeticalContactKeys[(NSUInteger)section]; -} - -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return (NSInteger)[[_latestAlphabeticalContacts allKeys] count]; -} - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - - ContactTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CONTACT_BROWSE_TABLE_CELL_IDENTIFIER]; - - if (!cell) { - cell = [[ContactTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault - reuseIdentifier:CONTACT_BROWSE_TABLE_CELL_IDENTIFIER]; - } - - NSArray *contactSection = [self contactsForSectionIndex:(NSUInteger)indexPath.section]; - Contact *contact = contactSection[(NSUInteger)indexPath.row]; - [cell configureWithContact:contact]; - - return cell; -} - -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - [_searchBarTitleView.searchTextField resignFirstResponder]; - [tableView deselectRowAtIndexPath:indexPath animated:YES]; - [self pushContactViewControllerForContactIndexPath:indexPath]; -} - -- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView { - return _latestSortedAlphabeticalContactKeys; -} - -#pragma mark - SearchBarTitleViewDelegate - -- (void)searchBarTitleView:(SearchBarTitleView *)view didSearchForTerm:(NSString *)term { - [self onSearchOrContactChange:term]; -} - -- (void)searchBarTitleViewDidTapMenu:(SearchBarTitleView *)view { - [self.mm_drawerController openDrawerSide:MMDrawerSideLeft - animated:YES - completion:nil]; -} - -- (void)searchBarTitleViewDidEndSearching:(SearchBarTitleView *)view { - [self onSearchOrContactChange:nil]; -} - -#pragma mark - Keyboard - -- (void)keyboardWillShow:(NSNotification *)notification { - double duration = [[notification userInfo][UIKeyboardAnimationDurationUserInfoKey] doubleValue]; - [UIView animateWithDuration:duration animations:^{ - CGSize keyboardSize = [[notification userInfo][UIKeyboardFrameBeginUserInfoKey] CGRectValue].size; - _contactTableView.frame = CGRectMake(CGRectGetMinX(_contactTableView.frame), - CGRectGetMinY(_contactTableView.frame), - CGRectGetWidth(_contactTableView.frame), - CGRectGetHeight(_contactTableView.frame) - (keyboardSize.height-BOTTOM_TAB_BAR_HEIGHT)); - }]; -} - -- (void)keyboardWillHide:(NSNotification *)notification { - CGSize keyboardSize = [[notification userInfo][UIKeyboardFrameEndUserInfoKey] CGRectValue].size; - _contactTableView.frame = CGRectMake(CGRectGetMinX(_contactTableView.frame), - CGRectGetMinY(_contactTableView.frame), - CGRectGetWidth(_contactTableView.frame), - CGRectGetHeight(_contactTableView.frame) + (keyboardSize.height-BOTTOM_TAB_BAR_HEIGHT)); -} - -#pragma mark - Refresh controls - -- (void)refreshContacts{ - [Environment.getCurrent.phoneDirectoryManager forceUpdate]; -} - -- (void)contactRefreshFailed{ - UIAlertView *alert = [[UIAlertView alloc] initWithTitle:TIMEOUT message:TIMEOUT_CONTACTS_DETAIL delegate:nil cancelButtonTitle:NSLocalizedString(@"OK", @"") otherButtonTitles:nil]; - [alert show]; - [self.refreshControl endRefreshing]; -} - -- (void)contactsDidRefresh{ - [self.refreshControl endRefreshing]; -} - -@end diff --git a/Signal/src/view controllers/DialerViewController.m b/Signal/src/view controllers/DialerViewController.m index 1dbee1a1d..77dcf3e41 100644 --- a/Signal/src/view controllers/DialerViewController.m +++ b/Signal/src/view controllers/DialerViewController.m @@ -5,7 +5,6 @@ #import "ContactsManager.h" #import "Environment.h" #import "InCallViewController.h" -#import "InviteContactModal.h" #import "LocalizableText.h" #import "PhoneManager.h" #import "PhoneNumberDirectoryFilter.h" @@ -24,7 +23,6 @@ NSTimer *_backspaceTimer; float _backspaceDuration; - InviteContactModal* inviteModal; } @end @@ -202,8 +200,7 @@ } -(void) promptToInvitePhoneNumber:(PhoneNumber*) phoneNumber { - inviteModal = [InviteContactModal inviteContactModelWithPhoneNumber:phoneNumber andParentViewController:self]; - [inviteModal presentModalView]; + // TODO } diff --git a/Signal/src/view controllers/FavouritesViewController.h b/Signal/src/view controllers/FavouritesViewController.h deleted file mode 100644 index 26c1fdb40..000000000 --- a/Signal/src/view controllers/FavouritesViewController.h +++ /dev/null @@ -1,16 +0,0 @@ -#import -#import "SearchBarTitleView.h" -#import "FavouriteTableViewCell.h" - -/** - * - * FavouritesViewController displays a table view of favourites obtained through the ContactsManager - * - */ - -@interface FavouritesViewController : UIViewController - -@property (nonatomic, strong) IBOutlet SearchBarTitleView *searchBarTitleView; -@property (nonatomic, strong) IBOutlet UITableView *favouriteTableView; - -@end diff --git a/Signal/src/view controllers/FavouritesViewController.m b/Signal/src/view controllers/FavouritesViewController.m deleted file mode 100644 index 58e3d8969..000000000 --- a/Signal/src/view controllers/FavouritesViewController.m +++ /dev/null @@ -1,180 +0,0 @@ -#import "FavouritesViewController.h" -#import "Environment.h" -#import "ContactDetailViewController.h" -#import "ContactsManager.h" -#import "LocalizableText.h" -#import "FunctionalUtil.h" -#import "PreferencesUtil.h" -#import "TabBarParentViewController.h" - -#import "UIViewController+MMDrawerController.h" - -static NSString *const CONTACT_TABLE_VIEW_CELL_IDENTIFIER = @"ContactTableViewCell"; - -@interface FavouritesViewController () { - NSArray *_favourites; - NSArray *_searchFavourites; - BOOL _isSearching; -} - -@end - -@implementation FavouritesViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - [self observeLatestFavourites]; - [self observeKeyboardNotifications]; - _favouriteTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero]; -} - -- (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; -} - -- (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; - self.navigationController.navigationBarHidden = YES; -} - -- (void)viewWillDisappear:(BOOL)animated { - [super viewWillDisappear:animated]; - self.navigationController.navigationBarHidden = NO; -} - -- (void)observeLatestFavourites { - ObservableValue *observableFavourites = Environment.getCurrent.contactsManager.getObservableFavourites; - - [observableFavourites watchLatestValue:^(NSArray *latestFavourites) { - _favourites = latestFavourites; - [_favouriteTableView reloadData]; - [self hideTableViewIfNoFavourites]; - } onThread:NSThread.mainThread untilCancelled:nil]; -} - -- (void)hideTableViewIfNoFavourites { - BOOL hideFavourites = _favourites.count == 0; - _favouriteTableView.hidden = hideFavourites; -} - -- (void)openLeftSideMenu { - [self.mm_drawerController openDrawerSide:MMDrawerSideLeft animated:YES completion:nil]; -} - -- (void)pushContactDetailViewControllerWithContact:(Contact *)contact { - ContactDetailViewController *vc = [ContactDetailViewController contactDetailViewControllerWithContact:contact]; - [self.navigationController pushViewController:vc animated:YES]; -} - -- (void)observeKeyboardNotifications { - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(keyboardWillShow:) - name:UIKeyboardWillShowNotification - object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(keyboardWillHide:) - name:UIKeyboardWillHideNotification - object:nil]; -} - -- (void)favouriteTapped:(Contact *)contact { - - PhoneNumberDirectoryFilter *filter = Environment.getCurrent.phoneDirectoryManager.getCurrentFilter; - - for (PhoneNumber *number in contact.parsedPhoneNumbers) { - if ([filter containsPhoneNumber:number]) { - [(TabBarParentViewController *)self.mm_drawerController.centerViewController showDialerViewControllerWithNumber:number]; - return; - } - } - - [UIApplication.sharedApplication openURL:[contact.parsedPhoneNumbers[0] toSystemDialerURL]]; -} - -#pragma mark - UITableViewDelegate - -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return _isSearching ? (NSInteger)_searchFavourites.count : (NSInteger)_favourites.count; -} - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - - FavouriteTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CONTACT_TABLE_VIEW_CELL_IDENTIFIER]; - if (!cell) { - cell = [[FavouriteTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault - reuseIdentifier:CONTACT_TABLE_VIEW_CELL_IDENTIFIER]; - cell.delegate = self; - } - - Contact *contact = _isSearching ? _searchFavourites[(NSUInteger)indexPath.row] : _favourites[(NSUInteger)indexPath.row]; - [cell configureWithContact:contact]; - - return cell; -} - -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - [tableView deselectRowAtIndexPath:indexPath animated:YES]; - [_searchBarTitleView.searchTextField resignFirstResponder]; - Contact *contact = _isSearching ? _searchFavourites[(NSUInteger)indexPath.row] : _favourites[(NSUInteger)indexPath.row]; - [self pushContactDetailViewControllerWithContact:contact]; -} - -#pragma mark - SearchBarTitleViewDelegate - -- (void)searchBarTitleView:(SearchBarTitleView *)view didSearchForTerm:(NSString *)term { - _isSearching = YES; - _searchFavourites = [self favouritesForSearchTerm:term]; - [_favouriteTableView reloadData]; -} - -- (void)searchBarTitleViewDidTapMenu:(SearchBarTitleView *)view { - [self.mm_drawerController openDrawerSide:MMDrawerSideLeft - animated:YES - completion:nil]; -} - -- (void)searchBarTitleViewDidEndSearching:(SearchBarTitleView *)view { - _isSearching = NO; - _searchFavourites = nil; - [_favouriteTableView reloadData]; -} - -- (NSArray *)favouritesForSearchTerm:(NSString *)searchTerm { - return [_favourites filter:^int(Contact *contact) { - return searchTerm.length == 0 || [ContactsManager name:contact.fullName matchesQuery:searchTerm]; - }]; -} - -#pragma mark - FavouriteTableViewCellDelegate - -- (void)favouriteTableViewCellTappedCall:(FavouriteTableViewCell *)cell { - NSIndexPath *indexPath = [_favouriteTableView indexPathForCell:cell]; - Contact *contact = _favourites[(NSUInteger)indexPath.row]; - [self favouriteTapped:contact]; -} - -#pragma mark - Keyboard - -- (void)keyboardWillShow:(NSNotification *)notification { - double duration = [[notification userInfo][UIKeyboardAnimationDurationUserInfoKey] doubleValue]; - [UIView animateWithDuration:duration animations:^{ - CGSize keyboardSize = [[notification userInfo][UIKeyboardFrameBeginUserInfoKey] CGRectValue].size; - CGFloat height = CGRectGetHeight(_favouriteTableView.frame) - (keyboardSize.height-BOTTOM_TAB_BAR_HEIGHT); - _favouriteTableView.frame = CGRectMake(CGRectGetMinX(_favouriteTableView.frame), - CGRectGetMinY(_favouriteTableView.frame), - CGRectGetWidth(_favouriteTableView.frame), - height); - }]; -} - -- (void)keyboardWillHide:(NSNotification *)notification { - CGSize keyboardSize = [[notification userInfo][UIKeyboardFrameEndUserInfoKey] CGRectValue].size; - CGFloat height = CGRectGetHeight(_favouriteTableView.frame) + (keyboardSize.height-BOTTOM_TAB_BAR_HEIGHT); - _favouriteTableView.frame = CGRectMake(CGRectGetMinX(_favouriteTableView.frame), - CGRectGetMinY(_favouriteTableView.frame), - CGRectGetWidth(_favouriteTableView.frame), - height); -} - -@end diff --git a/Signal/src/view controllers/InboxFeedViewController.h b/Signal/src/view controllers/InboxFeedViewController.h deleted file mode 100644 index c4322c74f..000000000 --- a/Signal/src/view controllers/InboxFeedViewController.h +++ /dev/null @@ -1,26 +0,0 @@ -#import - -#import "ContactsManager.h" -#import "InboxFeedTableViewCell.h" -#import "SearchBarTitleView.h" - -/** - * - * InboxFeedViewController is the first view the user sees after they have registered - * The search box searches items in your inbox, and contacts. - * A tutorial is displayed if the user has never made a call. - * This class is subscribed to the inbox feed table view cell delegate which tells us when to delete/archive items. - * - */ - -@interface InboxFeedViewController : UIViewController - -@property (nonatomic, strong) IBOutlet UITableView *inboxFeedTableView; -@property (nonatomic, strong) IBOutlet SearchBarTitleView *searchBarTitleView; -@property (nonatomic, strong) IBOutlet UIView *freshInboxView; -@property (nonatomic, strong) IBOutlet UILabel *freshAppTutorialTopLabel; -@property (nonatomic, strong) IBOutlet UILabel *freshAppTutorialMiddleLabel; - - - -@end diff --git a/Signal/src/view controllers/InboxFeedViewController.m b/Signal/src/view controllers/InboxFeedViewController.m deleted file mode 100644 index c0dbe303e..000000000 --- a/Signal/src/view controllers/InboxFeedViewController.m +++ /dev/null @@ -1,425 +0,0 @@ -#import "ContactDetailViewController.h" -#import "ContactTableViewCell.h" -#import "Environment.h" -#import "InboxFeedFooterCell.h" -#import "InboxFeedViewController.h" -#import "LeftSideMenuViewController.h" -#import "LocalizableText.h" -#import "PreferencesUtil.h" -#import "RecentCall.h" -#import "RecentCallManager.h" -#import "RegisterViewController.h" - -#import - -#define CONTACT_TABLE_VIEW_CELL_HEIGHT 44 -#define FOOTER_CELL_HEIGHT 44 -#define INBOX_TABLE_VIEW_CELL_HEIGHT 71 - -#define SEARCH_TABLE_SECTION_FEED 0 -#define SEARCH_TABLE_SECTION_REGISTERED 1 -#define SEARCH_TABLE_SECTION_UNREGISTERED 2 - -#define TABLE_VIEW_NUM_SECTIONS_DEFAULT 1 -#define TABLE_VIEW_NUM_SECTIONS_SEARCHING 3 - -static NSString *const INBOX_FEED_TABLE_VIEW_CELL_IDENTIFIER = @"InboxFeedTableViewCell"; -static NSString *const CONTACT_TABLE_VIEW_CELL_IDENTIFIER = @"ContactTableViewCell"; -static NSString *const FOOTER_TABLE_CELL_IDENTIFIER = @"InboxFeedFooterCell"; - -@interface InboxFeedViewController () { - NSArray *_inboxFeed; - BOOL _tableViewContentMutating; - BOOL _isSearching; - - NSArray *_searchInboxFeed; - NSArray *_searchRegisteredContacts; - NSArray *_searchUnregisteredContacts; -} - -@end - -@implementation InboxFeedViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - - [self observeRecentCalls]; - [self observeKeyboardNotifications]; - [self setupLabelLocalizationAndStyles]; - - _inboxFeedTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero]; -} - -- (void)viewWillDisappear:(BOOL)animated { - [super viewWillDisappear:animated]; - [self markMissedCallsAsViewed]; - [self.navigationController setNavigationBarHidden:NO animated:YES]; -} - -- (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; - [self.navigationController setNavigationBarHidden:YES animated:NO]; - [_searchBarTitleView updateAutoCorrectionType]; - [_inboxFeedTableView reloadData]; - - if (!Environment.isRegistered) { - [Environment resetAppData]; - RegisterViewController *registerViewController = [RegisterViewController registerViewController]; - [self presentViewController:registerViewController animated:NO completion:nil]; - } -} - -- (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; -} - -- (UIStatusBarStyle)preferredStatusBarStyle { - return UIStatusBarStyleLightContent; -} - -- (void)observeRecentCalls { - ObservableValue *observableContacts = Environment.getCurrent.contactsManager.getObservableContacts; - - [observableContacts watchLatestValue:^(id latestValue) { - - ObservableValue *observableRecents = Environment.getCurrent.recentCallManager.getObservableRecentCalls; - - [observableRecents watchLatestValue:^(NSArray *latestRecents) { - _inboxFeed = [Environment.getCurrent.recentCallManager recentsForSearchString:nil - andExcludeArchived:YES]; - [self updateTutorialVisibility]; - if (!_tableViewContentMutating) { - [_inboxFeedTableView reloadData]; - } - if (_isSearching) { - [_searchBarTitleView textField:_searchBarTitleView.searchTextField - shouldChangeCharactersInRange:NSMakeRange(0, 0) - replacementString:SEARCH_BAR_DEFAULT_EMPTY_STRING]; - } - } onThread:NSThread.mainThread untilCancelled:nil]; - - - } onThread:NSThread.mainThread untilCancelled:nil]; -} - -- (void)observeKeyboardNotifications { - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(keyboardWillShow:) - name:UIKeyboardWillShowNotification - object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(keyboardWillHide:) - name:UIKeyboardWillHideNotification - object:nil]; -} - -- (void)setupLabelLocalizationAndStyles { - _freshAppTutorialTopLabel.text = INBOX_VIEW_TUTORIAL_LABEL_TOP; - _freshAppTutorialMiddleLabel.text = INBOX_VIEW_TUTORIAL_LABEL_MIDDLE; -} - -#pragma mark - Viewed / Unviewed calls - -- (void)markMissedCallsAsViewed { - BOOL needsSave = NO; - - for (RecentCall *recent in _inboxFeed) { - if (!recent.userNotified) { - recent.userNotified = true; - needsSave = true; - } - } - if (needsSave) { - [Environment.getCurrent.recentCallManager saveContactsToDefaults]; - [(TabBarParentViewController *)self.mm_drawerController.centerViewController updateMissedCallCountLabel]; - [_inboxFeedTableView reloadData]; - } -} - -#pragma mark - Actions - -- (void)showRecentCallViewControllerWithRecentCall:(RecentCall *)recent { - [(TabBarParentViewController *)self.mm_drawerController.centerViewController showDialerViewControllerWithNumber:recent.phoneNumber]; -} - -- (void)showContactViewControllerWithContact:(Contact *)contact { - ContactDetailViewController *vc = [ContactDetailViewController contactDetailViewControllerWithContact:contact]; - [self.navigationController pushViewController:vc animated:YES]; -} - -- (void)removeNewsFeedCell:(InboxFeedTableViewCell *)cell willDelete:(BOOL)delete { - _tableViewContentMutating = YES; - NSIndexPath *indexPath = [_inboxFeedTableView indexPathForCell:cell]; - - [_inboxFeedTableView beginUpdates]; - - RecentCall *recent; - - if (_isSearching) { - recent = _searchInboxFeed[(NSUInteger)indexPath.row]; - } else { - recent = _inboxFeed[(NSUInteger)indexPath.row]; - } - - recent.userNotified = YES; - - UITableViewRowAnimation animation; - - if (delete) { - animation = UITableViewRowAnimationLeft; - [Environment.getCurrent.recentCallManager removeRecentCall:recent]; - } else { - animation = UITableViewRowAnimationRight; - [Environment.getCurrent.recentCallManager archiveRecentCall:recent]; - } - - [_inboxFeedTableView deleteRowsAtIndexPaths:@[indexPath] - withRowAnimation:animation]; - - [_inboxFeedTableView endUpdates]; - _tableViewContentMutating = NO; -} - -- (void)updateTutorialVisibility { - _freshInboxView.hidden = !Environment.preferences.getFreshInstallTutorialsEnabled; - _inboxFeedTableView.hidden = !_freshInboxView.hidden; -} - -#pragma mark - UITableViewDelegate - -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - if (_isSearching) { - return TABLE_VIEW_NUM_SECTIONS_SEARCHING; - } else { - return TABLE_VIEW_NUM_SECTIONS_DEFAULT; - } -} - -- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { - if (section == SEARCH_TABLE_SECTION_FEED) { - return @""; - } else if (section == SEARCH_TABLE_SECTION_REGISTERED) { - return TABLE_SECTION_TITLE_REGISTERED; - } else { - return TABLE_SECTION_TITLE_UNREGISTERED; - } -} - -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - - if (_isSearching) { - if (section == SEARCH_TABLE_SECTION_FEED) { - return (NSInteger)_searchInboxFeed.count; - } else if (section == SEARCH_TABLE_SECTION_REGISTERED) { - return (NSInteger)_searchRegisteredContacts.count; - } else { - return (NSInteger)_searchUnregisteredContacts.count; - } - } else { - NSInteger inboxFeedAndInfoCellCount = (NSInteger)_inboxFeed.count + 1; - return inboxFeedAndInfoCellCount; - } -} - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - if (_isSearching) { - return [self searchCellForIndexPath:indexPath]; - } else { - return [self inboxFeedCellForIndexPath:indexPath]; - } -} - -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - [tableView deselectRowAtIndexPath:indexPath animated:YES]; - [_searchBarTitleView.searchTextField resignFirstResponder]; - - if (_isSearching) { - if (indexPath.section == SEARCH_TABLE_SECTION_FEED) { - [self showRecentCallViewControllerWithRecentCall:_searchInboxFeed[(NSUInteger)indexPath.row]]; - } else if (indexPath.section == SEARCH_TABLE_SECTION_REGISTERED) { - [self showContactViewControllerWithContact:_searchRegisteredContacts[(NSUInteger)indexPath.row]]; - } else { - [self showContactViewControllerWithContact:_searchUnregisteredContacts[(NSUInteger)indexPath.row]]; - } - } else { - if (indexPath.row < (NSInteger)_inboxFeed.count) { - [self showRecentCallViewControllerWithRecentCall:_inboxFeed[(NSUInteger)indexPath.row]]; - } - } -} - -- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { - if (indexPath.section == SEARCH_TABLE_SECTION_FEED) { - if ((NSUInteger)indexPath.row == _inboxFeed.count) { - return FOOTER_CELL_HEIGHT; - } else { - return INBOX_TABLE_VIEW_CELL_HEIGHT; - } - } else { - return CONTACT_TABLE_VIEW_CELL_HEIGHT; - } -} - -#pragma mark - Table cell creation - -- (UITableViewCell *)searchCellForIndexPath:(NSIndexPath *)indexPath { - if (indexPath.section == SEARCH_TABLE_SECTION_FEED) { - return [self inboxCellForIndexPath:indexPath andIsSearching:YES]; - } else { - return [self contactCellForIndexPath:indexPath]; - } -} - -- (UITableViewCell *)inboxFeedCellForIndexPath:(NSIndexPath *)indexPath { - if (!_isSearching && (NSUInteger)[indexPath row] == _inboxFeed.count) { - return [self inboxFeedFooterCell]; - } else { - return [self inboxCellForIndexPath:indexPath andIsSearching:NO]; - } -} - -- (UITableViewCell *)inboxCellForIndexPath:(NSIndexPath *)indexPath andIsSearching:(BOOL)isSearching { - InboxFeedTableViewCell *cell = [_inboxFeedTableView dequeueReusableCellWithIdentifier:INBOX_FEED_TABLE_VIEW_CELL_IDENTIFIER]; - - if (!cell) { - cell = [[InboxFeedTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault - reuseIdentifier:INBOX_FEED_TABLE_VIEW_CELL_IDENTIFIER]; - cell.delegate = self; - } - - RecentCall *recent = isSearching ? _searchInboxFeed[(NSUInteger)indexPath.row] : _inboxFeed[(NSUInteger)indexPath.row]; - [cell configureWithRecentCall:recent]; - return cell; -} - -- (UITableViewCell *)contactCellForIndexPath:(NSIndexPath *)indexPath { - ContactTableViewCell *cell = [_inboxFeedTableView dequeueReusableCellWithIdentifier:CONTACT_TABLE_VIEW_CELL_IDENTIFIER]; - - if (!cell) { - cell = [[ContactTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault - reuseIdentifier:CONTACT_TABLE_VIEW_CELL_IDENTIFIER]; - } - - NSUInteger searchIndex = (NSUInteger)indexPath.row; - Contact *contact; - - if (indexPath.section == SEARCH_TABLE_SECTION_REGISTERED) { - contact = _searchRegisteredContacts[searchIndex]; - } else { - contact = _searchUnregisteredContacts[searchIndex]; - } - - [cell configureWithContact:contact]; - - return cell; -} - -- (UITableViewCell *)inboxFeedFooterCell { - InboxFeedFooterCell *cell = [_inboxFeedTableView dequeueReusableCellWithIdentifier:FOOTER_TABLE_CELL_IDENTIFIER]; - - if (!cell) { - cell = [[InboxFeedFooterCell alloc] initWithStyle:UITableViewCellStyleDefault - reuseIdentifier:FOOTER_TABLE_CELL_IDENTIFIER]; - } - - return cell; -} - -#pragma mark - HomeFeedTableViewCellDelegate - -- (void)inboxFeedTableViewCellTappedDelete:(InboxFeedTableViewCell *)cell { - [self removeNewsFeedCell:cell willDelete:YES]; -} - -- (void)inboxFeedTableViewCellTappedArchive:(InboxFeedTableViewCell *)cell { - [self removeNewsFeedCell:cell willDelete:NO]; -} - -#pragma mark - SearchBarTitleViewDelegate - -- (void)searchBarTitleView:(SearchBarTitleView *)view didSearchForTerm:(NSString *)term { - BOOL searching = term.length > 0; - _isSearching = searching; - - if (searching) { - _freshInboxView.hidden = YES; - _inboxFeedTableView.hidden = NO; - _searchInboxFeed = [Environment.getCurrent.recentCallManager recentsForSearchString:term - andExcludeArchived:YES]; - - [self reloadSearchContactsForTerm:term]; - } else { - [self updateTutorialVisibility]; - _searchInboxFeed = nil; - _searchRegisteredContacts = nil; - } - [_inboxFeedTableView reloadData]; -} - -- (void)searchBarTitleViewDidTapMenu:(SearchBarTitleView *)view { - [self.mm_drawerController openDrawerSide:MMDrawerSideLeft - animated:YES - completion:nil]; -} - -- (void)searchBarTitleViewDidEndSearching:(SearchBarTitleView *)view { - _isSearching = false; - [self updateTutorialVisibility]; - [_inboxFeedTableView reloadData]; -} - -- (void)reloadSearchContactsForTerm:(NSString *)term { - - NSArray *contacts = [Environment.getCurrent.contactsManager latestContactsWithSearchString:term]; - - NSMutableArray *registeredContacts = [NSMutableArray array]; - NSMutableArray *unregisteredContacts = [NSMutableArray array]; - - for (Contact *contact in contacts) { - BOOL registeredContact = NO; - - for (PhoneNumber *phoneNumber in contact.parsedPhoneNumbers) { - if ([Environment.getCurrent.phoneDirectoryManager.getCurrentFilter containsPhoneNumber:phoneNumber]) { - registeredContact = YES; - } - } - - if (registeredContact) { - [registeredContacts addObject:contact]; - } else { - [unregisteredContacts addObject:contact]; - } - } - - _searchRegisteredContacts = registeredContacts.copy; - _searchUnregisteredContacts = unregisteredContacts.copy; -} - -#pragma mark - Keyboard - -- (void)keyboardWillShow:(NSNotification *)notification { - double duration = [[notification userInfo][UIKeyboardAnimationDurationUserInfoKey] doubleValue]; - [UIView animateWithDuration:duration animations:^{ - CGSize keyboardSize = [[notification userInfo][UIKeyboardFrameBeginUserInfoKey] CGRectValue].size; - CGFloat height = CGRectGetHeight(_inboxFeedTableView.frame) - (keyboardSize.height-BOTTOM_TAB_BAR_HEIGHT); - _inboxFeedTableView.frame = CGRectMake(CGRectGetMinX(_inboxFeedTableView.frame), - CGRectGetMinY(_inboxFeedTableView.frame), - CGRectGetWidth(_inboxFeedTableView.frame), - height); - }]; -} - -- (void)keyboardWillHide:(NSNotification *)notification { - CGSize keyboardSize = [[notification userInfo][UIKeyboardFrameEndUserInfoKey] CGRectValue].size; - CGFloat height = CGRectGetHeight(_inboxFeedTableView.frame) + (keyboardSize.height-BOTTOM_TAB_BAR_HEIGHT); - _inboxFeedTableView.frame = CGRectMake(CGRectGetMinX(_inboxFeedTableView.frame), - CGRectGetMinY(_inboxFeedTableView.frame), - CGRectGetWidth(_inboxFeedTableView.frame), - height); - if (!_searchInboxFeed) { - [self updateTutorialVisibility]; - } -} -@end diff --git a/Signal/src/view controllers/InitialViewController.h b/Signal/src/view controllers/InitialViewController.h new file mode 100644 index 000000000..0fb96a22b --- /dev/null +++ b/Signal/src/view controllers/InitialViewController.h @@ -0,0 +1,13 @@ +// +// InitialViewController.h +// Signal +// +// Created by Dylan Bourgeois on 19/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import + +@interface InitialViewController : UIViewController + +@end diff --git a/Signal/src/view controllers/InitialViewController.m b/Signal/src/view controllers/InitialViewController.m new file mode 100644 index 000000000..1d364170b --- /dev/null +++ b/Signal/src/view controllers/InitialViewController.m @@ -0,0 +1,37 @@ +// +// InitialViewController.m +// Signal +// +// Created by Dylan Bourgeois on 19/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "InitialViewController.h" + +@interface InitialViewController () + +@end + +@implementation InitialViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +/* +#pragma mark - Navigation + +// In a storyboard-based application, you will often want to do a little preparation before navigation +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. +} +*/ + +@end diff --git a/Signal/src/view controllers/InviteContactModal.h b/Signal/src/view controllers/InviteContactModal.h deleted file mode 100644 index 627073d02..000000000 --- a/Signal/src/view controllers/InviteContactModal.h +++ /dev/null @@ -1,10 +0,0 @@ -#import - -#import "PhoneNumber.h" - -@interface InviteContactModal : NSObject - -+(InviteContactModal*) inviteContactModelWithPhoneNumber:(PhoneNumber*) phoneNumber andParentViewController:(UIViewController*) parent; --(void) presentModalView; - -@end diff --git a/Signal/src/view controllers/InviteContactModal.m b/Signal/src/view controllers/InviteContactModal.m deleted file mode 100644 index 06702dbd0..000000000 --- a/Signal/src/view controllers/InviteContactModal.m +++ /dev/null @@ -1,44 +0,0 @@ -#import "InviteContactModal.h" - -#import "InviteContactsViewController.h" -#import "LocalizableText.h" -#import "SmsInvite.h" - -#define CANCEL_BUTTON_INDEX 0 -#define INVITE_BUTTON_INDEX 1 - -@implementation InviteContactModal { - UIAlertView* alertView; - UIViewController* parent; - SmsInvite* smsInvite; - PhoneNumber* phoneNumber; -} - -+(InviteContactModal*) inviteContactModelWithPhoneNumber:(PhoneNumber*) phoneNumber andParentViewController:(UIViewController*) parent { - InviteContactModal* inviteModal = [InviteContactModal new]; - inviteModal->alertView = [[UIAlertView alloc] initWithTitle:INVITE_USER_MODAL_TITLE - message:INVITE_USER_MODAL_TEXT - delegate:inviteModal - cancelButtonTitle:INVITE_USER_MODAL_BUTTON_CANCEL - otherButtonTitles:INVITE_USER_MODAL_BUTTON_INVITE, nil]; - inviteModal->parent = parent; - inviteModal->phoneNumber = phoneNumber; - return inviteModal; -} --(void) presentModalView{ - [alertView show]; -} - --(void) alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { - if(INVITE_BUTTON_INDEX == buttonIndex){ - smsInvite = [SmsInvite smsInviteWithParent:parent]; - [smsInvite sendSMSInviteToNumber:phoneNumber]; - } -} - - - - - - -@end diff --git a/Signal/src/view controllers/InviteContactsViewController.h b/Signal/src/view controllers/InviteContactsViewController.h deleted file mode 100644 index c4e6c89c8..000000000 --- a/Signal/src/view controllers/InviteContactsViewController.h +++ /dev/null @@ -1,15 +0,0 @@ -#import -#import -#import "SearchBarTitleView.h" - -@interface InviteContactsViewController : UIViewController - -@property (nonatomic, strong) IBOutlet UIView *unseenWhisperUsersHeaderView; -@property (nonatomic, strong) IBOutlet UIView *regularContactsHeaderView; -@property (nonatomic, strong) IBOutlet UITableView *contactTableView; - -- (IBAction)dismissNewWhisperUsersTapped:(id)sender; - -- (void)updateWithNewWhisperUsers:(NSArray *)users; - -@end diff --git a/Signal/src/view controllers/InviteContactsViewController.m b/Signal/src/view controllers/InviteContactsViewController.m deleted file mode 100644 index 2b9825d73..000000000 --- a/Signal/src/view controllers/InviteContactsViewController.m +++ /dev/null @@ -1,265 +0,0 @@ -#import "InviteContactsViewController.h" - -#import - -#import "ContactsManager.h" -#import "ContactTableViewCell.h" -#import "Environment.h" -#import "FunctionalUtil.h" -#import "LocalizableText.h" -#import "ObservableValue.h" -#import "SmsInvite.h" -#import "TabBarParentViewController.h" -#import "UnseenWhisperUserCell.h" - - - -#define FIRST_TABLE_SECTION 0 -#define SECOND_TABLE_SECTION 1 - -static NSString *const NEW_USERS_TABLE_SECTION_IDENTIFIER = @"UnseenWhisperUserCell"; -static NSString *const INVITE_CONTACTS_TABLE_CELL_IDENTIFIER = @"ContactTableViewCell"; - -@interface InviteContactsViewController () { - NSArray *_latestContacts; - NSArray *_displayedContacts; - NSArray *_selectedContactNumbers; - NSArray *_newWhisperUsers; - - BOOL _isSearching; - NSString *_currentSearchTerm; - SmsInvite* smsInvite; -} - -@end - -@implementation InviteContactsViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - [self setupContacts]; - [self observeKeyboardNotifications]; -} - -- (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; - self.navigationController.navigationBarHidden = YES; - if (_newWhisperUsers) { - [(TabBarParentViewController *)self.mm_drawerController.centerViewController setNewWhisperUsersAsSeen:_newWhisperUsers]; - [_contactTableView reloadData]; - } -} - -- (void)didReceiveMemoryWarning { - [super didReceiveMemoryWarning]; -} - -- (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; -} - -- (void)observeKeyboardNotifications { - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(keyboardWillShow:) - name:UIKeyboardWillShowNotification - object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(keyboardWillHide:) - name:UIKeyboardWillHideNotification - object:nil]; -} - -- (void)setupContacts { - ObservableValue *observableContacts = Environment.getCurrent.contactsManager.getObservableContacts; - - [observableContacts watchLatestValue:^(NSArray *latestContacts) { - _latestContacts = [self getUnregisteredUsersFromAllUsers:latestContacts searchTerm:nil]; - _displayedContacts = _latestContacts; - [_contactTableView reloadData]; - } onThread:NSThread.mainThread untilCancelled:nil]; -} - -- (NSArray *)getUnregisteredUsersFromAllUsers:(NSArray *)users searchTerm:(NSString *)searchTerm { - ContactsManager *contactsManager = Environment.getCurrent.contactsManager; - - return [users filter:^int(Contact *contact) { - - BOOL matchesSearchQuery = YES; - - if (searchTerm != nil) { - matchesSearchQuery = [ContactsManager name:contact.fullName matchesQuery:searchTerm]; - } - - return ![contactsManager isContactRegisteredWithWhisper:contact] && matchesSearchQuery; - }]; -} - -- (void)presentActionSheetWithNumbersForContact:(Contact *)contact { - - _selectedContactNumbers = contact.parsedPhoneNumbers; - - UIActionSheet *actionSheet = [UIActionSheet new]; - actionSheet.delegate = self; - actionSheet.title = INVITE_USERS_ACTION_SHEET_TITLE; - - for (PhoneNumber *number in _selectedContactNumbers) { - [actionSheet addButtonWithTitle:number.localizedDescriptionForUser]; - } - actionSheet.cancelButtonIndex = [actionSheet addButtonWithTitle:TXT_CANCEL_TITLE]; - - [actionSheet showInView:self.mm_drawerController.centerViewController.view]; -} - -#pragma mark - Actions - -- (IBAction)dismissNewWhisperUsersTapped:(id)sender { - [_contactTableView beginUpdates]; - - NSMutableArray *indexPaths = [NSMutableArray array]; - - for (int i = 0; i < (NSInteger)_newWhisperUsers.count; i++) { - [indexPaths addObject:[NSIndexPath indexPathForRow:i inSection:FIRST_TABLE_SECTION]]; - } - [_contactTableView deleteRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationAutomatic]; - _newWhisperUsers = nil; - [_contactTableView endUpdates]; - [_contactTableView reloadData]; -} - -- (void)updateWithNewWhisperUsers:(NSArray *)users { - _newWhisperUsers = users; -} - -#pragma mark - UITableViewDelegate - -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return 2; -} - -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - if (section == FIRST_TABLE_SECTION) { - return _isSearching ? 0 : (NSInteger)_newWhisperUsers.count; - } else { - return (NSInteger)_displayedContacts.count; - } -} - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - if (indexPath.section == FIRST_TABLE_SECTION && !_isSearching) { - return [self cellForNewWhisperUserAtIndexPath:indexPath]; - } else { - return [self cellForUnregisteredContactAtIndexPath:indexPath]; - } -} - -- (UITableViewCell *)cellForNewWhisperUserAtIndexPath:(NSIndexPath *)indexPath { - UnseenWhisperUserCell *cell = [_contactTableView dequeueReusableCellWithIdentifier:NEW_USERS_TABLE_SECTION_IDENTIFIER]; - - if (!cell) { - cell = [[UnseenWhisperUserCell alloc] initWithStyle:UITableViewCellStyleDefault - reuseIdentifier:NEW_USERS_TABLE_SECTION_IDENTIFIER]; - } - - [cell configureWithContact:_newWhisperUsers[(NSUInteger)indexPath.row]]; - return cell; -} - -- (UITableViewCell *)cellForUnregisteredContactAtIndexPath:(NSIndexPath *)indexPath { - ContactTableViewCell *cell = [_contactTableView dequeueReusableCellWithIdentifier:INVITE_CONTACTS_TABLE_CELL_IDENTIFIER]; - - if (!cell) { - cell = [[ContactTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault - reuseIdentifier:INVITE_CONTACTS_TABLE_CELL_IDENTIFIER]; - } - - [cell configureWithContact:_displayedContacts[(NSUInteger)indexPath.row]]; - return cell; -} - -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - [tableView deselectRowAtIndexPath:indexPath animated:YES]; - - if (indexPath.section == SECOND_TABLE_SECTION) { - Contact *contact = _displayedContacts[(NSUInteger)indexPath.row]; - [self presentActionSheetWithNumbersForContact:contact]; - } -} - -- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { - if (section == FIRST_TABLE_SECTION && !_isSearching && _newWhisperUsers.count > 0) { - return _unseenWhisperUsersHeaderView; - } else if (section == SECOND_TABLE_SECTION) { - return _regularContactsHeaderView; - } else { - return nil; - } -} - -- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { - if (_isSearching || (_newWhisperUsers.count == 0 && section == FIRST_TABLE_SECTION)) { - return 0.0f; - } else { - - CGFloat newUsersViewHeight = CGRectGetHeight(_unseenWhisperUsersHeaderView.frame); - CGFloat regularContactsViewHeight = CGRectGetHeight(_regularContactsHeaderView.frame); - - return section == FIRST_TABLE_SECTION ? newUsersViewHeight : regularContactsViewHeight; - } -} - -#pragma mark - UIActionSheetDelegate - -- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { - if (buttonIndex != actionSheet.cancelButtonIndex) { - smsInvite = [SmsInvite smsInviteWithParent:self]; - [smsInvite sendSMSInviteToNumber:_selectedContactNumbers[(NSUInteger)buttonIndex]]; - } -} - -#pragma mark - SearchBarTitleViewDelegate - -- (void)searchBarTitleView:(SearchBarTitleView *)view didSearchForTerm:(NSString *)term { - _isSearching = YES; - _currentSearchTerm = term; - _displayedContacts = [self getUnregisteredUsersFromAllUsers:_latestContacts searchTerm:term]; - [_contactTableView reloadData]; -} - -- (void)searchBarTitleViewDidEndSearching:(SearchBarTitleView *)view { - _isSearching = NO; - _currentSearchTerm = nil; - _displayedContacts = [self getUnregisteredUsersFromAllUsers:_latestContacts searchTerm:_currentSearchTerm]; - [_contactTableView reloadData]; -} - -- (void)searchBarTitleViewDidTapMenu:(SearchBarTitleView *)view { - [self.mm_drawerController openDrawerSide:MMDrawerSideLeft - animated:YES - completion:nil]; -} - -#pragma mark - Keyboard - -- (void)keyboardWillShow:(NSNotification *)notification { - double duration = [[notification userInfo][UIKeyboardAnimationDurationUserInfoKey] doubleValue]; - [UIView animateWithDuration:duration animations:^{ - CGSize keyboardSize = [[notification userInfo][UIKeyboardFrameBeginUserInfoKey] CGRectValue].size; - CGFloat height = CGRectGetHeight(_contactTableView.frame) - (keyboardSize.height-BOTTOM_TAB_BAR_HEIGHT); - _contactTableView.frame = CGRectMake(CGRectGetMinX(_contactTableView.frame), - CGRectGetMinY(_contactTableView.frame), - CGRectGetWidth(_contactTableView.frame), - height); - }]; -} - -- (void)keyboardWillHide:(NSNotification *)notification { - CGSize keyboardSize = [[notification userInfo][UIKeyboardFrameEndUserInfoKey] CGRectValue].size; - CGFloat height = CGRectGetHeight(_contactTableView.frame) + (keyboardSize.height-BOTTOM_TAB_BAR_HEIGHT); - _contactTableView.frame = CGRectMake(CGRectGetMinX(_contactTableView.frame), - CGRectGetMinY(_contactTableView.frame), - CGRectGetWidth(_contactTableView.frame), - height); -} - -@end diff --git a/Signal/src/view controllers/InviteContactsViewController.xib b/Signal/src/view controllers/InviteContactsViewController.xib deleted file mode 100644 index a710eaed4..000000000 --- a/Signal/src/view controllers/InviteContactsViewController.xib +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Signal/src/view controllers/LeftSideMenuViewController.h b/Signal/src/view controllers/LeftSideMenuViewController.h deleted file mode 100644 index db98992c6..000000000 --- a/Signal/src/view controllers/LeftSideMenuViewController.h +++ /dev/null @@ -1,25 +0,0 @@ -#import - -#import "ContactBrowseViewController.h" -#import "ContactsManager.h" -#import "TabBarParentViewController.h" - -/** - * - * LeftSideMenuViewController is the nav bin view controller which can be swiped in from the left and/or tapped open from a button - * - */ - -@interface LeftSideMenuViewController : UIViewController - -@property (nonatomic, strong) TabBarParentViewController *centerTabBarViewController; -@property (nonatomic, strong) IBOutlet UITableView *menuOptionTableView; -@property (nonatomic, strong) IBOutlet UIView *firstSectionHeaderView; -@property (nonatomic, strong) IBOutlet UIView *secondSectionHeaderView; - -- (void)showDialerViewController; -- (void)showContactsViewController; -- (void)showRecentsViewController; -- (void)showFavouritesViewController; - -@end diff --git a/Signal/src/view controllers/LeftSideMenuViewController.m b/Signal/src/view controllers/LeftSideMenuViewController.m deleted file mode 100644 index 4a6a6ee58..000000000 --- a/Signal/src/view controllers/LeftSideMenuViewController.m +++ /dev/null @@ -1,201 +0,0 @@ -#import "LeftSideMenuViewController.h" -#import "LocalizableText.h" -#import "LeftSideMenuCell.h" -#import "UIUtil.h" - -#import - -#define FIRST_SECTION_INDEX 0 -#define SECOND_SECTION_INDEX 1 - -#define NUMBER_OF_TABLE_VIEW_SECTIONS 2 - -static NSString *SIDE_MENU_TABLE_CELL_IDENTIFIER = @"LeftSideMenuCell"; -static NSString *WHISPER_SYSTEMS_URL = @"https://whispersystems.org/"; -static NSString *WHISPER_SYSTEMS_BLOG_URL = @"https://whispersystems.org/blog"; -static NSString *WHISPER_SYSTEMS_BUGREPORT_URL = @"http://support.whispersystems.org"; - -@interface LeftSideMenuViewController () { - NSArray *_firstSectionOptions; - NSArray *_secondSectionOptions; -} - -@end - -@implementation LeftSideMenuViewController - -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { - self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; - if (self) { - _centerTabBarViewController = [TabBarParentViewController new]; - } - return self; -} - -- (void)viewDidLoad { - [super viewDidLoad]; - _firstSectionOptions = @[MAIN_MENU_OPTION_RECENT_CALLS, - MAIN_MENU_OPTION_FAVOURITES, - MAIN_MENU_OPTION_CONTACTS, - MAIN_MENU_OPTION_DIALER, - MAIN_MENU_INVITE_CONTACTS]; - - _secondSectionOptions = @[MAIN_MENU_OPTION_SETTINGS, - MAIN_MENU_OPTION_ABOUT, - MAIN_MENU_OPTION_REPORT_BUG, - MAIN_MENU_OPTION_BLOG]; - - self.mm_drawerController.closeDrawerGestureModeMask = MMCloseDrawerGestureModePanningCenterView | MMCloseDrawerGestureModeTapCenterView; - self.mm_drawerController.openDrawerGestureModeMask = MMOpenDrawerGestureModeBezelPanningCenterView; -} - -- (void)didReceiveMemoryWarning { - [super didReceiveMemoryWarning]; -} - -- (UIStatusBarStyle)preferredStatusBarStyle { - return UIStatusBarStyleLightContent; -} - -- (BOOL)isLeftSideViewOpenCompletely { - return self.mm_drawerController.visibleLeftDrawerWidth >= self.mm_drawerController.maximumLeftDrawerWidth; -} - -#pragma mark - View Controller Presentation - -- (void)showRecentsViewController { - [_centerTabBarViewController presentRecentCallsViewController]; - [self.mm_drawerController closeDrawerAnimated:YES completion:nil]; -} - -- (void)showContactsViewController { - [_centerTabBarViewController presentContactsViewController]; - [self.mm_drawerController closeDrawerAnimated:YES completion:nil]; -} - -- (void)showDialerViewController { - [_centerTabBarViewController presentDialerViewController]; - [self.mm_drawerController closeDrawerAnimated:YES completion:nil]; -} - -- (void)showSettingsViewController { - [_centerTabBarViewController presentSettingsViewController]; - [self.mm_drawerController closeDrawerAnimated:YES completion:nil]; -} - -- (void)showFavouritesViewController { - [_centerTabBarViewController presentFavouritesViewController]; - [self.mm_drawerController closeDrawerAnimated:YES completion:nil]; -} - -- (void)showInviteContactsViewController { - [_centerTabBarViewController presentInviteContactsViewController]; - [self.mm_drawerController closeDrawerAnimated:YES completion:nil]; -} - -- (void)selectMenuOption:(NSString *)menuOption { - if ([menuOption isEqualToString:MAIN_MENU_OPTION_RECENT_CALLS]) { - [self showRecentsViewController]; - } - if ([menuOption isEqualToString:MAIN_MENU_OPTION_FAVOURITES]) { - [self showFavouritesViewController]; - } - if ([menuOption isEqualToString:MAIN_MENU_OPTION_CONTACTS]) { - [self showContactsViewController]; - } - if ([menuOption isEqualToString:MAIN_MENU_OPTION_DIALER]) { - [self showDialerViewController]; - } - if ([menuOption isEqualToString:MAIN_MENU_INVITE_CONTACTS]) { - [self showInviteContactsViewController]; - } - if ([menuOption isEqualToString:MAIN_MENU_OPTION_SETTINGS]) { - [self showSettingsViewController]; - } - if ([menuOption isEqualToString:MAIN_MENU_OPTION_ABOUT]) { - [self openAboutWhisperUrl]; - } - if ([menuOption isEqualToString:MAIN_MENU_OPTION_REPORT_BUG]) { - [self openBugReporterUrl]; - } - if ([menuOption isEqualToString:MAIN_MENU_OPTION_BLOG]) { - [self openBlogUrl]; - } -} - -- (void)openAboutWhisperUrl { - [UIApplication.sharedApplication openURL:[NSURL URLWithString:WHISPER_SYSTEMS_URL]]; -} - -- (void)openBugReporterUrl { - [UIApplication.sharedApplication openURL:[NSURL URLWithString:WHISPER_SYSTEMS_BUGREPORT_URL]]; -} - -- (void)openBlogUrl { - [UIApplication.sharedApplication openURL:[NSURL URLWithString:WHISPER_SYSTEMS_BLOG_URL]]; -} - -#pragma mark - UITableViewDelegate - -- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { - if (section == FIRST_SECTION_INDEX) { - return CGRectGetHeight(_firstSectionHeaderView.frame); - } else { - return CGRectGetHeight(_secondSectionHeaderView.frame); - } -} - -- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { - if (section == FIRST_SECTION_INDEX) { - return _firstSectionHeaderView; - } else { - return _secondSectionHeaderView; - } -} - -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return NUMBER_OF_TABLE_VIEW_SECTIONS; -} - -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - if (section == FIRST_SECTION_INDEX) { - return (NSInteger)_firstSectionOptions.count; - } else { - return (NSInteger)_secondSectionOptions.count; - } -} - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - LeftSideMenuCell *cell = [tableView dequeueReusableCellWithIdentifier:SIDE_MENU_TABLE_CELL_IDENTIFIER]; - - if (!cell) { - cell = [[LeftSideMenuCell alloc] initWithStyle:UITableViewCellStyleDefault - reuseIdentifier:SIDE_MENU_TABLE_CELL_IDENTIFIER]; - cell.backgroundColor = [UIColor clearColor]; - } - - if (indexPath.section == FIRST_SECTION_INDEX) { - cell.menuTitleLabel.text = _firstSectionOptions[(NSUInteger)indexPath.row]; - } else { - cell.menuTitleLabel.text = _secondSectionOptions[(NSUInteger)indexPath.row]; - } - - return cell; -} - -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - [tableView deselectRowAtIndexPath:indexPath animated:YES]; - - if (self.isLeftSideViewOpenCompletely) { - NSString *menuOption; - if (indexPath.section == FIRST_SECTION_INDEX) { - menuOption = _firstSectionOptions[(NSUInteger)indexPath.row]; - } else { - menuOption = _secondSectionOptions[(NSUInteger)indexPath.row]; - } - - [self selectMenuOption:menuOption]; - } -} - -@end diff --git a/Signal/src/view controllers/PreferenceListViewController.xib b/Signal/src/view controllers/PreferenceListViewController.xib index 9ec7d7b02..af9c7463b 100644 --- a/Signal/src/view controllers/PreferenceListViewController.xib +++ b/Signal/src/view controllers/PreferenceListViewController.xib @@ -1,8 +1,7 @@ - + - - + diff --git a/Signal/src/view controllers/SettingsViewController.h b/Signal/src/view controllers/SettingsViewController.h deleted file mode 100644 index 3063c4266..000000000 --- a/Signal/src/view controllers/SettingsViewController.h +++ /dev/null @@ -1,54 +0,0 @@ -#import - -#import "LocalizableCustomFontLabel.h" -#import "SettingsTableHeaderView.h" - -/** - * - * SettingsViewController displays a list of settings in sections which can animate between being expanded or collapsed. - * The expanded/collapsed preference of the sections is remembered by the preference util. - * Table cell text labels are localized by setting them to a custom label class that has a localization key which are both set in the xib - - * and localized when the cell appears. - * Preferences are saved to preference util when tapped. - * - */ - -@interface SettingsViewController : UIViewController - -@property (nonatomic, strong) IBOutlet UITableView *settingsTableView; -@property (nonatomic, strong) IBOutlet UILabel *phoneNumberLabel; -@property (nonatomic, strong) IBOutlet UILabel *titleLabel; - -@property (nonatomic, strong) IBOutlet SettingsTableHeaderView *privacyAndSecurityHeaderView; -@property (nonatomic, strong) IBOutlet SettingsTableHeaderView *debuggingHeaderView; -@property (nonatomic, strong) IBOutlet UITableViewCell *hideContactImagesCell; -@property (nonatomic, strong) IBOutlet UITableViewCell *disableAutocorrectCell; -@property (nonatomic, strong) IBOutlet UITableViewCell *disableHistoryCell; -@property (nonatomic, strong) IBOutlet UITableViewCell *clearHistoryLogCell; -@property (nonatomic, strong) IBOutlet UITableViewCell *disableLogsCell; -@property (nonatomic, strong) IBOutlet UITableViewCell *enableScreenSecurityCell; - -@property (nonatomic, strong) IBOutlet UIButton *hideContactImagesButton; -@property (nonatomic, strong) IBOutlet UIButton *disableAutocorrectButton; -@property (nonatomic, strong) IBOutlet UIButton *disableHistoryButton; -@property (nonatomic, strong) IBOutlet UIButton *disableDebugLogsButton; -@property (nonatomic, strong) IBOutlet UIButton *enableScreenSecurityButton; - -@property (nonatomic, strong) IBOutlet UITableViewCell *sendDebugLog; - -- (IBAction)registerTapped; - -- (IBAction)privacyAndSecurityTapped; -- (IBAction)debuggingTapped:(id)sender; - -- (IBAction)hideContactImagesButtonTapped; -- (IBAction)disableAutocorrectButtonTapped; -- (IBAction)disableHistoryButtonTapped; - -- (IBAction)disableLogTapped:(id)sender; - -- (IBAction)enableScreenSecurityTapped:(id)sender; - -- (IBAction)menuButtonTapped; - -@end diff --git a/Signal/src/view controllers/SettingsViewController.m b/Signal/src/view controllers/SettingsViewController.m deleted file mode 100644 index 8945fcc7a..000000000 --- a/Signal/src/view controllers/SettingsViewController.m +++ /dev/null @@ -1,319 +0,0 @@ -#import "DebugLogger.h" -#import "Environment.h" -#import "FutureUtil.h" -#import "LocalizableText.h" -#import "Operation.h" -#import "PreferencesUtil.h" -#import "PhoneNumber.h" -#import "RecentCallManager.h" -#import "RegisterViewController.h" -#import "SettingsViewController.h" -#import "Pastelog.h" -#import "SGNKeychainUtil.h" - -#import "UIViewController+MMDrawerController.h" - -#define SECTION_HEADER_VIEW_HEIGHT 27 -#define PRIVACY_SECTION_INDEX 0 -#define DEBUG_SECTION_INDEX 1 - -static NSString *const CHECKBOX_CHECKMARK_IMAGE_NAME = @"checkbox_checkmark"; -static NSString *const CHECKBOX_EMPTY_IMAGE_NAME = @"checkbox_empty"; - -@interface SettingsViewController () { - NSArray *_sectionHeaderViews; - NSArray *_privacyTableViewCells; - NSArray *_debuggingTableViewCells; - - NSString *gistURL; -} - -@end - -@implementation SettingsViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - - _sectionHeaderViews = @[_privacyAndSecurityHeaderView , self.debuggingHeaderView]; - - _titleLabel.text = SETTINGS_NAV_BAR_TITLE; -} - -- (void)viewWillAppear:(BOOL)animated { - [self configureLocalNumber]; - [self configureAllCells]; - [self configureCheckboxPreferences]; - [self.navigationController setNavigationBarHidden:YES animated:NO]; - [super viewWillAppear:animated]; -} - -- (void)viewWillDisappear:(BOOL)animated { - [self saveExpandedSectionPreferences]; - - if (self.navigationController.viewControllers.count > 1) { - [self.navigationController setNavigationBarHidden:NO animated:YES]; - } - - [super viewWillDisappear:animated]; -} - -- (void)menuButtonTapped { - [self.mm_drawerController openDrawerSide:MMDrawerSideLeft animated:YES completion:nil]; -} - -#pragma mark - Local number - -- (void)configureLocalNumber { - PhoneNumber *localNumber = SGNKeychainUtil.localNumber; - if (localNumber) { - _phoneNumberLabel.attributedText = [self localNumberAttributedStringForNumber:localNumber]; - } else { - _phoneNumberLabel.text = @""; - } -} - -- (NSAttributedString *)localNumberAttributedStringForNumber:(PhoneNumber *)number { - NSString *numberPrefixString = SETTINGS_NUMBER_PREFIX; - NSString *localNumberString = number.toE164; - - NSString *displayString = [NSString stringWithFormat:@"%@ %@", numberPrefixString, localNumberString]; - NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:displayString]; - - UIFont *prefixFont = [UIUtil helveticaNeueLTStdLightFontWithSize:_phoneNumberLabel.font.pointSize]; - UIFont *numberFont = [UIUtil helveticaNeueLTStdBoldFontWithSize:_phoneNumberLabel.font.pointSize]; - - [attributedString addAttribute:NSFontAttributeName - value:prefixFont - range:NSMakeRange(0, numberPrefixString.length)]; - - [attributedString addAttribute:NSFontAttributeName - value:numberFont - range:NSMakeRange(numberPrefixString.length + 1, localNumberString.length)]; - return attributedString; -} - -#pragma mark - Preferences - -- (void)configureCheckboxPreferences { - NSArray *buttons = @[_hideContactImagesButton, - _enableScreenSecurityButton, - _disableAutocorrectButton, - _disableHistoryButton, - _disableDebugLogsButton]; - - for (UIButton *button in buttons) { - [button setImage:[UIImage imageNamed:CHECKBOX_EMPTY_IMAGE_NAME] - forState:UIControlStateNormal]; - - [button setImage:[UIImage imageNamed:CHECKBOX_CHECKMARK_IMAGE_NAME] - forState:UIControlStateSelected]; - } - PropertyListPreferences *prefs = Environment.preferences; - _hideContactImagesButton.selected = !prefs.getContactImagesEnabled; - _enableScreenSecurityButton.selected = prefs.screenSecurityIsEnabled; - _disableAutocorrectButton.selected = !prefs.getAutocorrectEnabled; - _disableHistoryButton.selected = !prefs.getHistoryLogEnabled; - _disableDebugLogsButton.selected = !prefs.loggingIsEnabled; -} - -- (void)configureAllCells { - _privacyTableViewCells = [self privacyAndSecurityCells]; - _debuggingTableViewCells = [self debugCells]; - [_privacyAndSecurityHeaderView setColumnStateExpanded:YES andIsAnimated:NO]; - [_debuggingHeaderView setColumnStateExpanded:YES andIsAnimated:NO]; -} - -- (void)saveExpandedSectionPreferences { - NSMutableArray *expandedSectionPrefs = [NSMutableArray array]; - NSNumber *numberBoolYes = @YES; - NSNumber *numberBoolNo = @NO; - - [expandedSectionPrefs addObject:(_privacyTableViewCells ? numberBoolYes : numberBoolNo)]; -} - -#pragma mark - Table View Helpers - -- (NSArray *)privacyAndSecurityCells { - return @[_hideContactImagesCell, - _enableScreenSecurityCell, - _disableAutocorrectCell, - _disableHistoryCell, - _clearHistoryLogCell]; -} - -- (NSArray *)debugCells{ - - NSMutableArray *cells = [@[_disableLogsCell] mutableCopy]; - - if (Environment.preferences.loggingIsEnabled) { - [cells addObject:_sendDebugLog]; - } - - return cells; -} - -- (NSArray *)indexPathsForCells:(NSArray *)cells forRow:(NSInteger)row { - NSMutableArray *indexPaths = [NSMutableArray array]; - for (NSUInteger i = 0; i < cells.count; i++) { - NSIndexPath *indexPath = [NSIndexPath indexPathForRow:(NSInteger)i inSection:row]; - [indexPaths addObject:indexPath]; - } - return indexPaths; -} - -- (NSArray *)cellsForRow:(NSInteger)row { - if (row == PRIVACY_SECTION_INDEX) { - return [self privacyAndSecurityCells]; - } else if (row == DEBUG_SECTION_INDEX){ - return [self debugCells]; - }else { - return @[]; - } -} - -#pragma mark - Actions - -- (void)registerTapped { - RegisterViewController *registerViewController = [RegisterViewController registerViewController]; - [self presentViewController:registerViewController animated:YES completion:nil]; -} - -- (void)privacyAndSecurityTapped { - [self toggleCells:&_privacyTableViewCells forRow:PRIVACY_SECTION_INDEX]; - BOOL columnExpanded = _privacyTableViewCells != nil; - [_privacyAndSecurityHeaderView setColumnStateExpanded:columnExpanded andIsAnimated:YES]; -} - -- (void)debuggingTapped:(id)sender{ - [self toggleCells:&_debuggingTableViewCells forRow:DEBUG_SECTION_INDEX]; - BOOL columnExpanded = _debuggingTableViewCells != nil; - [_debuggingHeaderView setColumnStateExpanded:columnExpanded andIsAnimated:YES]; -} - -- (void)toggleCells:(NSArray *__strong*)cells forRow:(NSInteger)row { - [_settingsTableView beginUpdates]; - if (*cells) { - [_settingsTableView deleteRowsAtIndexPaths:[self indexPathsForCells:*cells forRow:row] - withRowAnimation:UITableViewRowAnimationFade]; - *cells = nil; - } else { - *cells = [self cellsForRow:row]; - [_settingsTableView insertRowsAtIndexPaths:[self indexPathsForCells:*cells forRow:row] - withRowAnimation:UITableViewRowAnimationFade]; - } - [_settingsTableView endUpdates]; -} - -- (IBAction)hideContactImagesButtonTapped { - _hideContactImagesButton.selected = !_hideContactImagesButton.selected; - [Environment.preferences setContactImagesEnabled:!_hideContactImagesButton.selected]; -} - -- (IBAction)disableAutocorrectButtonTapped { - _disableAutocorrectButton.selected = !_disableAutocorrectButton.selected; - [Environment.preferences setAutocorrectEnabled:!_disableAutocorrectButton.selected]; -} - -- (IBAction)disableHistoryButtonTapped { - _disableHistoryButton.selected = !_disableHistoryButton.selected; - [Environment.preferences setHistoryLogEnabled:!_disableHistoryButton.selected]; -} - -- (IBAction)enableScreenSecurityTapped:(id)sender{ - _enableScreenSecurityButton.selected = !_enableScreenSecurityButton.selected; - [Environment.preferences setScreenSecurity:_enableScreenSecurityButton.selected]; -} - -- (IBAction)disableLogTapped:(id)sender{ - _disableDebugLogsButton.selected = !_disableDebugLogsButton.selected; - - BOOL loggingEnabled = !_disableDebugLogsButton.selected; - - if (!loggingEnabled) { - [DebugLogger.sharedInstance disableFileLogging]; - [DebugLogger.sharedInstance wipeLogs]; - } else{ - [DebugLogger.sharedInstance enableFileLogging]; - } - - [Environment.preferences setLoggingEnabled:loggingEnabled]; - _debuggingTableViewCells = [self debugCells]; - [_settingsTableView reloadData]; -} - -- (void)clearHistory { - [Environment.getCurrent.recentCallManager clearRecentCalls]; - UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:SETTINGS_LOG_CLEAR_TITLE - message:SETTINGS_LOG_CLEAR_MESSAGE - delegate:nil - cancelButtonTitle:nil - otherButtonTitles:SETTINGS_LOG_CLEAR_CONFIRM, nil]; - [alertView show]; -} - -#pragma mark - UITableViewDelegate - -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return (NSInteger)_sectionHeaderViews.count; -} - -- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { - return _sectionHeaderViews[(NSUInteger)section]; -} - -- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { - return SECTION_HEADER_VIEW_HEIGHT; -} - -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - UIView *headerView = _sectionHeaderViews[(NSUInteger)section]; - if (headerView == _privacyAndSecurityHeaderView) { - return (NSInteger)_privacyTableViewCells.count; - } else if (headerView == _debuggingHeaderView){ - return (NSInteger)_debuggingTableViewCells.count; - }else { - return 0; - } -} - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - UIView *headerView = _sectionHeaderViews[(NSUInteger)indexPath.section]; - UITableViewCell *cell = nil; - if (headerView == _privacyAndSecurityHeaderView) { - cell = _privacyTableViewCells[(NSUInteger)indexPath.row]; - } else if (headerView ==_debuggingHeaderView){ - cell = _debuggingTableViewCells[(NSUInteger)indexPath.row]; - } - [self findAndLocalizeLabelsForView:cell]; - - return cell; -} - -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - [tableView deselectRowAtIndexPath:indexPath animated:YES]; - - UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; - if (cell == _clearHistoryLogCell) { - [self clearHistory]; - } - - if (cell == _sendDebugLog) { - [Pastelog submitLogs]; - } -} - - -- (void)findAndLocalizeLabelsForView:(UIView *)view { - for (UIView *subview in view.subviews) { - if ([subview respondsToSelector:@selector(localizationKey)]) { - LocalizableCustomFontLabel *label = (LocalizableCustomFontLabel *)subview; - if (label.localizationKey) { - label.text = NSLocalizedString(label.localizationKey, @""); - } - } - [self findAndLocalizeLabelsForView:subview]; - } -} - -@end diff --git a/Signal/src/view controllers/TabBarParentViewController.h b/Signal/src/view controllers/TabBarParentViewController.h deleted file mode 100644 index 6326d2d46..000000000 --- a/Signal/src/view controllers/TabBarParentViewController.h +++ /dev/null @@ -1,37 +0,0 @@ -#import - -#import "InboxFeedViewController.h" -#import "SettingsViewController.h" - -#define BOTTOM_TAB_BAR_HEIGHT 64 - -@interface TabBarParentViewController : UIViewController - -@property (nonatomic, strong) IBOutlet UIButton *tabBarFavouritesButton; -@property (nonatomic, strong) IBOutlet UIButton *tabBarInboxButton; -@property (nonatomic, strong) IBOutlet UIButton *tabBarContactsButton; -@property (nonatomic, strong) IBOutlet UIButton *tabBarDialerButton; -@property (nonatomic, strong) IBOutlet UIButton *tabBarCallLogButton; - -@property (nonatomic, strong) IBOutlet UILabel *missedCallCountLabel; -@property (nonatomic, strong) IBOutlet UIImageView *whisperUserUpdateImageView; - -@property (nonatomic, strong) IBOutlet UIView *viewControllerFrameView; -@property (nonatomic, strong) InboxFeedViewController *inboxFeedViewController; -@property (nonatomic, strong) SettingsViewController *settingsViewController; - -- (IBAction)presentInboxViewController; -- (IBAction)presentDialerViewController; -- (IBAction)presentContactsViewController; -- (IBAction)presentFavouritesViewController; -- (IBAction)presentRecentCallsViewController; -- (void)presentInviteContactsViewController; - -- (void)presentSettingsViewController; -- (void)updateMissedCallCountLabel; - -- (void)setNewWhisperUsersAsSeen:(NSArray *)users; - -- (void)showDialerViewControllerWithNumber:(PhoneNumber *)number; - -@end diff --git a/Signal/src/view controllers/TabBarParentViewController.m b/Signal/src/view controllers/TabBarParentViewController.m deleted file mode 100644 index 72ad58508..000000000 --- a/Signal/src/view controllers/TabBarParentViewController.m +++ /dev/null @@ -1,210 +0,0 @@ -#import "AppAudioManager.h" -#import "CallLogViewController.h" -#import "ContactBrowseViewController.h" -#import "DialerViewController.h" -#import "Environment.h" -#import "FavouritesViewController.h" -#import "InviteContactsViewController.h" -#import "NotificationManifest.h" -#import "RecentCallManager.h" -#import "RegisterViewController.h" -#import "TabBarParentViewController.h" - -#import - -@interface TabBarParentViewController () { - DialerViewController *_dialerViewController; - ContactBrowseViewController *_contactsViewController; - CallLogViewController *_callLogViewController; - FavouritesViewController *_favouritesViewController; - InviteContactsViewController *_inviteContactsViewController; - - UINavigationController *_contactNavigationController; - UINavigationController *_dialerNavigationController; - UINavigationController *_callLogNavigationController; - UINavigationController *_inboxFeedNavigationController; - UINavigationController *_favouritesNavigationController; - UINavigationController *_settingsNavigationController; - UINavigationController *_inviteContactsNavigationController; - - UIViewController *_currentViewController; -} - -@end - -@implementation TabBarParentViewController - -- (id)init { - if ((self = [super init])) { - _settingsViewController = [SettingsViewController new]; - _inboxFeedViewController = [InboxFeedViewController new]; - _settingsNavigationController = [[UINavigationController alloc] initWithRootViewController:_settingsViewController]; - _inviteContactsViewController = [InviteContactsViewController new]; - _inviteContactsNavigationController = [[UINavigationController alloc] initWithRootViewController:_inviteContactsViewController]; - _contactsViewController = [ContactBrowseViewController new]; - _contactNavigationController = [[UINavigationController alloc] initWithRootViewController:_contactsViewController]; - } - return self; -} - -- (void)viewDidLoad { - [super viewDidLoad]; - [self updateMissedCallCountLabel]; - if (!_currentViewController) { - [self presentInboxViewController]; - } - _whisperUserUpdateImageView.hidden = [self hideUserUpdateNotification]; - - ObservableValue *recentCallObservable = Environment.getCurrent.recentCallManager.getObservableRecentCalls; - [recentCallObservable watchLatestValue:^(NSArray *latestRecents) { - [self updateMissedCallCountLabel]; - } onThread:NSThread.mainThread untilCancelled:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(newUsersDetected:) - name:NOTIFICATION_NEW_USERS_AVAILABLE - object:nil]; - -} - -- (UIStatusBarStyle)preferredStatusBarStyle { - return _currentViewController == _dialerNavigationController ? UIStatusBarStyleDefault: UIStatusBarStyleLightContent; -} - -- (void)presentChildViewController:(UIViewController *)controller { - [self removeCurrentChildViewController]; - _currentViewController = controller; - [self addChildViewController:controller]; - controller.view.frame = _viewControllerFrameView.frame; - [_viewControllerFrameView addSubview:controller.view]; - [controller didMoveToParentViewController:self]; - [self setNeedsStatusBarAppearanceUpdate]; - - _tabBarFavouritesButton.backgroundColor = [UIUtil darkBackgroundColor]; - _tabBarContactsButton.backgroundColor = [UIUtil darkBackgroundColor]; - _tabBarDialerButton.backgroundColor = [UIUtil darkBackgroundColor]; - _tabBarInboxButton.backgroundColor = [UIUtil darkBackgroundColor]; - _tabBarCallLogButton.backgroundColor = [UIUtil darkBackgroundColor]; -} - -- (void)removeCurrentChildViewController { - if (_currentViewController) { - [_currentViewController willMoveToParentViewController:nil]; - [_currentViewController.view removeFromSuperview]; - [_currentViewController removeFromParentViewController]; - } -} - -- (void)presentInboxViewController { - if (!_inboxFeedNavigationController) { - _inboxFeedNavigationController = [[UINavigationController alloc] initWithRootViewController:_inboxFeedViewController]; - } - - if (_currentViewController == _inboxFeedNavigationController) { - [_inboxFeedNavigationController popToRootViewControllerAnimated:YES]; - } else { - [self presentChildViewController:_inboxFeedNavigationController]; - _tabBarInboxButton.backgroundColor = [UIColor darkGrayColor]; - } -} - -- (IBAction)presentDialerViewController { - [self showDialerViewControllerWithNumber:nil]; -} - -- (void)presentContactsViewController { - [_contactNavigationController popToRootViewControllerAnimated:NO]; - [self presentChildViewController:_contactNavigationController]; - _tabBarContactsButton.backgroundColor = [UIColor darkGrayColor]; -} - -- (void)presentRecentCallsViewController { - if (!_callLogViewController) { - _callLogViewController = [CallLogViewController new]; - _callLogNavigationController = [[UINavigationController alloc] initWithRootViewController:_callLogViewController]; - } - - [self presentChildViewController:_callLogNavigationController]; - _tabBarCallLogButton.backgroundColor = [UIColor darkGrayColor]; -} - -- (void)presentFavouritesViewController { - if (!_favouritesViewController) { - _favouritesViewController = [FavouritesViewController new]; - _favouritesNavigationController = [[UINavigationController alloc] initWithRootViewController:_favouritesViewController]; - } - - [_favouritesNavigationController popToRootViewControllerAnimated:NO]; - [self presentChildViewController:_favouritesNavigationController]; - _tabBarFavouritesButton.backgroundColor = [UIColor darkGrayColor]; -} - -- (void)presentInviteContactsViewController { - [_inviteContactsNavigationController popToRootViewControllerAnimated:NO]; - [self presentChildViewController:_inviteContactsNavigationController]; -} - -- (void)presentSettingsViewController { - [self presentChildViewController:_settingsNavigationController]; -} - -- (void)presentLeftSideMenu { - [self.mm_drawerController toggleDrawerSide:MMDrawerSideLeft animated:YES completion:nil]; -} - -- (void)showDialerViewControllerWithNumber:(PhoneNumber *)number { - if (!_dialerViewController) { - _dialerViewController = [DialerViewController new]; - _dialerNavigationController = [[UINavigationController alloc] initWithRootViewController:_dialerViewController]; - } - if (number) { - _dialerViewController.phoneNumber = number; - } - [_dialerNavigationController popToRootViewControllerAnimated:NO]; - [self presentChildViewController:_dialerNavigationController]; - _tabBarDialerButton.backgroundColor = [UIColor darkGrayColor]; -} - -- (void)updateMissedCallCountLabel { - NSUInteger missedCallCount = Environment.getCurrent.recentCallManager.missedCallCount; - if (missedCallCount > 0) { - _tabBarInboxButton.frame = CGRectMake(CGRectGetMinX(_tabBarInboxButton.frame), - CGRectGetMinY(_tabBarInboxButton.frame), - CGRectGetWidth(_tabBarInboxButton.frame), - CGRectGetHeight(_tabBarInboxButton.frame) - CGRectGetHeight(_missedCallCountLabel.frame)); - _missedCallCountLabel.text = [NSString stringWithFormat:@"%lu",(unsigned long)missedCallCount]; - _missedCallCountLabel.hidden = NO; - } else { - _tabBarInboxButton.frame = CGRectMake(CGRectGetMinX(_tabBarInboxButton.frame), - CGRectGetMinY(_tabBarInboxButton.frame), - CGRectGetWidth(_tabBarInboxButton.frame), - CGRectGetHeight(_tabBarInboxButton.frame)); - _missedCallCountLabel.hidden = YES; - } -} - -#pragma mark - Contact Updates - -- (void)newUsersDetected:(NSNotification* )notification { - dispatch_async( dispatch_get_main_queue(), ^{ - NSArray *newUsers = [notification userInfo][NOTIFICATION_DATAKEY_NEW_USERS]; - [self updateNewUsers:newUsers]; - }); -} - -- (void)updateNewUsers:(NSArray *)users { - [_inviteContactsViewController updateWithNewWhisperUsers:users]; - [_contactsViewController showNotificationForNewWhisperUsers:users]; - _whisperUserUpdateImageView.hidden = [self hideUserUpdateNotification]; -} - -- (void)setNewWhisperUsersAsSeen:(NSArray *)users { - [Environment.getCurrent.contactsManager addContactsToKnownWhisperUsers:users]; - [_contactsViewController showNotificationForNewWhisperUsers:nil]; - _whisperUserUpdateImageView.hidden = [self hideUserUpdateNotification]; - } - --(BOOL) hideUserUpdateNotification { - return (0 == Environment.getCurrent.contactsManager.getNumberOfUnacknowledgedCurrentUsers); -} -@end diff --git a/Signal/src/view controllers/TabBarParentViewController.xib b/Signal/src/view controllers/TabBarParentViewController.xib deleted file mode 100644 index d74eeb275..000000000 --- a/Signal/src/view controllers/TabBarParentViewController.xib +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Signal/src/view controllers/xibs/CallLogViewController.xib b/Signal/src/view controllers/xibs/CallLogViewController.xib deleted file mode 100644 index 53454745d..000000000 --- a/Signal/src/view controllers/xibs/CallLogViewController.xib +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Signal/src/view controllers/xibs/ContactBrowseViewController.xib b/Signal/src/view controllers/xibs/ContactBrowseViewController.xib deleted file mode 100644 index 37f0f01e4..000000000 --- a/Signal/src/view controllers/xibs/ContactBrowseViewController.xib +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Signal/src/view controllers/xibs/ContactDetailTableViewCell.xib b/Signal/src/view controllers/xibs/ContactDetailTableViewCell.xib index 26a459533..262261880 100644 --- a/Signal/src/view controllers/xibs/ContactDetailTableViewCell.xib +++ b/Signal/src/view controllers/xibs/ContactDetailTableViewCell.xib @@ -1,7 +1,6 @@ - + - diff --git a/Signal/src/view controllers/xibs/ContactDetailViewController.xib b/Signal/src/view controllers/xibs/ContactDetailViewController.xib index 6604aac53..d58b4ca72 100644 --- a/Signal/src/view controllers/xibs/ContactDetailViewController.xib +++ b/Signal/src/view controllers/xibs/ContactDetailViewController.xib @@ -1,7 +1,6 @@ - + - diff --git a/Signal/src/view controllers/xibs/FavouritesViewController.xib b/Signal/src/view controllers/xibs/FavouritesViewController.xib deleted file mode 100644 index 95a0623da..000000000 --- a/Signal/src/view controllers/xibs/FavouritesViewController.xib +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Signal/src/view controllers/xibs/InboxFeedViewController.xib b/Signal/src/view controllers/xibs/InboxFeedViewController.xib deleted file mode 100644 index 052478c84..000000000 --- a/Signal/src/view controllers/xibs/InboxFeedViewController.xib +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Signal/src/view controllers/xibs/LeftSideMenuViewController.xib b/Signal/src/view controllers/xibs/LeftSideMenuViewController.xib deleted file mode 100644 index 5ef38807c..000000000 --- a/Signal/src/view controllers/xibs/LeftSideMenuViewController.xib +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Signal/src/view controllers/xibs/RegisterViewController.xib b/Signal/src/view controllers/xibs/RegisterViewController.xib index f4a8dea53..1e823bd5b 100644 --- a/Signal/src/view controllers/xibs/RegisterViewController.xib +++ b/Signal/src/view controllers/xibs/RegisterViewController.xib @@ -1,5 +1,5 @@ - + diff --git a/Signal/src/view controllers/xibs/SettingsViewController.xib b/Signal/src/view controllers/xibs/SettingsViewController.xib deleted file mode 100644 index 70211cd64..000000000 --- a/Signal/src/view controllers/xibs/SettingsViewController.xib +++ /dev/null @@ -1,477 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Signal/src/views/CallLogTableViewCell.h b/Signal/src/views/CallLogTableViewCell.h deleted file mode 100644 index a693e8c55..000000000 --- a/Signal/src/views/CallLogTableViewCell.h +++ /dev/null @@ -1,36 +0,0 @@ -#import -#import "RecentCall.h" -#import "Contact.h" -#import "NextResponderScrollView.h" - -/** - * - * RecentCallTableViewCell displays a Recent Call object and handles deleting by - - * swiping past an offset greater than the delete button width - * - */ - -@class CallLogTableViewCell; -@protocol CallLogTableViewCellDelegate - -- (void)recentCallTableViewCellTappedDelete:(CallLogTableViewCell *)cell; -- (void)recentCallTableViewCellTappedCall:(CallLogTableViewCell *)cell; - -@end - -@interface CallLogTableViewCell : UITableViewCell - -@property (nonatomic, strong) IBOutlet UILabel *contactNameLabel; -@property (nonatomic, strong) IBOutlet UILabel *contactNumberLabel; -@property (nonatomic, strong) IBOutlet UILabel *timeLabel; -@property (nonatomic, strong) IBOutlet UIImageView *callTypeImageView; -@property (nonatomic, strong) IBOutlet NextResponderScrollView *scrollView; -@property (nonatomic, strong) IBOutlet UIView *contentContainerView; -@property (nonatomic, strong) IBOutlet UIView *deleteView; -@property (nonatomic, strong) IBOutlet UIImageView *deleteImageView; -@property (nonatomic, assign) id delegate; - -- (void)configureWithRecentCall:(RecentCall *)recentCall; -- (IBAction)phoneCallButtonTapped; - -@end diff --git a/Signal/src/views/CallLogTableViewCell.m b/Signal/src/views/CallLogTableViewCell.m deleted file mode 100644 index f81606afe..000000000 --- a/Signal/src/views/CallLogTableViewCell.m +++ /dev/null @@ -1,98 +0,0 @@ -#import "CallLogTableViewCell.h" -#import "Environment.h" -#import "ContactsManager.h" -#import "PreferencesUtil.h" -#import "LocalizableText.h" -#import "Util.h" - -#define DELETE_IMAGE_VIEW_WIDTH 19.0f - -@implementation CallLogTableViewCell - -- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { - - self = [NSBundle.mainBundle loadNibNamed:NSStringFromClass(self.class) - owner:self - options:nil][0]; - if (self) { - _scrollView.contentSize = CGSizeMake(CGRectGetWidth(_contentContainerView.bounds), - CGRectGetHeight(_scrollView.frame)); - _deleteImageView.image = [_deleteImageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - } - return self; -} - -- (NSString *)reuseIdentifier { - return NSStringFromClass(self.class); -} - -- (void)prepareForReuse { - _scrollView.contentOffset = CGPointMake(0, 0); - [super prepareForReuse]; -} - -- (void)configureWithRecentCall:(RecentCall *)recentCall { - Contact *contact = [Environment.getCurrent.contactsManager latestContactWithRecordId:recentCall.contactRecordID]; - if (contact) { - _contactNameLabel.text = contact.fullName; - } else { - _contactNameLabel.text = UNKNOWN_CONTACT_NAME; - } - - if (recentCall.callType == RPRecentCallTypeOutgoing) { - _callTypeImageView.image = [UIImage imageNamed:CALL_TYPE_IMAGE_NAME_OUTGOING]; - } else { - _callTypeImageView.image = [UIImage imageNamed:CALL_TYPE_IMAGE_NAME_INCOMING]; - } - - _contactNumberLabel.text = recentCall.phoneNumber.localizedDescriptionForUser; - - if ([DateUtil dateIsOlderThanOneWeek:[recentCall date]]) { - _timeLabel.text = [[DateUtil dateFormatter] stringFromDate:[recentCall date]]; - } else { - _timeLabel.text = [[DateUtil weekdayFormatter] stringFromDate:[recentCall date]]; - } -} - -#pragma mark - UIScrollViewDelegate - -- (void)scrollViewDidScroll:(UIScrollView *)scrollView { - - if (scrollView.contentOffset.x > CGRectGetWidth(_deleteView.frame)) { - _deleteImageView.tintColor = [UIUtil redColor]; - - _deleteImageView.bounds = CGRectMake(_deleteImageView.bounds.origin.x, - _deleteImageView.bounds.origin.y, - DELETE_IMAGE_VIEW_WIDTH, - _deleteImageView.bounds.size.height); - } else { - - double ratio = _scrollView.contentOffset.x / CGRectGetWidth(_deleteView.frame); - double newWidth = DELETE_IMAGE_VIEW_WIDTH/2 + (DELETE_IMAGE_VIEW_WIDTH * ratio)/2.0f; - - _deleteImageView.bounds = CGRectMake(_deleteImageView.bounds.origin.x, - _deleteImageView.bounds.origin.y, - (CGFloat)newWidth, - _deleteImageView.bounds.size.height); - _deleteImageView.tintColor = UIColor.whiteColor; - } -} - -- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView - withVelocity:(CGPoint)velocity - targetContentOffset:(inout CGPoint *)targetContentOffset { - - if (scrollView.contentOffset.x > CGRectGetWidth(_deleteView.frame)) { - [_delegate recentCallTableViewCellTappedDelete:self]; - } else { - *targetContentOffset = CGPointMake(0, 0); - } -} - -#pragma mark - Actions - -- (IBAction)phoneCallButtonTapped { - [_delegate recentCallTableViewCellTappedCall:self]; -} - -@end diff --git a/Signal/src/views/InboxFeedFooterCell.h b/Signal/src/views/InboxFeedFooterCell.h deleted file mode 100644 index c2b944473..000000000 --- a/Signal/src/views/InboxFeedFooterCell.h +++ /dev/null @@ -1,15 +0,0 @@ -#import - -/** - * - * The last cell of Inbox feed that displays an active count of the items left to be archived/deleted - * - */ - -@interface InboxFeedFooterCell : UITableViewCell - -@property (nonatomic, strong) IBOutlet UILabel *inboxCountLabel; -@property (nonatomic, strong) IBOutlet UILabel *inboxMessageLabelFirst; -@property (nonatomic, strong) IBOutlet UILabel *inboxMessageLabelSecond; - -@end diff --git a/Signal/src/views/InboxFeedFooterCell.m b/Signal/src/views/InboxFeedFooterCell.m deleted file mode 100644 index 821616464..000000000 --- a/Signal/src/views/InboxFeedFooterCell.m +++ /dev/null @@ -1,31 +0,0 @@ -#import "InboxFeedFooterCell.h" -#import "RecentCallManager.h" -#import "LocalizableText.h" - -@implementation InboxFeedFooterCell - -- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { - self = [NSBundle.mainBundle loadNibNamed:NSStringFromClass(self.class) owner:self options:nil][0]; - if (self) { - ObservableValue *recentCallObserver = Environment.getCurrent.recentCallManager.getObservableRecentCalls; - [recentCallObserver watchLatestValue:^(id latestValue) { - NSUInteger inboxCount = [[Environment.getCurrent.recentCallManager recentsForSearchString:nil andExcludeArchived:YES] count]; - if (inboxCount == 0) { - _inboxCountLabel.text = @""; - _inboxMessageLabelFirst.text = HOME_FOOTER_FIRST_MESSAGE_CALLS_NIL; - _inboxMessageLabelSecond.text = HOME_FOOTER_SECOND_MESSAGE_CALLS_NIL; - } else { - _inboxCountLabel.text = [NSString stringWithFormat:@"%lu", (unsigned long)inboxCount]; - _inboxMessageLabelFirst.text = HOME_FOOTER_FIRST_MESSAGE_CALLS_UNSORTED; - _inboxMessageLabelSecond.text = inboxCount == 1 ? HOME_FOOTER_SECOND_MESSAGE_CALL_UNSORTED : HOME_FOOTER_SECOND_MESSAGE_CALLS_UNSORTED; - } - } onThread:NSThread.mainThread untilCancelled:nil]; - } - return self; -} - -- (NSString *)reuseIdentifier { - return NSStringFromClass(self.class); -} - -@end diff --git a/Signal/src/views/InboxFeedFooterCell.xib b/Signal/src/views/InboxFeedFooterCell.xib deleted file mode 100644 index 59abff1da..000000000 --- a/Signal/src/views/InboxFeedFooterCell.xib +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Signal/src/views/InboxFeedTableViewCell.h b/Signal/src/views/InboxFeedTableViewCell.h deleted file mode 100644 index beb6a759a..000000000 --- a/Signal/src/views/InboxFeedTableViewCell.h +++ /dev/null @@ -1,41 +0,0 @@ -#import -#import "RecentCall.h" -#import "ContactsManager.h" -#import "NextResponderScrollView.h" -#import "DemoDataModel.h" - -/** - * - * InboxFeedTableViewCell displays a non-archived Recent Call object and delegates deleting and archiving. - * Archiving and deleting is started by the scroll view being scrolled past/below an offset greater than the respective button. - * - */ - -@class InboxFeedTableViewCell; -@protocol InboxFeedTableViewCellDelegate - -- (void)inboxFeedTableViewCellTappedDelete:(InboxFeedTableViewCell *)cell; -- (void)inboxFeedTableViewCellTappedArchive:(InboxFeedTableViewCell *)cell; - -@end - -@interface InboxFeedTableViewCell : UITableViewCell - -@property (nonatomic, strong) IBOutlet UILabel *nameLabel; -@property (nonatomic, strong) IBOutlet UIImageView *contactPictureView; -@property (nonatomic, strong) IBOutlet UIImageView *callTypeImageView; -@property (nonatomic, strong) IBOutlet UILabel *numberLabel; -@property (nonatomic, strong) IBOutlet UILabel *timeLabel; -@property (nonatomic, strong) IBOutlet NextResponderScrollView *scrollView; -@property (nonatomic, strong) IBOutlet UIView *contentContainerView; -@property (nonatomic, strong) IBOutlet UIView *missedCallView; -@property (nonatomic, strong) IBOutlet UIView *deleteView; -@property (nonatomic, strong) IBOutlet UIView *archiveView; -@property (nonatomic, strong) IBOutlet UIImageView *deleteImageView; -@property (nonatomic, strong) IBOutlet UIImageView *archiveImageView; -@property (nonatomic, assign) id delegate; - --(void)configureWithRecentCall:(RecentCall *)recentCall; --(void)configureWithTestMessage:(DemoDataModel*)testMessage; - -@end diff --git a/Signal/src/views/InboxFeedTableViewCell.m b/Signal/src/views/InboxFeedTableViewCell.m deleted file mode 100644 index 5d7a979ab..000000000 --- a/Signal/src/views/InboxFeedTableViewCell.m +++ /dev/null @@ -1,171 +0,0 @@ -#import "InboxFeedTableViewCell.h" -#import "LocalizableText.h" -#import "Environment.h" -#import "Util.h" - - -#define ARCHIVE_IMAGE_VIEW_WIDTH 22.0f -#define DELETE_IMAGE_VIEW_WIDTH 19.0f -#define TIME_LABEL_SIZE 10 -#define DATE_LABEL_SIZE 13 - -#define MISSED_CALL_VIEW_CORNER_RADIUS 6.0f - -@implementation InboxFeedTableViewCell - -- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { - self = [NSBundle.mainBundle loadNibNamed:NSStringFromClass(self.class) - owner:self - options:nil][0]; - - - if (self) { - _scrollView.contentSize = CGSizeMake(CGRectGetWidth(_contentContainerView.bounds), - CGRectGetHeight(_scrollView.frame)); - - [UIUtil applyRoundedBorderToImageView:&_contactPictureView]; - - _scrollView.contentOffset = CGPointMake(CGRectGetWidth(_archiveView.frame), 0); - _missedCallView.layer.cornerRadius = MISSED_CALL_VIEW_CORNER_RADIUS; - _deleteImageView.image = [_deleteImageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - _archiveImageView.image = [_archiveImageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - } - return self; -} - -- (NSString *)reuseIdentifier { - return NSStringFromClass(self.class); -} - --(void)configureWithTestMessage:(DemoDataModel*)testMessage { - _nameLabel.text = testMessage._sender; - _contactPictureView.image = nil; - - _callTypeImageView.image = [UIImage imageNamed:CALL_TYPE_IMAGE_NAME_OUTGOING]; - - _missedCallView.hidden = NO; - _numberLabel.text = @"123-456-7890"; - _timeLabel.attributedText = [[NSAttributedString alloc] initWithString:@"21:58"]; - -} - -- (void)configureWithRecentCall:(RecentCall *)recentCall { - Contact *contact = [Environment.getCurrent.contactsManager latestContactWithRecordId:recentCall.contactRecordID]; - - if (contact) { - _nameLabel.text = contact.fullName; - if (contact.image) { - _contactPictureView.image = contact.image; - } else { - _contactPictureView.image = nil; - } - } else { - _nameLabel.text = UNKNOWN_CONTACT_NAME; - _contactPictureView.image = nil; - } - - if (recentCall.callType == RPRecentCallTypeOutgoing) { - _callTypeImageView.image = [UIImage imageNamed:CALL_TYPE_IMAGE_NAME_OUTGOING]; - } else { - _callTypeImageView.image = [UIImage imageNamed:CALL_TYPE_IMAGE_NAME_INCOMING]; - } - - _missedCallView.hidden = recentCall.userNotified; - _numberLabel.text = recentCall.phoneNumber.localizedDescriptionForUser; - _timeLabel.attributedText = [self dateArrributedString:[recentCall date]]; -} - -#pragma mark - Date formatting - -- (NSAttributedString *)dateArrributedString:(NSDate *)date { - - NSString *dateString; - NSString *timeString = [[DateUtil timeFormatter] stringFromDate:date]; - - - if ([DateUtil dateIsOlderThanOneWeek:date]) { - dateString = [[DateUtil dateFormatter] stringFromDate:date]; - } else { - dateString = [[DateUtil weekdayFormatter] stringFromDate:date]; - } - - NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:[timeString stringByAppendingString:dateString]]; - - [attributedString addAttribute:NSForegroundColorAttributeName - value:[UIColor darkGrayColor] - range:NSMakeRange(0, timeString.length)]; - - [attributedString addAttribute:NSForegroundColorAttributeName - value:[UIUtil darkBackgroundColor] - range:NSMakeRange(timeString.length,dateString.length)]; - - [attributedString addAttribute:NSFontAttributeName - value:[UIUtil helveticaLightWithSize:TIME_LABEL_SIZE] - range:NSMakeRange(0, timeString.length)]; - - [attributedString addAttribute:NSFontAttributeName - value:[UIUtil helveticaRegularWithSize:DATE_LABEL_SIZE] - range:NSMakeRange(timeString.length,dateString.length)]; - - return attributedString; -} - -#pragma mark - UIScrollViewDelegate - -- (void)scrollViewDidScroll:(UIScrollView *)scrollView { - - if (_scrollView.contentOffset.x < 0) { - _archiveImageView.tintColor = [UIUtil redColor]; - _archiveImageView.bounds = CGRectMake(_archiveImageView.bounds.origin.x, - _archiveImageView.bounds.origin.y, - ARCHIVE_IMAGE_VIEW_WIDTH, - _archiveImageView.bounds.size.height); - } else { - - double ratio = (_archiveView.frame.size.width/2.0f - _scrollView.contentOffset.x) / (_archiveView.frame.size.width/2.0f); - double newWidth = ARCHIVE_IMAGE_VIEW_WIDTH/2 + (ARCHIVE_IMAGE_VIEW_WIDTH * ratio)/2.0f; - _archiveImageView.bounds = CGRectMake(_archiveImageView.bounds.origin.x, - _archiveImageView.bounds.origin.y, - (CGFloat)newWidth, - _archiveImageView.bounds.size.height); - _archiveImageView.tintColor = UIColor.whiteColor; - - } - - if (scrollView.contentOffset.x > CGRectGetWidth(_archiveView.frame)*2) { - _deleteImageView.tintColor = [UIUtil redColor]; - _deleteImageView.bounds = CGRectMake(_deleteImageView.bounds.origin.x, - _deleteImageView.bounds.origin.y, - DELETE_IMAGE_VIEW_WIDTH, - _deleteImageView.bounds.size.height); - } else { - - double ratio = _scrollView.contentOffset.x / (CGRectGetWidth(_deleteView.frame)*2); - double newWidth = DELETE_IMAGE_VIEW_WIDTH/2 + (DELETE_IMAGE_VIEW_WIDTH * ratio)/2.0f; - - _deleteImageView.bounds = CGRectMake(_deleteImageView.bounds.origin.x, - _deleteImageView.bounds.origin.y, - (CGFloat)newWidth, - _deleteImageView.bounds.size.height); - _deleteImageView.tintColor = UIColor.whiteColor; - } -} - -- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView - withVelocity:(CGPoint)velocity - targetContentOffset:(inout CGPoint *)targetContentOffset { - - if (_scrollView.contentOffset.x < 0) { - [_delegate inboxFeedTableViewCellTappedArchive:self]; - } else { - *targetContentOffset = CGPointMake(CGRectGetWidth(_archiveView.frame), 0); - } - - if (scrollView.contentOffset.x > CGRectGetWidth(_archiveView.frame)*2) { - [_delegate inboxFeedTableViewCellTappedDelete:self]; - } else { - *targetContentOffset = CGPointMake(CGRectGetWidth(_archiveView.frame), 0); - } -} - -@end diff --git a/Signal/src/views/SearchBarTitleView.m b/Signal/src/views/SearchBarTitleView.m index d4f0b1740..ff2886397 100644 --- a/Signal/src/views/SearchBarTitleView.m +++ b/Signal/src/views/SearchBarTitleView.m @@ -3,7 +3,6 @@ #import "PreferencesUtil.h" #import "LocalizableText.h" -#import #define SEARCH_BAR_ANIMATION_DURATION 0.25 diff --git a/Signal/src/views/xibs/CallLogTableViewCell.xib b/Signal/src/views/xibs/CallLogTableViewCell.xib deleted file mode 100644 index 68ddf1a75..000000000 --- a/Signal/src/views/xibs/CallLogTableViewCell.xib +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Signal/src/views/xibs/InboxFeedTableViewCell.xib b/Signal/src/views/xibs/InboxFeedTableViewCell.xib deleted file mode 100644 index 1937e3c4d..000000000 --- a/Signal/src/views/xibs/InboxFeedTableViewCell.xib +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Signal/test/fr.lproj/InfoPlist.strings b/Signal/test/fr.lproj/InfoPlist.strings deleted file mode 100644 index 477b28ff8..000000000 --- a/Signal/test/fr.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/Signal/test/textsecure/CryptographyTests.mm b/Signal/test/textsecure/CryptographyTests.mm new file mode 100644 index 000000000..c5ed7e2e7 --- /dev/null +++ b/Signal/test/textsecure/CryptographyTests.mm @@ -0,0 +1,59 @@ +// +// CryptographyTests.m +// TextSecureiOS +// +// Created by Christine Corbett Moran on 12/19/13. +// Copyright (c) 2013 Open Whisper Systems. All rights reserved. +// + +#import +#include +#import "Cryptography.h" +#import "NSData+Base64.h" + +@interface CryptographyTests : XCTestCase + +@end + + +@interface Cryptography (Test) ++(NSData*) truncatedSHA256HMAC:(NSData*)dataToHMAC withHMACKey:(NSData*)HMACKey truncation:(int)bytes; ++(NSData*)encryptCBCMode:(NSData*) dataToEncrypt withKey:(NSData*) key withIV:(NSData*) iv withVersion:(NSData*)version withHMACKey:(NSData*) hmacKey withHMACType:(TSMACType)hmacType computedHMAC:(NSData**)hmac; ++(NSData*) decryptCBCMode:(NSData*) dataToDecrypt withKey:(NSData*) key withIV:(NSData*) iv withVersion:(NSData*)version withHMACKey:(NSData*) hmacKey withHMACType:(TSMACType)hmacType forHMAC:(NSData *)hmac; +@end + +@implementation CryptographyTests + + +-(void) testLocalDecryption { + NSString* originalMessage = @"Hawaii is awesome"; + NSString* signalingKeyString = @"VJuRzZcwuY/6VjGw+QSPy5ROzHo8xE36mKwHNvkfyZ+mSPaDlSDcenUqavIX1Vwn\nRRIdrg=="; + NSData* signalingKey = [NSData dataFromBase64String:signalingKeyString]; + XCTAssertTrue([signalingKey length]==52, @"signaling key is not 52 bytes but %llu", (unsigned long long)[signalingKey length]); + NSData* signalingKeyAESKeyMaterial = [signalingKey subdataWithRange:NSMakeRange(0, 32)]; + NSData* signalingKeyHMACKeyMaterial = [signalingKey subdataWithRange:NSMakeRange(32, 20)]; + NSData* iv = [Cryptography generateRandomBytes:16]; + NSData* version = [Cryptography generateRandomBytes:1]; + NSData* mac; + + NSData* encryption = [Cryptography encryptCBCMode:[originalMessage dataUsingEncoding:NSUTF8StringEncoding] withKey:signalingKeyAESKeyMaterial withIV:iv withVersion:version withHMACKey:signalingKeyHMACKeyMaterial withHMACType:TSHMACSHA1Truncated10Bytes computedHMAC:&mac]; //Encrypt + + NSMutableData *dataToHmac = [NSMutableData data ]; + [dataToHmac appendData:version]; + [dataToHmac appendData:iv]; + [dataToHmac appendData:encryption]; + + + NSData* expectedHmac = [Cryptography truncatedSHA1HMAC:dataToHmac withHMACKey:signalingKeyHMACKeyMaterial truncation:10]; + + XCTAssertTrue([mac isEqualToData:expectedHmac], @"Hmac of encrypted data %@, not equal to expected hmac %@", [mac base64EncodedString], [expectedHmac base64EncodedString]); + + NSData* decryption=[Cryptography decryptCBCMode:encryption withKey:signalingKeyAESKeyMaterial withIV:iv withVersion:version withHMACKey:signalingKeyHMACKeyMaterial withHMACType:TSHMACSHA1Truncated10Bytes forHMAC:mac]; + + NSString* decryptedMessage = [[NSString alloc] initWithData:decryption encoding:NSUTF8StringEncoding]; + XCTAssertTrue([decryptedMessage isEqualToString:originalMessage], @"Decrypted message: %@ is not equal to original: %@",decryptedMessage,originalMessage); + +} + +@end + diff --git a/Signal/test/textsecure/TSMessageStorageTests.m b/Signal/test/textsecure/TSMessageStorageTests.m new file mode 100644 index 000000000..ba7397b39 --- /dev/null +++ b/Signal/test/textsecure/TSMessageStorageTests.m @@ -0,0 +1,108 @@ +// +// TSMessageStorageTests.m +// TextSecureKit +// +// Created by Frederic Jacobs on 16/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import +#import + +#import "TSThread.h" +#import "TSContactThread.h" +#import "TSGroupThread.h" + +#import "TSStorageManager.h" + +#import "TSMessage.h" +#import "TSErrorMessage.h" +#import "TSInfoMessage.h" +#import "TSIncomingMessage.h" +#import "TSCall.h" +#import "TSOutgoingMessage.h" + + +@interface TSMessageStorageTests : XCTestCase + +@property TSContactThread *thread; + +@end + +@implementation TSMessageStorageTests + +- (void)setUp { + [super setUp]; + + self.thread = [TSContactThread threadWithContactId:@"aStupidId"]; + + [self.thread save]; + + TSStorageManager *manager = [TSStorageManager sharedManager]; + [manager purgeCollection:[TSMessage collection]]; +} + +- (void)tearDown { + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testStoreIncomingMessage { + uint64_t timestamp = 666; + + NSString *body = @"A child born today will grow up with no conception of privacy at all. They’ll never know what it means to have a private moment to themselves an unrecorded, unanalyzed thought. And that’s a problem because privacy matters; privacy is what allows us to determine who we are and who we want to be."; + + TSIncomingMessage *newMessage = [[TSIncomingMessage alloc] initWithTimestamp:timestamp + inThread:self.thread + messageBody:body + attachements:nil]; + [newMessage save]; + + + TSIncomingMessage *fetchedMessage = [TSIncomingMessage fetchObjectWithUniqueID:[TSInteraction stringFromTimeStamp:timestamp]]; + + NSAssert([fetchedMessage.body isEqualToString:body], @"Body of incoming message recovered"); + NSAssert(fetchedMessage.attachements == nil, @"Attachements are nil"); + NSAssert([fetchedMessage.uniqueId isEqualToString:[TSInteraction stringFromTimeStamp:timestamp]], @"Unique identifier is accurate"); + NSAssert(fetchedMessage.wasRead == false, @"Message should originally be unread"); + NSAssert([fetchedMessage.uniqueThreadId isEqualToString:self.thread.uniqueId], @"Isn't stored in the right thread!"); +} + +- (void)testMessagesDeletedOnThreadDeletion { + uint64_t timestamp = 666; + NSString *body = @"A child born today will grow up with no conception of privacy at all. They’ll never know what it means to have a private moment to themselves an unrecorded, unanalyzed thought. And that’s a problem because privacy matters; privacy is what allows us to determine who we are and who we want to be."; + + for (uint64_t i = timestamp; i<100; i++) { + TSIncomingMessage *newMessage = [[TSIncomingMessage alloc] initWithTimestamp:i + inThread:self.thread + messageBody:body + attachements:nil]; + [newMessage save]; + } + + + + [[TSStorageManager sharedManager].databaseConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) { + for (uint64_t i = timestamp; i<100; i++) { + TSIncomingMessage *fetchedMessage = [TSIncomingMessage fetchObjectWithUniqueID:[TSInteraction stringFromTimeStamp:timestamp] transaction:transaction]; + + NSAssert([fetchedMessage.body isEqualToString:body], @"Body of incoming message recovered"); + NSAssert(fetchedMessage.attachements == nil, @"Attachements are nil"); + NSAssert([fetchedMessage.uniqueId isEqualToString:[TSInteraction stringFromTimeStamp:timestamp]], @"Unique identifier is accurate"); + NSAssert(fetchedMessage.wasRead == false, @"Message should originally be unread"); + NSAssert([fetchedMessage.uniqueThreadId isEqualToString:self.thread.uniqueId], @"Isn't stored in the right thread!"); + } + }]; + + + [self.thread remove]; + + [[TSStorageManager sharedManager].databaseConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) { + for (uint64_t i = timestamp; i<1000; i++) { + TSIncomingMessage *fetchedMessage = [TSIncomingMessage fetchObjectWithUniqueID:[TSInteraction stringFromTimeStamp:timestamp] transaction:transaction]; + NSAssert(fetchedMessage == nil, @"Message should be deleted!"); + } + }]; +} + +@end diff --git a/Signal/test/textsecure/TSStorageIdentityKeyStoreTests.m b/Signal/test/textsecure/TSStorageIdentityKeyStoreTests.m new file mode 100644 index 000000000..1c3b626d2 --- /dev/null +++ b/Signal/test/textsecure/TSStorageIdentityKeyStoreTests.m @@ -0,0 +1,67 @@ +// +// TSStorageIdentityKeyStoreTests.m +// TextSecureKit +// +// Created by Frederic Jacobs on 06/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import +#import <25519/Curve25519.h> + +#import "TSStorageManager+IdentityKeyStore.h" +#import "SecurityUtils.h" + +@interface TSStorageIdentityKeyStoreTests : XCTestCase + +@end + +@implementation TSStorageIdentityKeyStoreTests + +- (void)setUp { + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown { + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testNewEmptyKey { + NSData *newKey = [SecurityUtils generateRandomBytes:32]; + NSString *recipientId = @"test@gmail.com"; + + XCTAssert([[TSStorageManager sharedManager] isTrustedIdentityKey:newKey recipientId:recipientId]); +} + +- (void)testAlreadyRegisteredKey { + NSData *newKey = [SecurityUtils generateRandomBytes:32]; + NSString *recipientId = @"test@gmail.com"; + + [[TSStorageManager sharedManager] saveRemoteIdentity:newKey recipientId:recipientId]; + + XCTAssert([[TSStorageManager sharedManager] isTrustedIdentityKey:newKey recipientId:recipientId]); +} + + +- (void)testChangedKey { + NSData *newKey = [SecurityUtils generateRandomBytes:32]; + NSString *recipientId = @"test@gmail.com"; + + [[TSStorageManager sharedManager] saveRemoteIdentity:newKey recipientId:recipientId]; + + XCTAssert([[TSStorageManager sharedManager] isTrustedIdentityKey:newKey recipientId:recipientId]); + + NSData *otherKey = [SecurityUtils generateRandomBytes:32]; + + XCTAssertFalse([[TSStorageManager sharedManager] isTrustedIdentityKey:otherKey recipientId:recipientId]); +} + +- (void)testIdentityKey { + [[TSStorageManager sharedManager] generateNewIdentityKey]; + + XCTAssert([[[TSStorageManager sharedManager] identityKeyPair].publicKey length] == 32); +} + +@end diff --git a/Signal/test/textsecure/TSStoragePreKeyStoreTests.m b/Signal/test/textsecure/TSStoragePreKeyStoreTests.m new file mode 100644 index 000000000..595f982cb --- /dev/null +++ b/Signal/test/textsecure/TSStoragePreKeyStoreTests.m @@ -0,0 +1,65 @@ +// +// TSStoragePreKeyStoreTests.m +// TextSecureKit +// +// Created by Frederic Jacobs on 07/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "TSStorageManager+PreKeyStore.h" +#import + +#import + +@interface TSStoragePreKeyStoreTests : XCTestCase + +@end + +@implementation TSStoragePreKeyStoreTests + +- (void)setUp { + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown { + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testGeneratingAndStoringPreKeys { + NSArray *generatedKeys = [[TSStorageManager sharedManager] generatePreKeyRecords]; + + + XCTAssert([generatedKeys count] == 100, @"Not hundred keys generated"); + + [[TSStorageManager sharedManager] storePreKeyRecords:generatedKeys]; + + PreKeyRecord *lastPreKeyRecord = [generatedKeys lastObject]; + PreKeyRecord *firstPreKeyRecord = [generatedKeys firstObject]; + + XCTAssert([[[TSStorageManager sharedManager] loadPreKey:lastPreKeyRecord.Id].keyPair.publicKey isEqualToData:lastPreKeyRecord.keyPair.publicKey]); + + XCTAssert([[[TSStorageManager sharedManager] loadPreKey:firstPreKeyRecord.Id].keyPair.publicKey isEqualToData:firstPreKeyRecord.keyPair.publicKey]); + +} + + +- (void)testRemovingPreKeys { + NSArray *generatedKeys = [[TSStorageManager sharedManager] generatePreKeyRecords]; + + XCTAssert([generatedKeys count] == 100, @"Not hundred keys generated"); + + [[TSStorageManager sharedManager] storePreKeyRecords:generatedKeys]; + + PreKeyRecord *lastPreKeyRecord = [generatedKeys lastObject]; + PreKeyRecord *firstPreKeyRecord = [generatedKeys firstObject]; + + [[TSStorageManager sharedManager] removePreKey:lastPreKeyRecord.Id]; + + XCTAssertThrows([[TSStorageManager sharedManager] loadPreKey:lastPreKeyRecord.Id]); + XCTAssertNoThrow([[TSStorageManager sharedManager] loadPreKey:firstPreKeyRecord.Id]); + +} + +@end diff --git a/Signal/test/textsecure/TSStorageSignedPreKeyStore.m b/Signal/test/textsecure/TSStorageSignedPreKeyStore.m new file mode 100644 index 000000000..f8d96b9d6 --- /dev/null +++ b/Signal/test/textsecure/TSStorageSignedPreKeyStore.m @@ -0,0 +1,29 @@ +// +// TSStorageSignedPreKeyStore.m +// TextSecureKit +// +// Created by Frederic Jacobs on 07/11/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import + +@interface TSStorageSignedPreKeyStore : XCTestCase + +@end + +@implementation TSStorageSignedPreKeyStore + +- (void)setUp { + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown { + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + + + +@end diff --git a/Signal/test/textsecure/TextSecureKitTests.m b/Signal/test/textsecure/TextSecureKitTests.m new file mode 100644 index 000000000..d53adbd64 --- /dev/null +++ b/Signal/test/textsecure/TextSecureKitTests.m @@ -0,0 +1,29 @@ +// +// TextSecureKitTests.m +// TextSecureKitTests +// +// Created by Frederic Jacobs on 27/10/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import +#import + +@interface TextSecureKitTests : XCTestCase + +@end + +@implementation TextSecureKitTests + +- (void)setUp { + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown { + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + + +@end