Skip to content

Commit

Permalink
Release 0.24.0 (#996)
Browse files Browse the repository at this point in the history
- Updated FFI Lib version
- Adjusted code to new FFI Lib
- Updated update_dependencies.sh script
- Updated base node's list
- Updated BaseNode validation code
- Adjusted NotificationManager to align with the new push notification service.
- Wrapped disconnect() method in TorManager with background task. This gives more time for the app to finish the disconnection from the Tor process before the app will be hibernated by the system.
- Updated Tor and Sentry frameworks
- Fixed reported issue. Now, the bridges form will appear on the screen when you scan the Tor Bridges QR code from the add recipient screen.
- Added data collection consent dialog that is shown on start when the user doesn't specify the data collection behavior
- Added data collection section in settings
- Moved UTXOs wallet entry point from the transaction list to the profile page
- Updated the profile page UI
- Removed connect Yat row from the settings page
- Added isUnknownUser computed value to TariAddress extension
- Added defaultAlias value to ContactModel
defaultAlias is now used in the contact book and transaction list to replace formatted Tari address as a contact name with "Unknown Source" for addresses that are "unknown" (when raw emoji ID contains only zeros)
  • Loading branch information
TruszczynskiA authored Nov 16, 2023
1 parent 08e029d commit 185e437
Show file tree
Hide file tree
Showing 159 changed files with 3,157 additions and 2,049 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ fastlane/screenshots/*.html*
fastlane/test_output
.DS_Store
fastlane/Appfile
MobileWallet/TariLib/libtari_wallet_ffi_ios.xcframework
MobileWallet/Libraries/TariLib/libminotari_wallet_ffi_ios.xcframework
MobileWallet/Constants.plist
.idea/
fastlane/.env*
Expand Down
9 changes: 0 additions & 9 deletions .travis.yml

This file was deleted.

268 changes: 164 additions & 104 deletions MobileWallet.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1500"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1500"
wasCreatedForAppExtension = "YES"
version = "1.3">
<BuildAction
Expand Down
49 changes: 1 addition & 48 deletions MobileWallet/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ final class AppDelegate: UIResponder, UIApplicationDelegate {
Giphy.configure(apiKey: giphyApiKey)
}

AppConfigurator.configure()
AppConfigurator.shared.configure()

return true
}
Expand Down Expand Up @@ -113,51 +113,4 @@ final class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, shouldAllowExtensionPointIdentifier extensionPointIdentifier: UIApplication.ExtensionPointIdentifier) -> Bool {
extensionPointIdentifier != .keyboard
}

// MARK: - Core Data stack

lazy var persistentContainer: NSPersistentCloudKitContainer = {
/*
The persistent container for the application. This implementation
creates and returns a container, having loaded the store for the
application to it. This property is optional since there are legitimate
error conditions that could cause the creation of the store to fail.
*/
let container = NSPersistentCloudKitContainer(name: "MobileWallet")
container.loadPersistentStores(completionHandler: { (_, error) in
if let error = error as NSError? {
// Replace this implementation with code to handle the error appropriately.
// fatalError() causes the application to generate a crash log and terminate.
// You should not use this function in a shipping application, although it may be useful during development.

/*
Typical reasons for an error here include:
* The parent directory does not exist, cannot be created, or disallows writing.
* The persistent store is not accessible, due to permissions or data protection when the device is locked.
* The device is out of space.
* The store could not be migrated to the current model version.
Check the error message to determine what the actual problem was.
*/
fatalError("Unresolved error \(error), \(error.userInfo)")
}
})
return container
}()

// MARK: - Core Data Saving support

func saveContext () {
let context = persistentContainer.viewContext
if context.hasChanges {
do {
try context.save()
} catch {
// Replace this implementation with code to handle the error appropriately.
// fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
let nserror = error as NSError
fatalError("Unresolved error \(nserror), \(nserror.userInfo)")
}
}
}

}
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "ico-yat.pdf",
"filename" : "Analytics.pdf",
"idiom" : "universal"
}
],
Expand All @@ -10,6 +10,7 @@
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true,
"template-rendering-intent" : "template"
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
{
"images" : [
{
"filename" : "background.pdf",
"filename" : "Background.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
{
"filename" : "TabBarSend.pdf",
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "send-dark.pdf",
"idiom" : "universal"
}
],
"info" : {
Expand Down
Binary file not shown.
9 changes: 6 additions & 3 deletions MobileWallet/Common/AppRouter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ enum AppRouter {
}

static func moveToProfile() {
present(controller: ProfileViewController(backButtonType: .close))
let controller = ProfileViewController(backButtonType: .close)
let navigationController = AlwaysPoppableNavigationController(rootViewController: controller)
navigationController.isNavigationBarHidden = true
tabBar?.presentOnFullScreen(navigationController)
}

// MARK: - Modal Actions
Expand Down Expand Up @@ -184,8 +187,8 @@ enum AppRouter {
}

static func presentCustomTorBridgesForm(bridges: String?) {
let controller = CustomBridgesViewController(bridgesConfiguration: BridgesConfiguration(bridges: .none, customBridges: nil), initialValue: bridges)
present(controller: controller)
let controller = CustomTorBridgesConstructor.buildScene(bridges: bridges)
presentOnTop(controller: controller)
}

// MARK: - External Apps
Expand Down
56 changes: 56 additions & 0 deletions MobileWallet/Common/Errors/PosixError.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// PosixError.swift

/*
Package MobileWallet
Created by Adrian Truszczyński on 02/10/2023
Using Swift 5.0
Running on macOS 13.5

Copyright 2019 The Tari Project

Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the
following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of
its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

struct PosixError: CoreError {

static var connectionRefused: Self { Self(code: 61) }

let code: Int
var domain: String { "POSIX" }
}

extension Error {

var posixError: PosixError? {
let error = self as NSError
guard error.domain == NSPOSIXErrorDomain else { return nil }
return PosixError(code: error.code)
}
}
47 changes: 47 additions & 0 deletions MobileWallet/Common/Extensions/Task+Utils.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Task+Utils.swift

/*
Package MobileWallet
Created by Adrian Truszczyński on 01/09/2023
Using Swift 5.0
Running on macOS 13.4

Copyright 2019 The Tari Project

Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the
following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of
its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

extension Task where Failure == Never, Success == Never {

static func sleep(seconds: Double) async throws {
let nanoseconds = UInt64(1000000000 * seconds)
try await Task.sleep(nanoseconds: nanoseconds)
}
}
26 changes: 12 additions & 14 deletions MobileWallet/Common/Extensions/UIImage+Utils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

/*
Package MobileWallet
Created by Adrian Truszczyński on 15/06/2023
Created by Adrian Truszczyński on 01/10/2023
Using Swift 5.0
Running on macOS 13.4
Running on macOS 13.5

Copyright 2019 The Tari Project

Expand Down Expand Up @@ -42,18 +42,16 @@ import UIKit

extension UIImage {

var invertedMask: UIImage? {
func makeCIImage() -> CIImage? {

guard let ciImage = CIImage(image: self),
let backgroundFilter = CIFilter(name: "CIConstantColorGenerator", parameters: [kCIInputColorKey: CIColor.black]),
let inputColorFilter = CIFilter(name: "CIConstantColorGenerator", parameters: [kCIInputColorKey: CIColor.clear]),
let inputImage = inputColorFilter.outputImage,
let backgroundImage = backgroundFilter.outputImage,
let blendFilter = CIFilter(name: "CIBlendWithAlphaMask", parameters: [kCIInputImageKey: inputImage, kCIInputBackgroundImageKey: backgroundImage, kCIInputMaskImageKey: ciImage]),
let filterOutput = blendFilter.outputImage,
let outputImage = CIContext().createCGImage(filterOutput, from: ciImage.extent)
else { return nil }
if let ciImage {
return ciImage
}

return UIImage(cgImage: outputImage)
}
if let cgImage {
return CIImage(cgImage: cgImage)
}

return nil
}
}
18 changes: 0 additions & 18 deletions MobileWallet/Common/Managers/ErrorMessageManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ enum ErrorMessageManager {
return model(internalWalletError: error)
case let error as SeedWords.InternalError:
return model(seedWordsError: error)
case let error as TorManager.TorError:
return model(torError: error)
default:
return genericErrorModel
}
Expand Down Expand Up @@ -98,22 +96,6 @@ enum ErrorMessageManager {
return MessageModel(title: localized("restore_from_seed_words.error.title"), message: message.appending(signature: seedWordsError.signature), type: .error)
}

private static func model(torError: TorManager.TorError) -> MessageModel {

let message: String

switch torError {
case .connectionFailed:
message = localized("Onion_Error.error.invalid_bridges")
case .missingCookie:
message = localized("Onion_Error.error.missing_cookie_file")
case .connectionTimeout:
message = localized("Onion_Error.error.connectionError")
}

return MessageModel(title: localized("Onion_Error.error.title.onionError"), message: message, type: .error)
}

private static func model(internalWalletError: FFIWalletManager.GeneralError) -> MessageModel {

let message: String
Expand Down
18 changes: 15 additions & 3 deletions MobileWallet/Common/Managers/MigrationManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ enum MigrationManager {

// MARK: - Properties

private static let minValidVersion = "0.50.0-hotfix.1"
private static let minValidVersion = "0.52.0"

// MARK: - Actions

Expand All @@ -61,9 +61,21 @@ enum MigrationManager {
}
}

private static func isWalletHasValidVersion() async -> Bool {
private static func isWalletHasValidVersion(retryCount: Int = 0) async -> Bool {

if let version = try? await Tari.shared.walletVersion() {
let maxRetryCount = 5
var version: String?

do {
version = try Tari.shared.walletVersion()
} catch {
guard retryCount < maxRetryCount else { return false }
Logger.log(message: "Waiting for cookies: Retry Count: \(retryCount)", domain: .general, level: .info)
try? await Task.sleep(seconds: 1)
return await isWalletHasValidVersion(retryCount: retryCount + 1)
}

if let version {
let isValid = VersionValidator.compare(version, isHigherOrEqualTo: minValidVersion)
Logger.log(message: "Min. Valid Wallet Version: \(minValidVersion), Local Wallet Version: \(version), isValid: \(isValid)", domain: .general, level: .info)
return isValid
Expand Down
Loading

0 comments on commit 185e437

Please sign in to comment.