1+
2+ mod activation;
3+ mod aps;
4+ mod util;
5+ mod imessage;
6+ mod mmcs;
7+ mod error;
8+ mod auth;
9+ mod ids;
10+ pub mod sharedstreams;
11+ pub mod findmy;
12+ pub mod facetime;
13+ pub mod cloudkit;
14+ pub mod statuskit;
15+ pub use imessage:: posterkit;
16+ pub use util:: KeyedArchive ;
17+
18+ #[ cfg( feature = "macOS" ) ]
19+ mod macos;
20+
21+ mod relay;
22+
23+ pub mod mmcsp {
24+ include ! ( concat!( env!( "OUT_DIR" ) , "/mmcsp.rs" ) ) ;
25+ }
26+
27+ use std:: collections:: HashMap ;
28+ use std:: fmt:: Debug ;
29+
30+ use activation:: ActivationInfo ;
31+ pub use aps:: { APSConnectionResource , APSConnection , APSMessage , APSState } ;
32+ use async_trait:: async_trait;
33+ pub use mmcs:: { FileContainer , prepare_put} ;
34+ pub use omnisette:: AnisetteProvider ;
35+ use icloud_auth:: LoginClientInfo ;
36+ pub use imessage:: messages:: { UpdateProfileMessage , UpdateProfileSharingMessage , MessageInst , ShareProfileMessage , SharedPoster , ScheduleMode , PermanentDeleteMessage , OperatedChat , DeleteTarget , MoveToRecycleBinMessage , TextFormat , TextEffect , TextFlags , LinkMeta , LPLinkMetadata , ReactMessageType , ErrorMessage , Reaction , UnsendMessage , EditMessage , UpdateExtensionMessage , PartExtension , ReactMessage , ChangeParticipantMessage , LPImageMetadata , RichLinkImageAttachmentSubstitute , LPIconMetadata , AttachmentType , ExtensionApp , BalloonLayout , Balloon , ConversationData , Message , MessageType , Attachment , NormalMessage , RenameMessage , IconChangeMessage , MessageParts , MessagePart , MMCSFile , IndexedMessagePart } ;
37+ pub use imessage:: aps_client:: { IMClient , MADRID_SERVICE } ;
38+ use openssl:: conf;
39+ use util:: encode_hex;
40+ pub use util:: { NSArrayClass , ResourceState , NSDictionaryClass , NSURL , NSArray , ResourceFailure } ;
41+ pub use ids:: user:: { IDSUser , register, IDSUserIdentity , IDSNGMIdentity , PrivateDeviceInfo , SupportAlert , SupportAction , ReportMessage } ;
42+ pub use ids:: identity_manager:: { SendJob , MessageTarget , IdentityManager } ;
43+ pub use ids:: CertifiedContext ;
44+ pub use auth:: { authenticate_apple, login_apple_delegates, authenticate_phone, AuthPhone , LoginDelegate } ;
45+ pub use error:: PushError ;
46+ #[ cfg( feature = "macOS" ) ]
47+ pub use macos:: MacOSConfig ;
48+ #[ cfg( feature = "macOS" ) ]
49+ pub use open_absinthe:: nac:: HardwareConfig ;
50+ pub use cloudkit_proto;
51+ pub use cloudkit_derive;
52+ pub use imessage:: name_photo_sharing;
53+
54+ pub use auth:: { IdmsAuthListener , IdmsMessage , IdmsRequestedSignIn , ApsData , ApsAlert , AkData , TeardownSignIn , CircleServerSession , IdmsCircleMessage } ;
55+
56+ use plist:: Dictionary ;
57+ pub use relay:: RelayConfig ;
58+ pub use util:: get_gateways_for_mccmnc;
59+
60+
61+ pub struct RegisterMeta {
62+ pub hardware_version : String ,
63+ pub os_version : String ,
64+ pub software_version : String ,
65+ }
66+
67+ pub struct DebugMeta {
68+ pub user_version : String ,
69+ pub hardware_version : String ,
70+ pub serial_number : String ,
71+ }
72+
73+ #[ async_trait]
74+ pub trait OSConfig : Sync + Send {
75+ fn build_activation_info ( & self , csr : Vec < u8 > ) -> ActivationInfo ;
76+ fn get_activation_device ( & self ) -> String ;
77+ async fn generate_validation_data ( & self ) -> Result < Vec < u8 > , PushError > ;
78+ fn get_protocol_version ( & self ) -> u32 ;
79+ fn get_register_meta ( & self ) -> RegisterMeta ;
80+ fn get_normal_ua ( & self , item : & str ) -> String ;
81+ fn get_mme_clientinfo ( & self , for_item : & str ) -> String ;
82+ fn get_version_ua ( & self ) -> String ;
83+ fn get_device_name ( & self ) -> String ;
84+ fn get_device_uuid ( & self ) -> String ;
85+ fn get_private_data ( & self ) -> Dictionary ;
86+ fn get_debug_meta ( & self ) -> DebugMeta ;
87+ fn get_login_url ( & self ) -> & ' static str ;
88+ fn get_serial_number ( & self ) -> String ;
89+ fn get_gsa_hardware_headers ( & self ) -> HashMap < String , String > ;
90+ fn get_aoskit_version ( & self ) -> String ;
91+ fn get_udid ( & self ) -> String { "55A1CFBF5BB56AD1159BD2CB7D6FF546E48EAAE4BF16188A07B1FB9C83138CA2" . to_string ( ) }
92+
93+ fn get_adi_mme_info ( & self , for_item : & str ) -> String {
94+ self . get_mme_clientinfo ( for_item)
95+ }
96+
97+ fn get_gsa_config ( & self , push : & APSState ) -> LoginClientInfo {
98+ LoginClientInfo {
99+ ak_context_type : "icloud" . to_string ( ) ,
100+ client_app_name : "AppleIDSettings" . to_string ( ) ,
101+ client_bundle_id : "com.apple.systempreferences.AppleIDSettings" . to_string ( ) ,
102+ mme_client_info_akd : self . get_adi_mme_info ( "com.apple.AuthKit/1 (com.apple.akd/1.0)" ) ,
103+ mme_client_info : self . get_adi_mme_info ( "com.apple.AuthKit/1 (com.apple.systempreferences.AppleIDSettings/1)" ) ,
104+ akd_user_agent : "akd/1.0 CFNetwork/1494.0.7 Darwin/23.4.0" . to_string ( ) ,
105+ browser_user_agent : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko)" . to_string ( ) ,
106+ hardware_headers : self . get_gsa_hardware_headers ( ) ,
107+ push_token : push. token . map ( |i| encode_hex ( & i) . to_uppercase ( ) ) ,
108+ update_account_bundle_id : self . get_adi_mme_info ( "com.apple.AppleAccount/1.0 (com.apple.systempreferences.AppleIDSettings/1)" ) ,
109+ }
110+ }
111+ }
112+
113+ extern crate pretty_env_logger;
114+ extern crate log;
0 commit comments