AnyoneKit is the easiest way to embed the Anyone/anon network in your iOS and macOS application.
Currently, the framework contains the following versions of anon, libevent, openssl, and liblzma:
| Component | Version |
|---|---|
| anon | 0.4.9.11 |
| libevent | 2.1.12 |
| OpenSSL | 3.5.1 |
| liblzma | 5.8.1 |
To run the example project, clone the repo, and run pod install from the Example directory first.
- iOS 12.0 or later
- MacOS 10.13 or later
- Xcode 15.0 or later
AnyoneKit is available through CocoaPods. To install it, simply add the following line to your Podfile:
use_frameworks!
pod 'AnyoneKit', '~> 409'For maintainers/contributors of AnyoneKit, a new release should be prepared by doing the following:
- Install build tools via Homebrew:
brew bundle-
Update the version numbers of the libraries used in
build-xcframework.sh. -
Run
build-xcframework.sh, check the logs and test the createdanon.xcframeworkwith the contained example apps. -
Update info and version numbers in
README.mdandAnyoneKit.podspec! -
Commit, tag and push new release.
-
Zip
anon.framework:
zip -r -9 anon.xcframework.zip anon.xcframework-
Create a pre-release on https://github.com/anyone-protocol/AnyoneKit/releases with the latest info as per older releases and zip and upload the created anon.xcframework.
-
Then lint like this:
pod lib lint --allow-warnings- If the linting went well, publish to CocoaPods:
pod trunk push --allow-warnings- Then update the release in GitHub, setting it as the latest release.
Starting an instance of the anon client involves using three classes: AnonThread, AnonConfiguration and AnonController.
Here is an example of integrating anon with NSURLSession:
AnonConfiguration *configuration = [AnonConfiguration new];
configuration.ignoreMissingAnonrc = YES;
configuration.cookieAuthentication = YES;
configuration.dataDirectory = [NSURL fileURLWithPath:NSTemporaryDirectory()];
configuration.controlSocket = [configuration.dataDirectory URLByAppendingPathComponent:@"control_port"];
AnonThread *thread = [[AnonThread alloc] initWithConfiguration:configuration];
[thread start];
NSData *cookie = configuration.cookie;
AnonController *controller = [[AnonController alloc] initWithSocketURL:configuration.controlSocket];
NSError *error;
[controller connect:&error];
if (error) {
NSLog(@"Error: %@", error);
return;
}
[controller authenticateWithData:cookie completion:^(BOOL success, NSError *error) {
if (!success)
return;
[controller addObserverForCircuitEstablished:^(BOOL established) {
if (!established)
return;
[controller getSessionConfiguration:^(NSURLSessionConfiguration *configuration) {
NSURLSession *session = [NSURLSession sessionWithConfiguration:configuration];
...
}];
}];
}];You might also want to have a look at the example iOS and macOS apps contained in the repository: https://github.com/anyone-protocol/AnyoneKit/tree/pure_pod/Example
If you want to use the provided GeoIP files, add this to your configuration:
AnonConfiguration *configuration = [AnonConfiguration new];
configuration.geoipFile = NSBundle.geoIpBundle.geoipFile;
configuration.geoip6File = NSBundle.geoIpBundle.geoip6File;- Conrad Kramer, conrad@conradkramer.com
- Chris Ballinger, chris@chatsecure.org
- Mike Tigas, mike@tig.as
- Benjamin Erhart, berhart@netzarchitekten.com
- Benjamin Erhart, berhart@netzarchitekten.com
AnyoneKit is available under the MIT license. See the
LICENSE file for more info.