Skip to content

Commit

Permalink
Merge branch 'release/1.0.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
Foboz committed Jan 22, 2019
2 parents 3f5d261 + 82574dd commit 927e016
Show file tree
Hide file tree
Showing 52 changed files with 235 additions and 146 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
### Release 1.0.6

- Smooth screen transition animations
- Reduced app loading time
- Other minor improvements

### Release 1.0.5

- Improved connection for some mobile operators.
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.5
APPLICATION_BUILD=19011002
APPLICATION_VERSION=1.0.6
APPLICATION_BUILD=19012102
6 changes: 6 additions & 0 deletions MyEtherWallet-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@
563CF30220EFAD8A005467AE /* BuyEtherHistoryEmptyTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 563CF30020EFAD8A005467AE /* BuyEtherHistoryEmptyTableViewCell.xib */; };
563CF30620EFAF26005467AE /* BuyEtherHistoryCellObjectBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = 563CF30520EFAF26005467AE /* BuyEtherHistoryCellObjectBuilder.m */; };
563CF30A20EFB235005467AE /* BuyEtherHistoryTableViewAnimator.m in Sources */ = {isa = PBXBuildFile; fileRef = 563CF30920EFB235005467AE /* BuyEtherHistoryTableViewAnimator.m */; };
563D081521F680C80055A963 /* TokensResponseValidator.m in Sources */ = {isa = PBXBuildFile; fileRef = 5645258A2164C63A004D23C4 /* TokensResponseValidator.m */; };
563D081621F680D50055A963 /* RateServiceImplementation.m in Sources */ = {isa = PBXBuildFile; fileRef = 56191EAD215052FD000BF97F /* RateServiceImplementation.m */; };
563D081721F680F20055A963 /* MEWconnectServiceStateMachine.m in Sources */ = {isa = PBXBuildFile; fileRef = 56F3EF662163F95E00C40804 /* MEWconnectServiceStateMachine.m */; };
563DF37E20986B7200F740FF /* UIColor+Hex.m in Sources */ = {isa = PBXBuildFile; fileRef = 563DF37D20986B7200F740FF /* UIColor+Hex.m */; };
563DF38120986B7900F740FF /* UIImage+Color.m in Sources */ = {isa = PBXBuildFile; fileRef = 563DF38020986B7900F740FF /* UIImage+Color.m */; };
563DF38520986F8500F740FF /* PasswordTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = 563DF38420986F8500F740FF /* PasswordTextField.m */; };
Expand Down Expand Up @@ -10250,6 +10253,7 @@
56E3E57721016DB60014152D /* HomeInteractor.m in Sources */,
56E3E57821016DB60014152D /* HomeRouter.m in Sources */,
56E3E57921016DB60014152D /* MEWMappingProvider.m in Sources */,
563D081521F680C80055A963 /* TokensResponseValidator.m in Sources */,
56E3E57A21016DB60014152D /* SimplexBodyTransformer.m in Sources */,
56E3E57B21016DB60014152D /* QRScannerAssembly.m in Sources */,
56E3E57C21016DB60014152D /* QRScannerViewController.m in Sources */,
Expand Down Expand Up @@ -10320,6 +10324,7 @@
56E3E5B721016DB60014152D /* InfoEmptyTableViewCellObject.m in Sources */,
56E3E5B821016DB60014152D /* PonsomizerImplementation.m in Sources */,
56E3E5B921016DB60014152D /* Web3Wrapper.swift in Sources */,
563D081721F680F20055A963 /* MEWconnectServiceStateMachine.m in Sources */,
5691625E2194B85300A58480 /* MnemonicsValidatorImplementation.m in Sources */,
56E3E5BA21016DB60014152D /* NSString+MEWTokens.m in Sources */,
56E3E5BB21016DB60014152D /* UIColor+HSL.swift in Sources */,
Expand Down Expand Up @@ -10380,6 +10385,7 @@
56E3E5ED21016DB60014152D /* SimplexOperationFactory.m in Sources */,
56E3E5EE21016DB60014152D /* InfoCellObjectBuilder.m in Sources */,
5677C58D2181226500477ACD /* _NetworkModelObject.m in Sources */,
563D081621F680D50055A963 /* RateServiceImplementation.m in Sources */,
56F8EAA32183B7F90010274B /* MappingModel_v_1_to_2.xcmappingmodel in Sources */,
56E3E5EF21016DB60014152D /* AccessoryTableViewAction.m in Sources */,
56E3E5F021016DB60014152D /* BackupInfoRouter.m in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
#import "ApplicationConfigurator.h"

@protocol KeychainService;
@protocol RateService;

@interface ApplicationConfiguratorImplementation : NSObject <ApplicationConfigurator>
@property (nonatomic, strong) id <KeychainService> keychainService;
@property (nonatomic, strong) id <RateService> rateService;
@end
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#import "BackupConfirmationSegmentedControl.h"

#import "KeychainService.h"
#import "RateService.h"

#import "ApplicationConfiguratorImplementation.h"

Expand All @@ -35,6 +36,8 @@ @implementation ApplicationConfiguratorImplementation

- (void)configureInitialSettings {
[self.keychainService saveFirstLaunchDate];
[self.rateService checkForUpdate];
[self.rateService applicationLaunched];
}

- (void)configurateAppearance {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ - (SecurityAppDelegate *) securityAppDelegate {
configuration:^(TyphoonDefinition *definition) {
[definition injectProperty:@selector(keychainService)
with:[self.serviceComponents keychainService]];
[definition injectProperty:@selector(rateService)
with:[self.serviceComponents rateService]];
}];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,15 @@ - (void)openInitialScreen {
[[navigationController.topViewController openModuleUsingFactory:self.splashPasswordFactory
withTransitionBlock:[self passwordTransitionBlockWithCompletion:^{
[self _animateSplash:launchViewController parentView:navigationController.topViewController.presentedViewController.presentationController.containerView withCompletion:^{
[launchViewController.view removeFromSuperview];
[passwordModuleInput takeControlAfterLaunch];
}];
}]] thenChainUsingBlock:linkBlock];
});
});
} else {
[self _animateSplash:launchViewController parentView:self.window.rootViewController.view withCompletion:^{
[launchViewController.view removeFromSuperview];
}];
}
}
Expand All @@ -111,11 +113,13 @@ - (RamblerViperModuleLinkBlock) passwordConfigurationBlockWithAccount:(AccountPl

- (void) _animateSplash:(UIViewController *)launchViewController parentView:(UIView *)parentView withCompletion:(void(^)(void))completion {
UIImageView *logoImageView = (UIImageView *)[launchViewController.view viewWithTag:kSplashPasswordLogoImageViewTag];
UIViewPropertyAnimator *animator = [self.propertyAnimatorsFactory mewQuatroPropertyAnimatorWithDuration:@0.9];

NSLayoutConstraint *widthConstraint = [logoImageView.widthAnchor constraintEqualToConstant:logoImageView.image.size.width];
CGFloat originalImageWidth = logoImageView.image.size.width;
NSLayoutConstraint *widthConstraint = [logoImageView.widthAnchor constraintEqualToConstant:originalImageWidth];
widthConstraint.active = YES;
[launchViewController.view layoutIfNeeded];
UIViewPropertyAnimator *animator = [self.propertyAnimatorsFactory mewQuatroPropertyAnimatorWithDuration:@1.1];

[logoImageView setImage:[UIImage imageNamed:@"mew_logo_scaled"]];

CGFloat firstPartAnimationDuration = 1.0/3.0;

Expand All @@ -128,15 +132,15 @@ - (void) _animateSplash:(UIViewController *)launchViewController parentView:(UIV
relativeDuration:firstPartAnimationDuration
animations:^{
parentView.transform = CGAffineTransformMakeScale(1.1, 1.1);
widthConstraint.constant = 0.9 * logoImageView.image.size.width;
widthConstraint.constant = 0.9 * originalImageWidth;
[launchViewController.view layoutIfNeeded];
}];
[UIView addKeyframeWithRelativeStartTime:firstPartAnimationDuration
relativeDuration:1.0 - firstPartAnimationDuration
animations:^{
parentView.transform = CGAffineTransformIdentity;
launchViewController.view.alpha = 0.0;
widthConstraint.constant = 16.0 * logoImageView.image.size.width;
widthConstraint.constant = 16.0 * originalImageWidth;
[launchViewController.view layoutIfNeeded];
}];
} completion:^(__unused BOOL finished) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ - (ModuleTransitionBlock) homeTransitionBlock {

- (RamblerViperModuleLinkBlock) homeConfigurationBlock {
return ^id<RamblerViperModuleOutput>(id<HomeModuleInput> moduleInput) {
[moduleInput configureModule];
[moduleInput configureModuleForNewWallet:NO];
return nil;
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ NS_ASSUME_NONNULL_BEGIN
Obtain rate status
*/
- (BOOL) obtainRateStatus;
/**
Reset rate status
*/
- (void) resetRateStatus;
@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ - (void) removeDataOfAccount:(AccountPlainObject *)account {

- (void) resetKeychain {
NSArray <NSString *> *keys = [self.keychainStore allKeys];
NSArray *ignoringKeys = @[kKeychainServiceRateAskedField, /*kKeychainServiceVersionField,*/ kKeychainServiceFirstLaunchField];
NSArray *ignoringKeys = @[kKeychainServiceRateAskedField, kKeychainServiceVersionField, kKeychainServiceFirstLaunchField];
for (NSString *key in keys) {
if (![ignoringKeys containsObject:key]) {
[self _removeItemWithKey:key];
Expand Down Expand Up @@ -186,6 +186,10 @@ - (BOOL) obtainRateStatus {
return [self.keychainStore stringForKey:kKeychainServiceRateAskedField] != nil;
}

- (void) resetRateStatus {
[self.keychainStore removeItemForKey:kKeychainServiceRateAskedField];
}

#pragma mark - Protected

#pragma mark - KeychainServiceProtected
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,8 @@ class Web3Wrapper: NSObject {
guard let seed = BIP39.seedFromMmemonics(mnemonics) else { return nil }

let prefixPath = KeySettings.derivationPath(network)
NSLog("1")
guard let bip32Keystore = try? BIP32Keystore(seed: seed, password: password, prefixPath: prefixPath), bip32Keystore != nil else { return nil }
NSLog("2")
guard let keydata = try? JSONEncoder().encode(bip32Keystore!.keystoreParams) else { return nil }
NSLog("3")
guard let encryptedKeydata = self.MEWcrypto?.encryptData(keydata, withPassword: password) else { return nil }

guard let keyAccount = bip32Keystore?.addresses?.first else { return nil }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
NS_ASSUME_NONNULL_BEGIN

@protocol RateService <NSObject>
- (void) transactionSigned;
- (void) checkForUpdate;
- (void) balanceUpdated;
- (void) applicationLaunched;
- (void) clearCount;
- (void) requestReviewIfNeeded;
@end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,54 @@
#import "RateServiceImplementation.h"
#import "KeychainService.h"

static NSString *const kRateServiceImplementationCountKey = @"group.myetherwallet.userdefaults.signedcount";
static NSInteger const kRateServiceImplementationNumberOfTransactionsForReview = 2;
static NSString *const kRateServiceImplementationRaterVersion = @"group.myetherwallet.userdefaults.raterversion";
static NSString *const kRateServiceImplementationLaunchCount = @"group.myetherwallet.userdefaults.launchcount";
static NSString *const kRateServiceImplementationBalanceUpdateCount = @"group.myetherwallet.userdefaults.balanceupdate";

static NSInteger const kRateServiceImplementationNumberOfLaunchCount = 5;
static NSInteger const kRateServiceImplementationNumberOfBalanceUpdate = 10;
static NSInteger const kRateServiceImplementationCurrentRaterVersion = 2;

@implementation RateServiceImplementation

- (void) transactionSigned {
NSInteger count = [self.userDefaults integerForKey:kRateServiceImplementationCountKey];
- (void) checkForUpdate {
NSInteger version = [self.userDefaults integerForKey:kRateServiceImplementationRaterVersion];
if (version != kRateServiceImplementationCurrentRaterVersion) {
[self clearCount];
[self.keychainService resetRateStatus];
[self.userDefaults setInteger:kRateServiceImplementationCurrentRaterVersion forKey:kRateServiceImplementationRaterVersion];
[self.userDefaults synchronize];
}
}

- (void) balanceUpdated {
NSInteger count = [self.userDefaults integerForKey:kRateServiceImplementationBalanceUpdateCount];
++count;
[self.userDefaults setInteger:count forKey:kRateServiceImplementationBalanceUpdateCount];
[self.userDefaults synchronize];
}

- (void) applicationLaunched {
NSInteger count = [self.userDefaults integerForKey:kRateServiceImplementationLaunchCount];
++count;
[self.userDefaults setInteger:count forKey:kRateServiceImplementationCountKey];
[self.userDefaults setInteger:count forKey:kRateServiceImplementationLaunchCount];
[self.userDefaults synchronize];
}

- (void) clearCount {
[self.userDefaults removeObjectForKey:kRateServiceImplementationCountKey];
[self.userDefaults removeObjectForKey:kRateServiceImplementationLaunchCount];
[self.userDefaults removeObjectForKey:kRateServiceImplementationBalanceUpdateCount];
[self.userDefaults synchronize];
}

- (void) requestReviewIfNeeded {
NSInteger count = [self.userDefaults integerForKey:kRateServiceImplementationCountKey];
if (count >= kRateServiceImplementationNumberOfTransactionsForReview && ![self.keychainService obtainRateStatus]) {
NSInteger launchCount = [self.userDefaults integerForKey:kRateServiceImplementationLaunchCount];
NSInteger updateCount = [self.userDefaults integerForKey:kRateServiceImplementationBalanceUpdateCount];

if (launchCount >= kRateServiceImplementationNumberOfLaunchCount
&& updateCount >= kRateServiceImplementationNumberOfBalanceUpdate
&& ![self.keychainService obtainRateStatus]) {

dispatch_async(dispatch_get_main_queue(), ^{
if (@available(iOS 10.3, *)) {
[SKStoreReviewController requestReview];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#endif

static NSString *const TokensABI = @"[{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"name\",\"type\":\"bool\"},{\"name\":\"website\",\"type\":\"bool\"},{\"name\":\"email\",\"type\":\"bool\"},{\"name\":\"count\",\"type\":\"uint256\"}],\"name\":\"getAllBalance\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}]";
static NSString *const MainnetTokensContractAddress = @"0xdAFf2b3BdC710EB33A847CCb30A24789c0Ef9c5b";
static NSString *const MainnetTokensContractAddress = @"0x2783c0a4bfd3721961653a9e9939fc63687bf07f";
static NSString *const RopstenTokensContractAddress = @"0xb8e1bbc50fd87ea00d8ce73747ac6f516af26dac";

@implementation TokensServiceImplementation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,37 @@ - (UIPresentationController *)controllerForPresentationType:(NSNumber *)type
presentedViewController:(UIViewController *)presented
presentingViewController:(UIViewController *)presenting
sourceViewController:(UIViewController *)source
cornerRadius:(NSNumber *)cornerRadius {
cornerRadius:(NSNumber *)cornerRadius
dimmed:(NSNumber *)dimmed {
return [TyphoonDefinition withOption:type matcher:^(TyphoonOptionMatcher *matcher) {
[matcher caseEqual:@(PresentationControllerBottomModalType)
use:[self bottomModalControllerForPresented:presented
presenting:presenting
source:source
cornerRadius:cornerRadius]];
cornerRadius:cornerRadius
dimmed:dimmed]];
[matcher caseEqual:@(PresentationControllerBottomBackgroundedModalType)
use:[self bottomBackgroundedModalControllerForPresented:presented
presenting:presenting
source:source
cornerRadiur:cornerRadius]];
cornerRadius:cornerRadius
dimmed:dimmed]];
}];
}

- (UIPresentationController *) bottomModalControllerForPresented:(UIViewController *)presented presenting:(UIViewController *)presenting source:(__unused UIViewController *)source cornerRadius:(NSNumber *)cornerRadius {
- (UIPresentationController *) bottomModalControllerForPresented:(UIViewController *)presented presenting:(UIViewController *)presenting source:(__unused UIViewController *)source cornerRadius:(NSNumber *)cornerRadius dimmed:(NSNumber *)dimmed {
return [TyphoonDefinition withClass:[BottomModalPresentationController class]
configuration:^(TyphoonDefinition *definition) {
[definition useInitializer:@selector(initWithPresentedViewController:presentingViewController:) parameters:^(TyphoonMethod *initializer) {
[initializer injectParameterWith:presented];
[initializer injectParameterWith:presenting];
}];
[definition injectProperty:@selector(cornerRadius)
with:cornerRadius];
[definition injectProperty:@selector(cornerRadius) with:cornerRadius];
[definition injectProperty:@selector(dimmed) with:dimmed];
}];
}

- (UIPresentationController *) bottomBackgroundedModalControllerForPresented:(UIViewController *)presented presenting:(UIViewController *)presenting source:(__unused UIViewController *)source cornerRadiur:(NSNumber *)cornerRadius {
- (UIPresentationController *) bottomBackgroundedModalControllerForPresented:(UIViewController *)presented presenting:(UIViewController *)presenting source:(__unused UIViewController *)source cornerRadius:(NSNumber *)cornerRadius dimmed:(NSNumber *)dimmed {
return [TyphoonDefinition withClass:[BottomBackgroundedModalPresentationController class]
configuration:^(TyphoonDefinition *definition) {
[definition useInitializer:@selector(initWithPresentedViewController:presentingViewController:) parameters:^(TyphoonMethod *initializer) {
Expand All @@ -57,6 +60,7 @@ - (UIPresentationController *) bottomBackgroundedModalControllerForPresented:(UI
[definition injectProperty:@selector(networkService) with:[self.serviceComponents blockchainNetworkService]];
[definition injectProperty:@selector(ponsomizer) with:[self.ponsomizerAssembly ponsomizer]];
[definition injectProperty:@selector(cornerRadius) with:cornerRadius];
[definition injectProperty:@selector(dimmed) with:dimmed];
}];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
presentedViewController:(UIViewController *)presented
presentingViewController:(UIViewController *)presenting
sourceViewController:(UIViewController *)source
cornerRadius:(NSNumber *)cornerRadius;
cornerRadius:(NSNumber *)cornerRadius
dimmed:(NSNumber *)dimmed;
@end
Loading

0 comments on commit 927e016

Please sign in to comment.