@@ -111,15 +111,17 @@ def get(self, data):
111
111
singbox_dto = self .__get_singbox_app_dto ()
112
112
# hiddifyng_dto = self.__get_hiddifyng_app_dto()
113
113
v2rayng_dto = self .__get_v2rayng_app_dto ()
114
+ cmfa_dto = self .__get_cmfa_app_dto ()
114
115
# hiddify_clash_android_dto = self.__get_hiddify_clash_android_app_dto()
115
116
nekobox_dto = self .__get_nekobox_app_dto ()
116
- apps_data += ([hiddify_next_dto , singbox_dto , v2rayng_dto , nekobox_dto ])
117
+ apps_data += ([hiddify_next_dto , singbox_dto , v2rayng_dto , cmfa_dto , nekobox_dto ])
117
118
case Platform .windows :
118
119
hiddify_next_dto = self .__get_hiddify_next_app_dto ()
120
+ clash_verge_rev_dto = self .__get_clash_verge_rev_app_dto ()
119
121
# hiddify_clash_dto = self.__get_hiddify_clash_desktop_app_dto()
120
122
# hiddifyn_dto = self.__get_hiddifyn_app_dto()
121
123
v2rayn_dto = self .__get_v2rayn_app_dto ()
122
- apps_data += ([hiddify_next_dto , v2rayn_dto ])
124
+ apps_data += ([hiddify_next_dto , v2rayn_dto , clash_verge_rev_dto ])
123
125
case Platform .ios :
124
126
hiddify_next_dto = self .__get_hiddify_next_app_dto ()
125
127
singbox_dto = self .__get_singbox_app_dto ()
@@ -131,13 +133,15 @@ def get(self, data):
131
133
apps_data += ([hiddify_next_dto , singbox_dto , streisand_dto , stash_dto , shadowrocket_dto , foxray_dto , loon_dto ])
132
134
case Platform .linux :
133
135
hiddify_next_dto = self .__get_hiddify_next_app_dto ()
136
+ clash_verge_rev_dto = self .__get_clash_verge_rev_app_dto ()
134
137
# hiddify_clash_dto = self.__get_hiddify_clash_desktop_app_dto()
135
- apps_data += ([hiddify_next_dto ])
138
+ apps_data += ([hiddify_next_dto , clash_verge_rev_dto ])
136
139
case Platform .mac :
137
140
hiddify_next_dto = self .__get_hiddify_next_app_dto ()
138
141
singbox_dto = self .__get_singbox_app_dto ()
142
+ clash_verge_rev_dto = self .__get_clash_verge_rev_app_dto ()
139
143
# hiddify_clash_dto = self.__get_hiddify_clash_desktop_app_dto()
140
- apps_data += ([hiddify_next_dto , singbox_dto ])
144
+ apps_data += ([hiddify_next_dto , singbox_dto , clash_verge_rev_dto ])
141
145
142
146
return apps_data
143
147
@@ -168,11 +172,13 @@ def __get_all_apps_dto(self):
168
172
stash_app_dto = self .__get_stash_app_dto ()
169
173
# hiddify_clash_app_dto = self.__get_hiddify_clash_desktop_app_dto()
170
174
singbox_app_dto = self .__get_singbox_app_dto ()
175
+ cmfa_app_dto = self .__get_cmfa_app_dto ()
176
+ clash_verge_rev_app_dto = self .__get_clash_verge_rev_app_dto ()
171
177
hiddify_next_app_dto = self .__get_hiddify_next_app_dto ()
172
178
return [
173
179
v2rayn_app_dto , v2rayng_app_dto ,
174
180
foxray_app_dto , shadowrocket_app_dto , streisand_app_dto ,
175
- loon_app_dto , stash_app_dto , singbox_app_dto , hiddify_next_app_dto
181
+ loon_app_dto , stash_app_dto , singbox_app_dto , cmfa_app_dto , clash_verge_rev_app_dto , hiddify_next_app_dto
176
182
]
177
183
178
184
def __get_app_icon_url (self , app_name ):
@@ -182,6 +188,10 @@ def __get_app_icon_url(self, app_name):
182
188
url = base + static_url_for (filename = 'apps-icon/hiddify_next.ico' )
183
189
elif app_name == _ ('app.singbox.title' ):
184
190
url = base + static_url_for (filename = 'apps-icon/singbox.ico' )
191
+ elif app_name == _ ('app.cmfa.title' ):
192
+ url = base + static_url_for (filename = 'apps-icon/cmfa.ico' )
193
+ elif app_name == _ ('app.clash_verge_rev.title' ):
194
+ url = base + static_url_for (filename = 'apps-icon/clash_verge_rev.ico' )
185
195
elif app_name == _ ('app.hiddifyn.title' ):
186
196
url = base + static_url_for (filename = 'apps-icon/hiddifyn.ico' )
187
197
elif app_name == _ ('app.v2rayng.title' ):
@@ -356,7 +366,7 @@ def __get_singbox_app_dto(self):
356
366
dto .description = _ ('app.singbox.description' )
357
367
dto .icon_url = self .__get_app_icon_url (_ ('app.singbox.title' ))
358
368
dto .guide_url = ''
359
- dto .deeplink = f'sing-box://import-remote-profile/?url={ self .user_panel_url } '
369
+ dto .deeplink = f'sing-box://import-remote-profile/?url={ self .user_panel_url } # { self . profile_title } '
360
370
361
371
# availabe installatoin types
362
372
installation_types = []
@@ -409,6 +419,66 @@ def remove_v_from_filename(url):
409
419
dto .install = install_dtos
410
420
return dto
411
421
422
+ def __get_clash_verge_rev_app_dto (self ):
423
+ dto = AppSchema ()
424
+ dto .title = _ ('app.clash_verge_rev.title' )
425
+ dto .description = _ ('app.clash_verge_rev.description' )
426
+ dto .icon_url = self .__get_app_icon_url (_ ('app.clash_verge_rev.title' ))
427
+ dto .guide_url = ''
428
+ dto .deeplink = f'clash://install-config/?url={ self .user_panel_encoded_url } &name={ self .profile_title } '
429
+
430
+ # availabe installatoin types
431
+ installation_types = []
432
+ if self .platform == Platform .all :
433
+ installation_types = [AppInstallType .setup , AppInstallType .appimage , AppInstallType .dmg ]
434
+ else :
435
+ match self .platform :
436
+ case Platform .windows :
437
+ installation_types = [AppInstallType .setup ]
438
+ case Platform .linux :
439
+ installation_types = [AppInstallType .appimage ]
440
+ case Platform .mac :
441
+ installation_types = [AppInstallType .dmg ]
442
+
443
+ install_dtos = []
444
+ for install_type in installation_types :
445
+ install_dto = AppInstall ()
446
+ ins_url = ''
447
+ match install_type :
448
+ case AppInstallType .appimage :
449
+ ins_url = 'https://www.clashverge.dev/install.html#__tabbed_1_2'
450
+ case AppInstallType .setup :
451
+ ins_url = 'https://www.clashverge.dev/install.html#__tabbed_1_1'
452
+ case AppInstallType .dmg :
453
+ ins_url = 'https://www.clashverge.dev/install.html#__tabbed_1_3'
454
+
455
+ install_dto = self .__get_app_install_dto (install_type , ins_url )
456
+ install_dtos .append (install_dto )
457
+
458
+ dto .install = install_dtos
459
+ return dto
460
+
461
+ def __get_cmfa_app_dto (self ):
462
+ dto = AppSchema ()
463
+ dto .title = _ ('app.cmfa.title' )
464
+ dto .description = _ ('app.cmfa.description' )
465
+ dto .icon_url = self .__get_app_icon_url (_ ('app.cmfa.title' ))
466
+ dto .guide_url = ''
467
+ dto .deeplink = f'clash://install-config/?url={ self .user_panel_encoded_url } &name={ self .profile_title } '
468
+
469
+ latest_url , version = get_latest_release_url (f'https://github.com/MetaCubeX/ClashMetaForAndroid' )
470
+ ins_url = latest_url .split ('releases/' )[0 ] + f'releases/download/{ version } /cmfa-{ version } -meta-universal-release.apk'
471
+ def remove_v_from_filename (url ):
472
+ parts = url .split ('/' )
473
+ filename = parts [- 1 ]
474
+ new_filename = filename .replace ('cmfa-v' , 'cmfa-' )
475
+ parts [- 1 ] = new_filename
476
+ new_url = '/' .join (parts )
477
+ return new_url
478
+ ins_url = remove_v_from_filename (ins_url )
479
+ dto .install = [self .__get_app_install_dto (AppInstallType .apk , ins_url )]
480
+ return dto
481
+
412
482
def __get_hiddify_next_app_dto (self ):
413
483
dto = AppSchema ()
414
484
dto .title = _ ('app.hiddify.next.title' )
0 commit comments