3 releases
0.1.3 | Jan 31, 2024 |
---|---|
0.1.2 | Jan 30, 2024 |
0.1.1 | Jan 30, 2024 |
#170 in Email
22 downloads per month
16KB
328 lines
Hide My Email
Rust implementation of Apple's Hide my email service
Requirements
- Apple ID
- iCloud+ Subscription
Installation
cargo add hide_my_email
Obtaining Apple Cookies
- Login to iCloud
- Open the Dot Menu (top right, next to your photo)
- Click "Hide My Email" under iCloud+ Features
- Open your browsers developer tools (F12, or right-click on the page and click "Inspect")
- Navigate to the Network tab on developer tools and ensure it is recording (enabling Preserve Log may help).
- Refresh the website
- In the Network tab, filter the request for "validate", should only be 1, if multiple, use the last request (most recent)
- Scroll/Navigate to Request Headers section/tab
- Copy the value for the Cookie header
Example
use std::env;
use hide_my_email::{Cookie, HideMyEmailManager, ICloudClient};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
// eg, key1=value1; key2=\"value2\";
let cookies = env::var("COOKIE").unwrap();
let cookies = Cookie::from_str(&cookies).unwrap();
let mut icloud = ICloudClient::new(&cookies);
let _ = icloud.validate().await?;
let manager = HideMyEmailManager::from(icloud);
let email = manager.generate().await?;
let _ = manager.claim(&email, "RustLang", "").await?;
// OR
let email = manager.generate_and_claim("RustLang", "").await?;
Ok(())
}
Plan for future
Add authentication support via Username/Password + 2FA instead of cookies
Dependencies
~7–19MB
~268K SLoC