├── Signal ├── Default.png ├── test │ ├── fr.lproj │ │ └── InfoPlist.strings │ ├── util │ │ ├── UtilTest.h │ │ ├── Crc32Test.h │ │ ├── QueueTest.h │ │ ├── BloomFilterTest.h │ │ ├── ConversionsTest.h │ │ ├── ExceptionsTest.h │ │ ├── CyclicalBufferTest.h │ │ ├── FunctionalUtilTest.h │ │ ├── FutureUtilTest.h │ │ ├── Crc32Test.m │ │ ├── QueueTest.m │ │ └── BloomFilterTest.m │ ├── Supporting Files │ │ ├── whisperFake.cer │ │ └── SignalTests-Info.plist │ ├── network │ │ ├── tcp │ │ │ └── tls │ │ │ │ └── SecureEndPointTest.m │ │ ├── rtp │ │ │ └── zrtp │ │ │ │ ├── ShortAuthenticationStringGeneratorTest.m │ │ │ │ └── utilities │ │ │ │ ├── PregeneratedKeyAgreementParticipantProtocol.h │ │ │ │ └── PregeneratedKeyAgreementParticipantProtocol.m │ │ └── IpEndPointTest.m │ ├── audio │ │ └── AudioFrameTest.m │ └── profiling │ │ └── EventWindowTest.m ├── Default@2x.png ├── whisperReal.cer ├── AudioFiles │ ├── r.caf │ ├── busy.mp3 │ ├── failure.mp3 │ ├── outring.mp3 │ ├── completed.mp3 │ ├── handshake.mp3 │ ├── sonarping.mp3 │ └── 171756__nenadsimic__picked-coin-echo-2.wav ├── Default-568h@2x.png ├── Images │ ├── backspace.png │ ├── home_icon.png │ ├── menu_icon.png │ ├── mute_icon.png │ ├── icon_keypad.png │ ├── phone_icon.png │ ├── search_icon.png │ ├── trash_icon.png │ ├── volume_high.png │ ├── volume_low.png │ ├── archive_icon.png │ ├── backspace@2x.png │ ├── checkbox_empty.png │ ├── contacts_arrow.png │ ├── forward_button.png │ ├── icon_contacts.png │ ├── icon_recents.png │ ├── menu_icon@2x.png │ ├── message_bubble.png │ ├── message_icon.png │ ├── mute_icon@2x.png │ ├── phone_icon@2x.png │ ├── search_cancel.png │ ├── search_icon@2x.png │ ├── send_code_icon.png │ ├── speaker_icon.png │ ├── spinner_error.png │ ├── tab_icon_inbox.png │ ├── tab_icon_menu.png │ ├── trash_icon@2x.png │ ├── volume_high@2x.png │ ├── volume_low@2x.png │ ├── archive_icon@2x.png │ ├── icon_favourites.png │ ├── search_cancel@2x.png │ ├── speaker_icon@2x.png │ ├── spinner_error@2x.png │ ├── spinner_ringing.png │ ├── tab_icon_keypad.png │ ├── tab_icon_menu@2x.png │ ├── DefaultContactImage.png │ ├── checkbox_checkmark.png │ ├── checkbox_empty@2x.png │ ├── contacts_arrow@2x.png │ ├── expanded_cell_icon.png │ ├── favourite_true_icon.png │ ├── forward_button@2x.png │ ├── in_call_phone_icon.png │ ├── in_call_phrase_icon.png │ ├── incoming_call_icon.png │ ├── message_bubble@2x.png │ ├── mute_icon_selected.png │ ├── outgoing_call_icon.png │ ├── send_code_icon@2x.png │ ├── spinner_connecting.png │ ├── spinner_ringing@2x.png │ ├── tab_icon_contacts.png │ ├── tab_icon_favourites.png │ ├── tab_icon_inbox@2x.png │ ├── tab_icon_keypad@2x.png │ ├── checkbox_checkmark@2x.png │ ├── contact_default_feed.png │ ├── drop_down_arrow_icon.png │ ├── expanded_cell_icon@2x.png │ ├── favourite_false_icon.png │ ├── in_call_phone_icon@2x.png │ ├── incoming_call_icon@2x.png │ ├── mute_icon_selected@2x.png │ ├── outgoing_call_icon@2x.png │ ├── speaker_icon_selected.png │ ├── spinner_connecting@2x.png │ ├── tab_icon_contacts@2x.png │ ├── drop_down_arrow_icon@2x.png │ ├── favourite_false_icon@2x.png │ ├── favourite_true_icon@2x.png │ ├── in_call_phrase_icon@2x.png │ ├── notification_detail_icon.png │ ├── notification_mini_icon.png │ ├── speaker_icon_selected@2x.png │ ├── spinner_connecting_flash.png │ ├── tab_icon_favourites@2x.png │ ├── dismiss_notification_icon.png │ ├── notification_mini_icon@2x.png │ ├── whisper_notification_icon.png │ ├── dismiss_notification_icon@2x.png │ ├── notification_detail_icon@2x.png │ ├── spinner_connecting_flash@2x.png │ └── whisper_notification_icon@2x.png ├── iTunesArtwork@2x.png ├── Icons │ ├── AppIcon29x29.jpg │ ├── AppIcon29x29.png │ ├── AppIcon40x40.png │ ├── AppIcon60x60.png │ ├── AppIcon76x76.png │ ├── AppIcon29x29@2x.png │ ├── AppIcon40x40@2x.png │ ├── AppIcon60x60@2x.png │ └── AppIcon76x76@2x.png ├── Fonts │ ├── HelveticaNeueLTStd-Bd.otf │ ├── HelveticaNeueLTStd-Lt.otf │ ├── HelveticaNeueLTStd-Md.otf │ └── HelveticaNeueLTStd-Th.otf ├── src │ ├── util │ │ ├── NSData+CRC.h │ │ ├── NSDictionary+Util.h │ │ ├── constraints │ │ │ ├── BadState.h │ │ │ ├── BadArgument.h │ │ │ ├── OperationFailed.h │ │ │ ├── BadState.m │ │ │ ├── SecurityFailure.h │ │ │ ├── BadArgument.m │ │ │ ├── SecurityFailure.m │ │ │ └── OperationFailed.m │ │ ├── ArrayUtil.h │ │ ├── NSArray+Util.h │ │ ├── Zid.h │ │ ├── protocols │ │ │ ├── Terminable.h │ │ │ └── utilities │ │ │ │ ├── AnonymousTerminator.h │ │ │ │ └── AnonymousTerminator.m │ │ ├── TOCCancelToken+FutureUtil.h │ │ ├── collections │ │ │ ├── Queue.h │ │ │ ├── PriorityQueue.h │ │ │ └── Queue.m │ │ ├── DateUtil.h │ │ ├── TOCCancelToken+FutureUtil.m │ │ ├── SMSInvite.h │ │ ├── NSNumber+NumberUtil.h │ │ ├── Zid.m │ │ ├── NSData+Conversions.h │ │ ├── NSMutableData+Util.h │ │ ├── RunningThreadRunLoopPair.h │ │ ├── NSDictionary+Util.m │ │ ├── Util.h │ │ ├── NSNumber+NumberUtil.m │ │ ├── PhoneNumberUtil.h │ │ ├── NSMutableData+Util.m │ │ ├── Operation.h │ │ ├── UIUtil.h │ │ ├── ObservableValue.h │ │ ├── BloomFilter.h │ │ ├── NSArray+Util.m │ │ └── NSString+Util.h │ ├── network │ │ ├── rtp │ │ │ ├── zrtp │ │ │ │ ├── RecipientUnavailable.h │ │ │ │ ├── RecipientUnavailable.m │ │ │ │ ├── NegotiationFailed.h │ │ │ │ ├── agreement │ │ │ │ │ ├── EC25KeyAgreementProtocol.h │ │ │ │ │ ├── EC25KeyAgreementParticipant.h │ │ │ │ │ ├── EVPKeyAgreement.h │ │ │ │ │ ├── EC25KeyAgreementProtocol.m │ │ │ │ │ ├── DH3KKeyAgreementParticipant.h │ │ │ │ │ ├── DH3KKeyAgreementProtocol.h │ │ │ │ │ └── EC25KeyAgreementParticipant.m │ │ │ │ ├── ShortAuthenticationStringGenerator.h │ │ │ │ ├── protocols │ │ │ │ │ ├── KeyAgreementProtocol.h │ │ │ │ │ └── KeyAgreementParticipant.h │ │ │ │ ├── NegotiationFailed.m │ │ │ │ ├── ZRTPHandshakeSocket.h │ │ │ │ ├── ZRTPHandshakeResult.h │ │ │ │ ├── ZRTPResponder.h │ │ │ │ ├── ZRTPHandshakeResult.m │ │ │ │ ├── ZRTPInitiator.h │ │ │ │ ├── packets │ │ │ │ │ ├── HelloAckPacket.m │ │ │ │ │ ├── ConfirmAckPacket.m │ │ │ │ │ └── HelloAckPacket.h │ │ │ │ └── HashChain.m │ │ │ ├── srtp │ │ │ │ ├── SequenceCounter.h │ │ │ │ ├── SequenceCounter.m │ │ │ │ ├── SRTPStream.h │ │ │ │ └── SRTPSocket.h │ │ │ └── RTPSocket.h │ │ ├── failures │ │ │ ├── IgnoredPacketFailure.h │ │ │ ├── UnrecognizedRequestFailure.h │ │ │ ├── IgnoredPacketFailure.m │ │ │ └── UnrecognizedRequestFailure.m │ │ ├── tcp │ │ │ ├── StreamPair.h │ │ │ ├── tls │ │ │ │ ├── Certificate.h │ │ │ │ ├── SecureEndPoint.h │ │ │ │ └── NetworkStream.h │ │ │ ├── LowLatencyCandidate.h │ │ │ ├── LowLatencyConnector.h │ │ │ └── StreamPair.m │ │ ├── http │ │ │ ├── HTTPRequestOrResponse.h │ │ │ ├── RPServerRequestsManager.h │ │ │ ├── HTTPRequest+Util.h │ │ │ ├── HTTPSocket.h │ │ │ └── AFHTTPSessionManager+SignalMethods.h │ │ ├── dns │ │ │ ├── HostNameEndPoint.h │ │ │ └── DNSManager.h │ │ ├── IPAddress.h │ │ ├── PacketHandler.h │ │ ├── udp │ │ │ └── UDPSocket.h │ │ ├── IPEndPoint.h │ │ ├── NetworkEndPoint.h │ │ └── PacketHandler.m │ ├── profiling │ │ ├── protocols │ │ │ ├── ValueLogger.h │ │ │ ├── OccurrenceLogger.h │ │ │ ├── ConditionLogger.h │ │ │ ├── utilities │ │ │ │ ├── DiscardingLog.h │ │ │ │ ├── AnonymousValueLogger.h │ │ │ │ ├── AnonymousOccurrenceLogger.h │ │ │ │ ├── AnonymousConditionLogger.h │ │ │ │ ├── AnonymousOccurrenceLogger.m │ │ │ │ └── AnonymousValueLogger.m │ │ │ └── Logging.h │ │ ├── CategorizingLogger.h │ │ ├── EventWindow.h │ │ └── DecayingSampleEstimator.h │ ├── AppDelegate.h │ ├── audio │ │ ├── incall_audio │ │ │ ├── protocols │ │ │ │ ├── BufferDepthMeasure.h │ │ │ │ ├── AudioCallbackHandler.h │ │ │ │ └── utilities │ │ │ │ │ └── AnonymousAudioCallbackHandler.h │ │ │ ├── EncodedAudioFrame.h │ │ │ ├── RemoteIOBufferListWrapper.h │ │ │ ├── SpeexCodec.h │ │ │ ├── processing │ │ │ │ ├── AudioStretcher.h │ │ │ │ ├── StretchFactorController.h │ │ │ │ ├── DesiredBufferDepthController.h │ │ │ │ ├── AudioProcessor.h │ │ │ │ └── JitterQueue.h │ │ │ ├── AudioSocket.h │ │ │ ├── EncodedAudioPacket.m │ │ │ ├── EncodedAudioFrame.m │ │ │ ├── EncodedAudioPacket.h │ │ │ ├── CallAudioManager.h │ │ │ ├── RemoteIOBufferListWrapper.m │ │ │ └── AudioPacker.h │ │ ├── AudioRouter.h │ │ ├── SoundBoard.h │ │ ├── SoundPlayer.h │ │ └── SoundInstance.h │ ├── views │ │ ├── LeftSideMenuCell.h │ │ ├── InteractiveLabel.h │ │ ├── PreferenceListTableViewCell.h │ │ ├── UnseenWhisperUserCell.h │ │ ├── CountryCodeTableViewCell.h │ │ ├── SettingsTableHeaderView.h │ │ ├── ContactTableViewCell.h │ │ ├── InboxFeedFooterCell.h │ │ ├── PreferenceListTableViewCell.m │ │ ├── SettingsTableHeaderView.m │ │ ├── CountryCodeTableViewCell.m │ │ ├── FavouriteTableViewCell.h │ │ ├── ContactDetailTableViewCell.h │ │ ├── LocalizableCustomFontLabel.m │ │ ├── LeftSideMenuCell.m │ │ ├── LocalizableCustomFontLabel.h │ │ ├── SearchBarTitleView.h │ │ ├── UnseenWhisperUserCell.m │ │ ├── DialerButtonView.m │ │ └── DialerButtonView.h │ ├── crypto │ │ ├── EVPUtil.h │ │ ├── EVPMessageDigest.h │ │ ├── CryptoTools.h │ │ ├── EVPSymetricUtil.h │ │ ├── NSData+CryptoTools.h │ │ └── CryptoTools.m │ ├── phone │ │ ├── callstate │ │ │ ├── CallFailedServerMessage.h │ │ │ ├── CallFailedServerMessage.m │ │ │ └── CallProgress.m │ │ └── signaling │ │ │ ├── InitiateSignal.proto │ │ │ ├── number directory │ │ │ ├── PhoneNumberDirectoryFilterManager.h │ │ │ └── PhoneNumberDirectoryFilter.h │ │ │ ├── CallConnectResult.h │ │ │ ├── CallConnectResult.m │ │ │ ├── CallConnectUtil_Initiator.h │ │ │ ├── InitiatorSessionDescriptor.h │ │ │ └── CallConnectUtil_Responder.h │ ├── NotificationTracker.h │ ├── view controllers │ │ ├── InviteContactModal.h │ │ ├── NextResponderScrollView.h │ │ ├── CallLogViewController.h │ │ ├── FavouritesViewController.h │ │ ├── InviteContactsViewController.h │ │ ├── CountryCodeViewController.h │ │ ├── ContactBrowseViewController.h │ │ ├── NextResponderScrollView.m │ │ ├── LeftSideMenuViewController.h │ │ ├── InboxFeedViewController.h │ │ └── ContactDetailViewController.h │ ├── environment │ │ ├── VersionMigrations.h │ │ ├── DebugLogger.h │ │ ├── Release.h │ │ ├── PropertyListPreferences.h │ │ └── SGNKeychainUtil.h │ └── NotificationManifest.h ├── translations │ ├── an.lproj │ │ └── Localizable.strings │ ├── ar.lproj │ │ └── Localizable.strings │ ├── be.lproj │ │ └── Localizable.strings │ ├── ca.lproj │ │ └── Localizable.strings │ ├── cs.lproj │ │ └── Localizable.strings │ ├── da.lproj │ │ └── Localizable.strings │ ├── de.lproj │ │ └── Localizable.strings │ ├── es.lproj │ │ └── Localizable.strings │ ├── eu.lproj │ │ └── Localizable.strings │ ├── fa.lproj │ │ └── Localizable.strings │ ├── fi.lproj │ │ └── Localizable.strings │ ├── fil.lproj │ │ └── Localizable.strings │ ├── fr.lproj │ │ └── Localizable.strings │ ├── he.lproj │ │ └── Localizable.strings │ ├── hu.lproj │ │ └── Localizable.strings │ ├── lv.lproj │ │ └── Localizable.strings │ ├── nb.lproj │ │ └── Localizable.strings │ ├── nl.lproj │ │ └── Localizable.strings │ ├── pl.lproj │ │ └── Localizable.strings │ ├── ro.lproj │ │ └── Localizable.strings │ ├── ru.lproj │ │ └── Localizable.strings │ ├── sl.lproj │ │ └── Localizable.strings │ ├── sq.lproj │ │ └── Localizable.strings │ ├── ta.lproj │ │ └── Localizable.strings │ ├── uk.lproj │ │ └── Localizable.strings │ ├── bg_BG.lproj │ │ └── Localizable.strings │ ├── ca-ES.lproj │ │ └── Localizable.strings │ ├── cs-CZ.lproj │ │ └── Localizable.strings │ ├── el_GR.lproj │ │ └── Localizable.strings │ ├── fa_IR.lproj │ │ └── Localizable.strings │ ├── it_IT.lproj │ │ └── Localizable.strings │ ├── ja_JP.lproj │ │ └── Localizable.strings │ ├── ko_KR.lproj │ │ └── Localizable.strings │ ├── pt_BR.lproj │ │ └── Localizable.strings │ ├── ro-RO.lproj │ │ └── Localizable.strings │ ├── sv_SE.lproj │ │ └── Localizable.strings │ ├── tr_TR.lproj │ │ └── Localizable.strings │ ├── zh_CN.lproj │ │ └── Localizable.strings │ ├── zh_TW.lproj │ │ └── Localizable.strings │ └── .tx │ │ ├── signal-ios.localizablestrings-30 │ │ ├── an_translation │ │ ├── ar_translation │ │ ├── ca_translation │ │ ├── cs_translation │ │ ├── da_translation │ │ ├── de_translation │ │ ├── es_translation │ │ ├── eu_translation │ │ ├── fa_translation │ │ ├── fi_translation │ │ ├── fil_translation │ │ ├── fr_translation │ │ ├── he_translation │ │ ├── hu_translation │ │ ├── lv_translation │ │ ├── nb_translation │ │ ├── nl_translation │ │ ├── pl_translation │ │ ├── ro_translation │ │ ├── ru_translation │ │ ├── sl_translation │ │ ├── sq_translation │ │ ├── ta_translation │ │ ├── uk_translation │ │ ├── bg_BG_translation │ │ ├── fa_IR_translation │ │ ├── it_IT_translation │ │ ├── ja_JP_translation │ │ ├── pt_BR_translation │ │ ├── sv_SE_translation │ │ ├── tr_TR_translation │ │ ├── zh_CN_translation │ │ ├── zh_TW_translation │ │ └── zh_TW.Big5_translation │ │ └── config ├── Images.xcassets │ └── AppIcon.appiconset │ │ ├── Icon-60@2x.png │ │ ├── Icon-60@3x.png │ │ ├── Icon-Small.png │ │ ├── Icon-Small@2x.png │ │ ├── Icon-Small@3x.png │ │ ├── Icon-Small-40@2x.png │ │ └── Icon-Small-40@3x.png ├── Signal.entitlements ├── main.m └── Signal-Prefix.pch ├── .gitmodules ├── Libraries ├── spandsp │ └── spandsp │ │ └── spandsp │ │ ├── noise.h │ │ └── private │ │ ├── t30_dis_dtc_dcs_bits.h │ │ └── README ├── speex │ └── include │ │ ├── speex │ │ ├── speex_config_types.h │ │ ├── speex_config_types.h.in │ │ └── Makefile.am │ │ └── ogg │ │ └── config_types.h └── ProtocolBuffers │ ├── TextFormat.h │ ├── MutableExtensionRegistry.h │ ├── AbstractMessage_Builder.h │ ├── AbstractMessage.h │ ├── Bootstrap.h │ └── WireFormat.m ├── .travis.yml ├── SettingsBundle └── Settings.bundle │ ├── en.lproj │ └── Root.strings │ └── Root.plist ├── Signal.xcworkspace └── contents.xcworkspacedata ├── Signal.xcodeproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── .gitignore ├── Podfile └── Podspecs └── UICKeyChainStore.podspec /Signal/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Default.png -------------------------------------------------------------------------------- /Signal/test/fr.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Signal/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Default@2x.png -------------------------------------------------------------------------------- /Signal/whisperReal.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/whisperReal.cer -------------------------------------------------------------------------------- /Signal/AudioFiles/r.caf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/AudioFiles/r.caf -------------------------------------------------------------------------------- /Signal/AudioFiles/busy.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/AudioFiles/busy.mp3 -------------------------------------------------------------------------------- /Signal/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Default-568h@2x.png -------------------------------------------------------------------------------- /Signal/Images/backspace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/backspace.png -------------------------------------------------------------------------------- /Signal/Images/home_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/home_icon.png -------------------------------------------------------------------------------- /Signal/Images/menu_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/menu_icon.png -------------------------------------------------------------------------------- /Signal/Images/mute_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/mute_icon.png -------------------------------------------------------------------------------- /Signal/iTunesArtwork@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/iTunesArtwork@2x.png -------------------------------------------------------------------------------- /Signal/AudioFiles/failure.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/AudioFiles/failure.mp3 -------------------------------------------------------------------------------- /Signal/AudioFiles/outring.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/AudioFiles/outring.mp3 -------------------------------------------------------------------------------- /Signal/Icons/AppIcon29x29.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Icons/AppIcon29x29.jpg -------------------------------------------------------------------------------- /Signal/Icons/AppIcon29x29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Icons/AppIcon29x29.png -------------------------------------------------------------------------------- /Signal/Icons/AppIcon40x40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Icons/AppIcon40x40.png -------------------------------------------------------------------------------- /Signal/Icons/AppIcon60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Icons/AppIcon60x60.png -------------------------------------------------------------------------------- /Signal/Icons/AppIcon76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Icons/AppIcon76x76.png -------------------------------------------------------------------------------- /Signal/Images/icon_keypad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/icon_keypad.png -------------------------------------------------------------------------------- /Signal/Images/phone_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/phone_icon.png -------------------------------------------------------------------------------- /Signal/Images/search_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/search_icon.png -------------------------------------------------------------------------------- /Signal/Images/trash_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/trash_icon.png -------------------------------------------------------------------------------- /Signal/Images/volume_high.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/volume_high.png -------------------------------------------------------------------------------- /Signal/Images/volume_low.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/volume_low.png -------------------------------------------------------------------------------- /Signal/test/util/UtilTest.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface UtilTest : XCTestCase 4 | 5 | @end 6 | -------------------------------------------------------------------------------- /Signal/AudioFiles/completed.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/AudioFiles/completed.mp3 -------------------------------------------------------------------------------- /Signal/AudioFiles/handshake.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/AudioFiles/handshake.mp3 -------------------------------------------------------------------------------- /Signal/AudioFiles/sonarping.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/AudioFiles/sonarping.mp3 -------------------------------------------------------------------------------- /Signal/Icons/AppIcon29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Icons/AppIcon29x29@2x.png -------------------------------------------------------------------------------- /Signal/Icons/AppIcon40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Icons/AppIcon40x40@2x.png -------------------------------------------------------------------------------- /Signal/Icons/AppIcon60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Icons/AppIcon60x60@2x.png -------------------------------------------------------------------------------- /Signal/Icons/AppIcon76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Icons/AppIcon76x76@2x.png -------------------------------------------------------------------------------- /Signal/Images/archive_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/archive_icon.png -------------------------------------------------------------------------------- /Signal/Images/backspace@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/backspace@2x.png -------------------------------------------------------------------------------- /Signal/Images/checkbox_empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/checkbox_empty.png -------------------------------------------------------------------------------- /Signal/Images/contacts_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/contacts_arrow.png -------------------------------------------------------------------------------- /Signal/Images/forward_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/forward_button.png -------------------------------------------------------------------------------- /Signal/Images/icon_contacts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/icon_contacts.png -------------------------------------------------------------------------------- /Signal/Images/icon_recents.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/icon_recents.png -------------------------------------------------------------------------------- /Signal/Images/menu_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/menu_icon@2x.png -------------------------------------------------------------------------------- /Signal/Images/message_bubble.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/message_bubble.png -------------------------------------------------------------------------------- /Signal/Images/message_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/message_icon.png -------------------------------------------------------------------------------- /Signal/Images/mute_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/mute_icon@2x.png -------------------------------------------------------------------------------- /Signal/Images/phone_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/phone_icon@2x.png -------------------------------------------------------------------------------- /Signal/Images/search_cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/search_cancel.png -------------------------------------------------------------------------------- /Signal/Images/search_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/search_icon@2x.png -------------------------------------------------------------------------------- /Signal/Images/send_code_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/send_code_icon.png -------------------------------------------------------------------------------- /Signal/Images/speaker_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/speaker_icon.png -------------------------------------------------------------------------------- /Signal/Images/spinner_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/spinner_error.png -------------------------------------------------------------------------------- /Signal/Images/tab_icon_inbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/tab_icon_inbox.png -------------------------------------------------------------------------------- /Signal/Images/tab_icon_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/tab_icon_menu.png -------------------------------------------------------------------------------- /Signal/Images/trash_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/trash_icon@2x.png -------------------------------------------------------------------------------- /Signal/Images/volume_high@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/volume_high@2x.png -------------------------------------------------------------------------------- /Signal/Images/volume_low@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/volume_low@2x.png -------------------------------------------------------------------------------- /Signal/test/util/Crc32Test.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface Crc32Test : XCTestCase 4 | 5 | @end 6 | -------------------------------------------------------------------------------- /Signal/test/util/QueueTest.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface QueueTest : XCTestCase 4 | 5 | @end 6 | -------------------------------------------------------------------------------- /Signal/Images/archive_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/archive_icon@2x.png -------------------------------------------------------------------------------- /Signal/Images/icon_favourites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/icon_favourites.png -------------------------------------------------------------------------------- /Signal/Images/search_cancel@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/search_cancel@2x.png -------------------------------------------------------------------------------- /Signal/Images/speaker_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/speaker_icon@2x.png -------------------------------------------------------------------------------- /Signal/Images/spinner_error@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/spinner_error@2x.png -------------------------------------------------------------------------------- /Signal/Images/spinner_ringing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/spinner_ringing.png -------------------------------------------------------------------------------- /Signal/Images/tab_icon_keypad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/tab_icon_keypad.png -------------------------------------------------------------------------------- /Signal/Images/tab_icon_menu@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/tab_icon_menu@2x.png -------------------------------------------------------------------------------- /Signal/Images/DefaultContactImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/DefaultContactImage.png -------------------------------------------------------------------------------- /Signal/Images/checkbox_checkmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/checkbox_checkmark.png -------------------------------------------------------------------------------- /Signal/Images/checkbox_empty@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/checkbox_empty@2x.png -------------------------------------------------------------------------------- /Signal/Images/contacts_arrow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/contacts_arrow@2x.png -------------------------------------------------------------------------------- /Signal/Images/expanded_cell_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/expanded_cell_icon.png -------------------------------------------------------------------------------- /Signal/Images/favourite_true_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/favourite_true_icon.png -------------------------------------------------------------------------------- /Signal/Images/forward_button@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/forward_button@2x.png -------------------------------------------------------------------------------- /Signal/Images/in_call_phone_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/in_call_phone_icon.png -------------------------------------------------------------------------------- /Signal/Images/in_call_phrase_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/in_call_phrase_icon.png -------------------------------------------------------------------------------- /Signal/Images/incoming_call_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/incoming_call_icon.png -------------------------------------------------------------------------------- /Signal/Images/message_bubble@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/message_bubble@2x.png -------------------------------------------------------------------------------- /Signal/Images/mute_icon_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/mute_icon_selected.png -------------------------------------------------------------------------------- /Signal/Images/outgoing_call_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/outgoing_call_icon.png -------------------------------------------------------------------------------- /Signal/Images/send_code_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/send_code_icon@2x.png -------------------------------------------------------------------------------- /Signal/Images/spinner_connecting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/spinner_connecting.png -------------------------------------------------------------------------------- /Signal/Images/spinner_ringing@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/spinner_ringing@2x.png -------------------------------------------------------------------------------- /Signal/Images/tab_icon_contacts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/tab_icon_contacts.png -------------------------------------------------------------------------------- /Signal/Images/tab_icon_favourites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/tab_icon_favourites.png -------------------------------------------------------------------------------- /Signal/Images/tab_icon_inbox@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/tab_icon_inbox@2x.png -------------------------------------------------------------------------------- /Signal/Images/tab_icon_keypad@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/tab_icon_keypad@2x.png -------------------------------------------------------------------------------- /Signal/test/util/BloomFilterTest.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface BloomFilterTest : XCTestCase 4 | 5 | @end 6 | -------------------------------------------------------------------------------- /Signal/test/util/ConversionsTest.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface ConversionsTest : XCTestCase 4 | 5 | @end 6 | -------------------------------------------------------------------------------- /Signal/test/util/ExceptionsTest.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface ExceptionsTest : XCTestCase 4 | 5 | @end 6 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Pods"] 2 | path = Pods 3 | url = https://github.com/FredericJacobs/Precompiled-Signal-Dependencies.git 4 | -------------------------------------------------------------------------------- /Signal/Fonts/HelveticaNeueLTStd-Bd.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Fonts/HelveticaNeueLTStd-Bd.otf -------------------------------------------------------------------------------- /Signal/Fonts/HelveticaNeueLTStd-Lt.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Fonts/HelveticaNeueLTStd-Lt.otf -------------------------------------------------------------------------------- /Signal/Fonts/HelveticaNeueLTStd-Md.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Fonts/HelveticaNeueLTStd-Md.otf -------------------------------------------------------------------------------- /Signal/Fonts/HelveticaNeueLTStd-Th.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Fonts/HelveticaNeueLTStd-Th.otf -------------------------------------------------------------------------------- /Signal/Images/checkbox_checkmark@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/checkbox_checkmark@2x.png -------------------------------------------------------------------------------- /Signal/Images/contact_default_feed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/contact_default_feed.png -------------------------------------------------------------------------------- /Signal/Images/drop_down_arrow_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/drop_down_arrow_icon.png -------------------------------------------------------------------------------- /Signal/Images/expanded_cell_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/expanded_cell_icon@2x.png -------------------------------------------------------------------------------- /Signal/Images/favourite_false_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/favourite_false_icon.png -------------------------------------------------------------------------------- /Signal/Images/in_call_phone_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/in_call_phone_icon@2x.png -------------------------------------------------------------------------------- /Signal/Images/incoming_call_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/incoming_call_icon@2x.png -------------------------------------------------------------------------------- /Signal/Images/mute_icon_selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/mute_icon_selected@2x.png -------------------------------------------------------------------------------- /Signal/Images/outgoing_call_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/outgoing_call_icon@2x.png -------------------------------------------------------------------------------- /Signal/Images/speaker_icon_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/speaker_icon_selected.png -------------------------------------------------------------------------------- /Signal/Images/spinner_connecting@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/spinner_connecting@2x.png -------------------------------------------------------------------------------- /Signal/Images/tab_icon_contacts@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/tab_icon_contacts@2x.png -------------------------------------------------------------------------------- /Signal/test/util/CyclicalBufferTest.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface CyclicalBufferTest : XCTestCase 4 | 5 | @end 6 | -------------------------------------------------------------------------------- /Signal/test/util/FunctionalUtilTest.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface FunctionalUtilTest : XCTestCase 4 | 5 | @end 6 | -------------------------------------------------------------------------------- /Libraries/spandsp/spandsp/spandsp/noise.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Libraries/spandsp/spandsp/spandsp/noise.h -------------------------------------------------------------------------------- /Signal/Images/drop_down_arrow_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/drop_down_arrow_icon@2x.png -------------------------------------------------------------------------------- /Signal/Images/favourite_false_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/favourite_false_icon@2x.png -------------------------------------------------------------------------------- /Signal/Images/favourite_true_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/favourite_true_icon@2x.png -------------------------------------------------------------------------------- /Signal/Images/in_call_phrase_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/in_call_phrase_icon@2x.png -------------------------------------------------------------------------------- /Signal/Images/notification_detail_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/notification_detail_icon.png -------------------------------------------------------------------------------- /Signal/Images/notification_mini_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/notification_mini_icon.png -------------------------------------------------------------------------------- /Signal/Images/speaker_icon_selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/speaker_icon_selected@2x.png -------------------------------------------------------------------------------- /Signal/Images/spinner_connecting_flash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/spinner_connecting_flash.png -------------------------------------------------------------------------------- /Signal/Images/tab_icon_favourites@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/tab_icon_favourites@2x.png -------------------------------------------------------------------------------- /Signal/Images/dismiss_notification_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/dismiss_notification_icon.png -------------------------------------------------------------------------------- /Signal/Images/notification_mini_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/notification_mini_icon@2x.png -------------------------------------------------------------------------------- /Signal/Images/whisper_notification_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/whisper_notification_icon.png -------------------------------------------------------------------------------- /Signal/src/util/NSData+CRC.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface NSData (CRC) 4 | 5 | - (uint32_t)crc32; 6 | 7 | @end 8 | -------------------------------------------------------------------------------- /Signal/test/Supporting Files/whisperFake.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/test/Supporting Files/whisperFake.cer -------------------------------------------------------------------------------- /Signal/Images/dismiss_notification_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/dismiss_notification_icon@2x.png -------------------------------------------------------------------------------- /Signal/Images/notification_detail_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/notification_detail_icon@2x.png -------------------------------------------------------------------------------- /Signal/Images/spinner_connecting_flash@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/spinner_connecting_flash@2x.png -------------------------------------------------------------------------------- /Signal/Images/whisper_notification_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images/whisper_notification_icon@2x.png -------------------------------------------------------------------------------- /Signal/translations/an.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/an.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/ar.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/ar.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/be.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/be.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/ca.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/ca.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/cs.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/cs.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/da.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/da.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/de.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/de.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/es.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/es.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/eu.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/eu.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/fa.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/fa.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/fi.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/fi.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/fil.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/fil.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/fr.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/fr.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/he.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/he.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/hu.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/hu.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/lv.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/lv.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/nb.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/nb.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/nl.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/nl.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/pl.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/pl.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/ro.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/ro.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/ru.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/ru.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/sl.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/sl.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/sq.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/sq.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/ta.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/ta.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/uk.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/uk.lproj/Localizable.strings -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | xcode_sdk: iphonesimulator8.1 3 | install: true 4 | xcode_workspace: Signal.xcworkspace 5 | xcode_scheme: Signal 6 | -------------------------------------------------------------------------------- /SettingsBundle/Settings.bundle/en.lproj/Root.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/SettingsBundle/Settings.bundle/en.lproj/Root.strings -------------------------------------------------------------------------------- /Signal/src/network/rtp/zrtp/RecipientUnavailable.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface RecipientUnavailable : NSObject 4 | 5 | @end 6 | -------------------------------------------------------------------------------- /Signal/translations/bg_BG.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/bg_BG.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/ca-ES.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/ca-ES.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/cs-CZ.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/cs-CZ.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/el_GR.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/el_GR.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/fa_IR.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/fa_IR.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/it_IT.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/it_IT.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/ja_JP.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/ja_JP.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/ko_KR.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/ko_KR.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/pt_BR.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/pt_BR.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/ro-RO.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/ro-RO.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/sv_SE.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/sv_SE.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/tr_TR.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/tr_TR.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/zh_CN.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/zh_CN.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/translations/zh_TW.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/zh_TW.lproj/Localizable.strings -------------------------------------------------------------------------------- /Signal/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png -------------------------------------------------------------------------------- /Signal/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png -------------------------------------------------------------------------------- /Signal/Images.xcassets/AppIcon.appiconset/Icon-Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images.xcassets/AppIcon.appiconset/Icon-Small.png -------------------------------------------------------------------------------- /Signal/src/util/NSDictionary+Util.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface NSDictionary (Util) 4 | 5 | - (NSString*)encodedAsJSON; 6 | 7 | @end 8 | -------------------------------------------------------------------------------- /Signal/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png -------------------------------------------------------------------------------- /Signal/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png -------------------------------------------------------------------------------- /Signal/AudioFiles/171756__nenadsimic__picked-coin-echo-2.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/AudioFiles/171756__nenadsimic__picked-coin-echo-2.wav -------------------------------------------------------------------------------- /Signal/Images.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png -------------------------------------------------------------------------------- /Signal/Images.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/Images.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png -------------------------------------------------------------------------------- /Signal/src/util/constraints/BadState.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface BadState : NSException 4 | 5 | + (void)raise:(NSString*)message; 6 | 7 | @end 8 | -------------------------------------------------------------------------------- /Libraries/spandsp/spandsp/spandsp/private/t30_dis_dtc_dcs_bits.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Libraries/spandsp/spandsp/spandsp/private/t30_dis_dtc_dcs_bits.h -------------------------------------------------------------------------------- /Signal/src/profiling/protocols/ValueLogger.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @protocol ValueLogger 4 | 5 | - (void)logValue:(double)value; 6 | 7 | @end 8 | -------------------------------------------------------------------------------- /Signal/src/profiling/protocols/OccurrenceLogger.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @protocol OccurrenceLogger 4 | 5 | - (void)markOccurrence:(id)details; 6 | 7 | @end 8 | -------------------------------------------------------------------------------- /Signal/src/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface AppDelegate : UIResponder 4 | 5 | @property (strong, nonatomic) UIWindow* window; 6 | 7 | @end 8 | -------------------------------------------------------------------------------- /Signal/translations/.tx/signal-ios.localizablestrings-30/an_translation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/.tx/signal-ios.localizablestrings-30/an_translation -------------------------------------------------------------------------------- /Signal/translations/.tx/signal-ios.localizablestrings-30/ar_translation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/.tx/signal-ios.localizablestrings-30/ar_translation -------------------------------------------------------------------------------- /Signal/translations/.tx/signal-ios.localizablestrings-30/ca_translation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/.tx/signal-ios.localizablestrings-30/ca_translation -------------------------------------------------------------------------------- /Signal/translations/.tx/signal-ios.localizablestrings-30/cs_translation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/.tx/signal-ios.localizablestrings-30/cs_translation -------------------------------------------------------------------------------- /Signal/translations/.tx/signal-ios.localizablestrings-30/da_translation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/.tx/signal-ios.localizablestrings-30/da_translation -------------------------------------------------------------------------------- /Signal/translations/.tx/signal-ios.localizablestrings-30/de_translation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/.tx/signal-ios.localizablestrings-30/de_translation -------------------------------------------------------------------------------- /Signal/translations/.tx/signal-ios.localizablestrings-30/es_translation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/.tx/signal-ios.localizablestrings-30/es_translation -------------------------------------------------------------------------------- /Signal/translations/.tx/signal-ios.localizablestrings-30/eu_translation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/.tx/signal-ios.localizablestrings-30/eu_translation -------------------------------------------------------------------------------- /Signal/translations/.tx/signal-ios.localizablestrings-30/fa_translation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/.tx/signal-ios.localizablestrings-30/fa_translation -------------------------------------------------------------------------------- /Signal/translations/.tx/signal-ios.localizablestrings-30/fi_translation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/.tx/signal-ios.localizablestrings-30/fi_translation -------------------------------------------------------------------------------- /Signal/translations/.tx/signal-ios.localizablestrings-30/fil_translation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/.tx/signal-ios.localizablestrings-30/fil_translation -------------------------------------------------------------------------------- /Signal/translations/.tx/signal-ios.localizablestrings-30/fr_translation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/.tx/signal-ios.localizablestrings-30/fr_translation -------------------------------------------------------------------------------- /Signal/translations/.tx/signal-ios.localizablestrings-30/he_translation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/.tx/signal-ios.localizablestrings-30/he_translation -------------------------------------------------------------------------------- /Signal/translations/.tx/signal-ios.localizablestrings-30/hu_translation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/.tx/signal-ios.localizablestrings-30/hu_translation -------------------------------------------------------------------------------- /Signal/translations/.tx/signal-ios.localizablestrings-30/lv_translation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/.tx/signal-ios.localizablestrings-30/lv_translation -------------------------------------------------------------------------------- /Signal/translations/.tx/signal-ios.localizablestrings-30/nb_translation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/.tx/signal-ios.localizablestrings-30/nb_translation -------------------------------------------------------------------------------- /Signal/translations/.tx/signal-ios.localizablestrings-30/nl_translation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/.tx/signal-ios.localizablestrings-30/nl_translation -------------------------------------------------------------------------------- /Signal/translations/.tx/signal-ios.localizablestrings-30/pl_translation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/.tx/signal-ios.localizablestrings-30/pl_translation -------------------------------------------------------------------------------- /Signal/translations/.tx/signal-ios.localizablestrings-30/ro_translation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/.tx/signal-ios.localizablestrings-30/ro_translation -------------------------------------------------------------------------------- /Signal/translations/.tx/signal-ios.localizablestrings-30/ru_translation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/.tx/signal-ios.localizablestrings-30/ru_translation -------------------------------------------------------------------------------- /Signal/translations/.tx/signal-ios.localizablestrings-30/sl_translation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/.tx/signal-ios.localizablestrings-30/sl_translation -------------------------------------------------------------------------------- /Signal/translations/.tx/signal-ios.localizablestrings-30/sq_translation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/.tx/signal-ios.localizablestrings-30/sq_translation -------------------------------------------------------------------------------- /Signal/translations/.tx/signal-ios.localizablestrings-30/ta_translation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/.tx/signal-ios.localizablestrings-30/ta_translation -------------------------------------------------------------------------------- /Signal/translations/.tx/signal-ios.localizablestrings-30/uk_translation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/.tx/signal-ios.localizablestrings-30/uk_translation -------------------------------------------------------------------------------- /Signal/src/audio/incall_audio/protocols/BufferDepthMeasure.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @protocol BufferDepthMeasure 4 | 5 | - (int16_t)currentBufferDepth; 6 | 7 | @end 8 | -------------------------------------------------------------------------------- /Signal/translations/.tx/signal-ios.localizablestrings-30/bg_BG_translation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/.tx/signal-ios.localizablestrings-30/bg_BG_translation -------------------------------------------------------------------------------- /Signal/translations/.tx/signal-ios.localizablestrings-30/fa_IR_translation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/.tx/signal-ios.localizablestrings-30/fa_IR_translation -------------------------------------------------------------------------------- /Signal/translations/.tx/signal-ios.localizablestrings-30/it_IT_translation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/.tx/signal-ios.localizablestrings-30/it_IT_translation -------------------------------------------------------------------------------- /Signal/translations/.tx/signal-ios.localizablestrings-30/ja_JP_translation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/.tx/signal-ios.localizablestrings-30/ja_JP_translation -------------------------------------------------------------------------------- /Signal/translations/.tx/signal-ios.localizablestrings-30/pt_BR_translation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/.tx/signal-ios.localizablestrings-30/pt_BR_translation -------------------------------------------------------------------------------- /Signal/translations/.tx/signal-ios.localizablestrings-30/sv_SE_translation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/.tx/signal-ios.localizablestrings-30/sv_SE_translation -------------------------------------------------------------------------------- /Signal/translations/.tx/signal-ios.localizablestrings-30/tr_TR_translation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/.tx/signal-ios.localizablestrings-30/tr_TR_translation -------------------------------------------------------------------------------- /Signal/translations/.tx/signal-ios.localizablestrings-30/zh_CN_translation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/.tx/signal-ios.localizablestrings-30/zh_CN_translation -------------------------------------------------------------------------------- /Signal/translations/.tx/signal-ios.localizablestrings-30/zh_TW_translation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/.tx/signal-ios.localizablestrings-30/zh_TW_translation -------------------------------------------------------------------------------- /Signal/src/util/ArrayUtil.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface NSArray (Util) 4 | -(NSData*)ows_toUint8Data; 5 | -(NSData*)ows_concatDatas; 6 | -(NSArray*)ows_concatArrays; 7 | @end 8 | -------------------------------------------------------------------------------- /Signal/src/views/LeftSideMenuCell.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface LeftSideMenuCell : UITableViewCell 4 | 5 | @property (strong, nonatomic) IBOutlet UILabel* menuTitleLabel; 6 | 7 | @end 8 | -------------------------------------------------------------------------------- /Signal.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Signal/translations/.tx/signal-ios.localizablestrings-30/zh_TW.Big5_translation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavia/Signal-iOS/master/Signal/translations/.tx/signal-ios.localizablestrings-30/zh_TW.Big5_translation -------------------------------------------------------------------------------- /Signal/Signal.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Signal/src/util/constraints/BadArgument.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface BadArgument : NSException 4 | 5 | + (BadArgument*)new:(NSString*)reason; 6 | + (void)raise:(NSString*)message; 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /Signal/src/util/NSArray+Util.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface NSArray (Util) 4 | 5 | - (NSData*)ows_toUint8Data; 6 | - (NSData*)ows_concatDatas; 7 | - (NSArray*)ows_concatArrays; 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /Signal/src/util/Zid.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface Zid : NSObject 4 | 5 | @property (strong, nonatomic, readonly) NSData* data; 6 | 7 | - (instancetype)initWithData:(NSData*)zidData; 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /Signal/src/util/constraints/OperationFailed.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface OperationFailed : NSException 4 | 5 | + (OperationFailed*)new:(NSString*)reason; 6 | + (void)raise:(NSString*)message; 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /Signal.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Signal/src/network/rtp/zrtp/RecipientUnavailable.m: -------------------------------------------------------------------------------- 1 | #import "RecipientUnavailable.h" 2 | 3 | @implementation RecipientUnavailable 4 | 5 | - (NSString*)description { 6 | return @"Recipient unavailable"; 7 | } 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /Signal/src/util/constraints/BadState.m: -------------------------------------------------------------------------------- 1 | #import "Constraints.h" 2 | 3 | @implementation BadState 4 | 5 | + (void)raise:(NSString*)message { 6 | [BadState raise:@"Invalid State" format:@"%@", message]; 7 | } 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /Signal/src/views/InteractiveLabel.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface InteractiveLabel : UILabel 4 | 5 | - (void)onPaste:(void(^)(id sender))pasteBlock; 6 | - (void)onCopy:(void(^)(id sender))copyBlock; 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /Signal/translations/.tx/config: -------------------------------------------------------------------------------- 1 | [main] 2 | host = https://www.transifex.com 3 | 4 | [signal-ios.localizablestrings-30] 5 | source_lang = en 6 | source_file = en.lproj/Localizable.strings 7 | file_filter = .lproj/Localizable.strings 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Exclude the build directory 2 | build/* 3 | # Exclude temp nibs and swap files 4 | *~.nib 5 | *.swp 6 | 7 | # Exclude OS X folder attributes 8 | .DS_Store 9 | 10 | # Exclude user-specific XCode 3 and 4 files 11 | xcuserdata 12 | 13 | -------------------------------------------------------------------------------- /Signal/src/crypto/EVPUtil.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #define RAISE_EXCEPTION [NSException raise:@"OPENSSL_Exception" format:@"Line:%d File:%s ", __LINE__ , __FILE__] 4 | #define RAISE_EXCEPTION_ON_FAILURE(X) if( 1 != X){ RAISE_EXCEPTION;} 5 | -------------------------------------------------------------------------------- /Signal/src/profiling/protocols/ConditionLogger.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @protocol ConditionLogger 4 | 5 | - (void)logNotice:(id)details; 6 | - (void)logWarning:(id)details; 7 | - (void)logError:(id)details; 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /Signal/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | @autoreleasepool { 8 | return UIApplicationMain(argc, argv, nil, NSStringFromClass(AppDelegate.class)); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Signal/src/phone/callstate/CallFailedServerMessage.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface CallFailedServerMessage : NSObject 4 | 5 | @property (readonly, nonatomic) NSString* text; 6 | 7 | - (instancetype)initWithText:(NSString*)text; 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /Signal/src/util/protocols/Terminable.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | /// Cancels something when terminate is called. 4 | /// It must be safe to call terminate multiple times. 5 | @protocol Terminable 6 | 7 | - (void)terminate; 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /Signal/src/network/rtp/zrtp/NegotiationFailed.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface NegotiationFailed : NSObject 4 | 5 | @property (strong, readonly, nonatomic) NSString* reason; 6 | 7 | - (instancetype)initWithReason:(NSString*)reason; 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /Signal/src/util/constraints/SecurityFailure.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "OperationFailed.h" 3 | 4 | @interface SecurityFailure : OperationFailed 5 | 6 | + (SecurityFailure*)new:(SecurityFailure*)reason; 7 | + (void)raise:(NSString*)message; 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /Signal/src/phone/signaling/InitiateSignal.proto: -------------------------------------------------------------------------------- 1 | package redphone; 2 | 3 | message InitiateSignal { 4 | optional string initiator = 1; 5 | optional uint64 sessionId = 2; 6 | optional uint32 port = 3; 7 | optional string serverName = 4; 8 | optional uint32 version = 5; 9 | } 10 | -------------------------------------------------------------------------------- /Signal/src/util/TOCCancelToken+FutureUtil.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "CollapsingFutures.h" 3 | #import "Terminable.h" 4 | 5 | @interface TOCCancelToken (FutureUtil) 6 | 7 | - (void)whenCancelledTerminate:(id)terminable; 8 | 9 | @end 10 | 11 | 12 | -------------------------------------------------------------------------------- /Signal/test/util/FutureUtilTest.h: -------------------------------------------------------------------------------- 1 | // 2 | // FutureUtilTest.h 3 | // Signal 4 | // 5 | // Created by Gil Azaria on 5/11/2014. 6 | // Copyright (c) 2014 Open Whisper Systems. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FutureUtilTest : XCTestCase 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Signal/src/profiling/protocols/utilities/DiscardingLog.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "Logging.h" 3 | #import "ConditionLogger.h" 4 | #import "JitterQueue.h" 5 | 6 | @interface DiscardingLog : NSObject 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /Signal/src/util/collections/Queue.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface Queue : NSObject 4 | 5 | - (instancetype)init; 6 | 7 | - (void)enqueue:(id)item; 8 | - (id)dequeue; 9 | - (id)tryDequeue; 10 | - (id)peek; 11 | - (id)peekAt:(NSUInteger)offset; 12 | - (NSUInteger)count; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Libraries/speex/include/speex/speex_config_types.h: -------------------------------------------------------------------------------- 1 | #ifndef __SPEEX_TYPES_H__ 2 | #define __SPEEX_TYPES_H__ 3 | 4 | /* these are filled in by configure */ 5 | typedef short spx_int16_t; 6 | typedef unsigned short spx_uint16_t; 7 | typedef int spx_int32_t; 8 | typedef unsigned int spx_uint32_t; 9 | 10 | #endif 11 | 12 | -------------------------------------------------------------------------------- /Signal/src/network/rtp/zrtp/agreement/EC25KeyAgreementProtocol.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "KeyAgreementProtocol.h" 3 | 4 | @interface EC25KeyAgreementProtocol : NSObject 5 | 6 | - (id)generateParticipantWithNewKeys; 7 | - (NSData*)getId; 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /Signal/src/views/PreferenceListTableViewCell.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | /** 4 | * 5 | * PreferenceListTableViewCell displays a preference. 6 | * 7 | */ 8 | 9 | @interface PreferenceListTableViewCell : UITableViewCell 10 | 11 | @property (strong, nonatomic) IBOutlet UILabel* preferenceTextLabel; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Signal/src/network/failures/IgnoredPacketFailure.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | /** 4 | * 5 | * Instances of IgnoredPacketFailure are used to indicate that a packet was ignored. 6 | * 7 | */ 8 | @interface IgnoredPacketFailure : NSObject 9 | 10 | - (instancetype)initWithReason:(NSString*)reason; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /Libraries/speex/include/speex/speex_config_types.h.in: -------------------------------------------------------------------------------- 1 | #ifndef __SPEEX_TYPES_H__ 2 | #define __SPEEX_TYPES_H__ 3 | 4 | /* these are filled in by configure */ 5 | typedef @SIZE16@ spx_int16_t; 6 | typedef unsigned @SIZE16@ spx_uint16_t; 7 | typedef @SIZE32@ spx_int32_t; 8 | typedef unsigned @SIZE32@ spx_uint32_t; 9 | 10 | #endif 11 | 12 | -------------------------------------------------------------------------------- /Signal/src/util/DateUtil.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface DateUtil : NSObject 4 | 5 | + (NSDateFormatter*)dateFormatter; 6 | + (NSDateFormatter*)weekdayFormatter; 7 | + (NSDateFormatter*)timeFormatter; 8 | + (BOOL)dateIsOlderThanOneDay:(NSDate*)date; 9 | + (BOOL)dateIsOlderThanOneWeek:(NSDate*)date; 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /Libraries/spandsp/spandsp/spandsp/private/README: -------------------------------------------------------------------------------- 1 | The header files in this directory should only be used by code tightly integrating itself with the 2 | spandsp library to maximise performance. To maximise compatibility with futures revisions of spandsp, 3 | most users should avoid using these headers, or probing into the spandsp data structures in other ways. -------------------------------------------------------------------------------- /Signal/src/util/protocols/utilities/AnonymousTerminator.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "Terminable.h" 3 | 4 | @interface AnonymousTerminator : NSObject 5 | 6 | @property (nonatomic, readonly, copy) void (^terminateBlock)(void); 7 | 8 | - (instancetype)initWithTerminator:(void (^)(void))terminate; 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /Signal/src/views/UnseenWhisperUserCell.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "Contact.h" 3 | 4 | @interface UnseenWhisperUserCell : UITableViewCell 5 | 6 | @property (strong, nonatomic) IBOutlet UILabel* nameLabel; 7 | @property (strong, nonatomic) IBOutlet UILabel* numberLabel; 8 | 9 | - (void)configureWithContact:(Contact*)contact; 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /Signal/src/NotificationTracker.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | /** 4 | * Tracks which notifications have already been processed, and which are are seen for the first time. 5 | **/ 6 | 7 | @interface NotificationTracker : NSObject 8 | 9 | - (instancetype)init; 10 | 11 | - (BOOL)shouldProcessNotification:(NSDictionary*)notification; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Signal/src/profiling/protocols/utilities/AnonymousValueLogger.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "ValueLogger.h" 3 | 4 | @interface AnonymousValueLogger : NSObject 5 | 6 | @property (nonatomic, readonly, copy) void (^logValueBlock)(double value); 7 | 8 | - (instancetype)initWithLogValue:(void(^)(double value))logValue; 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /Signal/src/view controllers/InviteContactModal.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "PhoneNumber.h" 3 | 4 | @interface InviteContactModal : NSObject 5 | 6 | - (instancetype)initWithPhoneNumber:(PhoneNumber*)phoneNumber 7 | andParentViewController:(UIViewController*)parent; 8 | - (void)presentModalView; 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /Signal/src/profiling/CategorizingLogger.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "JitterQueue.h" 3 | #import "Logging.h" 4 | 5 | @interface CategorizingLogger : NSObject 6 | 7 | - (instancetype)init; 8 | 9 | - (void)addLoggingCallback:(void(^)(NSString* category, id details, NSUInteger index))callback; 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /Signal/src/profiling/protocols/utilities/AnonymousOccurrenceLogger.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "OccurrenceLogger.h" 3 | 4 | @interface AnonymousOccurrenceLogger : NSObject 5 | 6 | @property (nonatomic, readonly, copy) void (^marker)(id details); 7 | 8 | - (instancetype)initWithMarker:(void(^)(id details))marker; 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /Signal/src/view controllers/NextResponderScrollView.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | /** 4 | * 5 | * This scroll view is used in inbox feed table cell to pass touches through to the next responder- 6 | * because the scroll view touches override the table cell touches otherwise. 7 | * 8 | */ 9 | 10 | @interface NextResponderScrollView : UIScrollView 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /Signal/src/environment/VersionMigrations.h: -------------------------------------------------------------------------------- 1 | // 2 | // VersionMigrations.h 3 | // Signal 4 | // 5 | // Created by Frederic Jacobs on 29/07/14. 6 | // Copyright (c) 2014 Open Whisper Systems. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface VersionMigrations : NSObject 12 | 13 | + (void)migrationFrom1Dot0Dot2toLarger; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Signal/src/network/failures/UnrecognizedRequestFailure.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | /** 4 | * 5 | * Instances of UnrecognizedRequestFailure are used to indicate that a request could not be handled due to being strange. 6 | * 7 | */ 8 | @interface UnrecognizedRequestFailure : NSObject 9 | 10 | - (instancetype)initWithReason:(NSString*)reason; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /Signal/src/views/CountryCodeTableViewCell.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface CountryCodeTableViewCell : UITableViewCell 4 | 5 | @property (strong, nonatomic) IBOutlet UILabel* countryCodeLabel; 6 | @property (strong, nonatomic) IBOutlet UILabel* countryNameLabel; 7 | 8 | - (void)configureWithCountryCode:(NSString*)code andCountryName:(NSString*)name; 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /Signal/src/profiling/EventWindow.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "PriorityQueue.h" 3 | 4 | @interface EventWindow : NSObject 5 | 6 | - (instancetype)initWithWindowDuration:(NSTimeInterval)windowDuration; 7 | - (void)addEventAtTime:(NSTimeInterval)eventTime; 8 | - (NSUInteger)countAfterRemovingEventsBeforeWindowEndingAt:(NSTimeInterval)endOfWindowTime; 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /Signal/src/util/TOCCancelToken+FutureUtil.m: -------------------------------------------------------------------------------- 1 | #import "Constraints.h" 2 | #import "TOCCancelToken+FutureUtil.h" 3 | #import "Operation.h" 4 | 5 | @implementation TOCCancelToken (FutureUtil) 6 | 7 | - (void)whenCancelledTerminate:(id)terminable { 8 | require(terminable != nil); 9 | [self whenCancelledDo:^{ [terminable terminate]; }]; 10 | } 11 | 12 | @end 13 | 14 | 15 | -------------------------------------------------------------------------------- /Signal/test/util/Crc32Test.m: -------------------------------------------------------------------------------- 1 | #import "Crc32Test.h" 2 | #import "NSData+CRC.h" 3 | #import "TestUtil.h" 4 | 5 | @implementation Crc32Test 6 | -(void) testKnownCrc32 { 7 | char* valText = "The quick brown fox jumps over the lazy dog"; 8 | NSData* val = [NSMutableData dataWithBytes:valText length:strlen(valText)]; 9 | test(0x414fa339 == [val crc32]); 10 | } 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /Signal/src/util/constraints/BadArgument.m: -------------------------------------------------------------------------------- 1 | #import "BadArgument.h" 2 | 3 | @implementation BadArgument 4 | 5 | + (BadArgument*)new:(NSString*)reason { 6 | return [[BadArgument alloc] initWithName:@"Invalid Argument" reason:reason userInfo:nil]; 7 | } 8 | 9 | + (void)raise:(NSString*)message { 10 | [BadArgument raise:@"Invalid Argument" format:@"%@", message]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Signal/src/crypto/EVPMessageDigest.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | // Implements class level functions for Openssl's EVP_Digest Api 4 | 5 | @interface EVPMessageDigest : NSObject 6 | 7 | + (NSData*)hashWithSHA256:(NSData*)data; 8 | + (NSData*)hmacUsingSHA1Data:(NSData*)data withKey:(NSData*)key; 9 | + (NSData*)hmacUsingSHA256Data:(NSData*)data withKey:(NSData*)key; 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /Signal/src/util/constraints/SecurityFailure.m: -------------------------------------------------------------------------------- 1 | #import "SecurityFailure.h" 2 | 3 | @implementation SecurityFailure 4 | 5 | + (SecurityFailure*)new:(NSString*)reason { 6 | return [[SecurityFailure alloc] initWithName:@"Insecure" reason:reason userInfo:nil]; 7 | } 8 | 9 | + (void)raise:(NSString*)message { 10 | [SecurityFailure raise:@"Insecure" format:@"%@", message]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Signal/src/util/constraints/OperationFailed.m: -------------------------------------------------------------------------------- 1 | #import "Constraints.h" 2 | 3 | @implementation OperationFailed 4 | 5 | + (OperationFailed*)new:(NSString*)reason { 6 | return [[OperationFailed alloc] initWithName:@"Operation failed" reason:reason userInfo:nil]; 7 | } 8 | 9 | + (void)raise:(NSString*)message { 10 | [OperationFailed raise:@"Operation failed" format:@"%@", message]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Signal/src/network/rtp/zrtp/agreement/EC25KeyAgreementParticipant.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "KeyAgreementParticipant.h" 3 | #import "EC25KeyAgreementProtocol.h" 4 | #import "EVPKeyAgreement.h" 5 | 6 | @interface EC25KeyAgreementParticipant : NSObject 7 | 8 | - (instancetype)initWithPrivateKeyGeneratedForProtocol:(EC25KeyAgreementProtocol*)protocol; 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /Signal/src/util/collections/PriorityQueue.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "Constraints.h" 3 | 4 | @interface PriorityQueue : NSObject 5 | 6 | @property (readonly, nonatomic, copy) NSComparator comparator; 7 | 8 | - (instancetype)initAscendingWithComparator:(NSComparator)comparator; 9 | - (void)enqueue:(id)item; 10 | - (id)peek; 11 | - (id)dequeue; 12 | - (NSUInteger)count; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Signal/src/util/SMSInvite.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "PhoneNumber.h" 4 | 5 | @interface SMSInvite : NSObject 6 | 7 | @property (strong, nonatomic, readonly) UIViewController* parent; 8 | 9 | - (instancetype)initWithParent:(UIViewController*)parent; 10 | - (void)sendSMSInviteToNumber:(PhoneNumber*)number; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /Signal/src/network/rtp/srtp/SequenceCounter.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | /** 4 | * 5 | * SequenceCounter is used to expand a 16-bit sequence number into a 64-bit sequence number. 6 | * 7 | * Works by tracking when the almost monotonically increasing id 'looops around'. 8 | * 9 | **/ 10 | 11 | @interface SequenceCounter : NSObject 12 | 13 | - (int64_t)convertNext:(uint16_t)nextShortId; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Libraries/speex/include/speex/Makefile.am: -------------------------------------------------------------------------------- 1 | # Disable automatic dependency tracking if using other tools than gcc and gmake 2 | #AUTOMAKE_OPTIONS = no-dependencies 3 | 4 | nodist_pkginclude_HEADERS = speex_config_types.h 5 | 6 | pkginclude_HEADERS = speex.h speex_bits.h speex_buffer.h speex_callbacks.h \ 7 | speex_echo.h speex_header.h speex_jitter.h speex_preprocess.h speex_resampler.h \ 8 | speex_stereo.h speex_types.h 9 | 10 | -------------------------------------------------------------------------------- /Signal/src/audio/AudioRouter.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | /** 4 | * Interfaces with OS to control which hardware devices audio is routed to 5 | **/ 6 | 7 | @interface AudioRouter : NSObject 8 | 9 | + (void)restoreDefaults; 10 | + (void)routeAllAudioToInteralSpeaker; 11 | + (void)routeAllAudioToExternalSpeaker; 12 | 13 | + (BOOL)isOutputRoutedToSpeaker; 14 | + (BOOL)isOutputRoutedToReciever; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Signal/src/util/NSNumber+NumberUtil.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSNumber+NumberUtil.h 3 | // Signal 4 | // 5 | // Created by Gil Azaria on 3/11/2014. 6 | // Copyright (c) 2014 Open Whisper Systems. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSNumber (NumberUtil) 12 | 13 | - (bool)hasUnsignedIntegerValue; 14 | - (bool)hasUnsignedLongLongValue; 15 | - (bool)hasLongLongValue; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Signal/src/network/rtp/zrtp/ShortAuthenticationStringGenerator.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | /** 4 | * 5 | * ShortAuthenticationStringGenerator is utility class responsible for generating the Short Authentication String. 6 | * Speaking the SAS is used to detect man-in-the-middle attacks. 7 | * 8 | **/ 9 | 10 | @interface ShortAuthenticationStringGenerator : NSObject 11 | 12 | + (NSString*)generateFromData:(NSData*)sasBytes; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Signal/src/views/SettingsTableHeaderView.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | /** 4 | * 5 | * The header view of the settings table view sections which handles rotating the image that indicates collapsed/expanded state 6 | * 7 | */ 8 | 9 | @interface SettingsTableHeaderView : UIView 10 | 11 | @property (strong, nonatomic) IBOutlet UIImageView* columnStateImageView; 12 | 13 | - (void)setColumnStateExpanded:(BOOL)isExpanded andIsAnimated:(BOOL)animated; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Signal/src/network/tcp/StreamPair.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | /** 4 | * 5 | * Stores an NSInputStream and an NSOutputStream in one object 6 | * 7 | **/ 8 | 9 | @interface StreamPair : NSObject 10 | 11 | @property (strong, readonly, nonatomic) NSInputStream* inputStream; 12 | @property (strong, readonly, nonatomic) NSOutputStream* outputStream; 13 | 14 | - (instancetype)initWithInput:(NSInputStream*)input andOutput:(NSOutputStream*)output; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Signal/src/views/ContactTableViewCell.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "ContactsManager.h" 3 | 4 | /** 5 | * 6 | * ContactTableViewCell displays a contact from a Contact object. 7 | * 8 | */ 9 | 10 | @interface ContactTableViewCell : UITableViewCell 11 | 12 | @property (strong, nonatomic) IBOutlet UILabel* nameLabel; 13 | @property (strong, nonatomic) IBOutlet UIImageView* contactPictureView; 14 | 15 | - (void)configureWithContact:(Contact*)contact; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Signal/src/audio/incall_audio/protocols/AudioCallbackHandler.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "CyclicalBuffer.h" 3 | 4 | /** 5 | * 6 | * An AudioCallbackHandler is called when audio is played or recorded. 7 | * 8 | **/ 9 | 10 | @protocol AudioCallbackHandler 11 | 12 | - (void)handleNewDataRecorded:(CyclicalBuffer*)data; 13 | - (void)handlePlaybackOccurredWithBytesRequested:(NSUInteger)requested andBytesRemaining:(NSUInteger)bytesRemaining; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Signal/src/environment/DebugLogger.h: -------------------------------------------------------------------------------- 1 | // 2 | // DebugLogger.h 3 | // Signal 4 | // 5 | // Created by Frederic Jacobs on 08/08/14. 6 | // Copyright (c) 2014 Open Whisper Systems. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DebugLogger : NSObject 12 | 13 | MacrosSingletonInterface 14 | 15 | - (void)enableFileLogging; 16 | 17 | - (void)disableFileLogging; 18 | 19 | - (void)enableTTYLogging; 20 | 21 | - (void)wipeLogs; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Signal/src/util/Zid.m: -------------------------------------------------------------------------------- 1 | #import "Zid.h" 2 | #import "Constraints.h" 3 | 4 | @interface Zid () 5 | 6 | @property (strong, nonatomic, readwrite) NSData* data; 7 | 8 | @end 9 | 10 | @implementation Zid 11 | 12 | - (instancetype)initWithData:(NSData*)zidData { 13 | self = [super init]; 14 | 15 | if (self) { 16 | require(zidData != nil); 17 | require(zidData.length == 12); 18 | self.data = zidData; 19 | } 20 | 21 | return self; 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '7.0' 2 | source 'https://github.com/CocoaPods/Specs.git' 3 | 4 | link_with ["Signal", "SignalTests"] 5 | 6 | pod 'UICKeyChainStore', :podspec => 'Podspecs/UICKeyChainStore.podspec' 7 | pod 'OpenSSL', '~> 1.0.109' 8 | pod 'MMDrawerController', '~> 0.5.7' 9 | pod 'libPhoneNumber-iOS', '~> 0.7' 10 | pod 'PastelogKit', '~> 1.2' 11 | pod 'AFNetworking', '~> 2.4.1' 12 | pod 'TwistedOakCollapsingFutures','~> 1.0' 13 | -------------------------------------------------------------------------------- /Signal/src/views/InboxFeedFooterCell.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | /** 4 | * 5 | * The last cell of Inbox feed that displays an active count of the items left to be archived/deleted 6 | * 7 | */ 8 | 9 | @interface InboxFeedFooterCell : UITableViewCell 10 | 11 | @property (strong, nonatomic) IBOutlet UILabel* inboxCountLabel; 12 | @property (strong, nonatomic) IBOutlet UILabel* inboxMessageLabelFirst; 13 | @property (strong, nonatomic) IBOutlet UILabel* inboxMessageLabelSecond; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Signal/test/network/tcp/tls/SecureEndPointTest.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import "SecureEndPoint.h" 3 | #import "TestUtil.h" 4 | #import "IPEndPoint.h" 5 | 6 | @interface SecureEndPointTest : XCTestCase 7 | 8 | @end 9 | 10 | @implementation SecureEndPointTest 11 | 12 | -(void) testCert { 13 | Certificate* r = [[Certificate alloc] initFromResourcePath:@"whisperReal" 14 | ofType:@"cer"]; 15 | test(r != nil); 16 | } 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Signal/src/views/PreferenceListTableViewCell.m: -------------------------------------------------------------------------------- 1 | #import "PreferenceListTableViewCell.h" 2 | 3 | @implementation PreferenceListTableViewCell 4 | 5 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString*)reuseIdentifier { 6 | self = [[NSBundle.mainBundle loadNibNamed:NSStringFromClass([self class]) owner:self options:nil] firstObject]; 7 | return self; 8 | } 9 | 10 | - (NSString*)reuseIdentifier { 11 | return NSStringFromClass([self class]); 12 | } 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Signal/src/network/rtp/zrtp/agreement/EVPKeyAgreement.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "DH3KKeyAgreementProtocol.h" 3 | #import "KeyAgreementParticipant.h" 4 | 5 | @interface EVPKeyAgreement : NSObject 6 | 7 | + (instancetype)evpDH3KKeyAgreementWithModulus:(NSData*)modulus andGenerator:(NSData*)generator; 8 | + (instancetype)evpEC25KeyAgreement; 9 | 10 | - (void)generateKeyPair; 11 | - (NSData*)getPublicKey; 12 | - (NSData*)getSharedSecretForRemotePublicKey:(NSData*)publicKey; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Signal/src/util/NSData+Conversions.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "Constraints.h" 4 | #import "CryptoTools.h" 5 | 6 | @interface NSData (Conversions) 7 | 8 | - (uint16_t)bigEndianUInt16At:(NSUInteger)offset; 9 | - (uint32_t)bigEndianUInt32At:(NSUInteger)offset; 10 | + (NSData*)dataWithBigEndianBytesOfUInt16:(uint16_t)value; 11 | + (NSData*)dataWithBigEndianBytesOfUInt32:(uint32_t)value; 12 | + (NSData*)switchEndiannessOfData:(NSData*)data; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Signal/src/util/NSMutableData+Util.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSMutableData+Util.h 3 | // Signal 4 | // 5 | // Created by Gil Azaria on 3/11/2014. 6 | // Copyright (c) 2014 Open Whisper Systems. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSMutableData (Util) 12 | 13 | - (void)replaceBytesStartingAt:(NSUInteger)offset 14 | withData:(NSData*)data; 15 | 16 | - (void)setUint8At:(NSUInteger)offset 17 | to:(uint8_t)newValue; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Signal/src/network/http/HTTPRequestOrResponse.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "HTTPRequest.h" 3 | #import "HTTPResponse.h" 4 | 5 | @interface HTTPRequestOrResponse : NSObject 6 | 7 | - (instancetype)initWithRequestOrResponse:(id)requestOrResponse; 8 | + (instancetype)tryExtractFromPartialData:(NSData*)data usedLengthOut:(NSUInteger*)usedLengthPtr; 9 | 10 | - (bool)isRequest; 11 | - (bool)isResponse; 12 | - (HTTPRequest*)request; 13 | - (HTTPResponse*)response; 14 | - (NSData*)serialize; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Signal/src/network/rtp/zrtp/agreement/EC25KeyAgreementProtocol.m: -------------------------------------------------------------------------------- 1 | #import "EC25KeyAgreementProtocol.h" 2 | #import "EC25KeyAgreementParticipant.h" 3 | 4 | #define EC25_KEY_AGREEMENT_ID @"EC25".encodedAsUtf8 5 | 6 | @implementation EC25KeyAgreementProtocol 7 | 8 | - (id)generateParticipantWithNewKeys { 9 | return [[EC25KeyAgreementParticipant alloc] initWithPrivateKeyGeneratedForProtocol:self]; 10 | } 11 | 12 | - (NSData*)getId { 13 | return EC25_KEY_AGREEMENT_ID; 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Signal/src/phone/callstate/CallFailedServerMessage.m: -------------------------------------------------------------------------------- 1 | #import "CallFailedServerMessage.h" 2 | #import "Util.h" 3 | 4 | @interface CallFailedServerMessage () 5 | 6 | @property (readwrite, nonatomic) NSString* text; 7 | 8 | @end 9 | 10 | @implementation CallFailedServerMessage 11 | 12 | - (instancetype)initWithText:(NSString*)text { 13 | self = [super init]; 14 | 15 | if (self) { 16 | require(text != nil); 17 | self.text = text; 18 | } 19 | 20 | return self; 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Signal/src/view controllers/CallLogViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "ContactsManager.h" 4 | #import "CallLogTableViewCell.h" 5 | #import "SearchBarTitleView.h" 6 | 7 | @interface CallLogViewController : UIViewController 8 | 9 | @property (strong, nonatomic) IBOutlet SearchBarTitleView *searchBarTitleView; 10 | @property (strong, nonatomic) IBOutlet UITableView *recentCallsTableView; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /Signal/src/network/dns/HostNameEndPoint.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "NetworkEndPoint.h" 3 | 4 | /** 5 | * 6 | * Stores the port and hostname for a resolvable network end point 7 | * 8 | **/ 9 | 10 | @interface HostNameEndPoint : NSObject 11 | 12 | @property (nonatomic, readonly) in_port_t port; 13 | @property (strong, nonatomic, readonly) NSString* hostname; 14 | 15 | - (instancetype)initWithHostName:(NSString*)hostname 16 | andPort:(in_port_t)port; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Signal/src/audio/incall_audio/EncodedAudioFrame.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | /** 4 | * 5 | * A data structure (frame) that stores encoded audio data 6 | * Can be an empty frame to be inferred as missing information 7 | * 8 | **/ 9 | 10 | @interface EncodedAudioFrame : NSObject 11 | 12 | @property (strong, readonly, nonatomic, getter=tryGetAudioData) NSData* audioData; 13 | 14 | - (instancetype)initWithData:(NSData*)audioData; 15 | + (instancetype)emptyFrame; 16 | 17 | - (bool)isMissingAudioData; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Signal/src/util/RunningThreadRunLoopPair.h: -------------------------------------------------------------------------------- 1 | // 2 | // RunningThreadRunLoopPair.h 3 | // Signal 4 | // 5 | // Created by Gil Azaria on 3/11/2014. 6 | // Copyright (c) 2014 Open Whisper Systems. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface RunningThreadRunLoopPair : NSObject 12 | 13 | @property (nonatomic, readonly) NSThread* thread; 14 | @property (nonatomic, readonly) NSRunLoop* runLoop; 15 | 16 | - (instancetype)initWithThreadName:(NSString*)name; 17 | - (void)terminate; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Signal/src/environment/Release.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "Environment.h" 3 | #import "DH3KKeyAgreementProtocol.h" 4 | #import "EC25KeyAgreementProtocol.h" 5 | 6 | @interface Release : NSObject 7 | 8 | /// Connects to actual production infrastructure 9 | + (Environment*)releaseEnvironmentWithLogging:(id)logging; 10 | 11 | /// Fake environment with no logging 12 | + (Environment*)unitTestEnvironment:(NSArray*)testingAndLegacyOptions; 13 | 14 | + (DH3KKeyAgreementProtocol*)supportedDH3KKeyAgreementProtocol; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Signal/src/network/failures/IgnoredPacketFailure.m: -------------------------------------------------------------------------------- 1 | #import "IgnoredPacketFailure.h" 2 | 3 | @interface IgnoredPacketFailure () 4 | 5 | @property (strong, nonatomic) NSString* reason; 6 | 7 | @end 8 | 9 | @implementation IgnoredPacketFailure 10 | 11 | - (instancetype)initWithReason:(NSString*)reason { 12 | self = [super init]; 13 | 14 | if (self) { 15 | self.reason = reason; 16 | } 17 | 18 | return self; 19 | } 20 | 21 | - (NSString*)description { 22 | return [NSString stringWithFormat:@"Ignored: %@", self.reason]; 23 | } 24 | @end 25 | -------------------------------------------------------------------------------- /Signal/src/util/NSDictionary+Util.m: -------------------------------------------------------------------------------- 1 | #import "NSData+Util.h" 2 | #import "NSDictionary+Util.h" 3 | #import "Constraints.h" 4 | 5 | @implementation NSDictionary (Util) 6 | 7 | - (NSString*)encodedAsJSON { 8 | NSError* jsonSerializeError = nil; 9 | NSData* data = [NSJSONSerialization dataWithJSONObject:self 10 | options:0 11 | error:&jsonSerializeError]; 12 | checkOperation(jsonSerializeError == nil); 13 | return [data decodedAsUtf8]; 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Signal/src/audio/incall_audio/RemoteIOBufferListWrapper.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import 4 | 5 | /** 6 | * 7 | * RemoteIOBufferListWrapper is used by RemoteIOAudio to manage an audio buffer list. 8 | * 9 | **/ 10 | 11 | @interface RemoteIOBufferListWrapper : NSObject 12 | 13 | @property (assign, nonatomic) NSUInteger sampleCount; 14 | @property (readonly, nonatomic) AudioBufferList* audioBufferList; 15 | 16 | - (instancetype)initWithMonoBufferSize:(NSUInteger)bufferSize; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Signal/src/network/rtp/zrtp/protocols/KeyAgreementProtocol.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "HashChain.h" 3 | #import "HandshakePacket.h" 4 | 5 | @protocol KeyAgreementParticipant; 6 | 7 | /** 8 | * 9 | * KeyAgreementProtocol is used to generate compatible participants for a key agreement protocol. 10 | * Two compatible participants generate shared key when given each others' public key data. 11 | * 12 | **/ 13 | 14 | @protocol KeyAgreementProtocol 15 | 16 | - (id)generateParticipantWithNewKeys; 17 | - (NSData*)getId; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Signal/src/network/rtp/zrtp/NegotiationFailed.m: -------------------------------------------------------------------------------- 1 | #import "NegotiationFailed.h" 2 | 3 | @interface NegotiationFailed () 4 | 5 | @property (strong, readwrite, nonatomic) NSString* reason; 6 | 7 | @end 8 | 9 | @implementation NegotiationFailed 10 | 11 | - (instancetype)initWithReason:(NSString*)reason { 12 | self = [super init]; 13 | 14 | if (self) { 15 | self.reason = reason; 16 | } 17 | 18 | return self; 19 | } 20 | 21 | - (NSString*)description { 22 | return [NSString stringWithFormat:@"Negotation failed: %@", self.reason]; 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Signal/src/util/Util.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "NSArray+Util.h" 3 | #import "Constraints.h" 4 | #import "NSData+CRC.h" 5 | #import "NSData+Util.h" 6 | #import "NSMutableData+Util.h" 7 | #import "NSDictionary+Util.h" 8 | #import "NSArray+FunctionalUtil.h" 9 | #import "Operation.h" 10 | #import "NumberUtil.h" 11 | #import "NSNumber+NumberUtil.h" 12 | #import "NSString+Util.h" 13 | #import "TimeUtil.h" 14 | #import "TOCCancelToken+FutureUtil.h" 15 | #import "TOCFuture+FutureUtil.h" 16 | #import "UIUtil.h" 17 | #import "DateUtil.h" 18 | #import "RunningThreadRunLoopPair.h" 19 | -------------------------------------------------------------------------------- /SettingsBundle/Settings.bundle/Root.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | File 9 | Acknowledgements 10 | Title 11 | Acknowledgements 12 | Type 13 | PSChildPaneSpecifier 14 | 15 | 16 | StringsTable 17 | Root 18 | 19 | 20 | -------------------------------------------------------------------------------- /Signal/src/audio/incall_audio/SpeexCodec.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import 4 | #import "Logging.h" 5 | 6 | /** 7 | * 8 | * SpeexCodec is responsible for encoding and decoding audio using the speex codec. 9 | * 10 | **/ 11 | 12 | @interface SpeexCodec : NSObject 13 | 14 | - (instancetype)init; 15 | + (NSUInteger)frameSizeInSamples; 16 | - (NSUInteger)encodedFrameSizeInBytes; 17 | - (NSUInteger)decodedFrameSizeInBytes; 18 | 19 | - (NSData*)decode:(NSData*)encodedData; 20 | - (NSData*)encode:(NSData*)rawData; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Signal/src/network/rtp/zrtp/ZRTPHandshakeSocket.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "HandshakePacket.h" 4 | #import "Environment.h" 5 | #import "RTPSocket.h" 6 | 7 | /** 8 | * 9 | * A ZRTPHandshakeSocket sends/receives handshake packets by serializing them onto/from an rtp socket. 10 | * 11 | **/ 12 | 13 | @interface ZRTPHandshakeSocket : NSObject 14 | 15 | - (instancetype)initOverRTP:(RTPSocket*)rtpSocket; 16 | - (void)send:(HandshakePacket*)packet; 17 | - (void)startWithHandler:(PacketHandler*)handler untilCancelled:(TOCCancelToken*)untilCancelledToken; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Signal/src/network/tcp/tls/Certificate.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | /** 4 | * 5 | * Certificate is responsible for loading, exposing, and managing a SecCertificateRef. 6 | * 7 | */ 8 | @interface Certificate : NSObject 9 | 10 | // This is unused, do we still need it? 11 | - (instancetype)initFromTrust:(SecTrustRef)trust 12 | atIndex:(CFIndex)index; 13 | 14 | - (instancetype)initFromResourcePath:(NSString*)resourcePath 15 | ofType:(NSString*)resourceType; 16 | 17 | - (void)setAsAnchorForTrust:(SecTrustRef)trust; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Signal/src/network/failures/UnrecognizedRequestFailure.m: -------------------------------------------------------------------------------- 1 | #import "UnrecognizedRequestFailure.h" 2 | 3 | @interface UnrecognizedRequestFailure () 4 | 5 | @property (strong, nonatomic) NSString* reason; 6 | 7 | @end 8 | 9 | @implementation UnrecognizedRequestFailure 10 | 11 | - (instancetype)initWithReason:(NSString*)reason { 12 | self = [super init]; 13 | 14 | if (self) { 15 | self.reason = reason; 16 | } 17 | 18 | return self; 19 | } 20 | 21 | - (NSString*)description { 22 | return [NSString stringWithFormat:@"Unrecognized request: %@", self.reason]; 23 | } 24 | @end 25 | -------------------------------------------------------------------------------- /Signal/src/environment/PropertyListPreferences.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface PropertyListPreferences : NSObject 4 | 5 | - (id)tryGetValueForKey:(NSString*)key; 6 | - (void)setValueForKey:(NSString*)key toValue:(id)value; 7 | - (id)adjustAndTryGetNewValueForKey:(NSString*)key afterAdjuster:(id (^)(id oldValue))adjuster; 8 | - (void)clear; 9 | 10 | - (NSData*)secureDataStoreAdjustAndTryGetNewValueForKey:(NSString*)key afterAdjuster:(id (^)(id))adjuster; 11 | - (NSString*)secureStringStoreAdjustAndTryGetNewValueForKey:(NSString*)key afterAdjuster:(id (^)(id))adjuster; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Signal/test/audio/AudioFrameTest.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import "EncodedAudioPacket.h" 3 | #import "TestUtil.h" 4 | 5 | @interface AudioFrameTest : XCTestCase 6 | 7 | @end 8 | 9 | @implementation AudioFrameTest 10 | -(void) testTrivial { 11 | NSData* d2 = [NSMutableData dataWithLength:6]; 12 | 13 | testThrows([[EncodedAudioPacket alloc] initWithAudioData:nil andSequenceNumber:0]); 14 | EncodedAudioPacket* p2 = [[EncodedAudioPacket alloc] initWithAudioData:d2 andSequenceNumber:0xFF00]; 15 | test([p2 audioData] == d2); 16 | test([p2 sequenceNumber] == 0xFF00); 17 | } 18 | @end 19 | -------------------------------------------------------------------------------- /Signal/src/network/tcp/LowLatencyCandidate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "CollapsingFutures.h" 3 | #import "IPEndPoint.h" 4 | #import "NetworkStream.h" 5 | 6 | @interface LowLatencyCandidate : NSObject 7 | 8 | @property (strong, readonly, nonatomic) IPEndPoint* remoteEndPoint; 9 | @property (strong, readonly, nonatomic) NetworkStream* networkStream; 10 | 11 | - (instancetype)initWithRemoteEndPoint:(id)remoteEndPoint; 12 | 13 | - (void)preStart; 14 | 15 | - (TOCUntilOperation)tcpHandshakeCompleter; 16 | 17 | - (TOCFuture*)delayedUntilAuthenticated; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Signal/src/network/rtp/zrtp/agreement/DH3KKeyAgreementParticipant.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "KeyAgreementParticipant.h" 3 | #import "DH3KKeyAgreementProtocol.h" 4 | #import "EVPKeyAgreement.h" 5 | 6 | /** 7 | * 8 | * DH3KKeyAgreementParticipant is used to do Diffie-Hellman key agreement. 9 | * Each participant has access to the protocol parameters, and their own key material. 10 | * 11 | **/ 12 | 13 | @interface DH3KKeyAgreementParticipant : NSObject 14 | 15 | - (instancetype)initWithPrivateKeyGeneratedForProtocol:(DH3KKeyAgreementProtocol*)protocol; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Signal/src/network/dns/DNSManager.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "CollapsingFutures.h" 3 | #import "IPAddress.h" 4 | 5 | /** 6 | * 7 | * DNSManager implements utility methods for querying the addresses/CName associated with a domain name. 8 | * 9 | **/ 10 | 11 | @interface DNSManager : NSObject 12 | 13 | @property (strong, nonatomic) TOCFutureSource* futureResultSource; 14 | 15 | /// Result has type Future(Array(IPAddress)) 16 | + (TOCFuture*)asyncQueryAddressesForDomainName:(NSString*)domainName 17 | unlessCancelled:(TOCCancelToken*)unlessCancelledToken; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Signal/src/NotificationManifest.h: -------------------------------------------------------------------------------- 1 | /** 2 | Stores All String Constants Used for NS Notifications 3 | **/ 4 | 5 | #ifndef RedPhone_NotificationManifest_h 6 | #define RedPhone_NotificationManifest_h 7 | 8 | #define NOTIFICATION_DIRECTORY_UPDATE @"NOTIFICATION_DIRECTORY_UPDATE" 9 | #define NOTIFICATION_DIRECTORY_WAS_UPDATED @"NOTIFICATION_DIRECTORY_WAS_UPDATED" 10 | #define NOTIFICATION_DIRECTORY_FAILED @"NOTIFICATION_DIRECTORY_FAILED" 11 | #define NOTIFICATION_NEW_USERS_AVAILABLE @"NOTIFICATION_NEW_USERS_AVAILABLE" 12 | 13 | 14 | #define NOTIFICATION_DATAKEY_NEW_USERS @"NOTIFICATION_DATAKEY_NEW_USERS" 15 | 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /Signal/src/audio/incall_audio/processing/AudioStretcher.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "AudioStretcher.h" 3 | #import "private/time_scale.h" 4 | 5 | /** 6 | * 7 | * AudioStretcher is used to make queued audio play faster or slower, without affecting pitch. 8 | * This capability allows the amount of buffered audio to be controlled. 9 | * 10 | * Internally, uses the same spandsp used by the android version of RedPhone. 11 | * 12 | **/ 13 | 14 | @interface AudioStretcher : NSObject 15 | 16 | - (instancetype)init; 17 | - (NSData*)stretchAudioData:(NSData*)audioData stretchFactor:(double)stretchFactor; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Signal/src/view controllers/FavouritesViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "SearchBarTitleView.h" 3 | #import "FavouriteTableViewCell.h" 4 | 5 | /** 6 | * 7 | * FavouritesViewController displays a table view of favourites obtained through the ContactsManager 8 | * 9 | */ 10 | 11 | @interface FavouritesViewController : UIViewController 12 | 13 | @property (strong, nonatomic) IBOutlet SearchBarTitleView* searchBarTitleView; 14 | @property (strong, nonatomic) IBOutlet UITableView* favouriteTableView; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Libraries/speex/include/ogg/config_types.h: -------------------------------------------------------------------------------- 1 | #ifndef __CONFIG_TYPES_H__ 2 | #define __CONFIG_TYPES_H__ 3 | 4 | /* these are filled in by configure */ 5 | #define INCLUDE_INTTYPES_H 1 6 | #define INCLUDE_STDINT_H 1 7 | #define INCLUDE_SYS_TYPES_H 1 8 | 9 | #if INCLUDE_INTTYPES_H 10 | # include 11 | #endif 12 | #if INCLUDE_STDINT_H 13 | # include 14 | #endif 15 | #if INCLUDE_SYS_TYPES_H 16 | # include 17 | #endif 18 | 19 | typedef short ogg_int16_t; 20 | typedef unsigned short ogg_uint16_t; 21 | typedef int ogg_int32_t; 22 | typedef unsigned int ogg_uint32_t; 23 | typedef long ogg_int64_t; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /Signal/src/util/NSNumber+NumberUtil.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSNumber+NumberUtil.m 3 | // Signal 4 | // 5 | // Created by Gil Azaria on 3/11/2014. 6 | // Copyright (c) 2014 Open Whisper Systems. All rights reserved. 7 | // 8 | 9 | #import "NSNumber+NumberUtil.h" 10 | 11 | @implementation NSNumber (NumberUtil) 12 | 13 | - (bool)hasUnsignedIntegerValue { 14 | return [self isEqual:@([self unsignedIntegerValue])]; 15 | } 16 | 17 | - (bool)hasUnsignedLongLongValue { 18 | return [self isEqual:@([self unsignedLongLongValue])]; 19 | } 20 | 21 | - (bool)hasLongLongValue { 22 | return [self isEqual:@([self longLongValue])]; 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Signal/src/network/rtp/zrtp/agreement/DH3KKeyAgreementProtocol.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "KeyAgreementProtocol.h" 3 | #import "CryptoTools.h" 4 | 5 | /** 6 | * 7 | * DH3KKeyAgreementProtocol is used to generate participants for Diffie-Hellman key agreement. 8 | * 9 | **/ 10 | 11 | @interface DH3KKeyAgreementProtocol : NSObject 12 | 13 | @property (strong, readonly, nonatomic, getter=getModulus) NSData* modulus; 14 | @property (strong, readonly, nonatomic, getter=getGenerator) NSData* generator; 15 | 16 | - (instancetype)initWithModulus:(NSData*)modulus andGenerator:(NSData*)generator; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Signal/src/util/PhoneNumberUtil.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "PhoneNumber.h" 3 | 4 | @interface PhoneNumberUtil : NSObject 5 | 6 | + (NSString*)callingCodeFromCountryCode:(NSString*)code; 7 | + (NSString*)countryNameFromCountryCode:(NSString*)code; 8 | + (NSArray*)countryCodesForSearchTerm:(NSString*)searchTerm; 9 | + (NSString*)normalizePhoneNumber:(NSString*)number; 10 | 11 | + (NSUInteger)translateCursorPosition:(NSUInteger)offset 12 | from:(NSString*)source 13 | to:(NSString*)target 14 | stickingRightward:(bool)preferHigh; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Signal/src/audio/incall_audio/AudioSocket.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "EncodedAudioPacket.h" 3 | #import "SRTPSocket.h" 4 | 5 | /** 6 | * 7 | * AudioSocket is used to send audio packets over an SRTPSocket. 8 | * The audio packet's data and sequence number become the payload and sequence number of the encrypted rtp packets. 9 | * 10 | **/ 11 | 12 | @interface AudioSocket : NSObject 13 | 14 | - (instancetype)initOverSRTPSocket:(SRTPSocket*)srtpSocket; 15 | 16 | - (void)startWithHandler:(PacketHandler*)handler untilCancelled:(TOCCancelToken*)untilCancelledToken; 17 | - (void)send:(EncodedAudioPacket*)audioPacket; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Signal/src/phone/signaling/number directory/PhoneNumberDirectoryFilterManager.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "CollapsingFutures.h" 3 | #import "PhoneNumberDirectoryFilter.h" 4 | 5 | /** 6 | * 7 | * PhoneNumberDirectoryFilterManager is responsible for periodically downloading the latest 8 | * bloom filter containing phone numbers considered to have RedPhone support. 9 | * 10 | */ 11 | @interface PhoneNumberDirectoryFilterManager : NSObject 12 | 13 | - (instancetype)init; 14 | 15 | - (void)forceUpdate; 16 | - (void)startUntilCancelled:(TOCCancelToken*)cancelToken; 17 | - (PhoneNumberDirectoryFilter*)getCurrentFilter; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Signal/test/network/rtp/zrtp/ShortAuthenticationStringGeneratorTest.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import "ShortAuthenticationStringGenerator.h" 3 | #import "Util.h" 4 | #import "TestUtil.h" 5 | 6 | @interface ShortAuthenticationStringGeneratorTest : XCTestCase 7 | 8 | @end 9 | 10 | @implementation ShortAuthenticationStringGeneratorTest 11 | -(void) testSAS { 12 | test([[ShortAuthenticationStringGenerator generateFromData:[(@[@0,@0]) ows_toUint8Data]] isEqualToString:@"aardvark adroitness"]); 13 | test([[ShortAuthenticationStringGenerator generateFromData:[(@[@0xFF,@0xFF]) ows_toUint8Data]] isEqualToString:@"Zulu Yucatan"]); 14 | } 15 | @end 16 | -------------------------------------------------------------------------------- /Signal/src/profiling/protocols/utilities/AnonymousConditionLogger.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "ConditionLogger.h" 3 | 4 | @interface AnonymousConditionLogger : NSObject 5 | 6 | @property (nonatomic, readonly, copy) void (^logNoticeBlock)(id details); 7 | @property (nonatomic, readonly, copy) void (^logWarningBlock)(id details); 8 | @property (nonatomic, readonly, copy) void (^logErrorBlock)(id details); 9 | 10 | - (instancetype)initWithLogNotice:(void(^)(id details))logNotice 11 | andLogWarning:(void(^)(id details))logWarning 12 | andLogError:(void(^)(id details))logError; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Signal/src/network/rtp/zrtp/ZRTPHandshakeResult.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "MasterSecret.h" 4 | #import "SRTPSocket.h" 5 | 6 | /** 7 | * 8 | * A ZRTPHandshakeResult stores the master secret and secure rtp communication channel produced by a successful zrtp handshake. 9 | * 10 | **/ 11 | 12 | @interface ZRTPHandshakeResult : NSObject 13 | 14 | @property (strong, readonly, nonatomic) SRTPSocket* secureRTPSocket; 15 | @property (strong, readonly, nonatomic) MasterSecret* masterSecret; 16 | 17 | - (instancetype)initWithSecureChannel:(SRTPSocket*)secureRTPSocket 18 | andMasterSecret:(MasterSecret*)masterSecret; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Signal/src/views/SettingsTableHeaderView.m: -------------------------------------------------------------------------------- 1 | #import "SettingsTableHeaderView.h" 2 | 3 | #define STATE_TRANSITION_ANIMATION_DURATION 0.25 4 | 5 | @implementation SettingsTableHeaderView 6 | 7 | - (void)setColumnStateExpanded:(BOOL)isExpanded andIsAnimated:(BOOL)animated { 8 | [UIView animateWithDuration:animated ? STATE_TRANSITION_ANIMATION_DURATION : 0.0 animations:^{ 9 | if (isExpanded) { 10 | self.columnStateImageView.transform = CGAffineTransformMakeRotation(0 * M_PI/180); 11 | } else { 12 | self.columnStateImageView.transform = CGAffineTransformMakeRotation( 270 * (float)M_PI/180); 13 | } 14 | }]; 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Signal/src/network/rtp/zrtp/protocols/KeyAgreementParticipant.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "HashChain.h" 3 | #import "HandshakePacket.h" 4 | 5 | @protocol KeyAgreementProtocol; 6 | 7 | /** 8 | * 9 | * KeyAgreementParticipant is used to represent a participant, with their own private/public key, in a key agreement protocol. 10 | * Two compatible participants generate shared key when given each others' public key data. 11 | * 12 | **/ 13 | 14 | @protocol KeyAgreementParticipant 15 | 16 | - (id)getProtocol; 17 | - (NSData*)getPublicKeyData; 18 | - (NSData*)calculateKeyAgreementAgainstRemotePublicKey:(NSData*)remotePublicKey; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Signal/src/view controllers/InviteContactsViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "SearchBarTitleView.h" 4 | 5 | @interface InviteContactsViewController : UIViewController 6 | 7 | @property (strong, nonatomic) IBOutlet UIView* unseenWhisperUsersHeaderView; 8 | @property (strong, nonatomic) IBOutlet UIView* regularContactsHeaderView; 9 | @property (strong, nonatomic) IBOutlet UITableView* contactTableView; 10 | 11 | - (IBAction)dismissNewWhisperUsersTapped:(id)sender; 12 | 13 | - (void)updateWithNewWhisperUsers:(NSArray*)users; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Signal/test/network/rtp/zrtp/utilities/PregeneratedKeyAgreementParticipantProtocol.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "KeyAgreementProtocol.h" 3 | #import "KeyAgreementParticipant.h" 4 | 5 | /// A mock key agreement protocol. 6 | /// Used in testing to create key agreement participants with preset keys. 7 | /// It would be very bad if one of these was used in non-testing code... 8 | 9 | @interface PregeneratedKeyAgreementParticipantProtocol : NSObject { 10 | @private id participant; 11 | } 12 | 13 | +(PregeneratedKeyAgreementParticipantProtocol*) pregeneratedWithParticipant:(id)participant; 14 | @end 15 | -------------------------------------------------------------------------------- /Signal/src/phone/signaling/CallConnectResult.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "AudioSocket.h" 3 | 4 | /** 5 | * 6 | * A CallConnectResult is the eventual result of trying to initiate or respond to a call. 7 | * It includes a secure communication channel and a short authentication string. 8 | * 9 | */ 10 | @interface CallConnectResult : NSObject 11 | 12 | @property (nonatomic, readonly) NSString* shortAuthenticationString; 13 | @property (nonatomic, readonly) AudioSocket* audioSocket; 14 | 15 | - (instancetype)initWithShortAuthenticationString:(NSString*)shortAuthenticationString 16 | andAudioSocket:(AudioSocket*)audioSocket; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Signal/test/network/rtp/zrtp/utilities/PregeneratedKeyAgreementParticipantProtocol.m: -------------------------------------------------------------------------------- 1 | #import "PregeneratedKeyAgreementParticipantProtocol.h" 2 | 3 | @implementation PregeneratedKeyAgreementParticipantProtocol 4 | 5 | +(PregeneratedKeyAgreementParticipantProtocol*) pregeneratedWithParticipant:(id)participant { 6 | PregeneratedKeyAgreementParticipantProtocol* s = [PregeneratedKeyAgreementParticipantProtocol new]; 7 | s->participant = participant; 8 | return s; 9 | } 10 | 11 | -(id) generateParticipantWithNewKeys { 12 | return participant; 13 | } 14 | -(NSData*) getId { 15 | return participant.getProtocol.getId; 16 | } 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Signal/src/audio/incall_audio/EncodedAudioPacket.m: -------------------------------------------------------------------------------- 1 | #import "EncodedAudioPacket.h" 2 | #import "Constraints.h" 3 | 4 | @interface EncodedAudioPacket () 5 | 6 | @property (strong, readwrite, nonatomic) NSData* audioData; 7 | @property (readwrite, nonatomic) uint16_t sequenceNumber; 8 | 9 | @end 10 | 11 | @implementation EncodedAudioPacket 12 | 13 | - (instancetype)initWithAudioData:(NSData*)audioData andSequenceNumber:(uint16_t)sequenceNumber { 14 | self = [super init]; 15 | 16 | if (self) { 17 | require(audioData != nil); 18 | 19 | self.audioData = audioData; 20 | self.sequenceNumber = sequenceNumber; 21 | } 22 | 23 | return self; 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Signal/src/audio/incall_audio/processing/StretchFactorController.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "BufferDepthMeasure.h" 3 | #import "DecayingSampleEstimator.h" 4 | #import "DesiredBufferDepthController.h" 5 | 6 | /** 7 | * 8 | * StretchFactorController determines when and how much to stretch audio. 9 | * When the amount of buffered audio is more than desired, audio is shrunk (sped up). 10 | * When the amount of buffered audio is less than desired, audio is expanded (slowed down). 11 | * 12 | **/ 13 | 14 | @interface StretchFactorController : NSObject 15 | 16 | - (instancetype)initForJitterQueue:(JitterQueue*)jitterQueue; 17 | 18 | - (double)getAndUpdateDesiredStretchFactor; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Signal/src/profiling/protocols/utilities/AnonymousOccurrenceLogger.m: -------------------------------------------------------------------------------- 1 | #import "AnonymousOccurrenceLogger.h" 2 | #import "Constraints.h" 3 | 4 | @interface AnonymousOccurrenceLogger () 5 | 6 | @property (nonatomic, readwrite, copy) void (^marker)(id details); 7 | 8 | @end 9 | 10 | @implementation AnonymousOccurrenceLogger 11 | 12 | - (instancetype)initWithMarker:(void(^)(id details))marker { 13 | self = [super init]; 14 | 15 | if (self) { 16 | require(marker != nil); 17 | self.marker = marker; 18 | } 19 | 20 | return self; 21 | } 22 | 23 | #pragma mark OccurrenceLogger 24 | 25 | - (void)markOccurrence:(id)details { 26 | self.marker(details); 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Signal/src/profiling/protocols/utilities/AnonymousValueLogger.m: -------------------------------------------------------------------------------- 1 | #import "AnonymousValueLogger.h" 2 | #import "Constraints.h" 3 | 4 | @interface AnonymousValueLogger () 5 | 6 | @property (nonatomic, readwrite, copy) void (^logValueBlock)(double value); 7 | 8 | @end 9 | 10 | @implementation AnonymousValueLogger 11 | 12 | - (instancetype)initWithLogValue:(void(^)(double value))logValue { 13 | self = [super init]; 14 | 15 | if (self) { 16 | require(logValue != nil); 17 | self.logValueBlock = logValue; 18 | } 19 | 20 | return self; 21 | } 22 | 23 | #pragma mark ValueLogger 24 | 25 | - (void)logValue:(double)value { 26 | self.logValueBlock(value); 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Signal/src/audio/SoundBoard.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "SoundInstance.h" 3 | 4 | /** 5 | * Factory class for generating Instances of specific Sound files. These are then maintained 6 | * and controlled from the SoundPlayer class. This class should mask the use of any specific 7 | * soundFiles. 8 | **/ 9 | 10 | @interface SoundBoard : NSObject 11 | 12 | + (SoundInstance*)instanceOfInboundRingtone; 13 | + (SoundInstance*)instanceOfOutboundRingtone; 14 | + (SoundInstance*)instanceOfHandshakeSound; 15 | + (SoundInstance*)instanceOfCompletedSound; 16 | + (SoundInstance*)instanceOfBusySound; 17 | + (SoundInstance*)instanceOfErrorAlert; 18 | + (SoundInstance*)instanceOfAlert; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Signal/src/network/tcp/LowLatencyConnector.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "CollapsingFutures.h" 3 | #import "IPEndPoint.h" 4 | #import "NetworkStream.h" 5 | #import "LowLatencyCandidate.h" 6 | 7 | /** 8 | * 9 | * Responsible for racing connections to all ip addresses associated with a host name simulatenously. 10 | * The first connection to complete its tcp handshake wins. 11 | * 12 | **/ 13 | 14 | @interface LowLatencyConnector : NSObject 15 | 16 | /// Result has type Future(LowLatencyCandidate). 17 | + (TOCFuture*)asyncLowLatencyConnectToEndPoint:(id)endPoint 18 | untilCancelled:(TOCCancelToken*)untilCancelledToken; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Signal/src/audio/incall_audio/EncodedAudioFrame.m: -------------------------------------------------------------------------------- 1 | #import "EncodedAudioFrame.h" 2 | #import "Constraints.h" 3 | 4 | @interface EncodedAudioFrame () 5 | 6 | @property (strong, readwrite, nonatomic, getter=tryGetAudioData) NSData* audioData; 7 | 8 | @end 9 | 10 | @implementation EncodedAudioFrame 11 | 12 | - (instancetype)initWithData:(NSData*)audioData { 13 | self = [super init]; 14 | 15 | if (self) { 16 | require(audioData != nil); 17 | 18 | self.audioData = audioData; 19 | } 20 | 21 | return self; 22 | } 23 | 24 | + (instancetype)emptyFrame { 25 | return [[self alloc] init]; 26 | } 27 | 28 | - (bool)isMissingAudioData { 29 | return self.audioData == nil; 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Signal/src/network/http/RPServerRequestsManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // CallServerRequests.h 3 | // Signal 4 | // 5 | // Created by Frederic Jacobs on 31/07/14. 6 | // Copyright (c) 2014 Open Whisper Systems. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "RPAPICall.h" 11 | 12 | #import 13 | 14 | @interface RPServerRequestsManager : NSObject 15 | 16 | MacrosSingletonInterface 17 | 18 | - (void)performRequest:(RPAPICall*)apiCall 19 | success:(void (^)(NSURLSessionDataTask* task, id responseObject))success 20 | failure:(void (^)(NSURLSessionDataTask* task, NSError* error))failure; 21 | 22 | - (TOCFuture*)futureForRequest:(RPAPICall*)apiCall; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Signal/src/network/rtp/srtp/SequenceCounter.m: -------------------------------------------------------------------------------- 1 | #import "SequenceCounter.h" 2 | 3 | const int64_t ShortRange = ((int64_t)1) << 16; 4 | 5 | @interface SequenceCounter () 6 | 7 | @property (nonatomic) uint16_t prevShortId; 8 | @property (nonatomic) int64_t prevLongId; 9 | 10 | @end 11 | 12 | @implementation SequenceCounter 13 | 14 | - (int64_t)convertNext:(uint16_t)nextShortId { 15 | int64_t delta = (int64_t)nextShortId - (int64_t)self.prevShortId; 16 | if (delta > INT16_MAX) delta -= ShortRange; 17 | if (delta < INT16_MIN) delta += ShortRange; 18 | int64_t nextLongId = self.prevLongId + delta; 19 | 20 | self.prevShortId = nextShortId; 21 | self.prevLongId = nextLongId; 22 | return nextLongId; 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Signal/src/network/rtp/zrtp/ZRTPResponder.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "ZRTPRole.h" 3 | #import "DHPacketSharedSecretHashes.h" 4 | #import "CallController.h" 5 | 6 | /** 7 | * 8 | * A ZRTPResponder implements the 'responder' role of the zrtp handshake. 9 | * 10 | * The responder SENDS the first handshake packet. 11 | * The 'responder' name is related to what happens during signaling, not the zrtp handshake. 12 | * The responder sends Hello, receives Hello, sends HelloAck, receives Commit, sends DH1, receives DH2, sends Confirm1, receives Confirm2, and sends ConfirmAck 13 | * 14 | **/ 15 | 16 | @interface ZRTPResponder : NSObject 17 | 18 | - (instancetype)initWithCallController:(CallController*)callController; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Signal/src/views/CountryCodeTableViewCell.m: -------------------------------------------------------------------------------- 1 | #import "CountryCodeTableViewCell.h" 2 | 3 | @implementation CountryCodeTableViewCell 4 | 5 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString*)reuseIdentifier { 6 | self = [[NSBundle.mainBundle loadNibNamed:NSStringFromClass([self class]) 7 | owner:self 8 | options:nil] firstObject]; 9 | return self; 10 | } 11 | 12 | - (NSString*)reuseIdentifier { 13 | return NSStringFromClass([self class]); 14 | } 15 | 16 | - (void)configureWithCountryCode:(NSString*)code andCountryName:(NSString*)name { 17 | self.countryCodeLabel.text = code; 18 | self.countryNameLabel.text = name; 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Signal/src/audio/incall_audio/EncodedAudioPacket.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | /** 4 | * 5 | * An EncodedAudioPacket takes the audio data concatenated from multiple EncodedAudioFrame objects 6 | * and pairs it with a sequence number, for sending over the network. 7 | * 8 | * Translation from streamed audio data to/from audio packets is done in AudioPacker. 9 | * Translating (trivially) audio packets to/from rtp packets is done in AudioSocket. 10 | * 11 | **/ 12 | @interface EncodedAudioPacket : NSObject 13 | 14 | @property (strong, readonly, nonatomic) NSData* audioData; 15 | @property (readonly, nonatomic) uint16_t sequenceNumber; 16 | 17 | - (instancetype)initWithAudioData:(NSData*)audioData andSequenceNumber:(uint16_t)sequenceNumber; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Signal/src/network/rtp/RTPSocket.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #include 4 | #include 5 | #import "UDPSocket.h" 6 | 7 | #include "RTPPacket.h" 8 | #import "PacketHandler.h" 9 | #import "Terminable.h" 10 | 11 | /** 12 | * 13 | * Rtp Socket is used to send RTP packets by serializing them over a UDPSocket. 14 | * 15 | **/ 16 | 17 | @interface RTPSocket : NSObject 18 | 19 | @property (strong, nonatomic) NSMutableArray* interopOptions; 20 | 21 | - (instancetype)initOverUDPSocket:(UDPSocket*)udpSocket interopOptions:(NSArray*)interopOptions; 22 | - (void)send:(RTPPacket*)packet; 23 | - (void)startWithHandler:(PacketHandler*)handler untilCancelled:(TOCCancelToken*)untilCancelledToken; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Signal/src/network/tcp/tls/SecureEndPoint.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "NetworkEndPoint.h" 3 | #import "HostNameEndPoint.h" 4 | #import "IPEndPoint.h" 5 | #import "Certificate.h" 6 | 7 | /** 8 | * 9 | * SecureEndPoint combines a hostname end point with a verifiable cryptographic identity. 10 | * 11 | * SecureEndPoint is responsible for resolving and authenticating SSL connections. 12 | * 13 | **/ 14 | 15 | @interface SecureEndPoint : NSObject 16 | 17 | @property (strong, readonly, nonatomic) Certificate* certificate; 18 | @property (strong, readonly, nonatomic) HostNameEndPoint* hostNameEndPoint; 19 | 20 | - (instancetype)initWithHost:(HostNameEndPoint*)host 21 | identifiedByCertificate:(Certificate*)certificate; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Signal/src/views/FavouriteTableViewCell.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "ContactsManager.h" 3 | 4 | /** 5 | * 6 | * FavouriteTableViewCell displays a contact from a Contact object. 7 | * 8 | */ 9 | 10 | @class FavouriteTableViewCell; 11 | 12 | @protocol FavouriteTableViewCellDelegate 13 | - (void)favouriteTableViewCellTappedCall:(FavouriteTableViewCell*)cell; 14 | @end 15 | 16 | 17 | @interface FavouriteTableViewCell : UITableViewCell 18 | 19 | @property (strong, nonatomic) IBOutlet UILabel* nameLabel; 20 | @property (strong, nonatomic) IBOutlet UIImageView* contactPictureView; 21 | @property (weak, nonatomic) id delegate; 22 | 23 | - (void)configureWithContact:(Contact*)contact; 24 | - (IBAction)callTapped; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Signal/test/util/QueueTest.m: -------------------------------------------------------------------------------- 1 | #import "QueueTest.h" 2 | #import "Queue.h" 3 | #import "TestUtil.h" 4 | 5 | @implementation QueueTest 6 | 7 | -(void) queueTest { 8 | Queue* q = [Queue new]; 9 | test(q.count == 0); 10 | testThrows(q.peek); 11 | testThrows([q dequeue]); 12 | 13 | [q enqueue:@5]; 14 | test(q.count == 1); 15 | test([q.peek isEqualToNumber:@5]); 16 | 17 | [q enqueue:@23]; 18 | test(q.count == 2); 19 | test([q.peek isEqualToNumber:@5]); 20 | 21 | test([[q dequeue] isEqualToNumber:@5]); 22 | test(q.count == 1); 23 | test([q.peek isEqualToNumber:@23]); 24 | 25 | test([[q dequeue] isEqualToNumber:@23]); 26 | test(q.count == 0); 27 | testThrows(q.peek); 28 | testThrows([q dequeue]); 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Signal/src/util/protocols/utilities/AnonymousTerminator.m: -------------------------------------------------------------------------------- 1 | #import "AnonymousTerminator.h" 2 | #import "Constraints.h" 3 | 4 | @interface AnonymousTerminator () 5 | 6 | @property BOOL alreadyCalled; 7 | @property (nonatomic, readwrite, copy) void (^terminateBlock)(void); 8 | 9 | @end 10 | 11 | @implementation AnonymousTerminator 12 | 13 | - (instancetype)initWithTerminator:(void (^)(void))terminate { 14 | self = [super init]; 15 | 16 | if (self) { 17 | require(terminate != nil); 18 | self.terminateBlock = terminate; 19 | } 20 | 21 | return self; 22 | } 23 | 24 | #pragma mark Terminable 25 | 26 | - (void)terminate { 27 | if (self.alreadyCalled) { return; } 28 | self.alreadyCalled = YES; 29 | self.terminateBlock(); 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Signal/src/network/rtp/zrtp/ZRTPHandshakeResult.m: -------------------------------------------------------------------------------- 1 | #import "ZRTPHandshakeResult.h" 2 | 3 | @interface ZRTPHandshakeResult () 4 | 5 | @property (strong, readwrite, nonatomic) SRTPSocket* secureRTPSocket; 6 | @property (strong, readwrite, nonatomic) MasterSecret* masterSecret; 7 | 8 | @end 9 | 10 | @implementation ZRTPHandshakeResult 11 | 12 | - (instancetype)initWithSecureChannel:(SRTPSocket*)secureRTPSocket 13 | andMasterSecret:(MasterSecret*)masterSecret { 14 | self = [super init]; 15 | 16 | if (self) { 17 | require(secureRTPSocket != nil); 18 | require(masterSecret != nil); 19 | 20 | self.masterSecret = masterSecret; 21 | self.secureRTPSocket = secureRTPSocket; 22 | } 23 | 24 | return self; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Signal/src/network/rtp/zrtp/ZRTPInitiator.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "ZRTPRole.h" 3 | #import "DHPacketSharedSecretHashes.h" 4 | #import "CallController.h" 5 | 6 | /** 7 | * 8 | * A ZRTPInitiator implements the 'initiator' role of the zrtp handshake. 9 | * 10 | * The initiator is NOT the one responsible for sending the first handshake packet. 11 | * The 'initiator' name is related to what happens during signaling, not the zrtp handshake. 12 | * The initiator receives Hello, sends Hello, receives HelloAck, sends Commit, receives DH1, sends DH2, receives Confirm1, sends Confirm2, and receives ConfirmAck 13 | * 14 | **/ 15 | 16 | @interface ZRTPInitiator : NSObject 17 | 18 | - (instancetype)initWithCallController:(CallController*)callController; 19 | 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Signal/src/network/rtp/srtp/SRTPStream.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "SequenceCounter.h" 3 | #import "RTPPacket.h" 4 | 5 | /** 6 | * 7 | * SRTPStream is used by SRTPSocket to authenticate and cipher packets. 8 | * One SRTPStream is used for sending, and one is used for receiving. 9 | * (Because it's bad to use the same cryptographic keys in both directions.) 10 | * 11 | **/ 12 | 13 | @interface SRTPStream : NSObject 14 | 15 | - (instancetype)initWithCipherKey:(NSData*)cipherKey 16 | andMacKey:(NSData*)macKey 17 | andCipherIVSalt:(NSData*)cipherIVSalt; 18 | 19 | - (RTPPacket*)encryptAndAuthenticateNormalRTPPacket:(RTPPacket*)normalRTPPacket; 20 | - (RTPPacket*)verifyAuthenticationAndDecryptSecuredRTPPacket:(RTPPacket*)securedRTPPacket; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Signal/src/views/ContactDetailTableViewCell.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "PhoneNumber.h" 3 | 4 | /** 5 | * 6 | * ContactDetailTableViewCell displays a contact communication item (Phone number, email, notes) 7 | * This will hide/show SMS/Phone buttons when needed, depending on the item type. 8 | * The color side view is blue if Whisper number or notes, and green otherwise. 9 | * 10 | */ 11 | 12 | @interface ContactDetailTableViewCell : UITableViewCell 13 | 14 | @property (strong, nonatomic) IBOutlet UILabel* infoTypeLabel; 15 | @property (strong, nonatomic) IBOutlet UILabel* infoDisplayLabel; 16 | 17 | - (void)configureWithPhoneNumber:(PhoneNumber*)numberString isSecure:(BOOL)isSecure; 18 | - (void)configureWithEmailString:(NSString*)emailString; 19 | - (void)configureWithNotes:(NSString*)notes; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Signal/src/audio/incall_audio/CallAudioManager.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "AudioProcessor.h" 3 | #import "AudioSocket.h" 4 | #import "Environment.h" 5 | #import "RemoteIOAudio.h" 6 | #import "SpeexCodec.h" 7 | 8 | /** 9 | * 10 | * CallAudioManager is responsible for creating and managing components related to playing real time audio communicated over a network. 11 | * 12 | * The components are for playing/recording, processing, and transporting audio data. 13 | * 14 | **/ 15 | 16 | @interface CallAudioManager : NSObject 17 | 18 | - (instancetype)initWithAudioSocket:(AudioSocket*)audioSocket 19 | andErrorHandler:(ErrorHandlerBlock)errorHandler 20 | untilCancelled:(TOCCancelToken*)untilCancelledToken; 21 | 22 | - (BOOL)toggleMute; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Signal/test/Supporting Files/SignalTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.twistedoakstudios.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Signal/src/phone/signaling/CallConnectResult.m: -------------------------------------------------------------------------------- 1 | #import "CallConnectResult.h" 2 | 3 | @interface CallConnectResult () 4 | 5 | @property (nonatomic, readwrite) NSString* shortAuthenticationString; 6 | @property (nonatomic, readwrite) AudioSocket* audioSocket; 7 | 8 | @end 9 | 10 | @implementation CallConnectResult 11 | 12 | - (instancetype)initWithShortAuthenticationString:(NSString*)shortAuthenticationString 13 | andAudioSocket:(AudioSocket*)audioSocket { 14 | self = [super init]; 15 | 16 | if (self) { 17 | require(shortAuthenticationString != nil); 18 | require(audioSocket != nil); 19 | 20 | self.shortAuthenticationString = shortAuthenticationString; 21 | self.audioSocket = audioSocket; 22 | } 23 | 24 | return self; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Signal/src/network/IPAddress.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @class IPEndPoint; 5 | 6 | /** 7 | * 8 | * Stores an IP address. 9 | * Supports both IPv4 and IPv6 addresses. 10 | * 11 | **/ 12 | 13 | @interface IPAddress : NSObject 14 | 15 | + (instancetype)localhost; 16 | 17 | - (instancetype)initFromString:(NSString*)text; 18 | - (instancetype)initIPv4AddressFromString:(NSString*)text; 19 | - (instancetype)initIPv6AddressFromString:(NSString*)text; 20 | 21 | - (instancetype)initIPv4AddressFromSockaddr:(struct sockaddr_in)sockaddr; 22 | - (instancetype)initIPv6AddressFromSockaddr:(struct sockaddr_in6)sockaddr; 23 | 24 | - (NSData*)sockaddrData; 25 | - (NSData*)sockaddrDataWithPort:(in_port_t)port; 26 | 27 | //+ (IPAddress*)tryGetIPAddressFromString:(NSString*)text; // Removed due to disuse 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Signal/src/views/LocalizableCustomFontLabel.m: -------------------------------------------------------------------------------- 1 | #import "LocalizableCustomFontLabel.h" 2 | 3 | @implementation LocalizableCustomFontLabel 4 | 5 | - (void)awakeFromNib { 6 | [super awakeFromNib]; 7 | 8 | self.font = [UIFont fontWithName:[self fontName] size:self.font.pointSize]; 9 | } 10 | 11 | - (void)setLocalizationKey:(NSString*)localizationKey { 12 | _localizationKey = localizationKey; 13 | if (_localizationKey) { 14 | self.text = NSLocalizedString(_localizationKey, @""); 15 | } 16 | } 17 | 18 | - (NSString*)fontName { 19 | return nil; 20 | } 21 | 22 | @end 23 | 24 | #define LocalizableCustomFontLabel(CLASS_NAME, FONT_NAME) \ 25 | @implementation CLASS_NAME \ 26 | - (NSString*)fontName { \ 27 | return @"" # FONT_NAME; \ 28 | } \ 29 | @end \ 30 | 31 | CUSTOM_FONT_LABELS 32 | 33 | #undef LocalizableCustomFontLabel 34 | -------------------------------------------------------------------------------- /Signal/src/util/NSMutableData+Util.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSMutableData+Util.m 3 | // Signal 4 | // 5 | // Created by Gil Azaria on 3/11/2014. 6 | // Copyright (c) 2014 Open Whisper Systems. All rights reserved. 7 | // 8 | 9 | #import "NSMutableData+Util.h" 10 | #import "NSData+Util.h" 11 | #import "Constraints.h" 12 | 13 | @implementation NSMutableData (Util) 14 | 15 | - (void)setUint8At:(NSUInteger)offset 16 | to:(uint8_t)newValue { 17 | require(offset < self.length); 18 | ((uint8_t*)[self mutableBytes])[offset] = newValue; 19 | } 20 | 21 | - (void)replaceBytesStartingAt:(NSUInteger)offset 22 | withData:(NSData*)data { 23 | require(data != nil); 24 | require(offset + data.length <= self.length); 25 | [self replaceBytesInRange:NSMakeRange(offset, data.length) withBytes:[data bytes]]; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Signal/src/audio/incall_audio/protocols/utilities/AnonymousAudioCallbackHandler.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "AudioCallbackHandler.h" 3 | 4 | /** 5 | * 6 | * AnonymousAudioCallbackHandler implements AudioCallbackHandler with blocks passed to its constructor. 7 | * 8 | **/ 9 | 10 | @interface AnonymousAudioCallbackHandler : NSObject 11 | 12 | @property (readonly, nonatomic, copy) void (^handleNewDataRecordedBlock)(CyclicalBuffer* data); 13 | @property (readonly, nonatomic, copy) void (^handlePlaybackOccurredWithBytesRequestedBlock)(NSUInteger requested, NSUInteger bytesRemaining); 14 | 15 | - (instancetype)initDelegateWithRecordingCallback:(void(^)(CyclicalBuffer* data))recordingCallback 16 | andPlaybackOccurredCallback:(void(^)(NSUInteger requested, NSUInteger bytesRemaining))playbackCallback; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Signal/src/crypto/CryptoTools.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | /// All dependencies on external libraries used for cryptography should be hidden behind CryptoTools methods. 4 | /// That way, changing to a different library affects only one part of the system. 5 | 6 | @interface CryptoTools : NSObject 7 | 8 | /// Returns a secure random 16-bit unsigned integer. 9 | + (uint16_t)generateSecureRandomUInt16; 10 | 11 | /// Returns a secure random 32-bit unsigned integer. 12 | + (uint32_t)generateSecureRandomUInt32; 13 | 14 | /// Returns data composed of 'length' cryptographically unpredictable bytes sampled uniformly from [0, 256). 15 | + (NSData*)generateSecureRandomData:(NSUInteger)length; 16 | 17 | /// Returns the token included as part of HTTP OTP authentication. 18 | + (NSString*)computeOTPWithPassword:(NSString*)password andCounter:(int64_t)counter; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Signal/src/network/http/HTTPRequest+Util.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "HTTPRequest.h" 3 | #import "HTTPResponse.h" 4 | #import "Environment.h" 5 | 6 | @interface HTTPRequest (Util) 7 | 8 | - (instancetype)initWithBasicAuthenticationAndMethod:(NSString*)method 9 | andLocation:(NSString*)location; 10 | - (instancetype)initWithBasicAuthenticationAndMethod:(NSString*)method 11 | andLocation:(NSString*)location 12 | andOptionalBody:(NSString*)optionalBody; 13 | - (instancetype)initWithOTPAuthenticationAndMethod:(NSString*)method 14 | andLocation:(NSString*)location; 15 | - (instancetype)initUnauthenticatedWithMethod:(NSString*)method 16 | andLocation:(NSString*)location; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Signal/src/network/http/HTTPSocket.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "PacketHandler.h" 3 | #import "HTTPRequestOrResponse.h" 4 | #import "HTTPResponse.h" 5 | #import "UDPSocket.h" 6 | #import "NetworkStream.h" 7 | #import "Environment.h" 8 | 9 | /** 10 | * 11 | * HTTPSocket is responsible for communicating HTTP requests and responses over some data channel (tcp, ssl, udp, whatever). 12 | * 13 | */ 14 | @interface HTTPSocket : NSObject 15 | 16 | - (instancetype)initOverNetworkStream:(NetworkStream*)rawDataChannel; 17 | - (instancetype)initOverUDP:(UDPSocket*)rawDataChannel; 18 | 19 | - (void)sendHTTPRequest:(HTTPRequest*)request; 20 | - (void)sendHTTPResponse:(HTTPResponse*)response; 21 | - (void)send:(HTTPRequestOrResponse*)packet; 22 | - (void)startWithHandler:(PacketHandler*)handler 23 | untilCancelled:(TOCCancelToken*)untilCancelledToken; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Signal/src/util/Operation.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "NSData+Util.h" 3 | #import "NSString+Util.h" 4 | #import "NSDictionary+Util.h" 5 | #import "NSArray+Util.h" 6 | 7 | typedef void(^Action)(void); 8 | typedef id(^Function)(void); 9 | 10 | @interface Operation : NSObject 11 | 12 | @property (nonatomic, readonly, copy) Action callback; 13 | 14 | - (instancetype)initWithAction:(Action)block; 15 | 16 | + (void)asyncRun:(Action)action 17 | onThread:(NSThread*)thread; 18 | 19 | + (void)asyncRunAndWaitUntilDone:(Action)action 20 | onThread:(NSThread*)thread; 21 | 22 | + (void)asyncRunOnNewThread:(Action)action; 23 | 24 | - (void)run; 25 | 26 | - (SEL)selectorToRun; 27 | 28 | - (void)performOnNewThread; 29 | 30 | - (void)performOnThread:(NSThread*)thread; 31 | 32 | - (void)performOnThreadAndWaitUntilDone:(NSThread*)thread; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Signal/src/view controllers/CountryCodeViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class CountryCodeViewController; 4 | 5 | @protocol CountryCodeViewControllerDelegate 6 | 7 | - (void)countryCodeViewController:(CountryCodeViewController*)vc 8 | didSelectCountryCode:(NSString*)code 9 | forCountry:(NSString*)country; 10 | 11 | - (void)countryCodeViewControllerDidCancel:(CountryCodeViewController*)vc; 12 | 13 | @end 14 | 15 | @interface CountryCodeViewController : UIViewController 16 | 17 | @property (strong, nonatomic) IBOutlet UITableView* countryCodeTableView; 18 | @property (strong, nonatomic) IBOutlet UISearchBar* searchBar; 19 | @property (weak, nonatomic) id delegate; 20 | 21 | - (IBAction)cancelTapped:(id)sender; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Signal/src/phone/signaling/CallConnectUtil_Initiator.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "CallController.h" 3 | #import "HTTPManager.h" 4 | #import "InitiatorSessionDescriptor.h" 5 | 6 | /** 7 | * 8 | * CallConnectUtil_Initiator is a utility class that deals with the details of initiating a call: 9 | * - Contacting the default signaling server 10 | * - Asking for a session descriptor to call the other number 11 | * - Forwarding later signals like 'ringing' and 'hangup' 12 | * - Contacting the relay server from the descriptor 13 | * - Starting the zrtp handshake 14 | * - etc 15 | * 16 | **/ 17 | @interface CallConnectUtil_Initiator : NSObject 18 | 19 | /// Result has type Future*(CallConnectResult) 20 | + (TOCFuture*)asyncConnectCallToRemoteNumber:(PhoneNumber*)remoteNumber 21 | withCallController:(CallController*)callController; 22 | 23 | @end 24 | 25 | -------------------------------------------------------------------------------- /Signal/src/phone/signaling/InitiatorSessionDescriptor.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "Environment.h" 3 | 4 | /** 5 | * 6 | * The InitiatorSessionDescriptor class stores the information returned by the signaling server when initiating a call. 7 | * It describes which relay server to connect to and what to tell the relay server. 8 | * 9 | */ 10 | @interface InitiatorSessionDescriptor : NSObject 11 | 12 | @property (nonatomic, readonly) in_port_t relayUDPSocketPort; 13 | @property (nonatomic, readonly) int64_t sessionId; 14 | @property (nonatomic, readonly) NSString* relayServerName; 15 | 16 | - (instancetype)initWithSessionId:(int64_t)sessionId 17 | andRelayServerName:(NSString*)relayServerName 18 | andRelayPort:(in_port_t)relayUDPSocketPort; 19 | - (instancetype)initFromJSON:(NSString*)json; 20 | 21 | - (NSString*)toJSON; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Signal/src/audio/incall_audio/RemoteIOBufferListWrapper.m: -------------------------------------------------------------------------------- 1 | #import "RemoteIOBufferListWrapper.h" 2 | 3 | @interface RemoteIOBufferListWrapper () 4 | 5 | @property (readwrite, nonatomic) AudioBufferList* audioBufferList; 6 | 7 | @end 8 | 9 | @implementation RemoteIOBufferListWrapper 10 | 11 | - (instancetype)initWithMonoBufferSize:(NSUInteger)bufferSize { 12 | self = [super init]; 13 | 14 | if (self) { 15 | self.audioBufferList = malloc(sizeof(AudioBufferList)); 16 | self.audioBufferList->mNumberBuffers = 1; 17 | self.audioBufferList->mBuffers[0].mNumberChannels = 1; 18 | self.audioBufferList->mBuffers[0].mDataByteSize = (UInt32)bufferSize; 19 | self.audioBufferList->mBuffers[0].mData = malloc(bufferSize); 20 | } 21 | 22 | return self; 23 | } 24 | 25 | - (void)dealloc { 26 | free(self.audioBufferList->mBuffers[0].mData); 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Signal/test/network/IpEndPointTest.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import "TestUtil.h" 3 | #import "IPEndPoint.h" 4 | #import "IPAddress.h" 5 | 6 | @interface IPEndPointTest : XCTestCase 7 | 8 | @end 9 | 10 | @implementation IPEndPointTest 11 | -(void) testTrivial { 12 | IPAddress* a = IPAddress.localhost; 13 | IPEndPoint* p = [[IPEndPoint alloc] initWithAddress:a onPort:2]; 14 | test([p address] == a); 15 | test([p port] == 2); 16 | } 17 | -(void) testFromSockaddrLoop { 18 | for (NSString* s in @[@"4.5.6.7", @"2001:0db8:85a3:0001:0002:8a2e:0370:7334"]) { 19 | IPAddress* a = [[IPAddress alloc] initFromString:s]; 20 | IPEndPoint* p = [[IPEndPoint alloc] initFromSockaddrData:[[[IPEndPoint alloc] initWithAddress:a onPort:6] sockaddrData]]; 21 | test([[[p address] description] isEqualToString:[a description]]); 22 | test([p port] == 6); 23 | } 24 | } 25 | @end 26 | -------------------------------------------------------------------------------- /Signal/Signal-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'RedPhone' target in the 'RedPhone' project 3 | // 4 | 5 | #import 6 | 7 | #ifdef __OBJC__ 8 | #import 9 | #import 10 | #import 11 | 12 | #ifdef DEBUG 13 | static const int ddLogLevel = LOG_LEVEL_VERBOSE; 14 | #else 15 | static const int ddLogLevel = LOG_LEVEL_ERROR; 16 | #endif 17 | 18 | #import "iOSVersions.h" 19 | 20 | #define SignalAlertView(title,msg) [[[UIAlertView alloc] initWithTitle:title message:msg delegate:nil cancelButtonTitle:NSLocalizedString(@"OK", @"") otherButtonTitles:nil, nil] show] 21 | #define SignalReportError [Pastelog reportErrorAndSubmitLogsWithAlertTitle:NSLocalizedString(@"ERROR_WAS_DETECTED_TITLE", @"") alertBody:NSLocalizedString(@"ERROR_WAS_DETECTED_SUBMIT", @"")]; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /Signal/src/view controllers/ContactBrowseViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "SearchBarTitleView.h" 3 | 4 | /** 5 | * 6 | * ContactBrowseViewController displays contacts from ContactsManager inside of a table view. 7 | * This class subscibes to addressbook updates to refresh information and/or add new contacts. 8 | * 9 | */ 10 | 11 | @interface ContactBrowseViewController : UIViewController 12 | 13 | @property (strong, nonatomic) IBOutlet UITableView* contactTableView; 14 | @property (strong, nonatomic) IBOutlet SearchBarTitleView* searchBarTitleView; 15 | @property (strong, nonatomic) IBOutlet UIView* notificationView; 16 | @property (strong, nonatomic) UIRefreshControl* refreshControl; 17 | 18 | - (IBAction)notificationViewTapped:(id)sender; 19 | - (void)showNotificationForNewWhisperUsers:(NSArray*)users; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Signal/test/profiling/EventWindowTest.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import "EventWindow.h" 3 | #import "TestUtil.h" 4 | 5 | @interface EventWindowTest : XCTestCase 6 | 7 | @end 8 | 9 | @implementation EventWindowTest 10 | -(void) testEventWindow { 11 | EventWindow* w = [[EventWindow alloc] initWithWindowDuration:5]; 12 | test([w countAfterRemovingEventsBeforeWindowEndingAt:0] == 0); 13 | [w addEventAtTime:4]; 14 | [w addEventAtTime:6]; 15 | [w addEventAtTime:8]; 16 | 17 | test([w countAfterRemovingEventsBeforeWindowEndingAt:8] == 3); 18 | test([w countAfterRemovingEventsBeforeWindowEndingAt:10] == 2); 19 | test([w countAfterRemovingEventsBeforeWindowEndingAt:12] == 1); 20 | test([w countAfterRemovingEventsBeforeWindowEndingAt:14] == 0); 21 | 22 | // going backwards not allowed 23 | testThrows([w countAfterRemovingEventsBeforeWindowEndingAt:8]); 24 | } 25 | @end 26 | -------------------------------------------------------------------------------- /Signal/test/util/BloomFilterTest.m: -------------------------------------------------------------------------------- 1 | #import "BloomFilterTest.h" 2 | #import "BloomFilter.h" 3 | #import "TestUtil.h" 4 | 5 | @implementation BloomFilterTest 6 | 7 | -(void) testEmptyBloomFilter { 8 | NSMutableData* d = [NSMutableData dataWithLength:100]; 9 | BloomFilter* b = [[BloomFilter alloc] initWithHashCount:5 andData:d]; 10 | NSArray* keys = @[@"", @"a", @"wonder", @"b"]; 11 | for (NSString* key in keys) { 12 | test(![b contains:key]); 13 | } 14 | } 15 | -(void) testFullBloomFilter { 16 | NSMutableData* d = [NSMutableData dataWithLength:100]; 17 | for (NSUInteger i = 0; i < 100; i++) { 18 | [d setUint8At:i to:0xFF]; 19 | } 20 | BloomFilter* b = [[BloomFilter alloc] initWithHashCount:5 andData:d]; 21 | NSArray* keys = @[@"", @"a", @"wonder", @"b"]; 22 | for (NSString* key in keys) { 23 | test([b contains:key]); 24 | } 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Signal/src/audio/SoundPlayer.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "SoundInstance.h" 3 | 4 | /** 5 | * SoundPlayer tracks and controls all Audiofiles being played. Currently only one instance 6 | * of a given sound can be played at a given time. Attemping to play multiple intances of a 7 | * sound is ignored. Multiple different sound instances can be played concurrently. 8 | */ 9 | 10 | @protocol SoundPlayerDelegate; 11 | 12 | @interface SoundPlayer : NSObject 13 | 14 | @property (weak, nonatomic) id delegate; 15 | 16 | + (instancetype)sharedInstance; 17 | 18 | - (void)playSound:(SoundInstance*)player; 19 | - (void)stopSound:(SoundInstance*)player; 20 | 21 | - (void)stopAllAudio; 22 | - (void)awake; 23 | 24 | @end 25 | 26 | @protocol SoundPlayerDelegate 27 | 28 | @optional 29 | - (void)didCompleteSoundInstanceOfType:(SoundInstanceType)instanceType; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Signal/src/views/LeftSideMenuCell.m: -------------------------------------------------------------------------------- 1 | #import "LeftSideMenuCell.h" 2 | #import "UIUtil.h" 3 | 4 | @implementation LeftSideMenuCell 5 | 6 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString*)reuseIdentifier { 7 | self = [[NSBundle.mainBundle loadNibNamed:NSStringFromClass([self class]) 8 | owner:self 9 | options:nil] firstObject]; 10 | return self; 11 | } 12 | 13 | - (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated { 14 | [super setHighlighted:highlighted animated:animated]; 15 | if (highlighted) { 16 | self.menuTitleLabel.textColor = UIUtil.darkBackgroundColor; 17 | } else { 18 | self.menuTitleLabel.textColor = UIUtil.whiteColor; 19 | } 20 | } 21 | 22 | - (NSString*)reuseIdentifier { 23 | return NSStringFromClass([self class]); 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Signal/src/crypto/EVPSymetricUtil.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | // Implements Symetric encryption methods using Openssl EVP Api. Raises Exceptions on failure. 5 | 6 | @interface EVPSymetricUtil : NSObject 7 | 8 | + (NSData*)encryptMessage:(NSData*)message usingAES128WithCBCAndPaddingAndKey:(NSData*)key andIV:(NSData*)iv; 9 | + (NSData*)decryptMessage:(NSData*)message usingAES128WithCBCAndPaddingAndKey:(NSData*)key andIV:(NSData*)iv; 10 | 11 | + (NSData*)encryptMessage:(NSData*)message usingAES128WithCFBAndKey:(NSData*)key andIV:(NSData*)iv; 12 | + (NSData*)decryptMessage:(NSData*)message usingAES128WithCFBAndKey:(NSData*)key andIV:(NSData*)iv; 13 | 14 | + (NSData*)encryptMessage:(NSData*)message usingAES128InCounterModeAndKey:(NSData*)key andIV:(NSData*)iv; 15 | + (NSData*)decryptMessage:(NSData*)message usingAES128InCounterModeAndKey:(NSData*)key andIV:(NSData*)iv; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Signal/src/network/tcp/StreamPair.m: -------------------------------------------------------------------------------- 1 | #import "StreamPair.h" 2 | #import "Constraints.h" 3 | 4 | @interface StreamPair () 5 | 6 | @property (strong, readwrite, nonatomic) NSInputStream* inputStream; 7 | @property (strong, readwrite, nonatomic) NSOutputStream* outputStream; 8 | 9 | @end 10 | 11 | @implementation StreamPair 12 | 13 | - (instancetype)initWithInput:(NSInputStream*)input andOutput:(NSOutputStream*)output { 14 | self = [super init]; 15 | 16 | if (self) { 17 | require(input != nil); 18 | require(output != nil); 19 | 20 | self.inputStream = input; 21 | self.outputStream = output; 22 | 23 | [self.inputStream setProperty:NSStreamNetworkServiceTypeVoIP forKey:NSStreamNetworkServiceType]; 24 | [self.outputStream setProperty:NSStreamNetworkServiceTypeVoIP forKey:NSStreamNetworkServiceType]; 25 | } 26 | 27 | return self; 28 | } 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Podspecs/UICKeyChainStore.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "UICKeyChainStore" 3 | s.version = "1.0.7" 4 | s.summary = "UICKeyChainStore is a simple wrapper for Keychain on iOS and OS X. Makes using Keychain APIs as easy as NSUserDefaults." 5 | s.homepage = "https://github.com/kishikawakatsumi/UICKeyChainStore" 6 | s.social_media_url = "https://twitter.com/k_katsumi" 7 | s.license = { :type => "MIT", :file => "LICENSE" } 8 | s.author = { "kishikawa katsumi" => "kishikawakatsumi@mac.com" } 9 | s.source = { :git => "https://github.com/FredericJacobs/UICKeyChainStore.git", :tag => "v#{s.version}" } 10 | 11 | s.ios.deployment_target = "4.3" 12 | s.osx.deployment_target = "10.6" 13 | s.requires_arc = true 14 | 15 | s.source_files = "Lib/*" 16 | 17 | s.framework = "Security" 18 | end 19 | -------------------------------------------------------------------------------- /Signal/src/view controllers/NextResponderScrollView.m: -------------------------------------------------------------------------------- 1 | #import "NextResponderScrollView.h" 2 | 3 | @implementation NextResponderScrollView 4 | 5 | - (void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event { 6 | if (!self.dragging) { 7 | [self.nextResponder touchesBegan: touches withEvent:event]; 8 | } else { 9 | [super touchesBegan: touches withEvent: event]; 10 | } 11 | } 12 | - (void)touchesEnded:(NSSet*)touches withEvent:(UIEvent*)event { 13 | if (!self.dragging) { 14 | [self.nextResponder touchesEnded: touches withEvent:event]; 15 | } else { 16 | [super touchesEnded: touches withEvent: event]; 17 | } 18 | } 19 | -(void)touchesCancelled:(NSSet*)touches withEvent:(UIEvent*)event { 20 | if (!self.dragging) { 21 | [self.nextResponder touchesCancelled:touches withEvent:event]; 22 | } else { 23 | [super touchesEnded: touches withEvent: event]; 24 | } 25 | } 26 | @end 27 | -------------------------------------------------------------------------------- /Signal/src/util/UIUtil.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | /** 4 | * 5 | * UTUtil contains various class methods that centralize common app UI functionality that would otherwise be hardcoded. 6 | * 7 | */ 8 | 9 | @interface UIUtil : NSObject 10 | 11 | + (UIFont*)helveticaNeueLTStdLightFontWithSize:(CGFloat)size; 12 | + (UIFont*)helveticaNeueLTStdBoldFontWithSize:(CGFloat)size; 13 | + (UIFont*)helveticaNeueLTStdMediumFontWithSize:(CGFloat)size; 14 | + (UIFont*)helveticaRegularWithSize:(CGFloat)size; 15 | + (UIFont*)helveticaLightWithSize:(CGFloat)size; 16 | + (UIColor*)darkBackgroundColor; 17 | + (UIColor*)blueColor; 18 | + (UIColor*)yellowColor; 19 | + (UIColor*)redColor; 20 | + (UIColor*)greenColor; 21 | + (UIColor*)whiteColor; 22 | + (UIColor*)transparentLightGrayColor; 23 | + (void)applyRoundedBorderToImageView:(UIImageView* __strong*)imageView; 24 | + (void)removeRoundedBorderToImageView:(UIImageView* __strong*)imageView; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Signal/src/phone/signaling/number directory/PhoneNumberDirectoryFilter.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "BloomFilter.h" 3 | #import "PhoneNumber.h" 4 | 5 | /** 6 | * 7 | * PhoneNumberDirectoryFilter matches numbers-to-be-called against a bloom filter that determines if those numbers are red phone compatible. 8 | * The bloom filter expires periodically, and must be updated from the whispersystem servers. 9 | * 10 | */ 11 | @interface PhoneNumberDirectoryFilter : NSObject 12 | 13 | @property (strong, nonatomic, readonly, getter=getExpirationDate) NSDate* expirationDate; 14 | @property (nonatomic, readonly) BloomFilter* bloomFilter; 15 | 16 | + (instancetype)defaultFilter; 17 | 18 | - (instancetype)initWithBloomFilter:(BloomFilter*)bloomFilter andExpirationDate:(NSDate*)expirationDate; 19 | - (instancetype)initFromURLResponse:(NSHTTPURLResponse*)response body:(NSData*)data; 20 | 21 | - (bool)containsPhoneNumber:(PhoneNumber*)phoneNumber; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Signal/src/network/http/AFHTTPSessionManager+SignalMethods.h: -------------------------------------------------------------------------------- 1 | // 2 | // AFHTTPSessionManager+SignalMethods.h 3 | // Signal 4 | // 5 | // Created by Frederic Jacobs on 05/10/14. 6 | // Copyright (c) 2014 Open Whisper Systems. All rights reserved. 7 | // 8 | 9 | #import "AFHTTPSessionManager.h" 10 | 11 | @interface AFHTTPSessionManager (SignalMethods) 12 | 13 | - (NSURLSessionDataTask*)BUSY:(NSString*)URLString 14 | parameters:(id)parameters 15 | success:(void (^)(NSURLSessionDataTask* task, id responseObject))success 16 | failure:(void (^)(NSURLSessionDataTask* task, NSError* error))failure; 17 | 18 | - (NSURLSessionDataTask*)RING:(NSString*)URLString 19 | parameters:(id)parameters 20 | success:(void (^)(NSURLSessionDataTask* task, id responseObject))success 21 | failure:(void (^)(NSURLSessionDataTask* task, NSError* error))failure; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Signal/src/environment/SGNKeychainUtil.h: -------------------------------------------------------------------------------- 1 | // 2 | // SGNKeychainUtil.h 3 | // Signal 4 | // 5 | // Created by Frederic Jacobs on 09/07/14. 6 | // Copyright (c) 2014 Open Whisper Systems. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PhoneNumber.h" 11 | #import "Zid.h" 12 | 13 | @interface SGNKeychainUtil : NSObject 14 | 15 | + (void)generateSignaling; 16 | + (void)generateServerAuthPassword; 17 | 18 | + (void)wipeKeychain; 19 | 20 | #pragma mark Registered Phone Number 21 | 22 | + (PhoneNumber*)localNumber; 23 | + (void)setLocalNumberTo:(PhoneNumber*)localNumber; 24 | 25 | #pragma mark Signaling Key 26 | 27 | + (int64_t)getAndIncrementOneTimeCounter; 28 | 29 | #pragma mark Zid 30 | 31 | + (Zid*)zid; 32 | 33 | #pragma mark Server Auth 34 | 35 | + (NSString*)serverAuthPassword; 36 | 37 | #pragma mark Signaling 38 | 39 | + (NSData*)signalingMacKey; 40 | + (NSData*)signalingCipherKey; 41 | + (NSData*)signalingExtraKey; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Signal/src/network/PacketHandler.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | typedef void (^PacketHandlerBlock)(id packet); 4 | typedef void (^ErrorHandlerBlock)(id error, id relatedInfo, bool causedTermination); 5 | 6 | /** 7 | * 8 | * A PacketHandler is a block to call for received values, and a block to call when minor or major error occur. 9 | * 10 | * Most of the socket types we use are started by giving them a packet handler. 11 | * 12 | **/ 13 | 14 | @interface PacketHandler : NSObject 15 | 16 | @property (strong, readonly, nonatomic) PacketHandlerBlock dataHandler; 17 | @property (strong, readonly, nonatomic) ErrorHandlerBlock errorHandler; 18 | 19 | - (instancetype)initPacketHandler:(PacketHandlerBlock)dataHandler 20 | withErrorHandler:(ErrorHandlerBlock)errorHandler; 21 | 22 | - (void)handlePacket:(id)packet; 23 | 24 | - (void)handleError:(id)error 25 | relatedInfo:(id)packet 26 | causedTermination:(bool)causedTermination; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Signal/src/view controllers/LeftSideMenuViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "ContactBrowseViewController.h" 4 | #import "ContactsManager.h" 5 | #import "TabBarParentViewController.h" 6 | 7 | /** 8 | * 9 | * LeftSideMenuViewController is the nav bin view controller which can be swiped in from the left and/or tapped open from a button 10 | * 11 | */ 12 | 13 | @interface LeftSideMenuViewController : UIViewController 14 | 15 | @property (strong, nonatomic) TabBarParentViewController* centerTabBarViewController; 16 | @property (strong, nonatomic) IBOutlet UITableView* menuOptionTableView; 17 | @property (strong, nonatomic) IBOutlet UIView* firstSectionHeaderView; 18 | @property (strong, nonatomic) IBOutlet UIView* secondSectionHeaderView; 19 | 20 | - (void)showDialerViewController; 21 | - (void)showContactsViewController; 22 | - (void)showRecentsViewController; 23 | - (void)showFavouritesViewController; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Signal/src/views/LocalizableCustomFontLabel.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | /** 4 | * 5 | * This class enables us to set custom fonts for labels in the xib without making an outlet and setting it manually 6 | * Also contains a property for localization purposes 7 | * 8 | */ 9 | 10 | #define CUSTOM_FONT_LABELS \ 11 | LocalizableCustomFontLabel(HelveticaNeueLTStdBoldLabel, HelveticaNeueLTStd-Bold) \ 12 | LocalizableCustomFontLabel(HelveticaNeueLTStdLightLabel, HelveticaNeueLTStd-Lt) \ 13 | LocalizableCustomFontLabel(HelveticaNeueLTStdMedLabel, HelveticaNeueLTStd-Md) \ 14 | LocalizableCustomFontLabel(HelveticaNeueLTStdThinLabel, HelveticaNeueLTStd-Th) \ 15 | 16 | @interface LocalizableCustomFontLabel : UILabel 17 | 18 | @property (strong, nonatomic) NSString* localizationKey; 19 | 20 | @end 21 | 22 | #define LocalizableCustomFontLabel(CLASS_NAME, FONT_NAME) @interface CLASS_NAME : LocalizableCustomFontLabel {} @end 23 | CUSTOM_FONT_LABELS 24 | #undef LocalizableCustomFontLabel 25 | -------------------------------------------------------------------------------- /Libraries/ProtocolBuffers/TextFormat.h: -------------------------------------------------------------------------------- 1 | // Copyright 2008 Cyrus Najmabadi 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | @interface PBTextFormat : NSObject { 16 | 17 | } 18 | 19 | + (int32_t) parseInt32:(NSString*) text; 20 | + (int32_t) parseUInt32:(NSString*) text; 21 | + (int64_t) parseInt64:(NSString*) text; 22 | + (int64_t) parseUInt64:(NSString*) text; 23 | 24 | + (NSData*) unescapeBytes:(NSString*) input; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Libraries/ProtocolBuffers/MutableExtensionRegistry.h: -------------------------------------------------------------------------------- 1 | // Copyright 2008 Cyrus Najmabadi 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #import "ExtensionRegistry.h" 16 | 17 | @interface PBMutableExtensionRegistry : PBExtensionRegistry { 18 | @private 19 | NSMutableDictionary* mutableClassMap; 20 | } 21 | 22 | + (PBMutableExtensionRegistry*) registry; 23 | 24 | - (void) addExtension:(id) extension; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Signal/src/network/rtp/zrtp/packets/HelloAckPacket.m: -------------------------------------------------------------------------------- 1 | #import "HelloAckPacket.h" 2 | 3 | @interface HelloAckPacket () 4 | 5 | @property (strong, readwrite, nonatomic, getter=embeddedIntoHandshakePacket) HandshakePacket* embedding; 6 | 7 | @end 8 | 9 | @implementation HelloAckPacket 10 | 11 | + (instancetype)defaultPacket { 12 | return [[self alloc] initFromHandshakePacket:[[HandshakePacket alloc] initWithTypeId:HANDSHAKE_TYPE_HELLO_ACK 13 | andPayload:[[NSData alloc] init]]]; 14 | } 15 | 16 | - (instancetype)initFromHandshakePacket:(HandshakePacket*)handshakePacket { 17 | self = [super init]; 18 | 19 | if (self) { 20 | checkOperation([[handshakePacket typeId] isEqualToData:HANDSHAKE_TYPE_HELLO_ACK]); 21 | checkOperation([[handshakePacket payload] length] == 0); 22 | 23 | self.embedding = handshakePacket; 24 | } 25 | 26 | return self; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Signal/src/network/udp/UDPSocket.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "IPEndPoint.h" 3 | #import "PacketHandler.h" 4 | #import "Terminable.h" 5 | 6 | /** 7 | * 8 | * Sends and receives raw data packets over UDP. 9 | * 10 | **/ 11 | 12 | @interface UDPSocket : NSObject 13 | 14 | @property (strong, nonatomic) PacketHandler* currentHandler; 15 | 16 | - (instancetype)initSocketToFirstSenderOnLocalPort:(in_port_t)localPort; 17 | 18 | - (instancetype)initSocketFromLocalPort:(in_port_t)localPort 19 | toRemoteEndPoint:(IPEndPoint*)remoteEndPoint; 20 | 21 | - (instancetype)initSocketToRemoteEndPoint:(IPEndPoint*)remoteEndPoint; 22 | 23 | - (bool)isLocalPortKnown; 24 | 25 | - (in_port_t)localPort; 26 | 27 | - (bool)isRemoteEndPointKnown; 28 | 29 | - (IPEndPoint*)remoteEndPoint; 30 | 31 | - (void)send:(NSData*)packet; 32 | 33 | - (void)startWithHandler:(PacketHandler*)handler 34 | untilCancelled:(TOCCancelToken*)untilCancelledToken; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Signal/src/phone/callstate/CallProgress.m: -------------------------------------------------------------------------------- 1 | #import "CallProgress.h" 2 | #import "LocalizableText.h" 3 | 4 | @interface CallProgress () 5 | 6 | @property (nonatomic, readwrite) CallProgressType type; 7 | 8 | @end 9 | 10 | @implementation CallProgress 11 | 12 | - (instancetype)initWithType:(CallProgressType)type { 13 | self = [super init]; 14 | 15 | if (self) { 16 | self.type = type; 17 | } 18 | 19 | return self; 20 | } 21 | 22 | - (BOOL)isEqual:(id)object { 23 | return [object isKindOfClass:[CallProgress class]] && ((CallProgress*)object).type == self.type; 24 | } 25 | 26 | - (NSUInteger)hash { 27 | return self.type; 28 | } 29 | 30 | - (NSString*)description { 31 | return makeCallProgressLocalizedTextDictionary()[self]; 32 | } 33 | 34 | - (NSString*)localizedDescriptionForUser { 35 | return [self description]; 36 | } 37 | 38 | - (id)copyWithZone:(NSZone*)zone { 39 | return [[CallProgress alloc] initWithType:self.type]; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Signal/src/network/rtp/zrtp/packets/ConfirmAckPacket.m: -------------------------------------------------------------------------------- 1 | #import "ConfirmAckPacket.h" 2 | 3 | @interface ConfirmAckPacket () 4 | 5 | @property (strong, readwrite, nonatomic, getter=embeddedIntoHandshakePacket) HandshakePacket* embedding; 6 | 7 | @end 8 | 9 | @implementation ConfirmAckPacket 10 | 11 | + (instancetype)defaultPacket { 12 | return [[self alloc] initFromHandshakePacket:[[HandshakePacket alloc] initWithTypeId:HANDSHAKE_TYPE_CONFIRM_ACK 13 | andPayload:[[NSData alloc] init]]]; 14 | } 15 | 16 | - (instancetype)initFromHandshakePacket:(HandshakePacket*)handshakePacket { 17 | self = [super init]; 18 | 19 | if (self) { 20 | checkOperation([[handshakePacket typeId] isEqualToData:HANDSHAKE_TYPE_CONFIRM_ACK]); 21 | checkOperation([[handshakePacket payload] length] == 0); 22 | 23 | self.embedding = handshakePacket; 24 | } 25 | 26 | return self; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Signal/src/network/tcp/tls/NetworkStream.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "CollapsingFutures.h" 3 | #import "CyclicalBuffer.h" 4 | #import "PacketHandler.h" 5 | #import "NetworkEndPoint.h" 6 | #import "Terminable.h" 7 | 8 | @class SecureEndPoint; 9 | @class HostNameEndPoint; 10 | @class IPEndPoint; 11 | 12 | /** 13 | * 14 | * The network stream class handles connecting to and communicating with a server over tcp or ssl. 15 | * To make an SSL connection, connect to a SecureEndPoint instead of a raw IPEndPoint or HostNameEndPoint. 16 | * 17 | **/ 18 | 19 | @interface NetworkStream : NSObject 20 | 21 | - (instancetype)initWithRemoteEndPoint:(id)remoteEndPoint; 22 | 23 | - (TOCFuture*)asyncConnectionCompleted; 24 | 25 | - (TOCFuture*)asyncTCPHandshakeCompleted; 26 | 27 | - (void)send:(NSData*)data; 28 | 29 | - (void)startWithHandler:(PacketHandler*)handler; 30 | 31 | - (void)startProcessingStreamEventsEvenWithoutHandler; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Libraries/ProtocolBuffers/AbstractMessage_Builder.h: -------------------------------------------------------------------------------- 1 | // Copyright 2008 Cyrus Najmabadi 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #import "Message_Builder.h" 16 | 17 | /** 18 | * A partial implementation of the {@link Message.Builder} interface which 19 | * implements as many methods of that interface as possible in terms of 20 | * other methods. 21 | */ 22 | @interface PBAbstractMessage_Builder : NSObject { 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Libraries/ProtocolBuffers/AbstractMessage.h: -------------------------------------------------------------------------------- 1 | // Copyright 2008 Cyrus Najmabadi 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #import "Message.h" 16 | 17 | /** 18 | * A partial implementation of the {@link Message} interface which implements 19 | * as many methods of that interface as possible in terms of other methods. 20 | * 21 | * @author Cyrus Najmabadi 22 | */ 23 | @interface PBAbstractMessage : NSObject { 24 | @private 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Signal/src/network/IPEndPoint.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "NetworkEndPoint.h" 4 | 5 | @class IPAddress; 6 | 7 | /** 8 | * 9 | * An ip address and port, identifying a network endpoint to/from which connections/data can be-sent/arrive-from. 10 | * Supports both IPv4 and IPv6 addresses. 11 | * 12 | * Used for interop with sockaddr structures. 13 | * 14 | **/ 15 | 16 | @interface IPEndPoint : NSObject 17 | 18 | @property (strong, readonly, nonatomic) IPAddress* address; 19 | @property (readonly, nonatomic) in_port_t port; 20 | 21 | - (instancetype)initWithAddress:(IPAddress*)address 22 | onPort:(in_port_t)port; 23 | 24 | - (instancetype)initWithUnspecifiedAddressOnPort:(in_port_t)port; 25 | 26 | - (instancetype)initFromSockaddrData:(NSData*)sockaddrData; 27 | - (instancetype)initFromIPv4SockaddrData:(NSData*)sockaddrData; 28 | - (instancetype)initFromIPv6SockaddrData:(NSData*)sockaddrData; 29 | 30 | - (NSData*)sockaddrData; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Signal/src/audio/incall_audio/processing/DesiredBufferDepthController.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "DecayingSampleEstimator.h" 3 | #import "DropoutTracker.h" 4 | #import "Environment.h" 5 | #import "JitterQueue.h" 6 | #import "Terminable.h" 7 | #import "SpeexCodec.h" 8 | 9 | /** 10 | * 11 | * DesiredBufferDepthController is used to determine how much audio should be kept in reserve, in case of network jitter. 12 | * 13 | * An instance must be registered to receive notifications from the network jitter queue in order to function correctly. 14 | * When packets arrive at a consistent rate without dropping, the desired buffer depth tends to decrease. 15 | * When packet delays vary significantly and when packets drop before arriving, the desired buffer tends to increase. 16 | * 17 | **/ 18 | 19 | @interface DesiredBufferDepthController : NSObject 20 | 21 | - (instancetype)initForJitterQueue:(JitterQueue*)jitterQueue; 22 | 23 | - (double)getAndUpdateDesiredBufferDepth; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Signal/src/network/rtp/srtp/SRTPSocket.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "RTPSocket.h" 3 | #import "SRTPStream.h" 4 | #import "HandshakePacket.h" 5 | #import "PacketHandler.h" 6 | #import "Logging.h" 7 | 8 | /** 9 | * 10 | * SRTPSocket is responsible for sending and receiving secured RTP packets. 11 | * Works by authenticating and encrypting/decrypting RTP packets sent/received over an RTPSocket. 12 | * 13 | **/ 14 | 15 | @interface SRTPSocket : NSObject 16 | 17 | - (instancetype) initOverRTP:(RTPSocket*)rtpSocket 18 | andIncomingCipherKey:(NSData*)incomingCipherKey 19 | andIncomingMacKey:(NSData*)incomingMacKey 20 | andIncomingSalt:(NSData*)incomingSalt 21 | andOutgoingCipherKey:(NSData*)outgoingCipherKey 22 | andOutgoingMacKey:(NSData*)outgoingMacKey 23 | andOutgoingSalt:(NSData*)outgoingSalt; 24 | 25 | - (void)secureAndSendRTPPacket:(RTPPacket*)packet; 26 | - (void)startWithHandler:(PacketHandler*)handler untilCancelled:(TOCCancelToken*)untilCancelledToken; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Signal/src/util/ObservableValue.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "CollapsingFutures.h" 3 | #import "Queue.h" 4 | 5 | typedef void (^LatestValueCallback)(id latestValue); 6 | 7 | /** 8 | * 9 | * An ObservableValue represents an asynchronous stream of values, such as 'latest state of toggle' or 'latest sensor reading'. 10 | * 11 | */ 12 | @interface ObservableValue : NSObject 13 | 14 | @property (strong, readonly, atomic) id currentValue; 15 | 16 | - (void)watchLatestValueOnArbitraryThread:(LatestValueCallback)callback 17 | untilCancelled:(TOCCancelToken*)untilCancelledToken; 18 | 19 | - (void)watchLatestValue:(LatestValueCallback)callback 20 | onThread:(NSThread*)thread 21 | untilCancelled:(TOCCancelToken*)untilCancelledToken; 22 | 23 | @end 24 | 25 | @interface ObservableValueController : ObservableValue 26 | 27 | - (instancetype)initWithInitialValue:(id)value; 28 | - (void)updateValue:(id)value; 29 | - (void)adjustValue:(id(^)(id))adjustment; 30 | - (void)sealValue; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Signal/src/phone/signaling/CallConnectUtil_Responder.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "HTTPManager.h" 3 | #import "ResponderSessionDescriptor.h" 4 | #import "CallController.h" 5 | 6 | /** 7 | * 8 | * CallConnectUtil_Responder is a utility class that deals with the details of responding to a call: 9 | * - Contacting the described signaling server 10 | * - Signalling busy or ringing 11 | * - Forwarding later signals like 'hangup' 12 | * - Contacting the described relay server 13 | * - Starting the zrtp handshake 14 | * - etc 15 | * 16 | **/ 17 | @interface CallConnectUtil_Responder : NSObject 18 | 19 | /// Result has type Future(CallConnectResult) 20 | + (TOCFuture*)asyncConnectToIncomingCallWithSessionDescriptor:(ResponderSessionDescriptor*)sessionDescriptor 21 | andCallController:(CallController*)callController; 22 | 23 | /// Result has type Future(HTTPResponse) 24 | + (TOCFuture*)asyncSignalTooBusyToAnswerCallWithSessionDescriptor:(ResponderSessionDescriptor*)sessionDescriptor; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Signal/src/network/rtp/zrtp/packets/HelloAckPacket.h: -------------------------------------------------------------------------------- 1 | #import "HandshakePacket.h" 2 | #import "HashChain.h" 3 | #import "ZID.h" 4 | 5 | /** 6 | * 7 | * The HelloAck packet sent by the responder to stop retransmission of the Hello packet. 8 | * 9 | * (extension header of RTP packet containing HelloAck handshake packet) 10 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 11 | * |0 1 0 1 0 0 0 0 0 1 0 1 1 0 1 0| length=3 words | 12 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 13 | * | Message Type Block="HelloACK" (2 words) | 14 | * | | 15 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 16 | * 17 | **/ 18 | 19 | @interface HelloAckPacket : NSObject 20 | 21 | @property (strong, readonly, nonatomic, getter=embeddedIntoHandshakePacket) HandshakePacket* embedding; 22 | 23 | + (instancetype)defaultPacket; 24 | 25 | - (instancetype)initFromHandshakePacket:(HandshakePacket*)handshakePacket; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Signal/src/util/BloomFilter.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | /** 4 | * 5 | * A bloom filter allows a set of items to be represented compactly, at the cost of false-positives when checking membership. 6 | * When contains returns true, the given item may be in the set. 7 | * When contains returns false, the given item is definitely not in the set. 8 | * 9 | * Bloom filters are used to opportunistically avoid starting an expensive operation that always fails for items not in a set. 10 | * In the specific case of RedPhone, it is used to determine if a phone number can be called (i.e. is in the RedPhone directory). 11 | * 12 | */ 13 | @interface BloomFilter : NSObject 14 | 15 | @property (readonly, nonatomic) NSUInteger hashCount; 16 | @property (strong, readonly, nonatomic) NSData* data; 17 | 18 | - (instancetype)initWithHashCount:(NSUInteger)hashCount 19 | andData:(NSData*)data; 20 | + (instancetype)bloomFilterWithNothing; 21 | + (instancetype)bloomFilterWithEverything; 22 | 23 | - (bool)contains:(NSString*)entity; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Signal/src/views/SearchBarTitleView.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #define SEARCH_BAR_DEFAULT_EMPTY_STRING @"" 4 | 5 | @class SearchBarTitleView; 6 | 7 | @protocol SearchBarTitleViewDelegate 8 | 9 | - (void)searchBarTitleView:(SearchBarTitleView*)view didSearchForTerm:(NSString*)term; 10 | - (void)searchBarTitleViewDidEndSearching:(SearchBarTitleView*)view; 11 | - (void)searchBarTitleViewDidTapMenu:(SearchBarTitleView*)view; 12 | 13 | @end 14 | 15 | @interface SearchBarTitleView : UIView 16 | 17 | @property (strong, nonatomic) IBOutlet UILabel* titleLabel; 18 | @property (strong, nonatomic) IBOutlet UIView* searchBarContainer; 19 | @property (strong, nonatomic) IBOutlet UITextField* searchTextField; 20 | @property (strong, nonatomic) IBOutlet UIButton* searchButton; 21 | @property (strong, nonatomic) IBOutlet UIButton* cancelButton; 22 | @property (strong, nonatomic) IBOutlet UIButton* menuButton; 23 | @property (weak, nonatomic) IBOutlet id delegate; 24 | 25 | - (void)updateAutoCorrectionType; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Signal/src/network/rtp/zrtp/HashChain.m: -------------------------------------------------------------------------------- 1 | #import "CryptoTools.h" 2 | #import "NSData+CryptoTools.h" 3 | #import "Constraints.h" 4 | #import "HashChain.h" 5 | 6 | @interface HashChain () 7 | 8 | @property (strong, readwrite, nonatomic) NSData* h0; 9 | @property (strong, readwrite, nonatomic) NSData* h1; 10 | @property (strong, readwrite, nonatomic) NSData* h2; 11 | @property (strong, readwrite, nonatomic) NSData* h3; 12 | 13 | @end 14 | 15 | @implementation HashChain 16 | 17 | - (instancetype)initWithSeed:(NSData*)seed { 18 | self = [super init]; 19 | 20 | if (self) { 21 | require(seed != nil); 22 | require(seed.length == HASH_CHAIN_ITEM_LENGTH); 23 | 24 | self.h0 = seed; 25 | self.h1 = [self.h0 hashWithSHA256]; 26 | self.h2 = [self.h1 hashWithSHA256]; 27 | self.h3 = [self.h2 hashWithSHA256]; 28 | } 29 | 30 | return self; 31 | } 32 | 33 | - (instancetype)initWithSecureGeneratedData { 34 | return [self initWithSeed:[CryptoTools generateSecureRandomData:HASH_CHAIN_ITEM_LENGTH]]; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Signal/src/util/collections/Queue.m: -------------------------------------------------------------------------------- 1 | #import "Queue.h" 2 | #import "Constraints.h" 3 | 4 | @interface Queue () 5 | 6 | @property (strong, nonatomic) NSMutableArray* items; 7 | 8 | @end 9 | 10 | @implementation Queue 11 | 12 | - (instancetype)init { 13 | self = [super init]; 14 | 15 | if (self) { 16 | self.items = [[NSMutableArray alloc] init]; 17 | } 18 | 19 | return self; 20 | } 21 | 22 | - (void)enqueue:(id)item { 23 | [self.items addObject:item]; 24 | } 25 | 26 | - (id)tryDequeue { 27 | if (self.count == 0) { return nil; } 28 | return [self dequeue]; 29 | } 30 | 31 | - (id)dequeue { 32 | requireState(self.count > 0); 33 | id result = self.items[0]; 34 | [self.items removeObjectAtIndex:0]; 35 | return result; 36 | } 37 | 38 | - (id)peek { 39 | requireState(self.count > 0); 40 | return self.items[0]; 41 | } 42 | 43 | - (id)peekAt:(NSUInteger)offset { 44 | require(offset < self.count); 45 | return self.items[offset]; 46 | } 47 | 48 | - (NSUInteger)count { 49 | return self.items.count; 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /Libraries/ProtocolBuffers/Bootstrap.h: -------------------------------------------------------------------------------- 1 | // Copyright 2008 Cyrus Najmabadi 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #import "ForwardDeclarations.h" 16 | 17 | #import "CodedInputStream.h" 18 | #import "CodedOutputStream.h" 19 | #import "ExtendableMessage.h" 20 | #import "ExtendableMessage_Builder.h" 21 | #import "ExtensionRegistry.h" 22 | #import "GeneratedMessage.h" 23 | #import "GeneratedMessage_Builder.h" 24 | #import "Message_Builder.h" 25 | #import "UnknownFieldSet.h" 26 | #import "UnknownFieldSet_Builder.h" 27 | #import "Utilities.h" 28 | -------------------------------------------------------------------------------- /Signal/src/audio/SoundInstance.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | /** 4 | * Wrapper for system dependant audio interface. 5 | **/ 6 | 7 | typedef NS_ENUM(NSInteger, SoundInstanceType) { 8 | SoundInstanceTypeNothing, 9 | SoundInstanceTypeInboundRingtone, 10 | SoundInstanceTypeOutboundRingtone, 11 | SoundInstanceTypeHandshakeSound, 12 | SoundInstanceTypeCompletedSound, 13 | SoundInstanceTypeBusySound, 14 | SoundInstanceTypeErrorAlert, 15 | SoundInstanceTypeAlert 16 | }; 17 | 18 | @interface SoundInstance : NSObject 19 | 20 | @property (strong, nonatomic) void (^completionBlock)(SoundInstance*); 21 | @property (readonly, nonatomic) SoundInstanceType soundInstanceType; 22 | 23 | - (instancetype)initWithFile:(NSString*)audioFile 24 | andSoundInstanceType:(SoundInstanceType)soundInstanceType; 25 | - (NSString*)getId; 26 | 27 | - (void)setAudioToLoopIndefinitely; 28 | - (void)setAudioLoopCount:(NSInteger)loopCount; 29 | 30 | - (void)audioPlayerDidFinishPlaying:(AVAudioPlayer*)player 31 | successfully:(BOOL)flag; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Signal/src/audio/incall_audio/processing/AudioProcessor.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "AudioPacker.h" 3 | #import "AudioStretcher.h" 4 | #import "BufferDepthMeasure.h" 5 | #import "CyclicalBuffer.h" 6 | #import "DecayingSampleEstimator.h" 7 | #import "EncodedAudioFrame.h" 8 | #import "Logging.h" 9 | #import "SpeexCodec.h" 10 | #import "StretchFactorController.h" 11 | 12 | /** 13 | * 14 | * AudioProcessor is responsible for transforming audio as it travels between 15 | * the network and the hardware. 16 | * 17 | * Processing involves: 18 | * - encoding and decoding using the Speex codec 19 | * - packing/unpacking audio into/from EncodedAudioPackets 20 | * - stretching audio using spandsp 21 | * - buffering audio in a jitter queue 22 | * - infering gaps in audio. 23 | * 24 | **/ 25 | 26 | @interface AudioProcessor : NSObject 27 | 28 | @property (strong, readonly, nonatomic) SpeexCodec* codec; 29 | 30 | - (instancetype)init; 31 | 32 | - (void)receivedPacket:(EncodedAudioPacket*)packet; 33 | - (NSArray*)encodeAudioPacketsFromBuffer:(CyclicalBuffer*)buffer; 34 | - (NSData*)tryDecodeOrInferFrame; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Signal/src/util/NSArray+Util.m: -------------------------------------------------------------------------------- 1 | #import "NSArray+Util.h" 2 | #import "Constraints.h" 3 | 4 | @implementation NSArray (Util) 5 | 6 | - (NSData*)ows_toUint8Data { 7 | NSUInteger n = self.count; 8 | uint8_t x[n]; 9 | for (NSUInteger i = 0; i < n; i++) { 10 | x[i] = [(NSNumber*)self[i] unsignedCharValue]; 11 | } 12 | return [NSData dataWithBytes:x length:n]; 13 | } 14 | 15 | - (NSData*)ows_concatDatas { 16 | NSUInteger t = 0; 17 | for (id d in self) { 18 | require([d isKindOfClass:[NSData class]]); 19 | t += [(NSData*)d length]; 20 | } 21 | 22 | NSMutableData* result = [NSMutableData dataWithLength:t]; 23 | uint8_t* dst = [result mutableBytes]; 24 | for (NSData* d in self) { 25 | memcpy(dst, [d bytes], d.length); 26 | dst += d.length; 27 | } 28 | return result; 29 | } 30 | 31 | - (NSArray*)ows_concatArrays { 32 | NSMutableArray* r = [[NSMutableArray alloc] init]; 33 | for (id e in self) { 34 | require([e isKindOfClass:[NSArray class]]); 35 | [r addObjectsFromArray:e]; 36 | } 37 | return r; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Libraries/ProtocolBuffers/WireFormat.m: -------------------------------------------------------------------------------- 1 | // Copyright 2008 Cyrus Najmabadi 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #import "WireFormat.h" 16 | 17 | #import "Utilities.h" 18 | 19 | int32_t PBWireFormatMakeTag(int32_t fieldNumber, int32_t wireType) { 20 | return (fieldNumber << PBWireFormatTagTypeBits) | wireType; 21 | } 22 | 23 | 24 | int32_t PBWireFormatGetTagWireType(int32_t tag) { 25 | return tag & PBWireFormatTagTypeMask; 26 | } 27 | 28 | 29 | int32_t PBWireFormatGetTagFieldNumber(int32_t tag) { 30 | return logicalRightShift32(tag, PBWireFormatTagTypeBits); 31 | } 32 | -------------------------------------------------------------------------------- /Signal/src/profiling/DecayingSampleEstimator.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | /// A sample estimate based on an exponential weighting of observed samples, favoring the latest samples. 4 | @interface DecayingSampleEstimator : NSObject 5 | 6 | @property (nonatomic, getter=currentEstimate, setter=forceEstimateTo:) double estimate; 7 | @property (nonatomic, readonly, getter=decayRatePerUnitSample) double decayPerUnitSample; 8 | 9 | - (instancetype)initWithInitialEstimate:(double)initialEstimate 10 | andDecayPerUnitSample:(double)decayPerUnitSample; 11 | 12 | - (instancetype)initWithInitialEstimate:(double)initialEstimate 13 | andDecayFactor:(double)decayFactor 14 | perNSamples:(double)decayPeriod; 15 | 16 | // Decays the current estimate towards the given sample value, assuming a unit weighting. 17 | - (void)updateWithNextSample:(double)sampleValue; 18 | 19 | // Decays the current estimate towards the given sample value, with a given weighting. 20 | - (void)updateWithNextSample:(double)sampleValue 21 | withSampleWeight:(double)weight; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Signal/src/util/NSString+Util.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface NSString (Util) 4 | 5 | /// The utf-8 encoding of the string's text. 6 | - (NSData*)encodedAsUtf8; 7 | /// The ascii encoding of the string's text. 8 | /// Throws when the string contains non-ascii characters. 9 | - (NSData*)encodedAsAscii; 10 | - (NSRegularExpression*)toRegularExpression; 11 | - (NSString*)withMatchesAgainst:(NSRegularExpression*)regex 12 | replacedBy:(NSString*)replacement; 13 | - (bool)containsAnyMatches:(NSRegularExpression*)regex; 14 | - (NSString*)withPrefixRemovedElseNull:(NSString*)prefix; 15 | - (NSData*)decodedAsJSONIntoData; 16 | - (NSDictionary*)decodedAsJSONIntoDictionary; 17 | - (NSData*)decodedAsHexString; 18 | - (NSData*)decodedAsSpaceSeparatedHexString; 19 | - (NSData*)decodedAsBase64Data; 20 | - (NSNumber*)tryParseAsDecimalNumber; 21 | - (NSNumber*)tryParseAsUnsignedInteger; 22 | - (NSString*)removeAllCharactersIn:(NSCharacterSet*)characterSet; 23 | - (NSString*)digitsOnly; 24 | - (NSString*)withCharactersInRange:(NSRange)range 25 | replacedBy:(NSString*)substring; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Signal/src/view controllers/InboxFeedViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "ContactsManager.h" 4 | #import "InboxFeedTableViewCell.h" 5 | #import "SearchBarTitleView.h" 6 | 7 | /** 8 | * 9 | * InboxFeedViewController is the first view the user sees after they have registered 10 | * The search box searches items in your inbox, and contacts. 11 | * A tutorial is displayed if the user has never made a call. 12 | * This class is subscribed to the inbox feed table view cell delegate which tells us when to delete/archive items. 13 | * 14 | */ 15 | 16 | @interface InboxFeedViewController : UIViewController 17 | 18 | @property (strong, nonatomic) IBOutlet UITableView* inboxFeedTableView; 19 | @property (strong, nonatomic) IBOutlet SearchBarTitleView* searchBarTitleView; 20 | @property (strong, nonatomic) IBOutlet UIView* freshInboxView; 21 | @property (strong, nonatomic) IBOutlet UILabel* freshAppTutorialTopLabel; 22 | @property (strong, nonatomic) IBOutlet UILabel* freshAppTutorialMiddleLabel; 23 | 24 | 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Signal/src/views/UnseenWhisperUserCell.m: -------------------------------------------------------------------------------- 1 | #import "Environment.h" 2 | #import "PhoneNumberDirectoryFilter.h" 3 | #import "PhoneNumberDirectoryFilterManager.h" 4 | #import "UnseenWhisperUserCell.h" 5 | 6 | @implementation UnseenWhisperUserCell 7 | 8 | - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString*)reuseIdentifier { 9 | self = [[NSBundle.mainBundle loadNibNamed:NSStringFromClass([self class]) owner:self options:nil] firstObject]; 10 | return self; 11 | } 12 | 13 | - (NSString*)restorationIdentifier { 14 | return NSStringFromClass([self class]); 15 | } 16 | 17 | - (void)configureWithContact:(Contact*)contact { 18 | self.nameLabel.text = contact.fullName; 19 | 20 | PhoneNumberDirectoryFilter* filter = Environment.getCurrent.phoneDirectoryManager.getCurrentFilter; 21 | BOOL foundPhoneNumber = NO; 22 | 23 | for (PhoneNumber* number in contact.parsedPhoneNumbers) { 24 | if ([filter containsPhoneNumber:number]) { 25 | foundPhoneNumber = YES; 26 | self.numberLabel.text = number.localizedDescriptionForUser; 27 | } 28 | } 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Signal/src/profiling/protocols/Logging.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "OccurrenceLogger.h" 3 | #import "ConditionLogger.h" 4 | #import "ValueLogger.h" 5 | 6 | @protocol JitterQueueNotificationReceiver; 7 | 8 | @protocol Logging 9 | 10 | /// Note: the logger MUST NOT store a reference to the given sender. Calling this method, or storing its result, must not create a reference cycle. 11 | - (id)getOccurrenceLoggerForSender:(id)sender 12 | withKey:(NSString*)key; 13 | 14 | /// Note: the logger MUST NOT store a reference to the given sender. Calling this method, or storing its result, must not create a reference cycle. 15 | - (id)getConditionLoggerForSender:(id)sender; 16 | 17 | /// Note: the logger MUST NOT store a reference to the given sender. Calling this method, or storing its result, must not create a reference cycle. 18 | - (id)getValueLoggerForValue:(id)valueIdentity 19 | from:(id)sender; 20 | 21 | - (id)jitterQueueNotificationReceiver; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Signal/src/crypto/NSData+CryptoTools.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface NSData (CryptoTools) 4 | 5 | - (NSData*)hashWithSHA256; 6 | 7 | - (NSData*)hmacWithSHA1WithKey:(NSData*)key; 8 | - (NSData*)hmacWithSHA256WithKey:(NSData*)key; 9 | 10 | - (NSData*)encryptWithAESInCipherFeedbackModeWithKey:(NSData*)key andIV:(NSData*)iv; 11 | - (NSData*)decryptWithAESInCipherFeedbackModeWithKey:(NSData*)key andIV:(NSData*)iv; 12 | 13 | - (NSData*)encryptWithAESInCipherBlockChainingModeWithPkcs7PaddingWithKey:(NSData*)key andIV:(NSData*)iv; 14 | - (NSData*)decryptWithAESInCipherBlockChainingModeWithPkcs7PaddingWithKey:(NSData*)key andIV:(NSData*)iv; 15 | 16 | - (NSData*)encryptWithAESInCounterModeWithKey:(NSData*)key andIV:(NSData*)iv; 17 | - (NSData*)decryptWithAESInCounterModeWithKey:(NSData*)key andIV:(NSData*)iv; 18 | 19 | /// Determines if two data vectors contain the same information. 20 | /// Avoids short-circuiting or data-dependent branches, so that early returns can't be used to infer where the difference is. 21 | /// Returns early if data is of different length. 22 | - (bool)isEqualToData_TimingSafe:(NSData*)other; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Signal/src/view controllers/ContactDetailViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "Contact.h" 4 | #import "ContactDetailTableViewCell.h" 5 | #import "PhoneNumberDirectoryFilterManager.h" 6 | 7 | /** 8 | * 9 | * ContactDetailViewController displays information about a contact in a table view such as additional non-encryped communication methods. 10 | * Any additional non-encrypted information is opened in an external application (Email, SMS, Phone) 11 | * 12 | */ 13 | 14 | @interface ContactDetailViewController : UIViewController 15 | 16 | @property (strong, nonatomic) IBOutlet UIButton* favouriteButton; 17 | @property (strong, nonatomic) IBOutlet UIView* secureInfoHeaderView; 18 | @property (strong, nonatomic) IBOutlet UILabel* contactNameLabel; 19 | @property (strong, nonatomic) IBOutlet UIImageView* contactImageView; 20 | @property (strong, nonatomic) IBOutlet UITableView* contactInfoTableView; 21 | 22 | @property (strong, readonly, nonatomic) Contact* contact; 23 | 24 | - (instancetype)initWithContact:(Contact*)contact; 25 | 26 | - (IBAction)favouriteButtonTapped; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Signal/src/audio/incall_audio/processing/JitterQueue.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "PriorityQueue.h" 3 | #import "EncodedAudioPacket.h" 4 | #import "Logging.h" 5 | #import "JitterQueueNotificationReceiver.h" 6 | #import "BufferDepthMeasure.h" 7 | 8 | /** 9 | * 10 | * JitterQueue handles the details of organizing and consuming real-time data, which may fail to arrive on time or arrive out of order. 11 | * 12 | **/ 13 | 14 | @interface JitterQueue : NSObject 15 | 16 | - (instancetype)init; 17 | 18 | - (void)registerWatcher:(id)watcher; 19 | 20 | // Provides a framed audio packet to be placed in sequence. 21 | // Returns true if the packet was successfully enqueued. 22 | // Returns false if the packet has arrived too late, far too early, or is a duplicate. 23 | - (bool)tryEnqueue:(EncodedAudioPacket*)packet; 24 | 25 | // Returns the next framed audio packet in sequence, or nil if the next packet has not arrived in time. 26 | - (EncodedAudioPacket*)tryDequeue; 27 | 28 | // The number of framed audio packets (contiguous or not) in the queue. 29 | - (NSUInteger)count; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Signal/src/views/DialerButtonView.m: -------------------------------------------------------------------------------- 1 | #import "DialerButtonView.h" 2 | #import "UIUtil.h" 3 | 4 | @implementation DialerButtonView 5 | 6 | - (void)awakeFromNib { 7 | [super awakeFromNib]; 8 | self.numberLabel.text = NSLocalizedString(self.numberLocalizationKey, @""); 9 | self.letterLabel.text = NSLocalizedString(self.letterLocalizationKey, @""); 10 | self.layer.cornerRadius = 4.0f; 11 | self.layer.borderColor = [UIUtil.darkBackgroundColor CGColor]; 12 | } 13 | 14 | - (void)setSelected:(BOOL)isSelected { 15 | if (isSelected) { 16 | self.backgroundColor = UIUtil.transparentLightGrayColor; 17 | self.layer.borderWidth = 0.5f; 18 | } else { 19 | self.backgroundColor = UIColor.clearColor; 20 | self.layer.borderWidth = 0.0f; 21 | } 22 | } 23 | 24 | #pragma mark - Actions 25 | 26 | - (void)buttonTouchUp { 27 | [self setSelected:NO]; 28 | id delegate = self.delegate; 29 | [delegate dialerButtonViewDidSelect:self]; 30 | } 31 | 32 | - (void)buttonTouchCancel { 33 | [self setSelected:NO]; 34 | } 35 | 36 | - (void)buttonTouchDown { 37 | [self setSelected:YES]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Signal/src/audio/incall_audio/AudioPacker.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "Queue.h" 3 | #import "EncodedAudioFrame.h" 4 | #import "EncodedAudioPacket.h" 5 | 6 | #define AUDIO_FRAMES_PER_PACKET 2 7 | 8 | /** 9 | * 10 | * AudioPacker is used to convert between encoded audio frames and encoded audio packets. 11 | * AudioPacker is also responsible for assigning incrementing sequence numbers to each packet. 12 | * 13 | * When sending, packer is used to combine frames into packets with an appropriate sequence number. 14 | * The initial sequence number is chosen randomly. 15 | * 16 | * When receiving, packer is used to split packets into their frames and grab those frames one at a time. 17 | * Missing packets are split into frames with no audio data. The missing frames are inferred by speex. 18 | * 19 | */ 20 | @interface AudioPacker : NSObject 21 | 22 | - (instancetype)init; 23 | 24 | - (void)packFrame:(EncodedAudioFrame*)frame; 25 | - (EncodedAudioPacket*)tryGetFinishedAudioPacket; 26 | 27 | - (void)unpackPotentiallyMissingAudioPacket:(EncodedAudioPacket*)potentiallyMissingPacket; 28 | - (EncodedAudioFrame*)tryGetReceivedFrame; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Signal/src/crypto/CryptoTools.m: -------------------------------------------------------------------------------- 1 | #import "CryptoTools.h" 2 | 3 | #import 4 | 5 | #import "Constraints.h" 6 | #import "NSData+Conversions.h" 7 | #import "EVPMessageDigest.h" 8 | #import "EVPSymetricUtil.h" 9 | #import "Util.h" 10 | #import "NSData+CryptoTools.h" 11 | 12 | @implementation CryptoTools 13 | 14 | + (NSData*)generateSecureRandomData:(NSUInteger)length { 15 | NSMutableData* d = [NSMutableData dataWithLength:length]; 16 | SecRandomCopyBytes(kSecRandomDefault, length, [d mutableBytes]); 17 | return d; 18 | } 19 | 20 | + (uint16_t)generateSecureRandomUInt16 { 21 | return [[self generateSecureRandomData:sizeof(uint16_t)] bigEndianUInt16At:0]; 22 | } 23 | 24 | + (uint32_t)generateSecureRandomUInt32 { 25 | return [[self generateSecureRandomData:sizeof(uint32_t)] bigEndianUInt32At:0]; 26 | } 27 | 28 | + (NSString*)computeOTPWithPassword:(NSString*)password andCounter:(int64_t)counter { 29 | require(password != nil); 30 | 31 | NSData* d = [[@(counter) stringValue] encodedAsUtf8]; 32 | NSData* h = [d hmacWithSHA1WithKey:[password encodedAsUtf8]]; 33 | return [h encodedAsBase64]; 34 | } 35 | 36 | @end 37 | 38 | -------------------------------------------------------------------------------- /Signal/src/network/NetworkEndPoint.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "CollapsingFutures.h" 3 | #import "StreamPair.h" 4 | 5 | /// Describes a location to which you can connect and communicate. 6 | @protocol NetworkEndPoint 7 | 8 | /// Creates a pair of read/write streams to this end point. 9 | - (StreamPair*)createStreamPair; 10 | 11 | /// Invoked when a stream pair has opened (tcp handshake completed), but before it is necessary writable. 12 | /// (The time to set any options on the stream.) 13 | - (void)handleStreamsOpened:(StreamPair*)streamPair; 14 | 15 | /// Invoked when a stream pair is ready for read/write. 16 | /// (The time to authenticate certificates of a completed SSL connection.) 17 | - (TOCFuture*)asyncHandleStreamsConnected:(StreamPair*)streamPair; 18 | 19 | /// Resolves this general end point into underlying associated specific end points. 20 | /// For example, a hostname+port end point resolves into one or more ip+port end points. 21 | /// The asynchronous result has type Future(Array(NetworkEndPoint)). 22 | - (TOCFuture*)asyncResolveToSpecificEndPointsUnlessCancelled:(TOCCancelToken*)unlessCancelledToken; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Signal/src/network/PacketHandler.m: -------------------------------------------------------------------------------- 1 | #import "PacketHandler.h" 2 | #import "Constraints.h" 3 | 4 | @interface PacketHandler () 5 | 6 | @property (strong, readwrite, nonatomic) PacketHandlerBlock dataHandler; 7 | @property (strong, readwrite, nonatomic) ErrorHandlerBlock errorHandler; 8 | 9 | @end 10 | 11 | @implementation PacketHandler 12 | 13 | - (instancetype)initPacketHandler:(PacketHandlerBlock)dataHandler 14 | withErrorHandler:(ErrorHandlerBlock)errorHandler { 15 | self = [super init]; 16 | 17 | if (self) { 18 | require(dataHandler != nil); 19 | require(errorHandler != nil); 20 | 21 | self.dataHandler = dataHandler; 22 | self.errorHandler = errorHandler; 23 | } 24 | 25 | return self; 26 | } 27 | 28 | - (void)handlePacket:(id)packet { 29 | self.dataHandler(packet); 30 | } 31 | 32 | - (void)handleError:(id)error 33 | relatedInfo:(id)relatedInfo 34 | causedTermination:(bool)causedTermination { 35 | 36 | DDLogError(@"Pack handler failed with error: %@ and info: %@", error, relatedInfo); 37 | self.errorHandler(error, relatedInfo, causedTermination); 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Signal/src/network/rtp/zrtp/agreement/EC25KeyAgreementParticipant.m: -------------------------------------------------------------------------------- 1 | #import "EC25KeyAgreementParticipant.h" 2 | #import "EVPKeyAgreement.h" 3 | #import "Constraints.h" 4 | 5 | @interface EC25KeyAgreementParticipant () 6 | 7 | @property (strong, nonatomic) EVPKeyAgreement* evpKeyAgreement; 8 | @property (strong, nonatomic) EC25KeyAgreementProtocol* protocol; 9 | 10 | @end 11 | 12 | @implementation EC25KeyAgreementParticipant 13 | 14 | - (instancetype)initWithPrivateKeyGeneratedForProtocol:(EC25KeyAgreementProtocol*)protocol { 15 | self = [super init]; 16 | 17 | if (self) { 18 | self.protocol = protocol; 19 | self.evpKeyAgreement = [EVPKeyAgreement evpEC25KeyAgreement]; 20 | [self.evpKeyAgreement generateKeyPair]; 21 | } 22 | 23 | return self; 24 | } 25 | 26 | - (id)getProtocol { 27 | return self.protocol; 28 | } 29 | 30 | - (NSData*)getPublicKeyData { 31 | return self.evpKeyAgreement.getPublicKey; 32 | } 33 | 34 | - (NSData*)calculateKeyAgreementAgainstRemotePublicKey:(NSData*)remotePublicKey { 35 | return [self.evpKeyAgreement getSharedSecretForRemotePublicKey:remotePublicKey]; 36 | } 37 | @end 38 | -------------------------------------------------------------------------------- /Signal/src/views/DialerButtonView.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | /** 4 | * 5 | * This class exists because a UIButton can't have 2 lines of text. 6 | * DialerButtonView gives us customization and also localizes the label text. 7 | * Localize text by the setting properties in the xib for letterLocalizationKey and numberLocalizationKey. 8 | * A protocol is implemented to pass touch events for touchUpInside. 9 | * 10 | */ 11 | 12 | @class DialerButtonView; 13 | 14 | @protocol DialerButtonViewDelegate 15 | 16 | - (void)dialerButtonViewDidSelect:(DialerButtonView*)view; 17 | 18 | @end 19 | 20 | @interface DialerButtonView : UIView 21 | 22 | @property (strong, nonatomic) NSString* buttonInput; 23 | @property (strong, nonatomic) NSString* letterLocalizationKey; 24 | @property (strong, nonatomic) NSString* numberLocalizationKey; 25 | 26 | @property (strong, nonatomic) IBOutlet UILabel* numberLabel; 27 | @property (strong, nonatomic) IBOutlet UILabel* letterLabel; 28 | @property (weak, nonatomic) IBOutlet id delegate; 29 | 30 | - (IBAction)buttonTouchUp; 31 | - (IBAction)buttonTouchCancel; 32 | - (IBAction)buttonTouchDown; 33 | 34 | @end 35 | --------------------------------------------------------------------------------