XcodesOrg / XcodesOrg/xcodes

Remember 2FA code

Open
#317 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
4.8k
Forks
182
Avg merge
2d 12h
Merged PRs (30d)
1

Description

Would it be possible to utilize anisette data to remember the 2FA code and not prompt for it each time? It's pretty easy to get anisette on macOS with SIP/AMFI enabled, works even on macOS 14.0 RC.

#!/usr/bin/osascript -l JavaScript

ObjC.bindFunction('dlopen', ['void*', ['char*', 'int']]);
$.dlopen('/System/Library/PrivateFrameworks/AOSKit.framework/Versions/A/AOSKit', 0xa);
const AOSUtilities = $.NSClassFromString($.NSString.alloc.initWithUTF8String('AOSUtilities'));

const otp = AOSUtilities.retrieveOTPHeadersForDSID('-2');
JSON.stringify(ObjC.unwrap(otp.allKeys).reduce((o,k) => { o[ObjC.unwrap(k)] = ObjC.deepUnwrap(otp.valueForKey(k)); return o; }, {}));

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing 2FA prompt and reviewing how the provided macOS anisette OTP-header example could supply authentication data. Done means the tool can use anisette data to remember the 2FA code and no longer prompt on every use, with the behavior verified on macOS.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, swift
Domain
authentication, cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.