Skip to content

Commit

Permalink
Merge branch 'release/1.0.12'
Browse files Browse the repository at this point in the history
  • Loading branch information
Foboz committed Jul 25, 2019
2 parents 58df32e + ea448e1 commit 1d482ef
Show file tree
Hide file tree
Showing 14 changed files with 46 additions and 107 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### Release 1.0.12
- Bugfixes

### Release 1.0.11

- Fixed rare issue that prevented some users from logging into the app
Expand Down
4 changes: 2 additions & 2 deletions Configurations/application.xcconfig
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
APPLICATION_VERSION=1.0.11
APPLICATION_BUILD=19042403
APPLICATION_VERSION=1.0.12
APPLICATION_BUILD=19050102
14 changes: 7 additions & 7 deletions MyEtherWallet-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10377,7 +10377,7 @@
56FE2B6520817F1100DB39D5 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1010;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = "MyEtherWallet, Inc.";
TargetAttributes = {
56E3E4E921016DB60014152D = {
Expand Down Expand Up @@ -12049,7 +12049,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "MyEtherWallet-iOS/MyEtherWallet-iOS-Bridging-Header.h";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = 1;
};
name = AppStore;
Expand Down Expand Up @@ -12119,7 +12119,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "MyEtherWallet-iOS/MyEtherWallet-iOS-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = 1;
};
name = Debug;
Expand Down Expand Up @@ -12147,7 +12147,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "MyEtherWallet-iOS/MyEtherWallet-iOS-Bridging-Header.h";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = 1;
};
name = Release;
Expand Down Expand Up @@ -12175,7 +12175,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "MyEtherWallet-iOS/MyEtherWallet-iOS-Bridging-Header.h";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = 1;
};
name = AppStore;
Expand Down Expand Up @@ -12339,7 +12339,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "MyEtherWallet-iOS/MyEtherWallet-iOS-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = 1;
};
name = Debug;
Expand Down Expand Up @@ -12369,7 +12369,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "MyEtherWallet-iOS/MyEtherWallet-iOS-Bridging-Header.h";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = 1;
};
name = Release;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,26 @@

#import "CoreDataConfiguratorImplementation.h"

static NSString *const kCoreDataConfiguratorStructureValidation = @"com.myetherwallet.coredata.validation";
static NSString *const kCoreDataConfiguratorReset1012 = @"com.myetherwallet.coredata.reset_1012";

@implementation CoreDataConfiguratorImplementation

#pragma mark - Public

- (void) setupCoreDataStack {
if (![self.userDefaults boolForKey:kCoreDataConfiguratorReset1012]) {
NSURL *storeURL = [self _storeURL];
if ([self.fileManager fileExistsAtPath:[storeURL path]]) {
[self.fileManager removeItemAtURL:storeURL error:nil];
}
[self.userDefaults setBool:YES forKey:kCoreDataConfiguratorReset1012];
[self.userDefaults synchronize];
}

if ([self shouldMigrateCoreData]) {
[self migrateStore];
} else {
NSURL *directory = [self.fileManager containerURLForSecurityApplicationGroupIdentifier:kAppGroupIdentifier];
NSURL *storeURL = [directory URLByAppendingPathComponent:kCoreDataName];
NSURL *storeURL = [self _storeURL];
[MagicalRecord setupCoreDataStackWithAutoMigratingSqliteStoreAtURL:storeURL];
NSError *error = nil;
if (![storeURL setResourceValue:@YES forKey:NSURLIsExcludedFromBackupKey error:&error]) {
Expand Down Expand Up @@ -76,81 +84,6 @@ - (void)migrateStore {

- (void) _restoreCoreDataStructure {
NSManagedObjectContext *rootSavingContext = [NSManagedObjectContext MR_rootSavingContext];

// Check structure

if (![self.userDefaults boolForKey:kCoreDataConfiguratorStructureValidation]) {
[rootSavingContext performBlockAndWait:^{
NSArray <AccountModelObject *> *accountModels = [AccountModelObject MR_findAllInContext:rootSavingContext];
NSArray <KeychainAccountModel *> *storedItems = [self.keychainService obtainStoredItems];

void(^ClearCoreData)(NSManagedObjectContext *) = ^(NSManagedObjectContext *context) {
NSArray <TokenModelObject *> *tokens = [TokenModelObject MR_findAllInContext:context];
NSArray <AccountModelObject *> *accountModels = [AccountModelObject MR_findAllInContext:context];
[context MR_deleteObjects:tokens];
[context MR_deleteObjects:accountModels];
if ([context hasChanges]) {
[context MR_saveToPersistentStoreAndWait];
}
};
if ([storedItems count] == 0) {
ClearCoreData(rootSavingContext);
return;
}

NSMutableSet *invalidAccounts = [[NSMutableSet alloc] initWithArray:accountModels];

for (KeychainAccountModel *keychainAccount in storedItems) {
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF.uid = %@", keychainAccount.uid];
NSArray <AccountModelObject *> *filteredAccountModels = [accountModels filteredArrayUsingPredicate:predicate];
if ([filteredAccountModels count] > 1) {
ClearCoreData(rootSavingContext);
return;
}
AccountModelObject *accountModelObject = [filteredAccountModels firstObject];
if (accountModelObject) {
[invalidAccounts removeObject:accountModelObject];

NSMutableSet *invalidNetworks = [accountModelObject.networks mutableCopy];

for (KeychainNetworkModel *keychainNetworkItem in keychainAccount.networks) {
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF.master.address = %@", keychainNetworkItem.address];
NSSet *networks = [accountModelObject.networks filteredSetUsingPredicate:predicate];
if ([networks count] != 1) {
ClearCoreData(rootSavingContext);
return;
}
[invalidNetworks minusSet:networks];
}

if ([invalidNetworks count] > 0) {
[rootSavingContext MR_deleteObjects:invalidNetworks];
}
}
}

if ([invalidAccounts count] > 0) {
[rootSavingContext MR_deleteObjects:invalidAccounts];
}

AccountModelObject *accountModelObject = [AccountModelObject MR_findFirstInContext:rootSavingContext];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF.chainID = %lld", BlockchainNetworkTypeEthereum];
NetworkModelObject *networkModelObject = [[accountModelObject.networks filteredSetUsingPredicate:predicate] anyObject];
if (!networkModelObject) {
networkModelObject = [accountModelObject.networks anyObject];
}

accountModelObject.active = @YES;
networkModelObject.active = @YES;

if ([rootSavingContext hasChanges]) {
[rootSavingContext MR_saveToPersistentStoreAndWait];
}
}];
[self.userDefaults setBool:YES forKey:kCoreDataConfiguratorStructureValidation];
[self.userDefaults synchronize];
}

// Restore structure if needed

[rootSavingContext performBlockAndWait:^{
Expand Down Expand Up @@ -226,4 +159,10 @@ - (void) _restoreCoreDataStructure {
}];
}

- (NSURL *) _storeURL {
NSURL *directory = [self.fileManager containerURLForSecurityApplicationGroupIdentifier:kAppGroupIdentifier];
NSURL *storeURL = [directory URLByAppendingPathComponent:kCoreDataName];
return storeURL;
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,6 @@ class CheckboxButton: UIButton {
//MARK: - Layout

override var intrinsicContentSize: CGSize {
return CGSize(width: UIView.noIntrinsicMetric, height: CheckboxButtonConstants.button.height)
return CGSize(width: UIViewNoIntrinsicMetric, height: CheckboxButtonConstants.button.height)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ - (void)animateTransition:(id <UIViewControllerContextTransitioning>)transitionC
[toViewController beginAppearanceTransition:YES animated:[self transitionDuration:transitionContext] > 0.0];

UIView *containerView = [transitionContext containerView];
UIView *dismissedViewSnapshot = [dismissedView snapshotViewAfterScreenUpdates:(dismissedView.window == nil)];
UIView *dismissedViewSnapshot = [dismissedView snapshotViewAfterScreenUpdates:NO];
[containerView addSubview:dismissedViewSnapshot];

CGRect frame = dismissedView.frame;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ - (void) animateTransition:(id <UIViewControllerContextTransitioning>)transition

[presentedView setNeedsLayout];
[presentedView layoutIfNeeded];
UIView *presentedViewSnapshot = [presentedView snapshotViewAfterScreenUpdates:YES];
UIView *presentedViewSnapshot = [presentedView snapshotViewAfterScreenUpdates:NO];
presentedView.hidden = YES;
[containerView addSubview:presentedViewSnapshot];
CGRect frame = presentedView.bounds;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ - (void) setupInitialState {

self.logoTopOffsetConstraint.constant = 24.0;
self.logoToTitleYOffsetConstraint.constant = 23.0;
}
if ([UIScreen mainScreen].screenSizeType == ScreenSizeTypeInches40) {

}
{ //Title label
NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init];
Expand Down Expand Up @@ -96,7 +93,7 @@ - (void) setupInitialState {
}
}

- (void) updateWithMessage:(MEWConnectMessage *)message {
- (void) updateWithMessage:(__unused MEWConnectMessage *)message {
}

#pragma mark - IBAction
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="dSU-dI-qOt">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="dSU-dI-qOt">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand Down Expand Up @@ -295,17 +295,17 @@ declined</string>
</connections>
</button>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="signmessage_logo" translatesAutoresizingMaskIntoConstraints="NO" id="S2m-As-ExC">
<rect key="frame" x="24" y="64" width="104" height="111"/>
<rect key="frame" x="32" y="60" width="16" height="16"/>
<color key="tintColor" red="0.023529411760000001" green="0.30196078430000001" blue="0.83921568629999999" alpha="1" colorSpace="deviceRGB"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Sign message" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nl7-IL-2Qw">
<rect key="frame" x="24" y="195" width="327" height="48"/>
<rect key="frame" x="32" y="96" width="311" height="48"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="40"/>
<color key="textColor" red="0.023529411760000001" green="0.30196078430000001" blue="0.83921568629999999" alpha="1" colorSpace="deviceRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5p2-Xe-moj">
<rect key="frame" x="24" y="255" width="327" height="81.5"/>
<rect key="frame" x="32" y="156" width="311" height="81.5"/>
<string key="text">Please remember to include your nickname and a specific reason for the message, so someone else cannot re-use it for a different purpose.</string>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
Expand All @@ -314,20 +314,20 @@ declined</string>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="S2m-As-ExC" firstAttribute="top" secondItem="jpP-E4-W78" secondAttribute="top" constant="64" id="1b2-I9-P0z"/>
<constraint firstItem="S2m-As-ExC" firstAttribute="top" secondItem="jpP-E4-W78" secondAttribute="top" constant="60" id="1b2-I9-P0z"/>
<constraint firstItem="ZGL-KX-pIb" firstAttribute="left" secondItem="U2W-Qh-rvb" secondAttribute="left" constant="24" id="IMP-uL-PUS"/>
<constraint firstItem="nl7-IL-2Qw" firstAttribute="left" secondItem="S2m-As-ExC" secondAttribute="left" id="KFN-kh-U8S"/>
<constraint firstItem="U2W-Qh-rvb" firstAttribute="right" secondItem="7rv-hF-bz6" secondAttribute="right" constant="24" id="M4L-g9-t4T"/>
<constraint firstItem="nl7-IL-2Qw" firstAttribute="top" secondItem="S2m-As-ExC" secondAttribute="bottom" constant="20" id="OOz-fx-OoI"/>
<constraint firstItem="5p2-Xe-moj" firstAttribute="right" secondItem="nl7-IL-2Qw" secondAttribute="right" id="R9P-xK-kOX"/>
<constraint firstItem="U2W-Qh-rvb" firstAttribute="bottom" secondItem="ZGL-KX-pIb" secondAttribute="bottom" constant="24" id="RDW-df-Dre"/>
<constraint firstItem="nl7-IL-2Qw" firstAttribute="leading" secondItem="U2W-Qh-rvb" secondAttribute="leading" constant="24" id="cN3-LH-12m"/>
<constraint firstItem="nl7-IL-2Qw" firstAttribute="leading" secondItem="U2W-Qh-rvb" secondAttribute="leading" constant="32" id="cN3-LH-12m"/>
<constraint firstItem="7rv-hF-bz6" firstAttribute="width" secondItem="ZGL-KX-pIb" secondAttribute="width" constant="40" id="e7E-Vf-zP3"/>
<constraint firstItem="5p2-Xe-moj" firstAttribute="left" secondItem="nl7-IL-2Qw" secondAttribute="left" id="ihr-MH-kz7"/>
<constraint firstItem="7rv-hF-bz6" firstAttribute="left" secondItem="ZGL-KX-pIb" secondAttribute="right" constant="15" id="lFZ-gn-Xn5"/>
<constraint firstItem="7rv-hF-bz6" firstAttribute="bottom" secondItem="ZGL-KX-pIb" secondAttribute="bottom" id="t2P-Fi-84n"/>
<constraint firstItem="5p2-Xe-moj" firstAttribute="top" secondItem="nl7-IL-2Qw" secondAttribute="bottom" constant="12" id="tgB-PF-Zsj"/>
<constraint firstItem="U2W-Qh-rvb" firstAttribute="trailing" secondItem="nl7-IL-2Qw" secondAttribute="trailing" constant="24" id="xsc-CY-JON"/>
<constraint firstItem="U2W-Qh-rvb" firstAttribute="trailing" secondItem="nl7-IL-2Qw" secondAttribute="trailing" constant="32" id="xsc-CY-JON"/>
</constraints>
<viewLayoutGuide key="safeArea" id="U2W-Qh-rvb"/>
</view>
Expand Down Expand Up @@ -429,7 +429,7 @@ declined</string>
</scene>
</scenes>
<resources>
<image name="signmessage_logo" width="104" height="111"/>
<image name="signmessage_logo" width="104" height="107"/>
</resources>
<inferredMetricsTieBreakers>
<segue reference="yXB-lP-loE"/>
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ abstract_target 'MEWconnect' do

# Ethereum
pod 'web3swift', :git => 'https://github.com/Foboz/web3swift.git', :branch => 'v200_mew'
pod 'GoogleWebRTC'
pod 'GoogleWebRTC', '=1.1.26675'

# Cryptographic
pod 'TrezorCrypto'#, :git => 'https://github.com/Foboz/trezor-crypto-ios.git'
Expand Down

0 comments on commit 1d482ef

Please sign in to comment.