Skip to content
aidservPublic

About

Authorize ios device ,实现爱思助手、鲨漏验机、3utools、imazing一样安装app、iOS私有应用市场

Topics

Resources

Stars

148 stars

Watchers

9 watching

Forks

Repository files navigation

🌐 Language: English (current)  |  简体中文

aid: Overview

aid authorizes iOS devices and installs IPA files. It provides functionality similar to i4Tools (AiSi Assistant), ShaLou device inspector, and 3uTools. After a device has been authorized with aid2, installing an IPA through aid2 does not require the Apple ID password again.

The project includes:

  • aid2.dll: device pairing, authorization, IPA installation, and remote authorization support.
  • aid-cli.exe: command-line access to device discovery, configuration, authorization, IPA installation, SC Info upload, and continuous USB service mode.

Commercial Licensing and Private Deployment

The source code in this repository is licensed under the Apache License 2.0.

Separate commercial agreements are available for professional services and supported deliverables that are not provided by the community build:

  • Cross-platform ports and commercial integration
  • OEM integration and customization
  • Supported private deployment of aidserv
  • Annual maintenance and compatibility updates

These agreements cover services, supported builds, deployment, and commercial support. They do not restrict rights granted by the Apache License 2.0.

All use must comply with applicable law, Apple terms, and the user's authorization to use the relevant accounts, devices, and IPA files.

Contact:

Contents

Requirements

Runtime

  • Windows 10 or later.
  • A non-Microsoft-Store iTunes installation.

Build from source

  • Visual Studio 2022 with C++.
  • Vcpkg.
  • OpenSSL.
  • nlohmann-json.
  • zlib.

The public source-build instructions target Windows. Linux, macOS, Android, and ARM builds are provided through commercial porting or custom delivery.

Microsoft Store versions of iTunes are not currently supported.

Build Environment

Clone and bootstrap Vcpkg:

git clone https://github.com/microsoft/vcpkg
.\vcpkg\bootstrap-vcpkg.bat
.\vcpkg\vcpkg integrate install

The current Visual Studio solution uses both dynamic and static package configurations. Install the 64-bit dynamic packages used by the CLI and the static packages used by the release library:

The Debug CLI uses dynamic Vcpkg packages. The Release native library uses static Vcpkg packages.

.\vcpkg\vcpkg install openssl:x64-windows nlohmann-json:x64-windows zlib:x64-windows
.\vcpkg\vcpkg install openssl:x64-windows-static nlohmann-json:x64-windows-static zlib:x64-windows-static

If you use another Vcpkg location or triplet, configure the Visual Studio vcpkg integration accordingly.

iTunes downloads

Note: iTunes 12.6.5.3 is the last version that supports downloading IPA files. Use this version if you need to download IPAs from iTunes.

Build

git clone --recursive https://github.com/aidserv/aid.git

Open aid2.sln in Visual Studio 2022, select x64, then build Debug or Release.

The output is written to:

x64\Debug
x64\Release

Both directories contain aid-cli.exe and aid2.dll. The Debug output also requires zlibd1.dll; the Release output requires no additional zlib runtime DLL.

Command-Line Usage

Run aid-cli.exe from the selected build output directory. Use --help with any command for its current options:

aid-cli --help
aid-cli <command> --help

Configuration

Default configuration:

server = http://aid.aidserv.cn
dsid   = 0

dsid = 0 means that the server selects its configured default DSID.

aid-cli config set
aid-cli config set --server http://aid.aidserv.cn --dsid <dsid>
aid-cli config get
aid-cli config get --server
aid-cli config get --dsid

Calling config set without options saves the default server and DSID.

List devices

aid-cli device
aid-cli device --wait 5 --json

Pair a device

aid-cli pair <udid>
aid-cli pair <udid> --wait 30 --json

Authorize a device

Without an explicit source, the configured DSID is used:

aid-cli auth <udid>

Use 0 to select the server's default DSID:

aid-cli auth <udid> --dsid 0

Use an explicit DSID:

aid-cli auth <udid> --dsid <dsid>

Read the current iTunes X-Dsid from Cookies.binarycookies:

aid-cli auth <udid> --from-cookie

--dsid and --from-cookie are mutually exclusive. Cookie mode requires one unique valid X-Dsid; multiple different values are rejected.

Install an IPA

aid-cli install <udid> app.ipa
aid-cli install <udid> app.ipa --wait 30 --json

The device is paired first when necessary.

Push authorization data

aid-cli push
aid-cli push --server http://aid.aidserv.cn
aid-cli push --json

Push uploads authorization-related SC Info files and host hardware information. Review Security and Privacy before use.

Push mode:

  • Does not upload the Apple ID password.
  • Reads the complete X-Dsid from Cookies.binarycookies.
  • Extracts the SC Info userID from SC Info.sidd.
  • Continues only when the low 32 bits match.
  • Uploads every regular file under SC Info.
  • Uploads all HardwareInfo values.

Service mode

Service mode continuously monitors USB devices and authorizes each newly connected device:

aid-cli service
aid-cli service --auto-pair
aid-cli service --ipa app.ipa
aid-cli service --ipa app.ipa --auto-pair --json

Without --ipa, authorization uses the configured DSID. With --ipa, aid-cli reads iTunesMetadata.plist from the IPA:

DSPersonID
    -> PurchaserID when DSPersonID is absent
    -> configured DSID when the metadata cannot be read

The IPA is installed after each successful authorization. Press Q then Enter to stop the service.

Common service JSON events include started, processed, and stopped. Started and processed events report the effective dsid and dsidSource.

IPA sharing workflow example

aid-cli push shares the authorization information of the current computer. A user can download an IPA with the authorized Apple ID, share that IPA with another computer, and let the other computer use aid-cli service to authorize and install it.

Sharing computer

  1. Open iTunes and sign in from Account > Sign In.
  2. Authorize this computer from Account > Authorize This Computer.

Authorize this computer in iTunes

  1. Set the server and share the current authorization information:
aid-cli config set --server http://aid.aidserv.cn
aid-cli push --server http://aid.aidserv.cn --json

If push reports an account mismatch, verify that iTunes is signed in to the same Apple ID and that Authorize This Computer completed successfully.

  1. After push succeeds, download the target IPA from iTunes with the same Apple ID.
  2. Send the downloaded IPA to the receiving user without removing iTunesMetadata.plist.

Receiving computer

The receiving user only needs the shared IPA and access to the configured server. They do not need to run push or sign in to the source Apple ID locally.

  1. Place aid-cli.exe and its required DLLs in a directory, then run the commands from that directory or add it to PATH.
  2. Configure the same server:
aid-cli config set --server http://aid.aidserv.cn
  1. Connect the iOS device by USB and run:
aid-cli service --ipa "path\to\Example.ipa" --auto-pair

Service mode automatically authorizes the connected device and installs the IPA. Press Q and Enter to stop.

Authorization Testing

After installing an app, open it on the device and check whether it requests an Apple ID and password.

To repeat a first-time authorization test, erase the device through Settings > General > Transfer or Reset iPhone > Erase All Content and Settings. Perform this only on a dedicated test device after taking a backup.

Security and Privacy

  • push transmits authorization-related SC Info files, DSID information, and host hardware identifiers. Use a trusted server.
  • Share only IPA files that you lawfully acquired and are authorized to distribute.
  • Do not publish SC Info, Cookies, push payloads, authorization logs, or hardware dumps.
  • Review JSON output before sharing it because it may contain DSID and hardware information.

Main API

The public C API is declared in aid2/aid2.h.

int DoPair(const char* udid);

AuthorizeReturnStatus AuthorizeDevice(
    const char* udid,
    long long dsid = 0);

bool InstallApplication(
    const char* udid,
    const char* ipaPath);

PushAuthorizeInfoStatus PushAuthorizeInfo(
    PushAuthorizeInfoResult* result);

Required initialization for device operations:

RegisterConnectCallback(OnDeviceConnect);
RegisterDisconnectCallback(OnDeviceDisconnect);
Setaidserv("http://aid.aidserv.cn");

// Optional for server configurations that require mutual TLS.
// TransferCertificate(rootCert, clientKey, clientCert);

StartListen();
if (AuthorizeDevice(udid, 0) == AuthorizeSuccess) {
    InstallApplication(udid, ipaPath);
}
StopListen();

Setaidserv() must be called before authorization or push operations that use the remote server. StartListen() is required to receive device connection callbacks before using the device APIs.

Push can be called without starting the device listener:

PushAuthorizeInfoResult pushResult{};
PushAuthorizeInfoStatus pushStatus = PushAuthorizeInfo(&pushResult);

About

Authorize ios device ,实现爱思助手、鲨漏验机、3utools、imazing一样安装app、iOS私有应用市场

Topics

Resources

Stars

148 stars

Watchers

9 watching

Forks

Releases

Packages

Used by

Contributors

Languages