Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ pretty_env_logger = "0.5.0"
async-trait = "0.1.73"
flume = "0.11.0"
open-absinthe = { path = "/home/tae/Documents/open-absinthe", optional = true, features = ["serde"] }
icloud_auth = { path = "/home/tae/Documents/GitHub/apple-private-apis/icloud-auth" }
omnisette = { path = "/home/tae/Documents/GitHub/apple-private-apis/omnisette" }
omnisette = { git = "https://github.com/OpenBubbles/apple-private-apis", branch = "master" }
icloud_auth = { git = "https://github.com/OpenBubbles/apple-private-apis", branch = "master" }
deku = "0.16.0"
zip = { version = "2.1.5", default-features = false, features = ["deflate-zlib"] }
rasn = "0.16.0"
Expand All @@ -42,6 +42,7 @@ serde_json = "1.0.133"
[features]
default = ["macOS"]
macOS = ["dep:open-absinthe"]
dummy-fairplay = []


[build-dependencies]
Expand All @@ -54,3 +55,7 @@ path = "src/test.rs"
[lib]
name = "rustpush"
path = "src/lib.rs"

[patch."https://github.com/OpenBubbles/apple-private-apis"]
omnisette = { path = "../apple-private-apis/omnisette"}
icloud_auth = { path = "../apple-private-apis/icloud-auth"}
Binary file added certs/dummy_fairplay.crt
Binary file not shown.
Binary file added certs/dummy_fairplay.pem
Binary file not shown.
7 changes: 7 additions & 0 deletions src/activation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ macro_rules! include_cert {
};
}

#[cfg(not(feature = "dummy-fairplay"))]
const FAIRPLAY_KEYS: &[(&'static [u8], &'static [u8])] = &[
include_cert!("4056631661436364584235346952193"),
include_cert!("4056631661436364584235346952194"),
Expand All @@ -51,6 +52,12 @@ const FAIRPLAY_KEYS: &[(&'static [u8], &'static [u8])] = &[
include_cert!("4056631661436364584235346952208"),
];

#[cfg(feature = "dummy-fairplay")]
const FAIRPLAY_KEYS: &[(&'static [u8], &'static [u8])] = &[(
include_bytes!("../certs/dummy_fairplay.crt"),
include_bytes!("../certs/dummy_fairplay.pem"),
)];

fn fairplay_sign(data: &[u8]) -> Result<(&'static [u8], Vec<u8>), PushError> {
let (cert, key) = FAIRPLAY_KEYS.choose(&mut thread_rng()).expect("no keys!");

Expand Down