Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] - Leo 1.64.x Uplift #22484

Merged
merged 5 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
askForAppToLaunch = "Yes"
launchAutomaticallySubstyle = "2">
<BuildableProductRunnable
runnableDebuggingMode = "0">
Expand Down
4 changes: 4 additions & 0 deletions ios/brave-ios/App/iOS/Delegates/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import BraveShields
import PrivateCDN
import Playlist
import UserAgent
import AIChat

@main
class AppDelegate: UIResponder, UIApplicationDelegate {
Expand Down Expand Up @@ -120,6 +121,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
await BraveVPN.hideActiveStorePromotion()
}

// Brave Store SDK - Initialization
BraveStoreSDK.shared.refreshAllSkusOrders()

// Override point for customization after application launch.
var shouldPerformAdditionalDelegateHandling = true
AdblockEngine.setDomainResolver()
Expand Down
3 changes: 2 additions & 1 deletion ios/brave-ios/App/iOS/Delegates/AppState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import Storage
import BraveNews
import os.log
import UserAgent
import AIChat

private let adsRewardsLog = Logger(subsystem: Bundle.main.bundleIdentifier!, category: "ads-rewards")

Expand Down Expand Up @@ -179,7 +180,7 @@ public class AppState {
}
}
switches.append(.init(key: .rewardsFlags, value: BraveRewards.Configuration.current().flags))

// Initialize BraveCore
return BraveCoreMain(userAgent: UserAgent.mobile, additionalSwitches: switches)
}
Expand Down
5 changes: 4 additions & 1 deletion ios/brave-ios/App/iOS/Delegates/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,10 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
AppState.shared.dau.sendPingToServer()
}

BraveSkusManager.refreshSKUCredential(isPrivate: scene.browserViewController?.privateBrowsingManager.isPrivateBrowsing == true)
Task { @MainActor in
let isPrivateBrowsing = scene.browserViewController?.privateBrowsingManager.isPrivateBrowsing == true
await BraveSkusManager(isPrivateMode: isPrivateBrowsing)?.refreshCredentials()
}
}

func sceneWillResignActive(_ scene: UIScene) {
Expand Down
43 changes: 43 additions & 0 deletions ios/brave-ios/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ var package = Package(
.library(name: "BraveStrings", targets: ["BraveStrings"]),
.library(name: "BraveVPN", targets: ["BraveVPN"]),
.library(name: "BraveNews", targets: ["BraveNews"]),
.library(name: "AIChat", targets: ["AIChat"]),
.library(name: "Favicon", targets: ["Favicon"]),
.library(name: "FaviconModels", targets: ["FaviconModels"]),
.library(name: "SpeechRecognition", targets: ["SpeechRecognition"]),
.library(name: "Onboarding", targets: ["Onboarding"]),
.library(name: "Growth", targets: ["Growth"]),
.library(name: "RuntimeWarnings", targets: ["RuntimeWarnings"]),
Expand Down Expand Up @@ -99,6 +101,11 @@ var package = Package(
dependencies: ["BraveVPN", "Shared", "BraveShared", "Strings", "SnapKit", "CertificateUtilities"],
plugins: ["LoggerPlugin"]
),
.target(
name: "SpeechRecognition",
dependencies: ["BraveUI", "Shared", "BraveShared", "Preferences", "Data"],
plugins: ["LoggerPlugin"]
),
.target(
name: "BraveUI",
dependencies: [
Expand Down Expand Up @@ -209,6 +216,39 @@ var package = Package(
],
plugins: ["LoggerPlugin"]
),
.target(
name: "AIChat",
dependencies: [
"BraveCore",
"BraveShared",
"BraveStrings",
"BraveUI",
"DesignSystem",
"Favicon",
"Fuzi",
"Preferences",
"Strings",
"SpeechRecognition",
.product(name: "Collections", package: "swift-collections"),
.product(name: "Introspect", package: "SwiftUI-Introspect"),
.product(name: "Lottie", package: "lottie-ios"),
],
resources: [
.copy("Components/Markdown/Code Highlight/Themes/atom-one-dark.min.css"),
.copy("Components/Markdown/Code Highlight/Themes/atom-one-light.min.css"),
.copy("Components/Markdown/Code Highlight/Scripts/highlight.min.js"),
],
plugins: ["LoggerPlugin"]
),
.testTarget(
name: "AIChatTests",
dependencies: ["AIChat"],
resources: [
.copy("Components/Markdown/Code Highlight/Themes/atom-one-dark.min.css"),
.copy("Components/Markdown/Code Highlight/Themes/atom-one-light.min.css"),
.copy("Components/Markdown/Code Highlight/Scripts/highlight.min.js"),
]
),
.target(name: "Preferences", dependencies: ["Shared"], plugins: ["LoggerPlugin"]),
.target(
name: "Onboarding",
Expand Down Expand Up @@ -335,8 +375,10 @@ var braveTarget: PackageDescription.Target = .target(
"BraveWidgetsModels",
"BraveVPN",
"BraveNews",
"AIChat",
"Onboarding",
"Growth",
"SpeechRecognition",
"CodableHelpers",
"Preferences",
"Favicon",
Expand Down Expand Up @@ -422,6 +464,7 @@ var braveTarget: PackageDescription.Target = .target(
.copy("Frontend/UserContent/UserScripts/Scripts_Dynamic/Scripts/Paged/WalletEthereumProviderScript.js"),
.copy("Frontend/UserContent/UserScripts/Scripts_Dynamic/Scripts/Paged/WalletSolanaProviderScript.js"),
.copy("Frontend/UserContent/UserScripts/Scripts_Dynamic/Scripts/Paged/YoutubeQualityScript.js"),
.copy("Frontend/UserContent/UserScripts/Scripts_Dynamic/Scripts/Sandboxed/BraveLeoScript.js"),
.copy("Frontend/UserContent/UserScripts/Scripts_Dynamic/Scripts/Sandboxed/DeAmpScript.js"),
.copy("Frontend/UserContent/UserScripts/Scripts_Dynamic/Scripts/Sandboxed/FaviconScript.js"),
.copy("Frontend/UserContent/UserScripts/Scripts_Dynamic/Scripts/Sandboxed/ResourceDownloaderScript.js"),
Expand Down
Loading
Loading