Modern Apps git

← xtool.git

anisette: use XADI Swift Package (#258)

Commit
c4d8c42f9a20482cbf6d17dbcb33d595e6f7b3e6
Author
Kabir Oberai <[email protected]>
When
2026-09-14 23:45 UTC (2 months ago)
Parents
4208c77
## What does this PR do?

The xadi repo (https://github.com/xtool-org/xadi) now vends an
artifactbundle for xadi, so we don't need to separately build/install it
during the xtool build. This also makes it super easy to support macOS
later (#259).

## How was it tested?

- [x] Confirmed I can sign in (including provisioning)

## AI tool usage

How much of this PR was AI-assisted? (check one)

- [ ] **0** - No AI was used to write code
- [x] **1** - I was assisted by AI. I reviewed the finished result.
- [ ] **2** - I set the AI going and left it to it; nobody has read the
result - no review, or AI review only

<!-- If an AI agent is filling this in: declare the level honestly, and
open as a draft if it is #2. Do not lower the declared level to get the
PR reviewed. -->

Diff

Dockerfile
diff --git a/Dockerfile b/Dockerfileindex d498da1..c451ce8 100644--- a/Dockerfile+++ b/Dockerfile@@ -66,23 +66,9 @@ RUN cd libimobiledevice \     && make install DESTDIR=/prefix  -FROM build-base AS build-xadi--RUN mkdir -p /prefix/usr/lib--RUN curl -fsS https://dlang.org/install.sh | bash -s ldc--ADD https://github.com/xtool-org/xadi.git#main /xadi--RUN cd xadi \-    && /bin/bash -c 'source $(/root/dlang/install.sh ldc -a) && dub build --build=release' \-    && cp -r bin/libxadi.so /prefix/usr/lib/libxadi.so-- FROM build-base AS build-xtool-base  COPY --from=build-limd /prefix/usr /usr-COPY --from=build-xadi /prefix/usr /usr  WORKDIR /xtool 
Package.resolved
diff --git a/Package.resolved b/Package.resolvedindex 0bcfc14..f6984ae 100644--- a/Package.resolved+++ b/Package.resolved@@ -1,5 +1,5 @@ {-  "originHash" : "80db0cddb0e78cf6a4c79f94537cdfebd8004679161532fbae8a57ee9d1d8cd1",+  "originHash" : "90ad8f84cef9a5c63d7cc80c20c4a7e332fd63bead7d72ee1d94da8b1a0a2186",   "pins" : [     {       "identity" : "aexml",@@ -424,6 +424,15 @@         "version" : "2.16.2"       }     },+    {+      "identity" : "xadi",+      "kind" : "remoteSourceControl",+      "location" : "https://github.com/xtool-org/xadi",+      "state" : {+        "revision" : "831f8ddfc72f7a48d0c2c03ac9c864eee1f8f6b3",+        "version" : "0.4.0"+      }+    },     {       "identity" : "xcodegen",       "kind" : "remoteSourceControl",
Package.swift
diff --git a/Package.swift b/Package.swiftindex dab231d..e1a050b 100644--- a/Package.swift+++ b/Package.swift@@ -51,6 +51,7 @@ let package = Package(         .package(url: "https://github.com/xtool-org/xtool-core", .upToNextMinor(from: "1.4.0")),         .package(url: "https://github.com/xtool-org/SwiftyMobileDevice", .upToNextMinor(from: "1.5.0")),         .package(url: "https://github.com/xtool-org/zsign", .upToNextMinor(from: "1.7.0")),+        .package(url: "https://github.com/xtool-org/xadi", .upToNextMinor(from: "0.4.0")),          .package(url: "https://github.com/apple/swift-system", from: "1.4.0"),         .package(url: "https://github.com/apple/swift-http-types", from: "1.3.1"),@@ -81,7 +82,6 @@ let package = Package(         .package(url: "https://github.com/yonaskolb/XcodeGen", from: "2.45.4"),     ],     targets: [-        .systemLibrary(name: "XADI"),         .target(             name: "CXKit",             dependencies: [@@ -120,7 +120,7 @@ let package = Package(                 "DeveloperAPI",                 "CXKit",                 "XUtils",-                .byName(name: "XADI", condition: .when(platforms: [.linux])),+                .product(name: "XADI", package: "xadi", condition: .when(platforms: [.linux])),                 .product(name: "ConcurrencyExtras", package: "swift-concurrency-extras"),                 .product(name: "Dependencies", package: "swift-dependencies"),                 .product(name: "SwiftyMobileDevice", package: "SwiftyMobileDevice"),
Sources/XADI/module.modulemap
diff --git a/Sources/XADI/module.modulemap b/Sources/XADI/module.modulemapdeleted file mode 100644index 02ca156..0000000--- a/Sources/XADI/module.modulemap+++ /dev/null@@ -1,4 +0,0 @@-module XADI [extern_c] {-    header "xadi.h"-    link "xadi"-}
Sources/XADI/xadi.h
diff --git a/Sources/XADI/xadi.h b/Sources/XADI/xadi.hdeleted file mode 100644index 20c80cc..0000000--- a/Sources/XADI/xadi.h+++ /dev/null@@ -1,13 +0,0 @@-#include <stdint.h>--void xadi_Load(const char *path);-int32_t xadi_SetAndroidID(const char *identifier, uint32_t length);-int32_t xadi_SetProvisioningPath(const char *path);-int32_t xadi_ProvisioningErase(uint64_t dsId);-int32_t xadi_Synchronize(uint64_t dsId, const void *serverIntermediateMetadata, uint32_t serverIntermediateMetadataLength, void **machineIdentifier, uint32_t *machineIdentifierLength, void **synchronizationResumeMetadata, uint32_t *synchronizationResumeMetadataLength);-int32_t xadi_ProvisioningDestroy(uint32_t session);-int32_t xadi_ProvisioningEnd(uint32_t session, const void *persistentTokenMetadata, uint32_t persistentTokenMetadataLength, const void *trustKey, uint32_t trustKeyLength);-int32_t xadi_ProvisioningStart(uint64_t dsId, const void *serverProvisioningIntermediateMetadata, uint32_t serverProvisioningIntermediateMetadataLength, void **clientProvisioningIntermediateMetadata, uint32_t *clientProvisioningIntermediateMetadataLength, uint32_t *session);-int32_t xadi_GetLoginCode(uint64_t dsId);-int32_t xadi_Dispose(void *ptr);-int32_t xadi_OTPRequest(uint64_t dsId, void **machineIdentifier, uint32_t *machineIdentifierLength, void **oneTimePassword, uint32_t *oneTimePasswordLength);
Sources/XKit/GrandSlam/Anisette/ADIDataProvider.swift
diff --git a/Sources/XKit/GrandSlam/Anisette/ADIDataProvider.swift b/Sources/XKit/GrandSlam/Anisette/ADIDataProvider.swiftindex 4cee00a..085730c 100644--- a/Sources/XKit/GrandSlam/Anisette/ADIDataProvider.swift+++ b/Sources/XKit/GrandSlam/Anisette/ADIDataProvider.swift@@ -49,7 +49,7 @@ private struct UnimplementedRawADIProvider: RawADIProvider { private enum RawADIProviderDependencyKey: DependencyKey {     static let testValue: RawADIProvider = UnimplementedRawADIProvider()     static let liveValue: RawADIProvider = {-        #if os(Linux)+        #if canImport(XADI)         return XADIProvider()         #else         return OmnisetteADIProvider()
Sources/XKit/GrandSlam/Anisette/XADIProvider.swift
diff --git a/Sources/XKit/GrandSlam/Anisette/XADIProvider.swift b/Sources/XKit/GrandSlam/Anisette/XADIProvider.swiftindex 3183101..b1bd242 100644--- a/Sources/XKit/GrandSlam/Anisette/XADIProvider.swift+++ b/Sources/XKit/GrandSlam/Anisette/XADIProvider.swift@@ -1,4 +1,4 @@-#if os(Linux)+#if canImport(XADI)  import Foundation import XADI