findmy.reports.anisette#

Module for Anisette header providers.

Attributes#

Classes#

RemoteAnisetteMapping

JSON mapping representing state of a remote Anisette provider.

LocalAnisetteMapping

JSON mapping representing state of a local Anisette provider.

BaseAnisetteProvider

Abstract base class for Anisette providers.

RemoteAnisetteProvider

Anisette provider. Fetches headers from a remote Anisette server.

LocalAnisetteProvider

Local anisette provider using the anisette library.

Functions#

get_provider_from_mapping(...)

Get the correct Anisette provider instance from saved JSON data.

Module Contents#

findmy.reports.anisette.logger#
class findmy.reports.anisette.RemoteAnisetteMapping#

Bases: TypedDict

Inheritance diagram of findmy.reports.anisette.RemoteAnisetteMapping

JSON mapping representing state of a remote Anisette provider.

type: Required[Literal['aniRemote']]#
url: Required[str]#
allow_unverified_https: bool#

Only written when it is true, so existing files stay valid and unchanged.

It has to be written at all because a provider is reconstructed from this: a user whose own server has a self-signed certificate would otherwise find that saving and reloading an account silently turned their working setup into a failing one.

class findmy.reports.anisette.LocalAnisetteMapping#

Bases: TypedDict

Inheritance diagram of findmy.reports.anisette.LocalAnisetteMapping

JSON mapping representing state of a local Anisette provider.

type: Literal['aniLocal']#
prov_data: str | None#
findmy.reports.anisette.AnisetteMapping#
findmy.reports.anisette.get_provider_from_mapping(mapping: AnisetteMapping, *, libs_path: str | pathlib.Path | None = None) → RemoteAnisetteProvider | LocalAnisetteProvider#

Get the correct Anisette provider instance from saved JSON data.

class findmy.reports.anisette.BaseAnisetteProvider(loop: asyncio.AbstractEventLoop | None = None)#

Bases: findmy.util.abc.Closable, findmy.util.abc.Serializable, abc.ABC

Inheritance diagram of findmy.reports.anisette.BaseAnisetteProvider

Abstract base class for Anisette providers.

Generously derived from nythepegasus/grandslam.

property otp: str#
Abstractmethod:

A seemingly random base64 string containing 28 bytes.

property machine: str#
Abstractmethod:

A base64 encoded string of 60 ‘random’ bytes.

property timestamp: str#

Current timestamp in ISO 8601 format.

property timezone: str#

Abbreviation of the timezone of the device.

property locale: str#

Locale of the device (e.g. en_US).

property router: str#

A number, either 17106176 or 50660608.

It doesn’t seem to matter which one we use. - 17106176 is used by Sideloadly and Provision (android) based servers. - 50660608 is used by Windows iCloud based servers.

property client: str#

Client string.

The format is as follows: <%MODEL%> <%OS%;%MAJOR%.%MINOR%(%SPMAJOR%,%SPMINOR%);%BUILD%>

<%AUTHKIT_BUNDLE_ID%/%AUTHKIT_VERSION% (%APP_BUNDLE_ID%/%APP_VERSION%)>

Where:

MODEL: The model of the device (e.g. MacBookPro15,1 or ‘PC’ OS: The OS of the device (e.g. Mac OS X or Windows) MAJOR: The major version of the OS (e.g. 10) MINOR: The minor version of the OS (e.g. 15) SPMAJOR: The major version of the service pack (e.g. 0) (Windows only) SPMINOR: The minor version of the service pack (e.g. 0) (Windows only) BUILD: The build number of the OS (e.g. 19C57) AUTHKIT_BUNDLE_ID: The bundle ID of the AuthKit framework (e.g. com.apple.AuthKit) AUTHKIT_VERSION: The version of the AuthKit framework (e.g. 1) APP_BUNDLE_ID: The bundle ID of the app (e.g. com.apple.akd) APP_VERSION: The version of the app (e.g. 1.0)

The app must not be reported as com.apple.dt.Xcode. Since early September 2026 Apple’s edge refuses any Grand Slam request whose client info names Xcode, before any credential is examined: a 190-byte HTML page from Server: Apple rather than a GSA plist, which surfaces as HTTP 503. com.apple.akd is the daemon that actually performs this request on macOS, and is answered normally.

async get_headers(user_id: str, device_id: str, serial: str = '0', with_client_info: bool = False) → dict[str, str]#

Generate a complete dictionary of Anisette headers.

Consider using BaseAppleAccount.get_anisette_headers() instead.

async get_cpd(user_id: str, device_id: str, serial: str = '0') → dict[str, str]#

Generate a complete dictionary of CPD data.

Intended for internal use.

class findmy.reports.anisette.RemoteAnisetteProvider(server_url: str, *, allow_unverified_https: bool = False)#

Bases: BaseAnisetteProvider, findmy.util.abc.Serializable[RemoteAnisetteMapping]

Inheritance diagram of findmy.reports.anisette.RemoteAnisetteProvider

Anisette provider. Fetches headers from a remote Anisette server.

to_json(dst: str | pathlib.Path | io.TextIOBase | None = None, /) → RemoteAnisetteMapping#

See BaseAnisetteProvider.serialize().

classmethod from_json(val: str | pathlib.Path | io.TextIOBase | io.BufferedIOBase | RemoteAnisetteMapping) → RemoteAnisetteProvider#

See BaseAnisetteProvider.deserialize().

property otp: str#

See BaseAnisetteProvider.otp().

property machine: str#

See BaseAnisetteProvider.machine().

async get_headers(user_id: str, device_id: str, serial: str = '0', with_client_info: bool = False) → dict[str, str]#

See :meth:BaseAnisetteProvider.get_headers().

async close() → None#

See AnisetteProvider.close().

class findmy.reports.anisette.LocalAnisetteProvider(*, state_blob: io.BytesIO | None = None, libs_path: str | pathlib.Path | None = None)#

Bases: BaseAnisetteProvider, findmy.util.abc.Serializable[LocalAnisetteMapping]

Inheritance diagram of findmy.reports.anisette.LocalAnisetteProvider

Local anisette provider using the anisette library.

to_json(dst: str | pathlib.Path | io.TextIOBase | None = None, /) → LocalAnisetteMapping#

See BaseAnisetteProvider.serialize().

classmethod from_json(val: str | pathlib.Path | io.TextIOBase | io.BufferedIOBase | LocalAnisetteMapping, *, libs_path: str | pathlib.Path | None = None) → LocalAnisetteProvider#

See BaseAnisetteProvider.deserialize().

async get_headers(user_id: str, device_id: str, serial: str = '0', with_client_info: bool = False) → dict[str, str]#

See BaseAnisetteProvider.get_headers().

property otp: str#

See BaseAnisetteProvider.otp().

property machine: str#

See BaseAnisetteProvider.machine().

async close() → None#

See BaseAnisetteProvider.close().