mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-25 07:46:02 +00:00
Remove unused code
This commit is contained in:
1 parent
52d3c62f7b
commit
8b17832111
6 files changed
+9
-10
No files matched your search
@@ -27,8 +27,8 @@ class InboundNearbyConnection: NearbyConnection {
|
|||||||
private var textPayloadID: Int64 = 0
|
private var textPayloadID: Int64 = 0
|
||||||
private var isPlainTextTransfer = false
|
private var isPlainTextTransfer = false
|
||||||
|
|
||||||
public var wasRejected = false
|
var wasRejected = false
|
||||||
public var delegate: InboundNearbyConnectionDelegate?
|
var delegate: InboundNearbyConnectionDelegate?
|
||||||
|
|
||||||
enum State {
|
enum State {
|
||||||
case initial, receivedConnectionRequest, sentUkeyServerInit, receivedUkeyClientFinish, sentConnectionResponse, sentPairedKeyResult, receivedPairedKeyResult, waitingForUserConsent, receivingFiles, disconnected
|
case initial, receivedConnectionRequest, sentUkeyServerInit, receivedUkeyClientFinish, sentConnectionResponse, sentPairedKeyResult, receivedPairedKeyResult, waitingForUserConsent, receivingFiles, disconnected
|
||||||
@@ -300,7 +300,6 @@ class InboundNearbyConnection: NearbyConnection {
|
|||||||
|
|
||||||
let domain = Domain.instance(curve: .EC256r1)
|
let domain = Domain.instance(curve: .EC256r1)
|
||||||
let (pubKey, privKey) = domain.makeKeyPair()
|
let (pubKey, privKey) = domain.makeKeyPair()
|
||||||
publicKey = pubKey
|
|
||||||
privateKey = privKey
|
privateKey = privKey
|
||||||
|
|
||||||
var serverInit = Securegcm_Ukey2ServerInit()
|
var serverInit = Securegcm_Ukey2ServerInit()
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ class NearbyConnection {
|
|||||||
private let timeoutInterval: TimeInterval = 30
|
private let timeoutInterval: TimeInterval = 30
|
||||||
|
|
||||||
// UKEY2-related state
|
// UKEY2-related state
|
||||||
var publicKey: ECPublicKey?
|
|
||||||
var privateKey: ECPrivateKey?
|
var privateKey: ECPrivateKey?
|
||||||
var ukeyClientInitMsgData: Data?
|
var ukeyClientInitMsgData: Data?
|
||||||
var ukeyServerInitMsgData: Data?
|
var ukeyServerInitMsgData: Data?
|
||||||
|
|||||||
@@ -27,11 +27,9 @@ public class NearbyConnectionManager: NSObject, NetServiceDelegate, InboundNearb
|
|||||||
private var startedDeviceDiscovery = false
|
private var startedDeviceDiscovery = false
|
||||||
private var browsers: [NWBrowser] = []
|
private var browsers: [NWBrowser] = []
|
||||||
private let serviceTypes = ["_FC9F5ED42C8A._tcp."]
|
private let serviceTypes = ["_FC9F5ED42C8A._tcp."]
|
||||||
private var qrCodePublicKey: ECPublicKey?
|
|
||||||
private var qrCodePrivateKey: ECPrivateKey?
|
private var qrCodePrivateKey: ECPrivateKey?
|
||||||
private var qrCodeAdvertisingToken: Data?
|
private var qrCodeAdvertisingToken: Data?
|
||||||
private var qrCodeNameEncryptionKey: SymmetricKey?
|
private var qrCodeNameEncryptionKey: SymmetricKey?
|
||||||
private var qrCodeData: Data?
|
|
||||||
|
|
||||||
public let endpointID: [UInt8] = generateEndpointID()
|
public let endpointID: [UInt8] = generateEndpointID()
|
||||||
public var mainAppDelegate: (any MainAppDelegate)?
|
public var mainAppDelegate: (any MainAppDelegate)?
|
||||||
@@ -302,7 +300,6 @@ public class NearbyConnectionManager: NSObject, NetServiceDelegate, InboundNearb
|
|||||||
public func generateQrCodeKey() -> String{
|
public func generateQrCodeKey() -> String{
|
||||||
let domain = Domain.instance(curve: .EC256r1)
|
let domain = Domain.instance(curve: .EC256r1)
|
||||||
let (pubKey, privKey) = domain.makeKeyPair()
|
let (pubKey, privKey) = domain.makeKeyPair()
|
||||||
qrCodePublicKey = pubKey
|
|
||||||
qrCodePrivateKey = privKey
|
qrCodePrivateKey = privKey
|
||||||
var keyData = Data()
|
var keyData = Data()
|
||||||
keyData.append(contentsOf: [0, 0, 2])
|
keyData.append(contentsOf: [0, 0, 2])
|
||||||
@@ -313,7 +310,6 @@ public class NearbyConnectionManager: NSObject, NetServiceDelegate, InboundNearb
|
|||||||
let ikm = SymmetricKey(data: keyData)
|
let ikm = SymmetricKey(data: keyData)
|
||||||
qrCodeAdvertisingToken = HKDF.deriveKey(ikm: ikm, salt: Data(), info: "advertisingContext".data(using: .utf8)!, outputLength: 16).data()
|
qrCodeAdvertisingToken = HKDF.deriveKey(ikm: ikm, salt: Data(), info: "advertisingContext".data(using: .utf8)!, outputLength: 16).data()
|
||||||
qrCodeNameEncryptionKey = HKDF.deriveKey(ikm: ikm, salt: Data(), info: "encryptionKey".data(using: .utf8)!, outputLength: 16)
|
qrCodeNameEncryptionKey = HKDF.deriveKey(ikm: ikm, salt: Data(), info: "encryptionKey".data(using: .utf8)!, outputLength: 16)
|
||||||
qrCodeData = keyData
|
|
||||||
|
|
||||||
return keyData.urlSafeBase64EncodedString()
|
return keyData.urlSafeBase64EncodedString()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -185,7 +185,6 @@ class OutboundNearbyConnection: NearbyConnection {
|
|||||||
private func sendUkey2ClientInit() throws {
|
private func sendUkey2ClientInit() throws {
|
||||||
let domain = Domain.instance(curve: .EC256r1)
|
let domain = Domain.instance(curve: .EC256r1)
|
||||||
let (pubKey, privKey) = domain.makeKeyPair()
|
let (pubKey, privKey) = domain.makeKeyPair()
|
||||||
publicKey = pubKey
|
|
||||||
privateKey = privKey
|
privateKey = privKey
|
||||||
|
|
||||||
var finishFrame = Securegcm_Ukey2Message()
|
var finishFrame = Securegcm_Ukey2Message()
|
||||||
|
|||||||
@@ -810,6 +810,7 @@
|
|||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
||||||
MARKETING_VERSION = "${SHARED_VERSION}";
|
MARKETING_VERSION = "${SHARED_VERSION}";
|
||||||
|
OTHER_SWIFT_FLAGS = "";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.leonboettger.neardrop.ShareExtension;
|
PRODUCT_BUNDLE_IDENTIFIER = com.leonboettger.neardrop.ShareExtension;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
@@ -842,6 +843,7 @@
|
|||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
||||||
MARKETING_VERSION = "${SHARED_VERSION}";
|
MARKETING_VERSION = "${SHARED_VERSION}";
|
||||||
|
OTHER_SWIFT_FLAGS = "";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.leonboettger.neardrop.ShareExtension;
|
PRODUCT_BUNDLE_IDENTIFIER = com.leonboettger.neardrop.ShareExtension;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
@@ -1012,6 +1014,7 @@
|
|||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
||||||
MARKETING_VERSION = "${SHARED_VERSION}";
|
MARKETING_VERSION = "${SHARED_VERSION}";
|
||||||
|
OTHER_SWIFT_FLAGS = "";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.leonboettger.neardrop;
|
PRODUCT_BUNDLE_IDENTIFIER = com.leonboettger.neardrop;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
@@ -1052,6 +1055,7 @@
|
|||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
||||||
MARKETING_VERSION = "${SHARED_VERSION}";
|
MARKETING_VERSION = "${SHARED_VERSION}";
|
||||||
|
OTHER_SWIFT_FLAGS = "";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.leonboettger.neardrop;
|
PRODUCT_BUNDLE_IDENTIFIER = com.leonboettger.neardrop;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
@@ -1086,6 +1090,7 @@
|
|||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
||||||
MARKETING_VERSION = 1.0;
|
MARKETING_VERSION = 1.0;
|
||||||
|
OTHER_SWIFT_FLAGS = "";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.leonboettger.neardrop;
|
PRODUCT_BUNDLE_IDENTIFIER = com.leonboettger.neardrop;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
@@ -1123,6 +1128,7 @@
|
|||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
||||||
MARKETING_VERSION = 1.0;
|
MARKETING_VERSION = 1.0;
|
||||||
|
OTHER_SWIFT_FLAGS = "";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.leonboettger.neardrop;
|
PRODUCT_BUNDLE_IDENTIFIER = com.leonboettger.neardrop;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
|
|||||||
welcomeWindow = nil
|
welcomeWindow = nil
|
||||||
NSApp.setActivationPolicy(.accessory)
|
NSApp.setActivationPolicy(.accessory)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func applicationShouldHandleReopen(_: NSApplication, hasVisibleWindows _: Bool) -> Bool {
|
func applicationShouldHandleReopen(_: NSApplication, hasVisibleWindows _: Bool) -> Bool {
|
||||||
|
|||||||
Reference in new issue
Block a user