Skip to content

Commit

Permalink
use lomod version in about window
Browse files Browse the repository at this point in the history
  • Loading branch information
fuji246 committed May 4, 2022
1 parent cd4fc30 commit 8750a2b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
5 changes: 2 additions & 3 deletions LomoAgent/AboutWindow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ class AboutWindow: NSWindowController {
self.window?.level = .floating
NSApp.activate(ignoringOtherApps: true)

if let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String {
versionLabel.stringValue = "ver: \(version)"
if let lomodVer = getLomodService()?.systemInfo?.lomodVer.split(separator: ".").last {
versionLabel.stringValue = "lomod: \(lomodVer)"
}

}

}
4 changes: 2 additions & 2 deletions LomoAgent/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>ccdcffd</string>
<string>cd4fc30</string>
<key>CFBundleVersion</key>
<string>2022_04_30.23_21_47.0.ccdcffd</string>
<string>2022_05_04.12_05_18.0.cd4fc30</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
Expand Down
7 changes: 5 additions & 2 deletions LomoAgent/LomodService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@ struct BackupRecordItem {

struct SystemInfo {
let os: String
let lomodVer: String
let apiVer: String
let timezoneOffset: Int32
let systemStatus: Int32
var listenIPs = [String]()
var backupRecords = [String: BackupRecordItem]()

init(os: String, apiVer: String, timezoneOffset: Int32, systemStatus: Int32) {
init(os: String, lomodVer: String, apiVer: String, timezoneOffset: Int32, systemStatus: Int32) {
self.os = os
self.lomodVer = lomodVer
self.apiVer = apiVer
self.timezoneOffset = timezoneOffset
self.systemStatus = systemStatus
Expand Down Expand Up @@ -424,10 +426,11 @@ class LomodService
DDLogInfo("check server status, json response: \(jsonResult)")
if let osSystem = jsonResult["OS"] as? String,
let apiVer = jsonResult["APIVersion"] as? String,
let lomodVer = jsonResult["LomodVersion"] as? String,
let status = jsonResult["SystemStatus"] as? Int32,
let timeZoneOffset = jsonResult["TimezoneOffset"] as? Int32
{
self.systemInfo = SystemInfo(os: osSystem, apiVer: apiVer, timezoneOffset: timeZoneOffset, systemStatus: status)
self.systemInfo = SystemInfo(os: osSystem, lomodVer: lomodVer, apiVer: apiVer, timezoneOffset: timeZoneOffset, systemStatus: status)

if let listenIPs = jsonResult["ListenIPs"] as? [String] {
for ip in listenIPs {
Expand Down
5 changes: 5 additions & 0 deletions sign.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/bash
set -xe

# https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/customizing_the_notarization_workflow

#sudo xattr -rd com.apple.quarantine $1
#security find-identity -v

codesign --remove-signature "$1/Contents/Library/LoginItems/LomoAgentLauncher.app/Contents/Frameworks/"*.dylib
Expand Down Expand Up @@ -50,5 +53,7 @@ rm -rf $filename.zip
#/usr/bin/ditto -c -k --keepParent $1 $filename.zip
xcrun altool --notarize-app --primary-bundle-id lomoware.lomorage.$filename --username lomorage@gmail.com --password "@keychain:altool" --file "$filename.zip"

#xcrun stapler staple "$1"

#xcrun altool --notarization-info $RequestUUID -u lomorage@gmail.com --password "@keychain:altool"
#spctl --assess -v $1

0 comments on commit 8750a2b

Please sign in to comment.