Merge branch 'release/2.5.0' into release/2.5.0-with-master

// FREEBIE
pull/1/head
Michael Kirk 9 years ago
commit ed06555567

@ -3,7 +3,7 @@ source 'https://github.com/CocoaPods/Specs.git'
target 'Signal' do
pod 'SocketRocket', :git => 'https://github.com/facebook/SocketRocket.git'
pod 'SignalServiceKit', :git => 'https://github.com/WhisperSystems/SignalServiceKit.git'
pod 'SignalServiceKit', git: 'https://github.com/WhisperSystems/SignalServiceKit.git'
#pod 'SignalServiceKit', path: '../SignalServiceKit'
pod 'OpenSSL', '~> 1.0.208'
pod 'PastelogKit', '~> 1.3'

@ -130,7 +130,7 @@ EXTERNAL SOURCES:
CHECKOUT OPTIONS:
SignalServiceKit:
:commit: d802918603158e50987a2a4c74d4174cdc0f72d6
:commit: 9821e0c0d03a01f556680a6ae869b70bf5b93681
:git: https://github.com/WhisperSystems/SignalServiceKit.git
SocketRocket:
:commit: 8096fef47d582bff8ae3758c9ae7af1d55ea53d6
@ -161,6 +161,6 @@ SPEC CHECKSUMS:
UnionFind: c33be5adb12983981d6e827ea94fc7f9e370f52d
YapDatabase: b1e43555a34a5298e23a045be96817a5ef0da58f
PODFILE CHECKSUM: 547945066e021c3aa0bd6bea018af5e4769a3113
PODFILE CHECKSUM: 5dccee4c1c1ba5d4bf9575a81eeede82d1e89e8b
COCOAPODS: 1.0.1

@ -24,6 +24,8 @@
458E383A1D6699FA0094BD24 /* OWSDeviceProvisioningURLParserTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 458E38391D6699FA0094BD24 /* OWSDeviceProvisioningURLParserTest.m */; };
459311FC1D75C948008DD4F0 /* OWSDeviceTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 459311FB1D75C948008DD4F0 /* OWSDeviceTableViewCell.m */; };
459C3F0D1C9B3A1B003ACF51 /* TSMessageAdapterTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 459C3F0C1C9B3A1B003ACF51 /* TSMessageAdapterTest.m */; };
45BFFFA81D898AF0004A12A7 /* OWSStaleNotificationObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = 45BFFFA71D898AF0004A12A7 /* OWSStaleNotificationObserver.m */; };
45BFFFA91D898AF0004A12A7 /* OWSStaleNotificationObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = 45BFFFA71D898AF0004A12A7 /* OWSStaleNotificationObserver.m */; };
45C681B71D305A580050903A /* OWSCall.m in Sources */ = {isa = PBXBuildFile; fileRef = 45C681B61D305A580050903A /* OWSCall.m */; };
45C681B81D305A580050903A /* OWSCall.m in Sources */ = {isa = PBXBuildFile; fileRef = 45C681B61D305A580050903A /* OWSCall.m */; };
45C681BC1D305C080050903A /* OWSCallCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 45C681BA1D305C080050903A /* OWSCallCollectionViewCell.m */; };
@ -537,6 +539,8 @@
4597E94E1D8313C100040CDE /* sq */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sq; path = translations/sq.lproj/Localizable.strings; sourceTree = "<group>"; };
4597E94F1D8313CB00040CDE /* bg */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = bg; path = translations/bg.lproj/Localizable.strings; sourceTree = "<group>"; };
459C3F0C1C9B3A1B003ACF51 /* TSMessageAdapterTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TSMessageAdapterTest.m; path = "view controllers/Signals/TSMessageAdapters/TSMessageAdapterTest.m"; sourceTree = "<group>"; };
45BFFFA61D898AF0004A12A7 /* OWSStaleNotificationObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OWSStaleNotificationObserver.h; path = Observers/OWSStaleNotificationObserver.h; sourceTree = "<group>"; };
45BFFFA71D898AF0004A12A7 /* OWSStaleNotificationObserver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OWSStaleNotificationObserver.m; path = Observers/OWSStaleNotificationObserver.m; sourceTree = "<group>"; };
45C681B51D305A580050903A /* OWSCall.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSCall.h; sourceTree = "<group>"; };
45C681B61D305A580050903A /* OWSCall.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSCall.m; sourceTree = "<group>"; };
45C681B91D305C080050903A /* OWSCallCollectionViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSCallCollectionViewCell.h; sourceTree = "<group>"; };
@ -1167,6 +1171,15 @@
name = TSMessageAdapters;
sourceTree = "<group>";
};
45BFFFA51D898AB8004A12A7 /* Observers */ = {
isa = PBXGroup;
children = (
45BFFFA61D898AF0004A12A7 /* OWSStaleNotificationObserver.h */,
45BFFFA71D898AF0004A12A7 /* OWSStaleNotificationObserver.m */,
);
name = Observers;
sourceTree = "<group>";
};
70B8009F190C529C0042E3F0 /* Products */ = {
isa = PBXGroup;
children = (
@ -1218,6 +1231,7 @@
457F3AC01D14A0F700C51351 /* Models */,
76EB052B18170B33006006FC /* Views */,
76EB04FE18170B33006006FC /* View Controllers */,
45BFFFA51D898AB8004A12A7 /* Observers */,
);
path = src;
sourceTree = "<group>";
@ -2367,6 +2381,7 @@
ORGANIZATIONNAME = "Open Whisper Systems";
TargetAttributes = {
D221A088169C9E5E00537ABF = {
DevelopmentTeam = U68MSDN6DR;
SystemCapabilities = {
com.apple.DataProtection = {
enabled = 1;
@ -2377,6 +2392,9 @@
com.apple.InterAppAudio = {
enabled = 0;
};
com.apple.Push = {
enabled = 1;
};
com.apple.VPNLite = {
enabled = 0;
};
@ -2688,6 +2706,7 @@
E197B61918BBEC1A00F073E5 /* RemoteIOBufferListWrapper.m in Sources */,
76EB05A618170B33006006FC /* RtpPacket.m in Sources */,
76EB064218170B33006006FC /* StringUtil.m in Sources */,
45BFFFA81D898AF0004A12A7 /* OWSStaleNotificationObserver.m in Sources */,
A547DD741A70A87800103EC7 /* DJWActionSheet+OWS.m in Sources */,
45C681B71D305A580050903A /* OWSCall.m in Sources */,
76EB062618170B33006006FC /* Queue.m in Sources */,
@ -2882,6 +2901,7 @@
B660F7311C29988E00687D6E /* IpEndPoint.m in Sources */,
B660F7321C29988E00687D6E /* PacketHandler.m in Sources */,
B660F7331C29988E00687D6E /* RtpPacket.m in Sources */,
45BFFFA91D898AF0004A12A7 /* OWSStaleNotificationObserver.m in Sources */,
B660F7341C29988E00687D6E /* RtpSocket.m in Sources */,
B660F7351C29988E00687D6E /* SequenceCounter.m in Sources */,
B660F7361C29988E00687D6E /* SrtpSocket.m in Sources */,
@ -3210,7 +3230,10 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Signal/Signal.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = U68MSDN6DR;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)\"",
@ -3263,7 +3286,10 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Signal/Signal.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = U68MSDN6DR;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)\"",

@ -38,7 +38,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>2.6.0.0</string>
<string>2.5.0.15</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LOGS_EMAIL</key>
@ -71,6 +71,8 @@
</dict>
<key>NSAppleMusicUsageDescription</key>
<string>Signal needs to use Apple Music to play media attachments.</string>
<key>NSCameraUsageDescription</key>
<string>Signal will let you take a photo to send to your contacts. You can review it before sending.</string>
<key>NSContactsUsageDescription</key>
<string>Signal uses your contacts to find users you know. We do not store your contacts on the server.</string>
<key>NSMicrophoneUsageDescription</key>

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
<dict>
<key>aps-environment</key>
<string>development</string>
</dict>
</plist>

@ -15,6 +15,7 @@
#import "TSSocketManager.h"
#import "TextSecureKitEnv.h"
#import "VersionMigrations.h"
#import "OWSStaleNotificationObserver.h"
#import <SignalServiceKit/OWSReadReceiptObserver.h>
static NSString *const kStoryboardName = @"Storyboard";
@ -26,6 +27,7 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
@property (nonatomic, retain) UIWindow *screenProtectionWindow;
@property (nonatomic) OWSReadReceiptObserver *readReceiptObserver;
@property (nonatomic) OWSStaleNotificationObserver *staleNotificationObserver;
@end
@ -119,20 +121,25 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
[TextSecureKitEnv sharedEnv].contactsManager = [Environment getCurrent].contactsManager;
[[TSStorageManager sharedManager] setupDatabase];
[TextSecureKitEnv sharedEnv].notificationsManager = [[NotificationsManager alloc] init];
self.readReceiptObserver =
[[OWSReadReceiptObserver alloc] initWithMessagesManager:[TSMessagesManager sharedManager]];
self.readReceiptObserver = [OWSReadReceiptObserver new];
[self.readReceiptObserver startObserving];
self.staleNotificationObserver = [OWSStaleNotificationObserver new];
[self.staleNotificationObserver startObserving];
}
- (void)application:(UIApplication *)application
didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
DDLogDebug(@"%@ Successfully registered for remote notifications with token: %@", self.tag, deviceToken);
[PushManager.sharedManager.pushNotificationFutureSource trySetResult:deviceToken];
}
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error {
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
{
DDLogError(@"%@ Failed to register for remote notifications with error %@", self.tag, error);
#ifdef DEBUG
DDLogWarn(@"We're in debug mode, and registered a fake push identifier");
[PushManager.sharedManager.pushNotificationFutureSource trySetResult:@"aFakePushIdentifier"];
DDLogWarn(@"%@ We're in debug mode. Faking success for remote registration with a fake push identifier", self.tag);
[PushManager.sharedManager.pushNotificationFutureSource trySetResult:[NSData dataWithLength:32]];
#else
[PushManager.sharedManager.pushNotificationFutureSource trySetFailure:error];
#endif
@ -352,4 +359,14 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
return NO;
}
+ (NSString *)tag
{
return [NSString stringWithFormat:@"[%@]", self.class];
}
- (NSString *)tag
{
return self.class.tag;
}
@end

@ -0,0 +1,15 @@
// Created by Michael Kirk on 9/14/16.
// Copyright © 2016 Open Whisper Systems. All rights reserved.
NS_ASSUME_NONNULL_BEGIN
@class PushManager;
@interface OWSStaleNotificationObserver : NSObject
- (instancetype)initWithPushManager:(PushManager *)pushManager NS_DESIGNATED_INITIALIZER;
- (void)startObserving;
@end
NS_ASSUME_NONNULL_END

@ -0,0 +1,71 @@
// Created by Michael Kirk on 9/14/16.
// Copyright © 2016 Open Whisper Systems. All rights reserved.
#import "OWSStaleNotificationObserver.h"
#import "PushManager.h"
#import <SignalServiceKit/OWSReadReceiptsProcessor.h>
#import <SignalServiceKit/TSIncomingMessage.h>
NS_ASSUME_NONNULL_BEGIN
@interface OWSStaleNotificationObserver ()
@property (nonatomic, readonly) PushManager *pushManager;
@end
@implementation OWSStaleNotificationObserver
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
- (instancetype)init
{
return [self initWithPushManager:[PushManager sharedManager]];
}
- (instancetype)initWithPushManager:(PushManager *)pushManager
{
self = [super init];
if (!self) {
return self;
}
_pushManager = pushManager;
return self;
}
- (void)startObserving
{
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleMessageRead:)
name:OWSReadReceiptsProcessorMarkedMessageAsReadNotification
object:nil];
}
- (void)handleMessageRead:(NSNotification *)notification
{
if ([notification.object isKindOfClass:[TSIncomingMessage class]]) {
TSIncomingMessage *message = (TSIncomingMessage *)notification.object;
DDLogDebug(@"%@ canceled notification for message:%@", self.tag, message);
[self.pushManager cancelNotificationsWithThreadId:message.uniqueThreadId];
}
}
+ (NSString *)tag
{
return [NSString stringWithFormat:@"[%@]", self.class];
}
- (NSString *)tag
{
return self.class.tag;
}
@end
NS_ASSUME_NONNULL_END

@ -1503,19 +1503,20 @@ A0 09 9A FF A8 8A 09 99</string>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Network Status" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uNq-FV-lwt">
<rect key="frame" x="15" y="12" width="200" height="20"/>
<rect key="frame" x="15" y="0.0" width="200" height="44"/>
<constraints>
<constraint firstAttribute="height" constant="44" id="nOw-0c-lAd"/>
<constraint firstAttribute="width" constant="200" id="q6L-Sa-lrA"/>
</constraints>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Connected" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsLetterSpacingToFitWidth="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tg3-dQ-odw">
<rect key="frame" x="105" y="11" width="200" height="21"/>
<rect key="frame" x="205" y="-1" width="100" height="45"/>
<constraints>
<constraint firstAttribute="width" constant="200" id="Lw2-Fv-sOC"/>
<constraint firstAttribute="height" constant="21" id="uvH-QZ-iUw"/>
<constraint firstAttribute="width" constant="100" id="Lw2-Fv-sOC"/>
<constraint firstAttribute="height" constant="44" id="uvH-QZ-iUw"/>
</constraints>
<fontDescription key="fontDescription" style="UICTFontTextStyleCallout"/>
<color key="textColor" red="0.5725490196078431" green="1" blue="0.54117647058823526" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@ -1523,7 +1524,7 @@ A0 09 9A FF A8 8A 09 99</string>
</label>
</subviews>
<constraints>
<constraint firstItem="tg3-dQ-odw" firstAttribute="top" secondItem="hqv-P5-du9" secondAttribute="topMargin" constant="3" id="C7U-ve-FJA"/>
<constraint firstItem="tg3-dQ-odw" firstAttribute="centerY" secondItem="hqv-P5-du9" secondAttribute="centerY" id="53z-bi-mXN"/>
<constraint firstItem="uNq-FV-lwt" firstAttribute="leading" secondItem="hqv-P5-du9" secondAttribute="leadingMargin" constant="7" id="ViZ-i6-VOo"/>
<constraint firstAttribute="centerY" secondItem="uNq-FV-lwt" secondAttribute="centerY" id="d7b-Jy-1gQ"/>
<constraint firstAttribute="trailingMargin" secondItem="tg3-dQ-odw" secondAttribute="trailing" constant="7" id="xHz-d7-B39"/>

@ -7,7 +7,7 @@
//
#import <CollapsingFutures.h>
#import <Foundation/Foundation.h>
#import <PushKit/PushKit.h>
#define Signal_Thread_UserInfo_Key @"Signal_Thread_Id"
#define Signal_Message_UserInfo_Key @"Signal_Message_Id"
@ -33,7 +33,7 @@ typedef void (^pushTokensSuccessBlock)(NSString *pushToken, NSString *voipToken)
* The Push Manager is responsible for registering the device for Signal push notifications.
*/
@interface PushManager : NSObject
@interface PushManager : NSObject <PKPushRegistryDelegate>
+ (PushManager *)sharedManager;
@ -65,6 +65,7 @@ typedef void (^pushTokensSuccessBlock)(NSString *pushToken, NSString *voipToken)
- (BOOL)supportsVOIPPush;
- (UILocalNotification *)closeVOIPBackgroundTask;
- (void)presentNotification:(UILocalNotification *)notification;
- (void)cancelNotificationsWithThreadId:(NSString *)threadId;
#pragma mark Push Notifications Delegate Methods

@ -6,8 +6,6 @@
// Copyright (c) 2014 Open Whisper Systems. All rights reserved.
//
#import <PushKit/PushKit.h>
#import "AppDelegate.h"
#import "OWSContactsManager.h"
#import "InCallViewController.h"
@ -22,7 +20,7 @@
#define pushManagerDomain @"org.whispersystems.pushmanager"
@interface PushManager () <PKPushRegistryDelegate>
@interface PushManager ()
@property TOCFutureSource *registerWithServerFutureSource;
@property UIAlertView *missingPermissionsAlertView;
@ -298,7 +296,8 @@
- (void)requestPushTokenWithSuccess:(pushTokensSuccessBlock)success failure:(failedPushRegistrationBlock)failure {
if (!self.wantRemoteNotifications) {
success(@"FakeToken", @"FakePushToken");
DDLogWarn(@"%@ Using fake push tokens", self.tag);
success(@"fakePushToken", @"fakeVoipToken");
return;
}
@ -451,4 +450,14 @@
[self.currentNotifications removeObjectsInArray:toDelete];
}
+ (NSString *)tag
{
return [NSString stringWithFormat:@"[%@]", self.class];
}
- (NSString *)tag
{
return self.class.tag;
}
@end

@ -0,0 +1,27 @@
#!/usr/bin/env bash
set -x
function usage() {
cat <<EOS
Extracts string from target file to new.strings
$0 <filename.m>
e.g.
$0 path/to/my/ClassName.m
EOS
}
TARGET=$1
if [[ -z $TARGET ]]
then
echo "Can't proceed without target"
usage
exit 1
fi
OUTPUT_DIR=new_strings
mkdir -p "${OUTPUT_DIR}"
genstrings -o "${OUTPUT_DIR}" "${TARGET}"
Loading…
Cancel
Save