Update iOS app to ObjFW changes
FossilOrigin-Name: 3eecffa2af1b183b334ba3153d923b423a4dff8ad4b27fc25630b1987eef00ad
This commit is contained in:
parent
a1ec666ced
commit
ee5c908943
18 changed files with 30 additions and 30 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016 - 2021 Jonathan Schleifer <js@nil.im>
|
||||
* Copyright (c) 2016 - 2023 Jonathan Schleifer <js@nil.im>
|
||||
*
|
||||
* https://fossil.nil.im/cryptopassphrase
|
||||
*
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016 - 2021 Jonathan Schleifer <js@nil.im>
|
||||
* Copyright (c) 2016 - 2023 Jonathan Schleifer <js@nil.im>
|
||||
*
|
||||
* https://fossil.nil.im/cryptopassphrase
|
||||
*
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016 - 2021 Jonathan Schleifer <js@nil.im>
|
||||
* Copyright (c) 2016 - 2023 Jonathan Schleifer <js@nil.im>
|
||||
*
|
||||
* https://fossil.nil.im/cryptopassphrase
|
||||
*
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||
<device id="retina4_7" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21678"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
|
@ -20,14 +20,14 @@
|
|||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="CryptoPassphrase" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="GvW-cV-5uf">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="630"/>
|
||||
<rect key="frame" x="0.0" y="20" width="375" height="610"/>
|
||||
<fontDescription key="fontDescription" type="system" weight="black" pointSize="32"/>
|
||||
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
<color key="shadowColor" red="0.23921568627450979" green="0.396078431372549" blue="0.54509803921568623" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<size key="shadowOffset" width="2" height="2"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Copyright © 2016 - 2021 Jonathan Schleifer" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="8gr-rl-2PJ">
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Copyright © 2016 - 2023 Jonathan Schleifer" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="8gr-rl-2PJ">
|
||||
<rect key="frame" x="0.0" y="638" width="375" height="21"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="21" id="n2V-4D-npg"/>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016 - 2021 Jonathan Schleifer <js@nil.im>
|
||||
* Copyright (c) 2016 - 2023 Jonathan Schleifer <js@nil.im>
|
||||
*
|
||||
* https://fossil.nil.im/cryptopassphrase
|
||||
*
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016 - 2021 Jonathan Schleifer <js@nil.im>
|
||||
* Copyright (c) 2016 - 2023 Jonathan Schleifer <js@nil.im>
|
||||
*
|
||||
* https://fossil.nil.im/cryptopassphrase
|
||||
*
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016 - 2021 Jonathan Schleifer <js@nil.im>
|
||||
* Copyright (c) 2016 - 2023 Jonathan Schleifer <js@nil.im>
|
||||
*
|
||||
* https://fossil.nil.im/cryptopassphrase
|
||||
*
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016 - 2021 Jonathan Schleifer <js@nil.im>
|
||||
* Copyright (c) 2016 - 2023 Jonathan Schleifer <js@nil.im>
|
||||
*
|
||||
* https://fossil.nil.im/cryptopassphrase
|
||||
*
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016 - 2021 Jonathan Schleifer <js@nil.im>
|
||||
* Copyright (c) 2016 - 2023 Jonathan Schleifer <js@nil.im>
|
||||
*
|
||||
* https://fossil.nil.im/cryptopassphrase
|
||||
*
|
||||
|
@ -28,24 +28,24 @@ class SiteStorage: OFObject {
|
|||
private static let legacyField = NSNumber(value: 1)
|
||||
private static let keyFileField = NSNumber(value: 2)
|
||||
|
||||
private var path: OFString
|
||||
private var IRI: OFIRI
|
||||
private var storage: [String: [NSNumber: AnyObject]]
|
||||
private var sites: [String]
|
||||
|
||||
override init() {
|
||||
let fileManager = OFFileManager.default
|
||||
let userDataURL = OFSystemInfo.userDataURL!
|
||||
let userDataIRI = OFSystemInfo.userDataIRI!
|
||||
|
||||
if !fileManager.directoryExists(at: userDataURL) {
|
||||
fileManager.createDirectory(at: userDataURL)
|
||||
if !fileManager.directoryExists(at: userDataIRI) {
|
||||
fileManager.createDirectory(at: userDataIRI)
|
||||
}
|
||||
|
||||
let URL = userDataURL.appendingPathComponent(
|
||||
let IRI = userDataIRI.appendingPathComponent(
|
||||
OFString(utf8String: "sites.msgpack"))
|
||||
|
||||
var storage: [String: [NSNumber: AnyObject]]? = nil
|
||||
OFException.try({
|
||||
let decoded = (OFData(contentsOf: URL).objectByParsingMessagePack)
|
||||
let decoded = (OFData(contentsOf: IRI).objectByParsingMessagePack)
|
||||
as? OFDictionary<OFString, OFDictionary<OFNumber, AnyObject>>
|
||||
storage =
|
||||
(decoded?.nsObject as? [String: [NSNumber: AnyObject]]) ?? [:]
|
||||
|
@ -53,7 +53,7 @@ class SiteStorage: OFObject {
|
|||
storage = [:]
|
||||
})
|
||||
|
||||
self.path = URL.fileSystemRepresentation!
|
||||
self.IRI = IRI
|
||||
self.storage = storage!
|
||||
self.sites = self.storage.keys.sorted()
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ class SiteStorage: OFObject {
|
|||
private func update() {
|
||||
let ofStorage = (storage as NSDictionary).ofObject
|
||||
|
||||
ofStorage.messagePackRepresentation.write(toFile: path)
|
||||
ofStorage.messagePackRepresentation.write(to: IRI)
|
||||
sites = storage.keys.sorted()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016 - 2021 Jonathan Schleifer <js@nil.im>
|
||||
* Copyright (c) 2016 - 2023 Jonathan Schleifer <js@nil.im>
|
||||
*
|
||||
* https://fossil.nil.im/cryptopassphrase
|
||||
*
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016 - 2021 Jonathan Schleifer <js@nil.im>
|
||||
* Copyright (c) 2016 - 2023 Jonathan Schleifer <js@nil.im>
|
||||
*
|
||||
* https://fossil.nil.im/cryptopassphrase
|
||||
*
|
||||
|
@ -32,7 +32,7 @@
|
|||
OF_APPLICATION_DELEGATE(OFAppDelegate)
|
||||
|
||||
@implementation OFAppDelegate
|
||||
- (void)applicationDidFinishLaunching
|
||||
- (void)applicationDidFinishLaunching: (OFNotification *)notification
|
||||
{
|
||||
int *argc;
|
||||
char ***argv;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue