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: Literal['aniRemote']#
url: str#
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#
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.dt.Xcode) APP_VERSION: The version of the app (e.g. 3594.4.19)

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)#

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 | None = None, /) RemoteAnisetteMapping#

See BaseAnisetteProvider.serialize().

classmethod from_json(val: str | pathlib.Path | 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: BinaryIO | 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 | None = None, /) LocalAnisetteMapping#

See BaseAnisetteProvider.serialize().

classmethod from_json(val: str | pathlib.Path | 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().