🌐 Language: English (current) | 简体中文
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.
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:
- Email: 2277695881@qq.com
- QQ: 2277695881
- Commercial Licensing and Private Deployment
- Requirements
- Build Environment
- Build
- Command-Line Usage
- IPA Sharing Workflow Example
- Authorization Testing
- Security and Privacy
- Main API
- Windows 10 or later.
- A non-Microsoft-Store iTunes installation.
- 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.
Clone and bootstrap Vcpkg:
git clone https://github.com/microsoft/vcpkg
.\vcpkg\bootstrap-vcpkg.bat
.\vcpkg\vcpkg integrate installThe 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-staticIf you use another Vcpkg location or triplet, configure the Visual Studio vcpkg integration accordingly.
- iTunes 12.13.9 for 64-bit Windows
- iTunes 12.13.9 for 32-bit Windows
- iTunes 12.6.5.3 for 64-bit Windows
- iTunes 12.6.5.3 for 64-bit macOS
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.
git clone --recursive https://github.com/aidserv/aid.gitOpen 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.
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> --helpDefault 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 --dsidCalling config set without options saves the default server and DSID.
aid-cli device
aid-cli device --wait 5 --jsonaid-cli pair <udid>
aid-cli pair <udid> --wait 30 --jsonWithout 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 0Use 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.
aid-cli install <udid> app.ipa
aid-cli install <udid> app.ipa --wait 30 --jsonThe device is paired first when necessary.
aid-cli push
aid-cli push --server http://aid.aidserv.cn
aid-cli push --jsonPush 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-DsidfromCookies.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
HardwareInfovalues.
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 --jsonWithout --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.
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.
- Open iTunes and sign in from
Account>Sign In. - Authorize this computer from
Account>Authorize This Computer.
- 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 --jsonIf push reports an account mismatch, verify that iTunes is signed in to the same Apple ID and that Authorize This Computer completed successfully.
- After
pushsucceeds, download the target IPA from iTunes with the same Apple ID. - Send the downloaded IPA to the receiving user without removing
iTunesMetadata.plist.
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.
- Place
aid-cli.exeand its required DLLs in a directory, then run the commands from that directory or add it toPATH. - Configure the same server:
aid-cli config set --server http://aid.aidserv.cn- Connect the iOS device by USB and run:
aid-cli service --ipa "path\to\Example.ipa" --auto-pairService mode automatically authorizes the connected device and installs the IPA. Press Q and Enter to stop.
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.
pushtransmits 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.
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);