Fix OS 26 build errors
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
This commit is contained in:
@@ -1590,6 +1590,10 @@
|
|||||||
D76BE18C2E0CF3DA004AD0C6 /* Interests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D76BE18B2E0CF3D5004AD0C6 /* Interests.swift */; };
|
D76BE18C2E0CF3DA004AD0C6 /* Interests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D76BE18B2E0CF3D5004AD0C6 /* Interests.swift */; };
|
||||||
D76BE18D2E0CF3DA004AD0C6 /* Interests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D76BE18B2E0CF3D5004AD0C6 /* Interests.swift */; };
|
D76BE18D2E0CF3DA004AD0C6 /* Interests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D76BE18B2E0CF3D5004AD0C6 /* Interests.swift */; };
|
||||||
D76BE18E2E0CF3DA004AD0C6 /* Interests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D76BE18B2E0CF3D5004AD0C6 /* Interests.swift */; };
|
D76BE18E2E0CF3DA004AD0C6 /* Interests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D76BE18B2E0CF3D5004AD0C6 /* Interests.swift */; };
|
||||||
|
D77135D32E7B766B00E7639F /* DataExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D77135D22E7B766300E7639F /* DataExtensions.swift */; };
|
||||||
|
D77135D42E7B766B00E7639F /* DataExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D77135D22E7B766300E7639F /* DataExtensions.swift */; };
|
||||||
|
D77135D52E7B766B00E7639F /* DataExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D77135D22E7B766300E7639F /* DataExtensions.swift */; };
|
||||||
|
D77135D62E7B78D700E7639F /* DataExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D77135D22E7B766300E7639F /* DataExtensions.swift */; };
|
||||||
D773BC5F2C6D538500349F0A /* CommentItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = D773BC5E2C6D538500349F0A /* CommentItem.swift */; };
|
D773BC5F2C6D538500349F0A /* CommentItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = D773BC5E2C6D538500349F0A /* CommentItem.swift */; };
|
||||||
D773BC602C6D538500349F0A /* CommentItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = D773BC5E2C6D538500349F0A /* CommentItem.swift */; };
|
D773BC602C6D538500349F0A /* CommentItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = D773BC5E2C6D538500349F0A /* CommentItem.swift */; };
|
||||||
D77BFA0B2AE3051200621634 /* ProfileActionSheetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D77BFA0A2AE3051200621634 /* ProfileActionSheetView.swift */; };
|
D77BFA0B2AE3051200621634 /* ProfileActionSheetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D77BFA0A2AE3051200621634 /* ProfileActionSheetView.swift */; };
|
||||||
@@ -2647,6 +2651,7 @@
|
|||||||
D767066E2C8BB3CE00F09726 /* URLHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLHandler.swift; sourceTree = "<group>"; };
|
D767066E2C8BB3CE00F09726 /* URLHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLHandler.swift; sourceTree = "<group>"; };
|
||||||
D76874F22AE3632B00FB0F68 /* ProfileZapLinkView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileZapLinkView.swift; sourceTree = "<group>"; };
|
D76874F22AE3632B00FB0F68 /* ProfileZapLinkView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileZapLinkView.swift; sourceTree = "<group>"; };
|
||||||
D76BE18B2E0CF3D5004AD0C6 /* Interests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Interests.swift; sourceTree = "<group>"; };
|
D76BE18B2E0CF3D5004AD0C6 /* Interests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Interests.swift; sourceTree = "<group>"; };
|
||||||
|
D77135D22E7B766300E7639F /* DataExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataExtensions.swift; sourceTree = "<group>"; };
|
||||||
D773BC5E2C6D538500349F0A /* CommentItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommentItem.swift; sourceTree = "<group>"; };
|
D773BC5E2C6D538500349F0A /* CommentItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommentItem.swift; sourceTree = "<group>"; };
|
||||||
D77BFA0A2AE3051200621634 /* ProfileActionSheetView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileActionSheetView.swift; sourceTree = "<group>"; };
|
D77BFA0A2AE3051200621634 /* ProfileActionSheetView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileActionSheetView.swift; sourceTree = "<group>"; };
|
||||||
D783A63E2AD4E53D00658DDA /* SuggestedHashtagsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SuggestedHashtagsView.swift; sourceTree = "<group>"; };
|
D783A63E2AD4E53D00658DDA /* SuggestedHashtagsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SuggestedHashtagsView.swift; sourceTree = "<group>"; };
|
||||||
@@ -4673,6 +4678,7 @@
|
|||||||
5C78A7B82E3047DE00CF177D /* Utilities */ = {
|
5C78A7B82E3047DE00CF177D /* Utilities */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
D77135D22E7B766300E7639F /* DataExtensions.swift */,
|
||||||
4CF0ABEA29844B2F00D66079 /* AnyCodable */,
|
4CF0ABEA29844B2F00D66079 /* AnyCodable */,
|
||||||
D73B74E02D8365B40067BDBC /* ExtraFonts.swift */,
|
D73B74E02D8365B40067BDBC /* ExtraFonts.swift */,
|
||||||
D7DB93042D66A43B00DA1EE5 /* Undistractor.swift */,
|
D7DB93042D66A43B00DA1EE5 /* Undistractor.swift */,
|
||||||
@@ -5925,6 +5931,7 @@
|
|||||||
D7100C5C2B77016700C59298 /* IAPProductStateView.swift in Sources */,
|
D7100C5C2B77016700C59298 /* IAPProductStateView.swift in Sources */,
|
||||||
4CB9D4A72992D02B00A9A7E4 /* ProfileNameView.swift in Sources */,
|
4CB9D4A72992D02B00A9A7E4 /* ProfileNameView.swift in Sources */,
|
||||||
D733F9E82D92C76100317B11 /* UnownedNdbNote.swift in Sources */,
|
D733F9E82D92C76100317B11 /* UnownedNdbNote.swift in Sources */,
|
||||||
|
D77135D42E7B766B00E7639F /* DataExtensions.swift in Sources */,
|
||||||
D74EA0902D2E271E002290DD /* ErrorView.swift in Sources */,
|
D74EA0902D2E271E002290DD /* ErrorView.swift in Sources */,
|
||||||
4CE4F0F429D779B5005914DB /* PostBox.swift in Sources */,
|
4CE4F0F429D779B5005914DB /* PostBox.swift in Sources */,
|
||||||
BA37598E2ABCCE500018D73B /* VideoCaptureProcessor.swift in Sources */,
|
BA37598E2ABCCE500018D73B /* VideoCaptureProcessor.swift in Sources */,
|
||||||
@@ -6013,6 +6020,7 @@
|
|||||||
4C36246F2D5EA16A00DD066E /* str.c in Sources */,
|
4C36246F2D5EA16A00DD066E /* str.c in Sources */,
|
||||||
4C36246E2D5EA10400DD066E /* hash_u5.c in Sources */,
|
4C36246E2D5EA10400DD066E /* hash_u5.c in Sources */,
|
||||||
4C36246C2D5EA0E500DD066E /* bolt11.c in Sources */,
|
4C36246C2D5EA0E500DD066E /* bolt11.c in Sources */,
|
||||||
|
D77135D52E7B766B00E7639F /* DataExtensions.swift in Sources */,
|
||||||
4C36246B2D5EA0D700DD066E /* invoice.c in Sources */,
|
4C36246B2D5EA0D700DD066E /* invoice.c in Sources */,
|
||||||
4C36246A2D5EA0CB00DD066E /* content_parser.c in Sources */,
|
4C36246A2D5EA0CB00DD066E /* content_parser.c in Sources */,
|
||||||
4C3624692D5EA0C200DD066E /* list.c in Sources */,
|
4C3624692D5EA0C200DD066E /* list.c in Sources */,
|
||||||
@@ -6586,6 +6594,7 @@
|
|||||||
D73E5E4F2C6A97F4007EB227 /* WebsiteLink.swift in Sources */,
|
D73E5E4F2C6A97F4007EB227 /* WebsiteLink.swift in Sources */,
|
||||||
D73E5E502C6A97F4007EB227 /* Highlight.swift in Sources */,
|
D73E5E502C6A97F4007EB227 /* Highlight.swift in Sources */,
|
||||||
D73E5E512C6A97F4007EB227 /* CustomPicker.swift in Sources */,
|
D73E5E512C6A97F4007EB227 /* CustomPicker.swift in Sources */,
|
||||||
|
D77135D32E7B766B00E7639F /* DataExtensions.swift in Sources */,
|
||||||
D73E5E522C6A97F4007EB227 /* UserView.swift in Sources */,
|
D73E5E522C6A97F4007EB227 /* UserView.swift in Sources */,
|
||||||
D73E5E532C6A97F4007EB227 /* ZoomableScrollView.swift in Sources */,
|
D73E5E532C6A97F4007EB227 /* ZoomableScrollView.swift in Sources */,
|
||||||
D73E5E542C6A97F4007EB227 /* NoteZapButton.swift in Sources */,
|
D73E5E542C6A97F4007EB227 /* NoteZapButton.swift in Sources */,
|
||||||
@@ -7180,6 +7189,7 @@
|
|||||||
D798D22D2B086DC400234419 /* NostrEvent.swift in Sources */,
|
D798D22D2B086DC400234419 /* NostrEvent.swift in Sources */,
|
||||||
D798D22E2B086E4800234419 /* NostrResponse.swift in Sources */,
|
D798D22E2B086E4800234419 /* NostrResponse.swift in Sources */,
|
||||||
D7EDED162B1177840018B19C /* LNUrls.swift in Sources */,
|
D7EDED162B1177840018B19C /* LNUrls.swift in Sources */,
|
||||||
|
D77135D62E7B78D700E7639F /* DataExtensions.swift in Sources */,
|
||||||
D7CCFC132B05887C00323D86 /* ProofOfWork.swift in Sources */,
|
D7CCFC132B05887C00323D86 /* ProofOfWork.swift in Sources */,
|
||||||
D7CE1B392B0BE719002EDAD4 /* Table.swift in Sources */,
|
D7CE1B392B0BE719002EDAD4 /* Table.swift in Sources */,
|
||||||
D7CE1B452B0BE719002EDAD4 /* Root.swift in Sources */,
|
D7CE1B452B0BE719002EDAD4 /* Root.swift in Sources */,
|
||||||
|
|||||||
@@ -12,11 +12,11 @@ struct NIP04 {}
|
|||||||
extension NIP04 {
|
extension NIP04 {
|
||||||
/// Encrypts a message using NIP-04.
|
/// Encrypts a message using NIP-04.
|
||||||
static func encrypt_message(message: String, privkey: Privkey, to_pk: Pubkey, encoding: EncEncoding = .base64) -> String? {
|
static func encrypt_message(message: String, privkey: Privkey, to_pk: Pubkey, encoding: EncEncoding = .base64) -> String? {
|
||||||
let iv = random_bytes(count: 16).bytes
|
let iv = random_bytes(count: 16).byteArray
|
||||||
guard let shared_sec = get_shared_secret(privkey: privkey, pubkey: to_pk) else {
|
guard let shared_sec = get_shared_secret(privkey: privkey, pubkey: to_pk) else {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
let utf8_message = Data(message.utf8).bytes
|
let utf8_message = Data(message.utf8).byteArray
|
||||||
guard let enc_message = aes_encrypt(data: utf8_message, iv: iv, shared_sec: shared_sec) else {
|
guard let enc_message = aes_encrypt(data: utf8_message, iv: iv, shared_sec: shared_sec) else {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -321,7 +321,7 @@ func sign_id(privkey: String, id: String) -> String {
|
|||||||
|
|
||||||
// Extra params for custom signing
|
// Extra params for custom signing
|
||||||
|
|
||||||
var aux_rand = random_bytes(count: 64).bytes
|
var aux_rand = random_bytes(count: 64).byteArray
|
||||||
var digest = try! id.bytes
|
var digest = try! id.bytes
|
||||||
|
|
||||||
// API allows for signing variable length messages
|
// API allows for signing variable length messages
|
||||||
@@ -786,15 +786,15 @@ func validate_event(ev: NostrEvent) -> ValidationResult {
|
|||||||
let ctx = secp256k1.Context.raw
|
let ctx = secp256k1.Context.raw
|
||||||
var xonly_pubkey = secp256k1_xonly_pubkey.init()
|
var xonly_pubkey = secp256k1_xonly_pubkey.init()
|
||||||
|
|
||||||
var ev_pubkey = ev.pubkey.id.bytes
|
var ev_pubkey = ev.pubkey.id.byteArray
|
||||||
|
|
||||||
var ok = secp256k1_xonly_pubkey_parse(ctx, &xonly_pubkey, &ev_pubkey) != 0
|
var ok = secp256k1_xonly_pubkey_parse(ctx, &xonly_pubkey, &ev_pubkey) != 0
|
||||||
if !ok {
|
if !ok {
|
||||||
return .bad_sig
|
return .bad_sig
|
||||||
}
|
}
|
||||||
|
|
||||||
var sig = ev.sig.data.bytes
|
var sig = ev.sig.data.byteArray
|
||||||
var idbytes = id.id.bytes
|
var idbytes = id.id.byteArray
|
||||||
|
|
||||||
ok = secp256k1_schnorrsig_verify(ctx, &sig, &idbytes, 32, &xonly_pubkey) > 0
|
ok = secp256k1_schnorrsig_verify(ctx, &sig, &idbytes, 32, &xonly_pubkey) > 0
|
||||||
return ok ? .ok : .bad_sig
|
return ok ? .ok : .bad_sig
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
import SwiftUICore
|
import SwiftUI
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
/// Represents artifacts in a post draft, which is rendered by `PostView`
|
/// Represents artifacts in a post draft, which is rendered by `PostView`
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
import Combine
|
import Combine
|
||||||
import Foundation
|
import Foundation
|
||||||
import SwiftUICore
|
import SwiftUI
|
||||||
import AVFoundation
|
import AVFoundation
|
||||||
|
|
||||||
/// DamusVideoCoordinator is responsible for coordinating the various video players throughout the app, and providing a nicely orchestrated experience.
|
/// DamusVideoCoordinator is responsible for coordinating the various video players throughout the app, and providing a nicely orchestrated experience.
|
||||||
|
|||||||
17
damus/Shared/Utilities/DataExtensions.swift
Normal file
17
damus/Shared/Utilities/DataExtensions.swift
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
//
|
||||||
|
// DataExtensions.swift
|
||||||
|
// damus
|
||||||
|
//
|
||||||
|
// Created by Daniel D’Aquino on 2025-09-17.
|
||||||
|
//
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
extension Data {
|
||||||
|
var byteArray: [UInt8] {
|
||||||
|
var bytesToReturn: [UInt8] = []
|
||||||
|
for i in self.bytes.byteOffsets {
|
||||||
|
bytesToReturn.append(self[i])
|
||||||
|
}
|
||||||
|
return bytesToReturn
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -132,7 +132,7 @@ final class NIP44v2EncryptingTests: XCTestCase {
|
|||||||
try encryptDecryptVectors.forEach { vector in
|
try encryptDecryptVectors.forEach { vector in
|
||||||
let conversationKey = vector.conversationKey
|
let conversationKey = vector.conversationKey
|
||||||
let conversationKeyData = try XCTUnwrap(conversationKey.hexDecoded)
|
let conversationKeyData = try XCTUnwrap(conversationKey.hexDecoded)
|
||||||
let conversationKeyBytes = conversationKeyData.bytes
|
let conversationKeyBytes = conversationKeyData.byteArray
|
||||||
|
|
||||||
let nonce = try XCTUnwrap(vector.nonce.hexDecoded)
|
let nonce = try XCTUnwrap(vector.nonce.hexDecoded)
|
||||||
let expectedPlaintextSHA256 = vector.plaintextSHA256
|
let expectedPlaintextSHA256 = vector.plaintextSHA256
|
||||||
@@ -211,7 +211,7 @@ final class NIP44v2EncryptingTests: XCTestCase {
|
|||||||
func testInvalidDecrypt() throws {
|
func testInvalidDecrypt() throws {
|
||||||
let decryptVectors = try XCTUnwrap(vectors.v2.invalid.decrypt)
|
let decryptVectors = try XCTUnwrap(vectors.v2.invalid.decrypt)
|
||||||
try decryptVectors.forEach { vector in
|
try decryptVectors.forEach { vector in
|
||||||
let conversationKey = try XCTUnwrap(vector.conversationKey.hexDecoded).bytes
|
let conversationKey = try XCTUnwrap(vector.conversationKey.hexDecoded).byteArray
|
||||||
let payload = vector.payload
|
let payload = vector.payload
|
||||||
XCTAssertThrowsError(try NIP44v2Encryption.decrypt(payload: payload, conversationKey: conversationKey), vector.note)
|
XCTAssertThrowsError(try NIP44v2Encryption.decrypt(payload: payload, conversationKey: conversationKey), vector.note)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -291,7 +291,7 @@ class NdbNote: Codable, Equatable, Hashable {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
case .manual(_, let signature, _):
|
case .manual(_, let signature, _):
|
||||||
var raw_sig = signature.data.bytes
|
var raw_sig = signature.data.byteArray
|
||||||
ndb_builder_set_sig(&builder, &raw_sig)
|
ndb_builder_set_sig(&builder, &raw_sig)
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
|||||||
Reference in New Issue
Block a user