From 220c4fd94728063706ad72745adc119c8a435504 Mon Sep 17 00:00:00 2001 From: Nodeful Date: Sun, 4 Oct 2020 13:58:29 +0300 Subject: [PATCH] changes --- .gitignore | 6 +- native/.gitignore | 11 +++ native/Podfile.lock | 2 +- native/app/Source/Application.swift | 23 ----- native/app/Source/ApplicationDataBus.swift | 18 ++-- .../Source/Audio/Sources/System/Driver.swift | 83 ++++++------------- native/app/Source/Helpers/Storage.swift | 2 - native/app/update/deploy.sh | 2 - native/{app => }/update/CHANGELOG.md | 0 native/{app => }/update/UPDATE.md | 0 native/update/deploy.sh | 2 + native/{app => }/update/generate-changelog.sh | 0 native/{app => }/update/update.html | 0 native/{app => }/update/update.xml | 0 ui/src/app/sections/help/help.component.html | 2 +- 15 files changed, 50 insertions(+), 101 deletions(-) create mode 100644 native/.gitignore delete mode 100755 native/app/update/deploy.sh rename native/{app => }/update/CHANGELOG.md (100%) rename native/{app => }/update/UPDATE.md (100%) create mode 100755 native/update/deploy.sh rename native/{app => }/update/generate-changelog.sh (100%) rename native/{app => }/update/update.html (100%) rename native/{app => }/update/update.xml (100%) diff --git a/.gitignore b/.gitignore index d410e52..42eb1ae 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,7 @@ -Pods/ .DS_Store .DS_Store/ */.DS_Store -**/*.xcworkspace/xcuserdata* -**/*.xcodeproj/xcuserdata* -native/build -native/build_debug + node_modules .env dist diff --git a/native/.gitignore b/native/.gitignore new file mode 100644 index 0000000..e95ee3d --- /dev/null +++ b/native/.gitignore @@ -0,0 +1,11 @@ +**/*.xcworkspace/xcuserdata* +**/*.xcodeproj/xcuserdata* +build +build_debug +DerivedData +Pods/ +update/*.pkg +update/*.dmg +update/*.app +update/*.zip +update/update-test.xml \ No newline at end of file diff --git a/native/Podfile.lock b/native/Podfile.lock index b03ad32..e08eca5 100644 --- a/native/Podfile.lock +++ b/native/Podfile.lock @@ -81,4 +81,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: a4fdf35b1dcec9414bd0137d36ff00e0ba6eaf99 -COCOAPODS: 1.9.1 +COCOAPODS: 1.9.3 diff --git a/native/app/Source/Application.swift b/native/app/Source/Application.swift index b29ca25..de42dcf 100644 --- a/native/app/Source/Application.swift +++ b/native/app/Source/Application.swift @@ -132,29 +132,6 @@ class Application { quit() } } - } else if (Driver.isOutdated && !Driver.skipCurrentVersion) { - Alert.confirm( - title: "Audio Driver Update", - message: "There is an optional Audio Driver update that should improve user experience. \nIn order to update eqMac will ask for your System Password. \nPlease close any apps playing audio (Spotify, YouTube etc.) otherwise installation might fail.\nVersion change: \(Driver.lastInstalledVersion ?? "1.0.0") -> \(Driver.bundledVersion)", - okText: "Update Driver", - cancelText: "Skip Driver update" - ) { update in - if update { - Driver.install(started: { - UI.showLoadingWindow("Updating eqMac audio driver\nIf this process takes too long,\nplease restart your Mac") - }) { success in - if (success) { - UI.hideLoadingWindow() - completion() - } else { - driverFailedToInstallPrompt() - } - } - } else { - Driver.skipCurrentVersion = true - completion() - } - } } else { completion() } diff --git a/native/app/Source/ApplicationDataBus.swift b/native/app/Source/ApplicationDataBus.swift index 2375d3d..737be6b 100644 --- a/native/app/Source/ApplicationDataBus.swift +++ b/native/app/Source/ApplicationDataBus.swift @@ -24,7 +24,7 @@ class ApplicationDataBus: DataBus { "name": host.localizedName as AnyObject, "model": Sysctl.model as String, "version": Bundle.main.infoDictionary?["CFBundleVersion"] as Any, - "driverVersion": Driver.lastInstalledVersion +// "driverVersion": Driver.bundledVersion ] } @@ -61,16 +61,16 @@ class ApplicationDataBus: DataBus { } self.on(.GET, "/driver/reinstall/available") { _, res in - return "Yes" - } - - self.on(.GET, "/driver/reinstall") { _, res in - Application.reinstallDriver { success in - res.send([ "reinstalled": success ]) - } - return nil + return false } +// self.on(.GET, "/driver/reinstall") { _, res in +// Application.reinstallDriver { success in +// res.send([ "reinstalled": success ]) +// } +// return nil +// } +// self.on(.GET, "/update") { _, _ in Application.checkForUpdates() return "Checking for updates." diff --git a/native/app/Source/Audio/Sources/System/Driver.swift b/native/app/Source/Audio/Sources/System/Driver.swift index a2c82eb..45689b0 100644 --- a/native/app/Source/Audio/Sources/System/Driver.swift +++ b/native/app/Source/Audio/Sources/System/Driver.swift @@ -28,25 +28,16 @@ enum CustomProperties: String { } class Driver { - static var legacyIsInstalled: Bool { - get { - for legacyDriverUID in Constants.LEGACY_DRIVER_UIDS { - let device = AudioDevice.getOutputDeviceFromUID(UID: legacyDriverUID) - if (device != nil) { return true } - } - return false - } - } - - static var lastInstalledVersion: String? { - get { - return Storage[.lastInstalledDriverVersion] - } - set { - Storage[.lastInstalledDriverVersion] = newValue - } - } - +// static var legacyIsInstalled: Bool { +// get { +// for legacyDriverUID in Constants.LEGACY_DRIVER_UIDS { +// let device = AudioDevice.getOutputDeviceFromUID(UID: legacyDriverUID) +// if (device != nil) { return true } +// } +// return false +// } +// } +// static var pluginId: AudioObjectID? { return AudioDevice.lookupIDByPluginBundleID(by: Constants.DRIVER_BUNDLE_ID) } @@ -56,39 +47,21 @@ class Driver { return self.device != nil || self.pluginId != nil } } - - static var info: Dictionary { - return NSDictionary(contentsOfFile: Bundle.main.path(forResource: "Info", ofType: "plist", inDirectory: "Embedded/eqMac.driver/Contents")!) as! Dictionary - } - - static var bundledVersion: String { - return info["CFBundleVersion"] as! String - } - - static var lastSkippedDriverVersion: String? { - get { - return Storage[.lastSkippedDriverVersion] - } - set { - Storage[.lastSkippedDriverVersion] = newValue - } - } - - static var skipCurrentVersion: Bool { - get { - return lastSkippedDriverVersion == bundledVersion - } - set { - lastSkippedDriverVersion = newValue ? bundledVersion : nil - } - } - - static var isOutdated: Bool { - get { - return bundledVersion != lastInstalledVersion - } - } - +// +// static var info: Dictionary { +// return NSDictionary(contentsOfFile: Bundle.main.path(forResource: "Info", ofType: "plist", inDirectory: "Embedded/eqMac.driver/Contents")!) as! Dictionary +// } +// +// static var bundledVersion: String { +// return info["CFBundleVersion"] as! String +// } +// +// static var isOutdated: Bool { +// get { +// return bundledVersion != lastInstalledVersion +// } +// } +// static var sampleRates: [Double] { return [ 8_000, @@ -249,18 +222,12 @@ class Driver { static func install (started: (() -> Void)? = nil, _ finished: @escaping (Bool) -> Void) { Script.sudo("install_driver", started: started, { success in - if (success) { - lastInstalledVersion = bundledVersion - } finished(success) }) } static func uninstall (started: (() -> Void)? = nil, _ finished: @escaping (Bool) -> Void) { Script.sudo("uninstall_driver", started: started, { success in - if (success) { - lastInstalledVersion = nil - } finished(success) }) } diff --git a/native/app/Source/Helpers/Storage.swift b/native/app/Source/Helpers/Storage.swift index 61b866e..1f005d1 100644 --- a/native/app/Source/Helpers/Storage.swift +++ b/native/app/Source/Helpers/Storage.swift @@ -26,8 +26,6 @@ extension DefaultsKeys { // Effects - Equalizer - Advanced static let advancedEqualizerPresets = DefaultsKey<[AdvancedEqualizerPreset]?>("advancedEqualizerPresets") - static let lastInstalledDriverVersion = DefaultsKey("lastInstalledDriverVersion") - static let lastSkippedDriverVersion = DefaultsKey("lastSkippedDriverVersion") } let Storage = Defaults diff --git a/native/app/update/deploy.sh b/native/app/update/deploy.sh deleted file mode 100755 index 8749a15..0000000 --- a/native/app/update/deploy.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -gsutil -m cp -z js,css,html -r ./* gs://update.eqmac.app \ No newline at end of file diff --git a/native/app/update/CHANGELOG.md b/native/update/CHANGELOG.md similarity index 100% rename from native/app/update/CHANGELOG.md rename to native/update/CHANGELOG.md diff --git a/native/app/update/UPDATE.md b/native/update/UPDATE.md similarity index 100% rename from native/app/update/UPDATE.md rename to native/update/UPDATE.md diff --git a/native/update/deploy.sh b/native/update/deploy.sh new file mode 100755 index 0000000..77c8a57 --- /dev/null +++ b/native/update/deploy.sh @@ -0,0 +1,2 @@ +#!/bin/sh +gsutil -m -h "Cache-Control:no-cache, max-age=0" cp -z js,css,html -r ./* gs://update.eqmac.app \ No newline at end of file diff --git a/native/app/update/generate-changelog.sh b/native/update/generate-changelog.sh similarity index 100% rename from native/app/update/generate-changelog.sh rename to native/update/generate-changelog.sh diff --git a/native/app/update/update.html b/native/update/update.html similarity index 100% rename from native/app/update/update.html rename to native/update/update.html diff --git a/native/app/update/update.xml b/native/update/update.xml similarity index 100% rename from native/app/update/update.xml rename to native/update/update.xml diff --git a/ui/src/app/sections/help/help.component.html b/ui/src/app/sections/help/help.component.html index 1caa797..078b6ab 100644 --- a/ui/src/app/sections/help/help.component.html +++ b/ui/src/app/sections/help/help.component.html @@ -2,5 +2,5 @@
UI Version: {{uiVersion}} App Version: {{info.version}} - Driver Version: {{info.driverVersion || '1.0.0'}} + Driver Version: {{info.driverVersion || '1.0.0'}}