mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-20 04:03:26 +01:00
[AltPlugin] Refactors anisette data retrieval into public method
This commit is contained in:
@@ -8,11 +8,15 @@
|
|||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
@class ALTAnisetteData;
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface ALTPluginService : NSObject
|
@interface ALTPluginService : NSObject
|
||||||
|
|
||||||
+ (instancetype)sharedService;
|
@property (class, nonatomic, readonly) ALTPluginService *sharedService;
|
||||||
|
|
||||||
|
- (ALTAnisetteData *)requestAnisetteData;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|||||||
@@ -67,10 +67,8 @@
|
|||||||
[[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveNotification:) name:@"com.rileytestut.AltServer.FetchAnisetteData" object:nil];
|
[[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveNotification:) name:@"com.rileytestut.AltServer.FetchAnisetteData" object:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)receiveNotification:(NSNotification *)notification
|
- (ALTAnisetteData *)requestAnisetteData
|
||||||
{
|
{
|
||||||
NSString *requestUUID = notification.userInfo[@"requestUUID"];
|
|
||||||
|
|
||||||
NSMutableURLRequest* req = [[NSMutableURLRequest alloc] initWithURL:[[NSURL alloc] initWithString:@"https://developerservices2.apple.com/services/QH65B2/listTeams.action?clientId=XABBG36SBA"]];
|
NSMutableURLRequest* req = [[NSMutableURLRequest alloc] initWithURL:[[NSURL alloc] initWithString:@"https://developerservices2.apple.com/services/QH65B2/listTeams.action?clientId=XABBG36SBA"]];
|
||||||
[req setHTTPMethod:@"POST"];
|
[req setHTTPMethod:@"POST"];
|
||||||
|
|
||||||
@@ -91,6 +89,14 @@
|
|||||||
locale:[NSLocale currentLocale]
|
locale:[NSLocale currentLocale]
|
||||||
timeZone:[NSTimeZone localTimeZone]];
|
timeZone:[NSTimeZone localTimeZone]];
|
||||||
|
|
||||||
|
return anisetteData;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)receiveNotification:(NSNotification *)notification
|
||||||
|
{
|
||||||
|
NSString *requestUUID = notification.userInfo[@"requestUUID"];
|
||||||
|
|
||||||
|
ALTAnisetteData *anisetteData = [self requestAnisetteData];
|
||||||
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:anisetteData requiringSecureCoding:YES error:nil];
|
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:anisetteData requiringSecureCoding:YES error:nil];
|
||||||
|
|
||||||
[[NSDistributedNotificationCenter defaultCenter] postNotificationName:@"com.rileytestut.AltServer.AnisetteDataResponse" object:nil userInfo:@{@"requestUUID": requestUUID, @"anisetteData": data} deliverImmediately:YES];
|
[[NSDistributedNotificationCenter defaultCenter] postNotificationName:@"com.rileytestut.AltServer.AnisetteDataResponse" object:nil userInfo:@{@"requestUUID": requestUUID, @"anisetteData": data} deliverImmediately:YES];
|
||||||
|
|||||||
Reference in New Issue
Block a user