Skip to content

Use a Dictionary instead of ALTAnisetteData to allow for more universal usage #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# MacAnisette
This Swift package allows you to more easily use the private class `AOSUtilities` on macOS to generate anisette data.

This package exports a single function that uses [AltSign's](https://github.com/rileytestut/AltSign) `ALTAnisetteData` class to hold the result.
This package exports a single function that uses `[AnyHashable : Any]` dictionary to hold the result.
```swift
func genAOSAnisette() -> ALTAnisetteData
func genAOSAnisette() -> [AnyHashable : Any]
```

### License
Expand Down
224 changes: 0 additions & 224 deletions Sources/AOSKit/ALTAnisetteData.m

This file was deleted.

5 changes: 2 additions & 3 deletions Sources/AOSKit/AOSKit.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

@implementation AOSKit

+ (ALTAnisetteData *)getAnisetteData {
+ (NSDictionary *)getAnisetteData {

AKDevice *device = [AKDevice currentDevice];
id headers = [AOSUtilities retrieveOTPHeadersForDSID:@"-2"];
Expand All @@ -26,8 +26,7 @@ + (ALTAnisetteData *)getAnisetteData {
@"deviceUniqueIdentifier" : [device uniqueDeviceIdentifier]
};

ALTAnisetteData *data = [[ALTAnisetteData alloc] initWithJSON:dict];
return data;
return dict;
}

@end
Expand Down
45 changes: 0 additions & 45 deletions Sources/AOSKit/include/ALTAnisetteData.h

This file was deleted.

3 changes: 1 addition & 2 deletions Sources/AOSKit/include/AOSKit.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#import <Foundation/Foundation.h>
#import "ALTAnisetteData.h"

@interface AOSUtilities : NSObject
+ (id)currentComputerName;
Expand All @@ -17,6 +16,6 @@
@end

@interface AOSKit : NSObject
+ (ALTAnisetteData *)getAnisetteData;
+ (NSDictionary *)getAnisetteData;
@end

4 changes: 2 additions & 2 deletions Sources/MacAnisette/MacAnisette.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@_exported import AOSKit
import Foundation

/// Uses `AOSKit` to return `ALTAnisetteData`
/// Uses `AOSKit` to return `AnisetteData`
@available(macOS 10.13, *)
public func getAOSAnisette() -> ALTAnisetteData { AOSKit.getAnisetteData() }
public func getAOSAnisette() -> [AnyHashable : Any] { AOSKit.getAnisetteData() ?? [:] }

4 changes: 2 additions & 2 deletions Tests/MacAnisetteTests/MacAnisetteTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import Testing

@Test func getanisette() async throws {
let ani = getAOSAnisette()
#expect(ani.locale.language == NSLocale.current.language)
#expect(ani.routingInfo == 0)
#expect(ani["locale"] as! String == Locale.current.identifier)
#expect(ani["routingInfo"] as! String == "0")
}