mirror of
https://github.com/nab138/isideload.git
synced 2026-03-02 06:26:16 +01:00
start implimenting cert stuff
This commit is contained in:
11
Cargo.lock
generated
11
Cargo.lock
generated
@@ -968,6 +968,7 @@ dependencies = [
|
||||
"hex",
|
||||
"hmac",
|
||||
"idevice",
|
||||
"keyring",
|
||||
"pbkdf2",
|
||||
"plist",
|
||||
"plist-macro",
|
||||
@@ -1033,6 +1034,16 @@ dependencies = [
|
||||
"wasm-bindgen",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "keyring"
|
||||
version = "3.6.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "eebcc3aff044e5944a8fbaf69eb277d11986064cba30c468730e8b9909fb551c"
|
||||
dependencies = [
|
||||
"log",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "lazy_static"
|
||||
version = "1.5.0"
|
||||
|
||||
@@ -11,8 +11,9 @@ keywords = ["ios", "sideload"]
|
||||
readme = "../README.md"
|
||||
|
||||
[features]
|
||||
default = ["install"]
|
||||
default = ["install", "keyring-storage"]
|
||||
install = ["dep:idevice"]
|
||||
keyring-storage = ["keyring"]
|
||||
|
||||
[dependencies]
|
||||
idevice = { version = "0.1.52", optional = true }
|
||||
@@ -39,3 +40,4 @@ cbc = { version = "0.2.0-rc.3", features = ["alloc"] }
|
||||
aes = "0.9.0-rc.4"
|
||||
aes-gcm = "0.11.0-rc.3"
|
||||
tokio = "1.49.0"
|
||||
keyring = { version = "3.6.3", optional = true }
|
||||
|
||||
@@ -20,7 +20,7 @@ use crate::auth::grandslam::GrandSlam;
|
||||
use crate::util::plist::PlistDataExtract;
|
||||
use futures_util::{SinkExt, StreamExt};
|
||||
|
||||
pub const DEFAULT_ANISETTE_V3_URL: &str = "https://ani.sidestore.io";
|
||||
pub const DEFAULT_ANISETTE_V3_URL: &str = "https://ani.stikstore.app";
|
||||
|
||||
pub struct RemoteV3AnisetteProvider {
|
||||
pub state: Option<AnisetteState>,
|
||||
@@ -127,8 +127,7 @@ impl AnisetteProvider for RemoteV3AnisetteProvider {
|
||||
Ok(data)
|
||||
}
|
||||
AnisetteHeaders::GetHeadersError { message } => {
|
||||
Err(report!("Failed to get anisette headers")
|
||||
.attach(message))
|
||||
Err(report!("Failed to get anisette headers").attach(message))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
6
isideload/src/sideload/certificate.rs
Normal file
6
isideload/src/sideload/certificate.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
pub struct CertificateIdentity {
|
||||
pub machine_id: String,
|
||||
pub machine_name: String,
|
||||
}
|
||||
|
||||
impl CertificateIdentity {}
|
||||
@@ -8,6 +8,7 @@ use crate::dev::teams::TeamsApi;
|
||||
use crate::dev::{developer_session::DeveloperSession, devices::DevicesApi};
|
||||
use crate::util::device::IdeviceInfo;
|
||||
|
||||
pub mod certificate;
|
||||
pub mod config;
|
||||
pub use config::{SideloadConfiguration, TeamSelection};
|
||||
|
||||
@@ -18,7 +19,6 @@ pub async fn sideload_app(
|
||||
config: &SideloadConfiguration,
|
||||
) -> Result<(), Report> {
|
||||
let device_info = IdeviceInfo::from_device(device_provider).await?;
|
||||
|
||||
let teams = dev_session.list_teams().await?;
|
||||
let team = match teams.len() {
|
||||
0 => {
|
||||
|
||||
0
isideload/src/util/keyring_storage.rs
Normal file
0
isideload/src/util/keyring_storage.rs
Normal file
@@ -1,2 +1,5 @@
|
||||
pub mod device;
|
||||
#[cfg(feature = "keyring-storage")]
|
||||
pub mod keyring_storage;
|
||||
pub mod plist;
|
||||
pub mod storage;
|
||||
|
||||
21
isideload/src/util/storage.rs
Normal file
21
isideload/src/util/storage.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use base64::prelude::*;
|
||||
use rootcause::prelude::*;
|
||||
|
||||
pub trait SideloadingStorage: Send + Sync {
|
||||
fn store(&self, key: &str, value: &str) -> Result<(), Report>;
|
||||
fn retrieve(&self, key: &str) -> Result<Option<String>, Report>;
|
||||
|
||||
fn store_data(&self, key: &str, value: &[u8]) -> Result<(), Report> {
|
||||
let encoded = BASE64_STANDARD.encode(value);
|
||||
self.store(key, &encoded)
|
||||
}
|
||||
|
||||
fn retrieve_data(&self, key: &str) -> Result<Option<Vec<u8>>, Report> {
|
||||
if let Some(encoded) = self.retrieve(key)? {
|
||||
let decoded = BASE64_STANDARD.decode(&encoded)?;
|
||||
Ok(Some(decoded))
|
||||
} else {
|
||||
Ok(None)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user