A Swift Package that allows iOS apps to communicate with AltServer.

Related tags

Networking AltKit
Overview

AltKit

AltKit allows apps to communicate with AltServers on the same WiFi network and enable features such as JIT compilation.

Installation

To use AltKit in your app, add the following to your Package.swift file's dependencies:

.package(url: "https://github.com/rileytestut/AltKit.git", .upToNextMajor(from: "0.0.1")),

Next, add the AltKit package as a dependency for your target:

.product(name: "AltKit", package: "AltKit"),

Finally, right-click on your app's Info.plist, select "Open As > Source Code", then add the following entries:

NSBonjourServices

    _altserver._tcp

NSLocalNetworkUsageDescription
[Your app] uses the local network to find and communicate with AltServer.

Usage

Swift

import AltKit

ServerManager.shared.startDiscovering()

ServerManager.shared.autoconnect { result in
    switch result
    {
    case .failure(let error): print("Could not auto-connect to server.", error)
    case .success(let connection):
        connection.enableUnsignedCodeExecution { result in
            switch result
            {
            case .failure(let error): print("Could not enable JIT compilation.", error)
            case .success: 
                print("Successfully enabled JIT compilation!")
                ServerManager.shared.stopDiscovering()
            }
            
            connection.disconnect()
        }
    }
}

Objective-C

@import AltKit;

[[ALTServerManager sharedManager] startDiscovering];

[[ALTServerManager sharedManager] autoconnectWithCompletionHandler:^(ALTServerConnection *connection, NSError *error) {
    if (error)
    {
        return NSLog(@"Could not auto-connect to server. %@", error);
    }
    
    [connection enableUnsignedCodeExecutionWithCompletionHandler:^(BOOL success, NSError *error) {
        if (success)
        {
            NSLog(@"Successfully enabled JIT compilation!");
            [[ALTServerManager sharedManager] stopDiscovering];
        }
        else
        {
            NSLog(@"Could not enable JIT compilation. %@", error);
        }
        
        [connection disconnect];
    }];
}];
You might also like...
AsyncWebSocketClient - A package that contains a client behaving as a wrapper for the URLSessionWebSocketTask

(WORK IN PROGRESS) AsyncWebSocketClient This is a package that contains a client

APIProvider - API Provider Package for easier API management inspired by abstraction

APIProvider Using APIProvider you can easily communicate with all API endpoints

UnsplashProvider - A package that can use the Unsplash API. It was developed as a SwiftUI

UnsplashProvider It is a package that can use the Unsplash API. It was developed

A type-safe, high-level networking solution for Swift apps
A type-safe, high-level networking solution for Swift apps

What Type-safe network calls made easy Netswift offers an easy way to perform network calls in a structured and type-safe way. Why Networking in Swift

An open-source Swift framework for building event-driven, zero-config Multipeer Connectivity apps

PeerKit An open-source Swift framework for building event-driven, zero-config Multipeer Connectivity apps Usage // Automatically detect and attach to

StatusBarOverlay will automatically show a
StatusBarOverlay will automatically show a "No Internet Connection" bar when your app loses connection, and hide it again. It supports apps which hide the status bar and The Notch

StatusBarOverlay StatusBarOverlay will automatically show a "No Internet Connection" bar when your app loses connection, and hide it again. It support

Control apps' wireless connectivity policy
Control apps' wireless connectivity policy

AirKeeper This tweak replicates a feature in Chinese iPhone model by using Apple's own private APIs, which effectively writes to /var/preferences/com.

Codegeneration tool for isomorphic server and mobile Go apps with gRPC & Protobuf.
Codegeneration tool for isomorphic server and mobile Go apps with gRPC & Protobuf.

Codegeneration tool for isomorphic server and mobile Go apps with gRPC & Protobuf. Share code between your backend, Android & iOS app!

Real-time Apps the SwiftUI way
Real-time Apps the SwiftUI way

Sync Sync is a proof of concept for expanding on the Magic of ObservableObject, and making it work over the network. This let's you create real-time A

Comments
  • Support linking with lower version OS

    Support linking with lower version OS

    Swift PM does not have a good way to conditionally include a package. That means that apps targeting a lower OS version cannot import AltKit. As a workaround, we lower the linking version while inserting availability checks into AltKit.

    Since NWConnection requires iOS 12, we will return an error when trying to connect with iOS 11.

    opened by osy 1
  • Can't add package through XCode SwiftPM IDE

    Can't add package through XCode SwiftPM IDE

    Our project doesn't use a Package.swift. I've been adding dependencies in XCode using the integrated package manager.

    No matter what I put for the version rule, I can't add the package, the button is locked out.

    image

    opened by JoeMatt 1
  • Psychic paper support for JIT (iOS up to 13.4.1)?

    Psychic paper support for JIT (iOS up to 13.4.1)?

    Hi! It looks like current implementation of AltKit requires remote JIT activation even for psychicpaper-capable devices running iOS 13.4.1 or earlier that have the ability to enable JIT on their own (if entitlements are granted during installation). Is it possible to account for that ability for such devices and grant JIT permissions right when installing the application powered by AltKit rather than forcing the inconvenient way of remote JIT activation?

    opened by fomalsd 0
Releases(0.0.2)
  • 0.0.2(Nov 12, 2021)

    What's Changed

    • Fixes discovering servers when calling ServerManager.startDiscovering() from background thread
    • Support linking with lower version OS by @osy in https://github.com/rileytestut/AltKit/pull/5

    Full Changelog: https://github.com/rileytestut/AltKit/compare/0.0.1...0.0.2

    Source code(tar.gz)
    Source code(zip)
Owner
Riley Testut
App developer. Building AltStore and Delta πŸ‡ΊπŸ‡ΈπŸ‡³πŸ‡Ώ
Riley Testut
This package is meant to make http request of an easy way inspiren in the architecture of Moya package

NetworkAgent This package is meant to make http request of an easy way inspiren in the architecture of Moya package. This package is 100% free of depe

Angel Rada 19 Sep 8, 2022
Socket framework for Swift using the Swift Package Manager. Works on iOS, macOS, and Linux.

BlueSocket Socket framework for Swift using the Swift Package Manager. Works on iOS, macOS, and Linux. Prerequisites Swift Swift Open Source swift-5.1

Kitura 1.3k Dec 26, 2022
Approov Integration Examples 0 Jan 26, 2022
This generic SOAP client allows you to access web services using a your iOS app, Mac OS X app and AppleTV app.

This generic SOAP client allows you to access web services using a your iOS app, Mac OS X app and Apple TV app. With this Framework you can create iPh

Prioregroup.com 479 Nov 22, 2022
This is my attempt to make this repo available on swift package manager

Parse LiveQuery Client for iOS/OSX PFQuery is one of the key concepts for Parse. It allows you to retrieve PFObjects by specifying some conditions, ma

Benji 0 Nov 3, 2021
Swift package for adding API Key requirement to vapor backends.

APIKeyMiddleware Swift package for adding API Key requirement to vapor backends. Features βœ… Supports an array of keys βœ… Supports overriding thrown err

null 2 Dec 9, 2021
Create xcframework zip archive for Swift binary package.

xczip xczip - create xcframework zip archive for swift binary package. Creates an xcframework archive with a stable checksum that does not change when

Dmitriy Borovikov 0 Jan 8, 2022
NotionDrive - A swift package that can upload files to Notion.so or download files from Notion.so

NotionDrive NotionDrive is a swift package that can upload files to Notion.so or

Underthestars-zhy 4 Apr 9, 2022
Vrrrroom - An aplication that allows the user to perform remote actions on a car

Vrrrroom Vrrrroom is an aplication that allows the user to perform remote action

Paruyr Muradian 1 Feb 20, 2022
UDPReader : a simple package for reading udp packets

UDPReader is a simple package for reading udp packets

leroy 2 Aug 7, 2022