@@ -12,7 +12,6 @@ use mullvad_update::{
12
12
} ;
13
13
use rand:: seq:: SliceRandom ;
14
14
15
- use std:: sync:: LazyLock ;
16
15
use tokio:: sync:: { mpsc, oneshot} ;
17
16
18
17
/// Actions handled by an async worker task in [handle_action_messages].
@@ -27,31 +26,6 @@ enum TaskMessage {
27
26
/// See the [module-level docs](self).
28
27
pub struct AppController { }
29
28
30
- pub struct FakeVersionInfoProvider { }
31
-
32
- static FAKE_VERSION : LazyLock < VersionInfo > = LazyLock :: new ( || VersionInfo {
33
- stable : Version {
34
- version : "2025.1" . parse ( ) . unwrap ( ) ,
35
- urls : vec ! [
36
- "https://releases.mullvad.net/desktop/releases/2025.4/MullvadVPN-2025.4.pkg" . to_owned( ) ,
37
- ] ,
38
- size : 226928055 ,
39
- changelog : "a changelog" . to_owned ( ) ,
40
- sha256 : hex:: decode ( "af81d35022f6d1abecc0eacf33b3c767efbe16a0edb07beec5911c114092d69b" )
41
- . unwrap ( )
42
- . try_into ( )
43
- . unwrap ( ) ,
44
- } ,
45
- beta : None ,
46
- } ) ;
47
-
48
- #[ async_trait:: async_trait]
49
- impl VersionInfoProvider for FakeVersionInfoProvider {
50
- async fn get_version_info ( & self , _params : VersionParameters ) -> anyhow:: Result < VersionInfo > {
51
- Ok ( FAKE_VERSION . clone ( ) )
52
- }
53
- }
54
-
55
29
/// Public entry function for registering a [AppDelegate].
56
30
pub fn initialize_controller < T : AppDelegate + ' static > ( delegate : & mut T ) {
57
31
use mullvad_update:: { api:: HttpVersionInfoProvider , app:: HttpAppDownloader } ;
@@ -62,20 +36,31 @@ pub fn initialize_controller<T: AppDelegate + 'static>(delegate: &mut T) {
62
36
type DirProvider = crate :: temp:: TempDirProvider ;
63
37
64
38
// Version info provider to use
65
- /*const TEST_PUBKEY: &str = include_str!("../../mullvad-update/test-pubkey");
39
+ const STAGEMOLE_PUBKEY : & str = include_str ! ( "../../mullvad-update/stagemole-pubkey" ) ;
40
+ //"https://releases.mullvad.net/desktop/metadata/updater-windows.json"
66
41
let verifying_key =
67
- mullvad_update::format::key::VerifyingKey::from_hex(TEST_PUBKEY ).expect("valid key");
42
+ mullvad_update:: format:: key:: VerifyingKey :: from_hex ( STAGEMOLE_PUBKEY ) . expect ( "valid key" ) ;
68
43
let version_provider = HttpVersionInfoProvider {
69
- url: "https://releases.mullvad.net/thing".to_owned (),
44
+ url : get_metadata_url ( ) ,
70
45
pinned_certificate : None ,
71
46
verifying_key,
72
- };*/
73
-
74
- let version_provider = FakeVersionInfoProvider { } ;
47
+ } ;
75
48
76
49
AppController :: initialize :: < _ , Downloader < T > , _ , DirProvider > ( delegate, version_provider)
77
50
}
78
51
52
+ /// JSON files should be stored at `<base url>/updates-<platform>.json`.
53
+ fn get_metadata_url ( ) -> String {
54
+ const PLATFORM : & str = if cfg ! ( target_os = "windows" ) {
55
+ "windows"
56
+ } else if cfg ! ( target_os = "macos" ) {
57
+ "macos"
58
+ } else {
59
+ panic ! ( "Unsupported platform" )
60
+ } ;
61
+ format ! ( "https://releases.stagemole.eu/desktop/metadata/updates-{PLATFORM}.json" )
62
+ }
63
+
79
64
impl AppController {
80
65
/// Initialize [AppController] using the provided delegate.
81
66
///
0 commit comments