Skip to content

Commit

Permalink
v3.5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
alienator88 committed Apr 25, 2024
1 parent 8f89720 commit a7eb573
Show file tree
Hide file tree
Showing 18 changed files with 465 additions and 257 deletions.
40 changes: 22 additions & 18 deletions Pearcleaner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -521,10 +521,12 @@
C72893142AFD51EA00C8C1CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
APP_BUILD = "$(APP_BUILD)";
APP_VERSION = "$(APP_VERSION)";
CODE_SIGN_ENTITLEMENTS = PearcleanerSentinel/PearcleanerSentinel.entitlements;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "";
CURRENT_PROJECT_VERSION = "$(APP_BUILD)";
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = BK8443AXLU;
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -540,10 +542,12 @@
C72893152AFD51EA00C8C1CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
APP_BUILD = "$(APP_BUILD)";
APP_VERSION = "$(APP_VERSION)";
CODE_SIGN_ENTITLEMENTS = PearcleanerSentinel/PearcleanerSentinel.entitlements;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "";
CURRENT_PROJECT_VERSION = "$(APP_BUILD)";
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = BK8443AXLU;
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -560,8 +564,8 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
APP_BUILD = 36;
APP_VERSION = 3.5.2;
APP_BUILD = 38;
APP_VERSION = 3.5.4;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
Expand Down Expand Up @@ -593,7 +597,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_ENTITLEMENTS = "";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 33;
CURRENT_PROJECT_VERSION = "$(APP_BUILD)";
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand All @@ -616,7 +620,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 3.4.2;
MARKETING_VERSION = "$(APP_VERSION)";
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand All @@ -630,8 +634,8 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
APP_BUILD = 36;
APP_VERSION = 3.5.2;
APP_BUILD = 38;
APP_VERSION = 3.5.4;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
Expand Down Expand Up @@ -663,7 +667,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_ENTITLEMENTS = "";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 33;
CURRENT_PROJECT_VERSION = "$(APP_BUILD)";
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
Expand All @@ -680,7 +684,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 3.4.2;
MARKETING_VERSION = "$(APP_VERSION)";
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = macosx;
Expand All @@ -692,15 +696,14 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
APP_BUILD = 36;
APP_VERSION = 3.5.2;
APP_BUILD = "$(APP_BUILD)";
APP_VERSION = "$(APP_VERSION)";
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = Pearcleaner/Resources/Pearcleaner.entitlements;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = "$(APP_BUILD)";
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = BK8443AXLU;
Expand All @@ -718,7 +721,6 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = "$(APP_VERSION)";
PRODUCT_BUNDLE_IDENTIFIER = com.alienator88.Pearcleaner;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand All @@ -730,15 +732,14 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
APP_BUILD = 36;
APP_VERSION = 3.5.2;
APP_BUILD = "$(APP_BUILD)";
APP_VERSION = "$(APP_VERSION)";
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = Pearcleaner/Resources/Pearcleaner.entitlements;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = "$(APP_BUILD)";
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = BK8443AXLU;
Expand All @@ -756,7 +757,6 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = "$(APP_VERSION)";
PRODUCT_BUNDLE_IDENTIFIER = com.alienator88.Pearcleaner;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand All @@ -767,6 +767,8 @@
C781216D2BC892A000BE06BD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
APP_BUILD = "$(APP_BUILD)";
APP_VERSION = "$(APP_VERSION)";
CODE_SIGN_ENTITLEMENTS = FinderOpen/FinderOpen.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
Expand Down Expand Up @@ -797,6 +799,8 @@
C781216E2BC892A000BE06BD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
APP_BUILD = "$(APP_BUILD)";
APP_VERSION = "$(APP_VERSION)";
CODE_SIGN_ENTITLEMENTS = FinderOpen/FinderOpen.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
Expand Down
23 changes: 4 additions & 19 deletions Pearcleaner/Logic/AppPathsFetch.swift
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class AppPathFinder {


private func getAllContainers(bundleURL: URL) -> [URL] {
var containers = [URL]()
var containers: [URL] = []

// Extract bundle identifier from bundleURL
let bundleIdentifier = Bundle(url: bundleURL)?.bundleIdentifier
Expand All @@ -190,7 +190,9 @@ class AppPathFinder {

// Get the regular container URL for the extracted bundle identifier
if let groupContainer = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: containerBundleIdentifier) {
containers.append(groupContainer)
if FileManager.default.fileExists(atPath: groupContainer.path) {
containers.append(groupContainer)
}
} else {
printOS("Get Containers: Failed to retrieve container URL for bundle identifier: \(containerBundleIdentifier)")
}
Expand Down Expand Up @@ -221,23 +223,6 @@ class AppPathFinder {
printOS("Error accessing the Containers directory: \(error)")
}


// let fileURL = URL(fileURLWithPath: "/Users/alin/Library/Containers/2792352D-95FE-43AE-947D-FF4BF31DE4E6")
//
// do {
// // Retrieve the localized name
// let resourceValues = try fileURL.resourceValues(forKeys: [.localizedNameKey])
// if let localizedName = resourceValues.localizedName {
// print("Localized Name: \(localizedName)")
// } else {
// print("Localized name not available.")
// }
// } catch {
// print("Error retrieving localized name: \(error)")
// }



// Return all found containers
return containers
}
Expand Down
7 changes: 4 additions & 3 deletions Pearcleaner/Logic/AppState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class AppState: ObservableObject
@Published var currentView = CurrentDetailsView.empty
@Published var showAlert: Bool = false
@Published var sidebar: Bool = true
@Published var isReminderVisible: Bool = false
// @Published var isReminderVisible: Bool = false
@Published var releases = [Release]()
@Published var progressBar: (String, Double) = ("Ready", 0.0)
@Published var reload: Bool = false
Expand Down Expand Up @@ -55,6 +55,7 @@ class AppState: ObservableObject
fileSizeLogical: [:],
fileIcon: [:]
)

updateExtensionStatus()
NotificationCenter.default.addObserver(
self,
Expand All @@ -66,9 +67,9 @@ class AppState: ObservableObject
}

@objc func updateExtensionStatus() {
let extentionStatus = FIFinderSyncController.isExtensionEnabled
let extensionStatus = FIFinderSyncController.isExtensionEnabled
DispatchQueue.main.async {
self.finderExtensionEnabled = extentionStatus
self.finderExtensionEnabled = extensionStatus
}
}
}
Expand Down
75 changes: 74 additions & 1 deletion Pearcleaner/Logic/Styles.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,80 @@ struct SimpleButtonStyle: ButtonStyle {
}


struct RegularButtonStyle: ButtonStyle {
let icon: String
let label: String
let help: String
@State private var hovered = false

func makeBody(configuration: Configuration) -> some View {

HStack(alignment: .center) {
Image(systemName: icon).foregroundColor(Color("mode")).padding(.leading, 2).padding(.trailing, 0)
Text(label).textCase(.uppercase).foregroundColor(Color("mode")).fontWeight(.bold).padding(.trailing, 2)

}
.padding(8)
.background(!configuration.isPressed ? hovered ? Color("mode").opacity(0.4) : Color("mode").opacity(0) : Color("mode").opacity(0.5))
.cornerRadius(6)
.scaleEffect(configuration.isPressed ? 0.95 : 1)
.animation(.easeOut(duration: 0.2), value: configuration.isPressed)
.onHover { hovering in
withAnimation(Animation.easeIn(duration: 0.15)) {
hovered = hovering
}
}
.overlay(
RoundedRectangle(cornerRadius: 6)
.strokeBorder(Color("mode").opacity(0.5), lineWidth: 1)
.scaleEffect(configuration.isPressed ? 0.95 : 1)
)
.help(help)

}
}


struct ResetSettingsButtonStyle: ButtonStyle {
@Binding var isResetting: Bool
let label: String
let help: String
@State private var hovered = false

func makeBody(configuration: Configuration) -> some View {
HStack(alignment: .center) {
if isResetting {
ProgressView()
.progressViewStyle(CircularProgressViewStyle())
.controlSize(.small)
.frame(width: 15)
} else {
Image(systemName: "gear")
.foregroundColor(Color("mode")).padding(.leading, 2).padding(.trailing, 0)
}
Text(label)
.textCase(.uppercase).foregroundColor(Color("mode")).fontWeight(.bold).padding(.trailing, 2)
}
.padding(8)
.background(!configuration.isPressed ? hovered ? Color("mode").opacity(0.4) : Color("mode").opacity(0) : Color("mode").opacity(0.5))
.cornerRadius(6)
.scaleEffect(configuration.isPressed ? 0.95 : 1)
.animation(.easeOut(duration: 0.2), value: configuration.isPressed)
.onHover { hovering in
withAnimation(Animation.easeIn(duration: 0.15)) {
hovered = hovering
}
}
.overlay(
RoundedRectangle(cornerRadius: 6)
.strokeBorder(Color("mode").opacity(0.5), lineWidth: 1)
.scaleEffect(configuration.isPressed ? 0.95 : 1)
)
.help(help)
}
}



struct InfoButton: View {
@State private var isPopoverPresented: Bool = false
Expand Down Expand Up @@ -769,7 +843,6 @@ func backgroundView(themeSettings: ThemeSettings, darker: Bool = false, glass: B
}



struct PresetColor: ButtonStyle {
var fillColor: Color
var label: String
Expand Down
8 changes: 6 additions & 2 deletions Pearcleaner/Logic/ThemeManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ class ThemeSettings: ObservableObject {

// light - Color(.sRGB, red: 1.0, green: 1.0, blue: 1.0, opacity: 1)
// dark - Color(.sRGB, red: 0.149, green: 0.149, blue: 0.149, opacity: 1)
// slate - Color(.sRGB, red: 0.188143, green: 0.208556, blue: 0.262679, opacity: 1)

init() {
// Initialize color from UserDefaults or use a default value
if let components = UserDefaults.standard.object(forKey: colorKey) as? [CGFloat], components.count >= 4 {
themeColor = Color(.sRGB, red: components[0], green: components[1], blue: components[2], opacity: components[3])
} else {

themeColor = Color.clear
}
}
Expand All @@ -42,7 +42,8 @@ class ThemeSettings: ObservableObject {
}

func resetToDefault(dark: Bool = true) {
themeColor = dark ? Color(.sRGB, red: 0.149, green: 0.149, blue: 0.149, opacity: 1) : Color(.sRGB, red: 1.0, green: 1.0, blue: 1.0, opacity: 1)
themeColor = dark ? Color(.sRGB, red: 0.188143, green: 0.208556, blue: 0.262679, opacity: 1) : Color(.sRGB, red: 1.0, green: 1.0, blue: 1.0, opacity: 1)
// themeColor = dark ? Color(.sRGB, red: 0.149, green: 0.149, blue: 0.149, opacity: 1) : Color(.sRGB, red: 1.0, green: 1.0, blue: 1.0, opacity: 1)
saveThemeColor()
}

Expand All @@ -55,6 +56,7 @@ class ThemeSettings: ObservableObject {
let slate = colorScheme.colorScheme == .light ? Color(.sRGB, red: 0.499549, green: 0.545169, blue: 0.682028, opacity: 1) : Color(.sRGB, red: 0.188143, green: 0.208556, blue: 0.262679, opacity: 1)
let solarized = colorScheme.colorScheme == .light ? Color(.sRGB, red: 0.554372, green: 0.6557, blue: 0.734336, opacity: 1) : Color(.sRGB, red: 0.117257, green: 0.22506, blue: 0.249171, opacity: 1)
let dracula = colorScheme.colorScheme == .light ? Color(.sRGB, red: 0.567094, green: 0.562125, blue: 0.81285, opacity: 1) : Color(.sRGB, red: 0.268614, green: 0.264737, blue: 0.383503, opacity: 1)
let macOS = colorScheme.colorScheme == .light ? Color(.sRGB, red: 1.0, green: 1.0, blue: 1.0, opacity: 1) : Color(.sRGB, red: 0.149, green: 0.149, blue: 0.149, opacity: 1)

switch preset {
case "slate":
Expand All @@ -63,6 +65,8 @@ class ThemeSettings: ObservableObject {
return solarized
case "dracula":
return dracula
case "macOS":
return macOS
default:
return themeColor
}
Expand Down
Loading

0 comments on commit a7eb573

Please sign in to comment.