Skip to content

Commit

Permalink
新增手动版 Sparkle 更新 V2rayU
Browse files Browse the repository at this point in the history
  • Loading branch information
yanue committed Jul 1, 2024
1 parent 634d08c commit 3fcdf6a
Show file tree
Hide file tree
Showing 24 changed files with 682 additions and 131 deletions.
3 changes: 1 addition & 2 deletions Podfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
source 'https://github.com/CocoaPods/Specs.git'
platform :osx, '10.14'
platform :osx, '11.0'

target 'V2rayU' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
Expand All @@ -14,7 +14,6 @@ target 'V2rayU' do
pod 'SwiftyJSON'
# master branch
pod 'Preferences', :git => 'https://github.com/sindresorhus/Preferences.git'
pod 'Sparkle' ,'~> 2.0'
pod 'QRCoder'
pod 'MASShortcut'
pod 'Swifter'
Expand Down
28 changes: 14 additions & 14 deletions V2rayU.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
6618372E23E9BF74000F7410 /* ToastWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6618372C23E9BF73000F7410 /* ToastWindow.xib */; };
66193A8623EE45B200289B6A /* PreferenceRouting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66193A8523EE45B200289B6A /* PreferenceRouting.swift */; };
66193A8923EE46BC00289B6A /* PreferenceRouting.xib in Resources */ = {isa = PBXBuildFile; fileRef = 66193A8723EE46BC00289B6A /* PreferenceRouting.xib */; };
6633A43F2C0A120000C54CA5 /* Sparkle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6633A43E2C0A120000C54CA5 /* Sparkle.swift */; };
663F040625ED4B2C00687600 /* V2rayLaunch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 663F040525ED4B2C00687600 /* V2rayLaunch.swift */; };
664BAC472C2DB0E100654FB7 /* V2rayRouting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 664BAC462C2DB0E100654FB7 /* V2rayRouting.swift */; };
664BAC492C314CD600654FB7 /* AppVersion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 664BAC482C314CD600654FB7 /* AppVersion.swift */; };
664EB375216C9A5E00B6AE0D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 664EB374216C9A5E00B6AE0D /* AppDelegate.swift */; };
664EB377216C9A5F00B6AE0D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 664EB376216C9A5F00B6AE0D /* Assets.xcassets */; };
664EB392216CA9E800B6AE0D /* ConfigWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 664EB390216CA9E800B6AE0D /* ConfigWindow.swift */; };
Expand Down Expand Up @@ -121,11 +121,11 @@
6625848D2AB745E700DFDC1E /* sign.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = sign.sh; sourceTree = "<group>"; };
6625848E2AB746D500DFDC1E /* appdmg.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = appdmg.sh; sourceTree = "<group>"; };
662F0ACE2AB720C700884C17 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = ../en.lproj/PreferenceGeneral.strings; sourceTree = "<group>"; };
6633A43E2C0A120000C54CA5 /* Sparkle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Sparkle.swift; sourceTree = "<group>"; };
663F040525ED4B2C00687600 /* V2rayLaunch.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = V2rayLaunch.swift; sourceTree = "<group>"; };
664666A021CBD6C60094F0B7 /* libPods-V2rayUTool.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = "libPods-V2rayUTool.a"; sourceTree = BUILT_PRODUCTS_DIR; };
664B95DD217062A500DBC941 /* Alamofire */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Alamofire; path = Pods/Alamofire; sourceTree = "<group>"; };
664BAC462C2DB0E100654FB7 /* V2rayRouting.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = V2rayRouting.swift; sourceTree = "<group>"; };
664BAC482C314CD600654FB7 /* AppVersion.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppVersion.swift; sourceTree = "<group>"; };
664EB371216C9A5E00B6AE0D /* V2rayU.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = V2rayU.app; sourceTree = BUILT_PRODUCTS_DIR; };
664EB374216C9A5E00B6AE0D /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
664EB376216C9A5F00B6AE0D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
Expand Down Expand Up @@ -267,6 +267,7 @@
6608D9B82182BBAC00A0E0DD /* v2ray */,
664EB376216C9A5F00B6AE0D /* Assets.xcassets */,
664EB374216C9A5E00B6AE0D /* AppDelegate.swift */,
664BAC482C314CD600654FB7 /* AppVersion.swift */,
66ACB19F21757D5B005B5881 /* MainMenu.swift */,
664EB378216C9A5F00B6AE0D /* MainMenu.xib */,
664EB390216CA9E800B6AE0D /* ConfigWindow.swift */,
Expand All @@ -287,7 +288,6 @@
6D6DF7F662C35646734A352E /* install.sh */,
6D6DF11F0983AFCBEF1E347B /* Uri.swift */,
6D6DF79424C83391C205CB9C /* Share.swift */,
6633A43E2C0A120000C54CA5 /* Sparkle.swift */,
);
path = V2rayU;
sourceTree = "<group>";
Expand Down Expand Up @@ -556,6 +556,7 @@
6608D9DA2182C69D00A0E0DD /* v2rayStruct.swift in Sources */,
66F07CF9236D79540088A4AE /* Ping.swift in Sources */,
664EB392216CA9E800B6AE0D /* ConfigWindow.swift in Sources */,
664BAC492C314CD600654FB7 /* AppVersion.swift in Sources */,
66193A8623EE45B200289B6A /* PreferenceRouting.swift in Sources */,
6D6DF8BFC33F97E9AFCA5A4B /* V2rayConfig.swift in Sources */,
6D6DF6F065067CD879201FF9 /* Import.swift in Sources */,
Expand All @@ -568,7 +569,6 @@
6D6DF807BE591BE396221EF3 /* PreferenceAdvance.swift in Sources */,
6D6DFC1D9432F2A60D2156E2 /* PreferenceDns.swift in Sources */,
6D6DF670FFB063EE2360776C /* Uri.swift in Sources */,
6633A43F2C0A120000C54CA5 /* Sparkle.swift in Sources */,
6D6DF41FA8F7C7B020AC4115 /* Share.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -768,7 +768,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -827,7 +827,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = macosx;
Expand All @@ -849,7 +849,7 @@
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 4.2.0;
CURRENT_PROJECT_VERSION = 4.0.0;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
ENABLE_ONLY_ACTIVE_RESOURCES = YES;
Expand All @@ -859,8 +859,8 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 4.2.0;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 4.0.0;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = net.yanue.V2rayU;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -883,7 +883,7 @@
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 4.2.0;
CURRENT_PROJECT_VERSION = 4.0.0;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
ENABLE_ONLY_ACTIVE_RESOURCES = YES;
Expand All @@ -893,8 +893,8 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 4.2.0;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 4.0.0;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = net.yanue.V2rayU;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -915,7 +915,7 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = YES;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MACOSX_DEPLOYMENT_TARGET = 11.0;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
};
Expand All @@ -930,7 +930,7 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = YES;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MACOSX_DEPLOYMENT_TARGET = 11.0;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
};
Expand Down
5 changes: 3 additions & 2 deletions V2rayU/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ import Cocoa
import ServiceManagement
import MASShortcut
import Preferences
import Sparkle
import FirebaseCore

let launcherAppIdentifier = "net.yanue.V2rayU.Launcher"
let appVersion = getAppVersion()
let V2rayUpdater = V2rayUpdaterController()

let NOTIFY_TOGGLE_RUNNING_SHORTCUT = Notification.Name(rawValue: "NOTIFY_TOGGLE_RUNNING_SHORTCUT")
let NOTIFY_SWITCH_PROXY_MODE_SHORTCUT = Notification.Name(rawValue: "NOTIFY_SWITCH_PROXY_MODE_SHORTCUT")
Expand All @@ -42,6 +40,9 @@ let preferencesWindowController = PreferencesWindowController(
]
)

let langStr = Locale.current.languageCode
let isMainland = langStr == "zh-CN" || langStr == "zh" || langStr == "zh-Hans" || langStr == "zh-Hant"

@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
// bar menu
Expand Down
Loading

0 comments on commit 3fcdf6a

Please sign in to comment.