Skip to content

Support encrypted .sideconf SideStore account files - #29

Open
thamerszx-source wants to merge 1 commit into
hugeBlack:mainfrom
thamerszx-source:sideconf-import
Open

thamerszx-source wants to merge 1 commit into
hugeBlack:mainfrom
thamerszx-source:sideconf-import

Conversation

@thamerszx-source

Copy link
Copy Markdown

SideStore 2.0 changed its account export twice: the JSON keys were renamed (adiPB/local_user -> anisetteAdiBlob/anisetteIdentifier), the Apple ID password became optional, and the file is now written as an encrypted .sideconf container instead of plain JSON. Importing such an export failed with an opaque JSON decoding error.

SideStoreAccount now decodes both the legacy and the 2.0 key names and treats the Apple ID password as optional. SideStoreConfigurationFile reads the .sideconf container: a 16 byte salt followed by an AES-GCM sealed box, keyed with PBKDF2-HMAC-SHA256 over the file password (10 000 iterations, 32 bytes), matching SideStore's own ImportExport.swift and scripts/sideconf/decrypt_sideconf.py.

The file type is detected by attempting to parse the payload as JSON rather than by sniffing the first byte, since a container whose salt happens to start with "{" would otherwise be misread as a legacy export.

In Settings, the importer now accepts .sideconf files, prompts for the file password when the payload is encrypted, and reports distinct errors for a wrong password, a missing field and a malformed file. When the export omits the Apple ID password, the confirmation says so instead of implying the account is ready to sign in.

FULLY CLAUDE GENERATED COMMIT, I TESTED IT.

SideStore 2.0 changed its account export twice: the JSON keys were renamed
(`adiPB`/`local_user` -> `anisetteAdiBlob`/`anisetteIdentifier`), the Apple ID
password became optional, and the file is now written as an encrypted
`.sideconf` container instead of plain JSON. Importing such an export failed
with an opaque JSON decoding error.

SideStoreAccount now decodes both the legacy and the 2.0 key names and treats
the Apple ID password as optional. SideStoreConfigurationFile reads the
`.sideconf` container: a 16 byte salt followed by an AES-GCM sealed box, keyed
with PBKDF2-HMAC-SHA256 over the file password (10 000 iterations, 32 bytes),
matching SideStore's own ImportExport.swift and scripts/sideconf/decrypt_sideconf.py.

The file type is detected by attempting to parse the payload as JSON rather
than by sniffing the first byte, since a container whose salt happens to start
with "{" would otherwise be misread as a legacy export.

In Settings, the importer now accepts .sideconf files, prompts for the file
password when the payload is encrypted, and reports distinct errors for a wrong
password, a missing field and a malformed file. When the export omits the Apple
ID password, the confirmation says so instead of implying the account is ready
to sign in.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@hugeBlack

Copy link
Copy Markdown
Owner

Thanks, however since the sidestore 0.6.4 is still under rapid development, the format of exported account might change at anytime. We might add support for encrypted sidestore account after a stable version is released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants