Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_sdk_framework
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
Manos Chorianopoulos
2022-11-30 19:36:37 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c095225dab1c6f579dfc84cfb8bed7ba7543bb42
c095225d
1 parent
d960a51e
fix keychain crash
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
94 additions
and
2 deletions
SwiftWarplyFramework/SwiftWarplyFramework/Warply/Warply.m
SwiftWarplyFramework/SwiftWarplyFramework/Warply/managers/WLPushManager.m
SwiftWarplyFramework/SwiftWarplyFramework/Warply/Warply.m
View file @
c095225
...
...
@@ -6018,7 +6018,23 @@ CGFloat DistanceBetweenTwoPoints(CGPoint point1,CGPoint point2)
NSDictionary
*
context
=
[
JSON
valueForKey
:
@"context"
];
self
.
apiKey
=
[
context
valueForKey
:
@"api_key"
];
self
.
webId
=
[
context
valueForKey
:
@"web_id"
];
// [WLKeychain setString:[[[UIDevice currentDevice] identifierForVendor] UUIDString] forKey:@"old_identifier_for_vendor"];
@try
{
[
WLKeychain
setString
:[[[
UIDevice
currentDevice
]
identifierForVendor
]
UUIDString
]
forKey
:
@"old_identifier_for_vendor"
];
}
@catch
(
NSException
*
exception
)
{
NSLog
(
@"WLKeychain set old_identifier_for_vendor error: %@"
,
exception
.
reason
);
}
@finally
{
// NSLog(@"Finally condition");
}
NSUserDefaults
*
defaults
=
[
NSUserDefaults
standardUserDefaults
];
[
defaults
setObject
:[[[
UIDevice
currentDevice
]
identifierForVendor
]
UUIDString
]
forKey
:
@"old_identifier_for_vendor_UD"
];
[
defaults
setObject
:[
context
valueForKey
:
@"api_key"
]
forKey
:
@"NBAPIKeyUD"
];
[
defaults
setObject
:[
context
valueForKey
:
@"web_id"
]
forKey
:
@"NBWebIDUD"
];
[[
NSUserDefaults
standardUserDefaults
]
synchronize
];
[
_pendingOperationsQueue
setSuspended
:
!
[
self
isRegistrationValid
]];
if
(
success
)
{
...
...
@@ -6059,11 +6075,32 @@ CGFloat DistanceBetweenTwoPoints(CGPoint point1,CGPoint point2)
// NSData *parameters = [NSJSONSerialization dataWithJSONObject:context options:0 error:NULL];
NSString
*
old_identifier_for_vendor
;
@try
{
if
([
WLKeychain
getStringForKey
:
@"old_identifier_for_vendor"
])
{
old_identifier_for_vendor
=
[
WLKeychain
getStringForKey
:
@"old_identifier_for_vendor"
];
}
else
{
old_identifier_for_vendor
=
[[[
UIDevice
currentDevice
]
identifierForVendor
]
UUIDString
];
}
}
@catch
(
NSException
*
exception
)
{
NSUserDefaults
*
defaults
=
[
NSUserDefaults
standardUserDefaults
];
if
([
defaults
stringForKey
:
@"old_identifier_for_vendor_UD"
]
&&
!
[[
defaults
stringForKey
:
@"old_identifier_for_vendor_UD"
]
isEqual
:
@""
])
{
old_identifier_for_vendor
=
[
defaults
stringForKey
:
@"old_identifier_for_vendor_UD"
];
}
else
{
old_identifier_for_vendor
=
[[[
UIDevice
currentDevice
]
identifierForVendor
]
UUIDString
];
}
}
@finally
{
// NSLog(@"Finally condition");
}
// NSString *old_identifier_for_vendor;
// if ([WLKeychain getStringForKey:@"old_identifier_for_vendor"]) {
// old_identifier_for_vendor = [WLKeychain getStringForKey:@"old_identifier_for_vendor"];
// } else {
// old_identifier_for_vendor = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
// }
// NSDictionary *parameters = @{@"advertising_identifier": [[ASIdentifierManager sharedManager].advertisingIdentifier UUIDString],
// @"old_identifier_for_vendor": old_identifier_for_vendor,
...
...
@@ -6182,9 +6219,20 @@ CGFloat DistanceBetweenTwoPoints(CGPoint point1,CGPoint point2)
NSDictionary
*
context
=
[
JSON
valueForKey
:
@"context"
];
self
.
apiKey
=
[
context
valueForKey
:
@"api_key"
];
self
.
webId
=
[
context
valueForKey
:
@"web_id"
];
// [WLKeychain setString:[[[UIDevice currentDevice] identifierForVendor] UUIDString] forKey:@"old_identifier_for_vendor"];
@try
{
[
WLKeychain
setString
:[[[
UIDevice
currentDevice
]
identifierForVendor
]
UUIDString
]
forKey
:
@"old_identifier_for_vendor"
];
}
@catch
(
NSException
*
exception
)
{
NSLog
(
@"WLKeychain set old_identifier_for_vendor error: %@"
,
exception
.
reason
);
}
@finally
{
// NSLog(@"Finally condition");
}
NSUserDefaults
*
defaults
=
[
NSUserDefaults
standardUserDefaults
];
[
defaults
setObject
:[[[
UIDevice
currentDevice
]
identifierForVendor
]
UUIDString
]
forKey
:
@"old_identifier_for_vendor_UD"
];
[
defaults
setObject
:[
context
valueForKey
:
@"api_key"
]
forKey
:
@"NBAPIKeyUD"
];
[
defaults
setObject
:[
context
valueForKey
:
@"web_id"
]
forKey
:
@"NBWebIDUD"
];
[[
NSUserDefaults
standardUserDefaults
]
synchronize
];
...
...
@@ -6231,11 +6279,31 @@ CGFloat DistanceBetweenTwoPoints(CGPoint point1,CGPoint point2)
// NSData *parameters = [NSJSONSerialization dataWithJSONObject:context options:0 error:NULL];
NSString
*
old_identifier_for_vendor
;
@try
{
if
([
WLKeychain
getStringForKey
:
@"old_identifier_for_vendor"
])
{
old_identifier_for_vendor
=
[
WLKeychain
getStringForKey
:
@"old_identifier_for_vendor"
];
}
else
{
old_identifier_for_vendor
=
[[[
UIDevice
currentDevice
]
identifierForVendor
]
UUIDString
];
}
}
@catch
(
NSException
*
exception
)
{
NSUserDefaults
*
defaults
=
[
NSUserDefaults
standardUserDefaults
];
if
([
defaults
stringForKey
:
@"old_identifier_for_vendor_UD"
]
&&
!
[[
defaults
stringForKey
:
@"old_identifier_for_vendor_UD"
]
isEqual
:
@""
])
{
old_identifier_for_vendor
=
[
defaults
stringForKey
:
@"old_identifier_for_vendor_UD"
];
}
else
{
old_identifier_for_vendor
=
[[[
UIDevice
currentDevice
]
identifierForVendor
]
UUIDString
];
}
}
@finally
{
// NSLog(@"Finally condition");
}
// if ([WLKeychain getStringForKey:@"old_identifier_for_vendor"]) {
// old_identifier_for_vendor = [WLKeychain getStringForKey:@"old_identifier_for_vendor"];
// } else {
// old_identifier_for_vendor = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
// }
// OLD parameters
// NSDictionary *parameters = @{@"advertising_identifier": [[ASIdentifierManager sharedManager].advertisingIdentifier UUIDString],
...
...
SwiftWarplyFramework/SwiftWarplyFramework/Warply/managers/WLPushManager.m
View file @
c095225
...
...
@@ -93,10 +93,34 @@ static const char* jailbreak_apps[] =
_deviceToken
=
[
aDeviceToken
copy
];
//Save new valuetodo
if
((
_deviceToken
!=
(
NSString
*
)[
NSNull
null
])
&&
(
_deviceToken
.
length
>
0
))
if
((
_deviceToken
!=
(
NSString
*
)[
NSNull
null
])
&&
(
_deviceToken
.
length
>
0
))
{
// [WLKeychain setString:_deviceToken forKey:@"NBDeviceToken"];
@try
{
[
WLKeychain
setString
:
_deviceToken
forKey
:
@"NBDeviceToken"
];
else
}
@catch
(
NSException
*
exception
)
{
NSLog
(
@"WLKeychain set DeviceToken error: %@"
,
exception
.
reason
);
}
@finally
{
// NSLog(@"Finally condition");
}
NSUserDefaults
*
defaults
=
[
NSUserDefaults
standardUserDefaults
];
[
defaults
setObject
:
_deviceToken
forKey
:
@"NBDeviceTokenUD"
];
}
else
{
// [WLKeychain deleteStringForKey:@"NBDeviceToken"];
@try
{
[
WLKeychain
deleteStringForKey
:
@"NBDeviceToken"
];
}
@catch
(
NSException
*
exception
)
{
NSLog
(
@"WLKeychain delete DeviceToken error: %@"
,
exception
.
reason
);
}
@finally
{
// NSLog(@"Finally condition");
}
NSUserDefaults
*
defaults
=
[
NSUserDefaults
standardUserDefaults
];
[
defaults
setObject
:
@""
forKey
:
@"NBDeviceTokenUD"
];
}
}
#pragma mark - Public Methods
...
...
Please
register
or
login
to post a comment