Skip to content

Commit ede4a5c

Browse files
committed
Using cocoapods-keys for Key handling
1 parent c312d68 commit ede4a5c

10 files changed

Lines changed: 10045 additions & 10042 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ DerivedData
1616
.idea/
1717
*.hmap
1818
*.xccheckout
19-
InfoPlist.h
19+
InfoPlist.h
20+
Pods/Keys

BitStore.xcodeproj/project.pbxproj

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
9A073F3F1996EDCD007E0D0F /* Order.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A073F3E1996EDCD007E0D0F /* Order.m */; };
3030
9A073F421996F044007E0D0F /* PhoneInputViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A073F411996F044007E0D0F /* PhoneInputViewController.m */; };
3131
9A073F4819978042007E0D0F /* PhoneVerificationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A073F4719978042007E0D0F /* PhoneVerificationViewController.m */; };
32-
9A19022D19A0FAD7008D928B /* Keys.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A19022C19A0FAD7008D928B /* Keys.m */; };
3332
9A1DAEC4197BD95300BB9DF7 /* PushHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A1DAEC3197BD95300BB9DF7 /* PushHelper.m */; };
3433
9A1DAEC8197C2C1C00BB9DF7 /* Unit.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A1DAEC7197C2C1C00BB9DF7 /* Unit.m */; };
3534
9A1DAECB197C305400BB9DF7 /* ChangeUnitViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A1DAECA197C305400BB9DF7 /* ChangeUnitViewController.m */; };
@@ -88,7 +87,6 @@
8887
9A97A0C319D05BBF0023C9AD /* libicucore.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A97A0C219D05BBF0023C9AD /* libicucore.dylib */; };
8988
9A97A0C519D05C820023C9AD /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A97A0C419D05C820023C9AD /* CFNetwork.framework */; };
9089
9A9D587D19D0D0AF00EA940A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9A9D587C19D0D0AF00EA940A /* Images.xcassets */; };
91-
9A9D588019D1F63200EA940A /* Keys.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A19022C19A0FAD7008D928B /* Keys.m */; };
9290
9A9D588319D1F73800EA940A /* SharedUser.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A9D588219D1F73800EA940A /* SharedUser.m */; };
9391
9A9D588419D1F8F200EA940A /* SharedUser.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A9D588219D1F73800EA940A /* SharedUser.m */; };
9492
9A9D588819D484C900EA940A /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 9A9D588A19D484C900EA940A /* Localizable.strings */; };
@@ -197,8 +195,6 @@
197195
9A073F411996F044007E0D0F /* PhoneInputViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PhoneInputViewController.m; sourceTree = "<group>"; };
198196
9A073F4619978042007E0D0F /* PhoneVerificationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PhoneVerificationViewController.h; sourceTree = "<group>"; };
199197
9A073F4719978042007E0D0F /* PhoneVerificationViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PhoneVerificationViewController.m; sourceTree = "<group>"; };
200-
9A19022B19A0FAD7008D928B /* Keys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Keys.h; sourceTree = "<group>"; };
201-
9A19022C19A0FAD7008D928B /* Keys.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Keys.m; sourceTree = "<group>"; };
202198
9A1DAEC2197BD95300BB9DF7 /* PushHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PushHelper.h; sourceTree = "<group>"; };
203199
9A1DAEC3197BD95300BB9DF7 /* PushHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PushHelper.m; sourceTree = "<group>"; };
204200
9A1DAEC6197C2C1C00BB9DF7 /* Unit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Unit.h; sourceTree = "<group>"; };
@@ -820,8 +816,6 @@
820816
9AB7EAEF19903DEA00B9A1BA /* API.m */,
821817
9AB7EAF119903DFB00B9A1BA /* Environment.h */,
822818
9AB7EAF219903DFB00B9A1BA /* Environment.m */,
823-
9A19022B19A0FAD7008D928B /* Keys.h */,
824-
9A19022C19A0FAD7008D928B /* Keys.m */,
825819
9A528CE519A0D6B8007B3DF0 /* Settings.h */,
826820
9A528CE619A0D6B8007B3DF0 /* Settings.m */,
827821
);
@@ -1164,7 +1158,6 @@
11641158
9A67A7831950D70A001FCE32 /* Exchange.m in Sources */,
11651159
9A67A7791950D70A001FCE32 /* qrencode.c in Sources */,
11661160
9A67A7681950D70A001FCE32 /* ExchangeHelper.m in Sources */,
1167-
9A19022D19A0FAD7008D928B /* Keys.m in Sources */,
11681161
9A67A77F1950D70A001FCE32 /* Address.m in Sources */,
11691162
9A67A7821950D70A001FCE32 /* ContactList.m in Sources */,
11701163
9A1DAECB197C305400BB9DF7 /* ChangeUnitViewController.m in Sources */,
@@ -1211,7 +1204,6 @@
12111204
buildActionMask = 2147483647;
12121205
files = (
12131206
9AE335C31A268FD500021269 /* split.c in Sources */,
1214-
9A9D588019D1F63200EA940A /* Keys.m in Sources */,
12151207
9AE335BE1A268FC500021269 /* qrenc.c in Sources */,
12161208
9AE335BC1A268FBD00021269 /* bitstream.c in Sources */,
12171209
9AE335C21A268FD200021269 /* rscode.c in Sources */,

BitStore/BitStore-Prefix.pch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
#import "API.h"
2323
#import "Environment.h"
2424
#import "Settings.h"
25-
#import "Keys.h"
2625
#import "BTCAddress+BitStore.h"
26+
#import <CocoaPods-Keys/BitStoreKeys.h>
2727

2828
#define l10n(key) NSLocalizedString(key, nil)
2929

BitStore/Config/Keys.h

Lines changed: 0 additions & 20 deletions
This file was deleted.

BitStore/Config/Keys.m

Lines changed: 0 additions & 37 deletions
This file was deleted.

BitStore/Controller/AppStart.m

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,12 @@
1515
#import "AppDelegate.h"
1616
#import "RequestHelper.h"
1717
#import "MainViewControllerPhone.h"
18-
#import "Keys.h"
1918
#import "SharedUser.h"
2019
#import "SDStatusBarManager.h"
2120

2221
@implementation AppStart
2322

2423
+ (void)start {
25-
NSAssert([Keys chainKey].length > 0, @"Missing API keys!");
2624
[self migrate];
2725
[self setupStorage];
2826
[self setupKeychain];
@@ -113,8 +111,9 @@ + (void)setupRate {
113111
}
114112

115113
+ (void)setupAnalytics {
114+
BitStoreKeys* keys = [[BitStoreKeys alloc] init];
116115
NSString* url = [API analyticsUrl];
117-
[PiwikTracker sharedInstanceWithBaseURL:[NSURL URLWithString:url] siteID:@"2" authenticationToken:[Keys analyticsKey]];
116+
[PiwikTracker sharedInstanceWithBaseURL:[NSURL URLWithString:url] siteID:@"2" authenticationToken:keys.analytics];
118117
[PiwikTracker sharedInstance].dispatchInterval = 30;
119118
}
120119

BitStore/Controller/Buy/PhoneInputViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ - (void)next:(id)sender {
123123
[self showVerificationScreen];
124124
} else {
125125
[self showHUD];
126-
_ringCaptcha = [[RingcaptchaAPI alloc] initWithAppKey:[Keys ringCaptchaAppKey] andAPIKey:[Keys ringCaptchaAPIKey]];
126+
_ringCaptcha = [[RingcaptchaAPI alloc] initWithAppKey:nil andAPIKey:nil];
127127
[_ringCaptcha sendCaptchaCodeToNumber:[self phoneNumber] withService:SMS delegate:self];
128128
}
129129
}

BitStore/Model/Address.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,9 @@ - (void)updateMeta {
9696
}
9797

9898
- (void)update:(BOOL)full showError:(BOOL)showError {
99-
NSString* addrUrl = [NSString stringWithFormat:@"https://api.chain.com/v1/bitcoin/addresses/%@?key=%@", self.address, [Keys chainKey]];
100-
NSString* txUrl = [NSString stringWithFormat:@"https://api.chain.com/v1/bitcoin/addresses/%@/transactions?key=%@&limit=20", self.address, [Keys chainKey]];
99+
BitStoreKeys* keys = [[BitStoreKeys alloc] init];
100+
NSString* addrUrl = [NSString stringWithFormat:@"https://api.chain.com/v1/bitcoin/addresses/%@?key=%@", self.address, keys.chain];
101+
NSString* txUrl = [NSString stringWithFormat:@"https://api.chain.com/v1/bitcoin/addresses/%@/transactions?key=%@&limit=20", self.address, keys.chain];
101102

102103
NSMutableArray* urls = [[NSMutableArray alloc] init];
103104
[urls addObject:addrUrl];

Pods/Headers/Public/CocoaPods-Keys/BitStoreKeys.h

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)