fix: Fixed an issue where dependency package detection on Intel-based models mistakenly identified osx10 as ARM architecture, leading to incorrect downloads.

This commit is contained in:
X1a0He
2025-04-23 23:02:39 +08:00
parent 2898dd6f3c
commit 2431b0efab
10 changed files with 227 additions and 76 deletions

View File

@@ -416,7 +416,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 201;
CURRENT_PROJECT_VERSION = 202;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"Adobe Downloader/Preview Content\"";
DEVELOPMENT_TEAM = TG862GVKHK;
@@ -432,7 +432,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 2.0.1;
MARKETING_VERSION = 2.0.2;
PRODUCT_BUNDLE_IDENTIFIER = "com.x1a0he.macOS.Adobe-Downloader";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
@@ -450,7 +450,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 201;
CURRENT_PROJECT_VERSION = 202;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"Adobe Downloader/Preview Content\"";
DEVELOPMENT_TEAM = TG862GVKHK;
@@ -466,7 +466,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 2.0.1;
MARKETING_VERSION = 2.0.2;
PRODUCT_BUNDLE_IDENTIFIER = "com.x1a0he.macOS.Adobe-Downloader";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;

View File

@@ -231,7 +231,7 @@ class NewJSONParser {
continue
}
if productDisplayName == "Creative Cloud" { continue }
if(productDisplayName == "Creative Cloud" || productDisplayName == "Substance Alchemist") { continue }
let icons = (product["productIcons"] as? [String: Any])?["icon"] as? [[String: Any]] ?? []
let productIcons = icons.compactMap { icon -> Product.ProductIcon? in
@@ -304,7 +304,9 @@ class NewJSONParser {
return AppStatics.compareVersions($0.version, $1.version) > 0
}).first {
if let matchingPlatform = latestProduct.platforms.first(where: { platform in
platform.id == targetPlatform || platform.id == "macuniversal"
platform.id == targetPlatform || platform.id == "macuniversal" ||
(targetPlatform == "osx10-64" && platform.id == "osx10") ||
(targetPlatform == "osx10" && platform.id == "osx10-64")
}),
let firstLanguageSet = matchingPlatform.languageSet.first {
productVersion = firstLanguageSet.productVersion
@@ -313,7 +315,9 @@ class NewJSONParser {
selectedPlatform = matchingPlatform.id
selectedReason = matchingPlatform.id == "macuniversal" ?
"成功匹配通用平台 macuniversal支持所有 Mac 平台)" :
"成功匹配目标平台"
(matchingPlatform.id != targetPlatform ?
"成功匹配兼容平台 \(matchingPlatform.id)" :
"成功匹配目标平台")
} else {
if let firstAvailablePlatform = latestProduct.platforms.first,
let firstLanguageSet = firstAvailablePlatform.languageSet.first {

View File

@@ -29,18 +29,17 @@ struct CustomSettingsView: View {
HStack(spacing: 0) {
SquareTabButton(
imageName: "gear",
title: "通用",
title: String(localized: "通用"),
isSelected: selectedTab == "general_settings"
) {
withAnimation(.easeInOut(duration: 0.15)) {
selectedTab = "general_settings"
}
}
.accessibilityLabel("通用")
SquareTabButton(
imageName: "trash",
title: "清理工具",
title: String(localized: "清理工具"),
isSelected: selectedTab == "cleanup_view"
) {
withAnimation(.easeInOut(duration: 0.15)) {
@@ -51,7 +50,7 @@ struct CustomSettingsView: View {
SquareTabButton(
imageName: "questionmark.circle",
title: "常见问题",
title: String(localized: "常见问题"),
isSelected: selectedTab == "qa_view"
) {
withAnimation(.easeInOut(duration: 0.15)) {
@@ -62,7 +61,7 @@ struct CustomSettingsView: View {
SquareTabButton(
imageName: "info.circle",
title: "关于",
title: String(localized: "关于"),
isSelected: selectedTab == "about_app"
) {
withAnimation(.easeInOut(duration: 0.15)) {
@@ -129,7 +128,7 @@ struct CustomSettingsView: View {
.padding(.trailing, 10)
}
}
.frame(width: 600, height: 830)
.frame(width: 700, height: 650)
.onAppear {
selectedTab = "general_settings"
}

View File

@@ -59,7 +59,7 @@ struct DownloadManagerView: View {
)
}
.background(Color(.clear))
.frame(width:750, height: 500)
.frame(width:750, height: 600)
}
}

View File

@@ -635,6 +635,51 @@ private struct PackageListView: View {
@Binding var showSetupProcessAlert: Bool
let actionButtons: AnyView
@State private var showCopyAllAlert = false
private func generateAllProductsInfo(task: NewDownloadTask) -> String {
var result = ""
for (index, product) in task.dependenciesToDownload.enumerated() {
let productInfo: String
if product.sapCode == "APRO" {
productInfo = "\(product.sapCode) \(product.version)"
} else {
productInfo = "\(product.sapCode) \(product.version) - (\(product.buildGuid))"
}
result += productInfo + "\n"
for (pkgIndex, package) in product.packages.enumerated() {
let isLastPackage = pkgIndex == product.packages.count - 1
let prefix = isLastPackage ? " └── " : " ├── "
result += "\(prefix)\(package.fullPackageName) (\(package.packageVersion)) - \(package.type)\n"
}
if let originalProduct = findProduct(id: task.productId),
let platform = originalProduct.platforms.first,
let languageSet = platform.languageSet.first,
let dependency = languageSet.dependencies.first(where: { $0.sapCode == product.sapCode }) {
let matchPlatform = dependency.isMatchPlatform ? "" : ""
let targetPlatform = dependency.targetPlatform.isEmpty ? "(无)" : dependency.targetPlatform
let selectedPlatform = dependency.selectedPlatform.isEmpty ? "(无)" : dependency.selectedPlatform
let selectedReason = dependency.selectedReason.isEmpty ? "(无)" : dependency.selectedReason
result += " 依赖详情:\n"
result += " - isMatchPlatform: \(matchPlatform)\n"
result += " - targetPlatform: \(targetPlatform)\n"
result += " - selectedPlatform: \(selectedPlatform)\n"
result += " - selectedReason: \(selectedReason)\n"
}
if index < task.dependenciesToDownload.count - 1 {
result += "\n"
}
}
return result
}
var body: some View {
VStack(alignment: .leading, spacing: 6) {
HStack {
@@ -675,7 +720,7 @@ private struct PackageListView: View {
let fileURL = tasksDirectory.appendingPathComponent(fileName)
NSWorkspace.shared.selectFile(fileURL.path, inFileViewerRootedAtPath: tasksDirectory.path)
}) {
Label("查看持久化文件", systemImage: "doc.text.magnifyingglass")
Label("持久化文件", systemImage: "doc.text.magnifyingglass")
.font(.system(size: 13, weight: .medium))
.foregroundColor(.white)
}
@@ -719,29 +764,63 @@ private struct PackageListView: View {
}
if isPackageListExpanded {
ScrollView(showsIndicators: false) {
VStack(alignment: .leading, spacing: 10) {
ForEach(task.dependenciesToDownload, id: \.sapCode) { product in
ProductRow(
product: product,
isCurrentProduct: task.currentPackage?.id == product.packages.first?.id,
expandedProducts: $expandedProducts
)
.shadow(color: Color.black.opacity(0.03), radius: 2, x: 0, y: 1)
VStack(alignment: .leading, spacing: 8) {
Button(action: {
let info = generateAllProductsInfo(task: task)
let pasteboard = NSPasteboard.general
pasteboard.clearContents()
pasteboard.setString(info, forType: .string)
showCopyAllAlert = true
DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
showCopyAllAlert = false
}
}) {
Label("复制所有信息", systemImage: "doc.on.clipboard")
.font(.system(size: 13, weight: .medium))
.foregroundColor(.white)
}
.padding(.horizontal, 2)
.padding(.vertical, 5)
.buttonStyle(BeautifulButtonStyle(baseColor: .green))
.popover(isPresented: $showCopyAllAlert, arrowEdge: .leading) {
HStack(spacing: 6) {
Image(systemName: "checkmark.circle.fill")
.foregroundColor(.green)
Text("已复制所有信息")
.font(.system(size: 14, weight: .medium))
.foregroundColor(.primary)
}
.padding(.horizontal, 12)
.padding(.vertical, 8)
.background(Color(NSColor.controlBackgroundColor))
.cornerRadius(8)
.shadow(color: Color.black.opacity(0.1), radius: 2, x: 0, y: 1)
.padding(6)
}
ScrollView(showsIndicators: false) {
VStack(alignment: .leading, spacing: 10) {
ForEach(task.dependenciesToDownload, id: \.sapCode) { product in
ProductRow(
product: product,
isCurrentProduct: task.currentPackage?.id == product.packages.first?.id,
expandedProducts: $expandedProducts
)
.shadow(color: Color.black.opacity(0.03), radius: 2, x: 0, y: 1)
}
}
.padding(.horizontal, 2)
.padding(.vertical, 5)
}
.frame(maxHeight: 300)
.background(
RoundedRectangle(cornerRadius: 8)
.fill(Color(NSColor.windowBackgroundColor).opacity(0.5))
)
.overlay(
RoundedRectangle(cornerRadius: 8)
.stroke(Color.secondary.opacity(0.1), lineWidth: 0.5)
)
}
.frame(maxHeight: 300)
.background(
RoundedRectangle(cornerRadius: 8)
.fill(Color(NSColor.windowBackgroundColor).opacity(0.5))
)
.overlay(
RoundedRectangle(cornerRadius: 8)
.stroke(Color.secondary.opacity(0.1), lineWidth: 0.5)
)
}
}
}
@@ -847,13 +926,19 @@ struct ProductRow: View {
.buttonStyle(BeautifulButtonStyle(baseColor: .blue))
.help("复制 buildGuid")
.popover(isPresented: $showCopiedAlert, arrowEdge: .trailing) {
Text("已复制")
.font(.system(size: 14, weight: .medium))
.foregroundColor(.white)
.padding(.horizontal, 12)
.padding(.vertical, 8)
.cornerRadius(6)
.padding(6)
HStack(spacing: 6) {
Image(systemName: "checkmark.circle.fill")
.foregroundColor(.green)
Text("已复制")
.font(.system(size: 14, weight: .medium))
.foregroundColor(.primary)
}
.padding(.horizontal, 12)
.padding(.vertical, 8)
.background(Color(NSColor.controlBackgroundColor))
.cornerRadius(8)
.shadow(color: Color.black.opacity(0.1), radius: 2, x: 0, y: 1)
.padding(6)
}
}

View File

@@ -97,7 +97,7 @@ struct ToolbarView: View {
var body: some View {
HStack(spacing: 16) {
Toggle(isOn: $downloadAppleSilicon) {
Text("Apple Silicon")
Text("下载 Apple Silicon")
.font(.system(size: 14, weight: .medium))
}
.toggleStyle(FlatToggleStyle(onColor: .green, offColor: .gray.opacity(0.25)))

View File

@@ -17,6 +17,7 @@
},
"(可能导致处理失败)" : {
"extractionState" : "stale",
"localizations" : {
"en" : {
"stringUnit" : {
@@ -27,6 +28,7 @@
}
},
"(无法使用安装功能)" : {
"extractionState" : "stale",
"localizations" : {
"en" : {
"stringUnit" : {
@@ -135,6 +137,12 @@
},
"•" : {
},
"✅" : {
},
"❌" : {
},
"Adobe Creative Cloud" : {
@@ -278,7 +286,6 @@
},
"Debug 模式" : {
"extractionState" : "stale",
"localizations" : {
"en" : {
"stringUnit" : {
@@ -359,6 +366,7 @@
}
},
"Helper 未连接" : {
"extractionState" : "stale",
"localizations" : {
"en" : {
"stringUnit" : {
@@ -414,9 +422,15 @@
},
"macOS %@" : {
},
"Match:" : {
},
"OK" : {
},
"Reason:" : {
},
"Setup 组件是 Adobe 官方的安装程序组件,我们需要对其进行修改以实现绕过验证的功能。如果没有下载并处理 Setup 组件,将无法使用安装功能。" : {
"localizations" : {
@@ -439,6 +453,7 @@
}
},
"Setup 组件未处理,无法安装" : {
"extractionState" : "stale",
"localizations" : {
"en" : {
"stringUnit" : {
@@ -457,6 +472,9 @@
}
}
}
},
"Target:" : {
},
"v%@" : {
@@ -506,6 +524,16 @@
}
}
},
"下载 Apple Silicon" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Download Apple Silicon"
}
}
}
},
"下载 Apple Silicon 架构" : {
"localizations" : {
"en" : {
@@ -1066,7 +1094,6 @@
}
},
"可选模块" : {
"extractionState" : "stale",
"localizations" : {
"en" : {
"stringUnit" : {
@@ -1186,6 +1213,16 @@
}
}
},
"复制所有信息" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Copy all"
}
}
}
},
"多次尝试连接失败" : {
"localizations" : {
"en" : {
@@ -1421,7 +1458,6 @@
}
},
"展开全部" : {
"extractionState" : "stale",
"localizations" : {
"en" : {
"stringUnit" : {
@@ -1462,6 +1498,7 @@
}
},
"已处理" : {
"extractionState" : "stale",
"localizations" : {
"en" : {
"stringUnit" : {
@@ -1472,6 +1509,7 @@
}
},
"已备份" : {
"extractionState" : "stale",
"localizations" : {
"en" : {
"stringUnit" : {
@@ -1491,6 +1529,16 @@
}
}
},
"已复制所有信息" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Copied"
}
}
}
},
"已存在" : {
"localizations" : {
"en" : {
@@ -1697,7 +1745,6 @@
}
},
"折叠全部" : {
"extractionState" : "stale",
"localizations" : {
"en" : {
"stringUnit" : {
@@ -1707,6 +1754,16 @@
}
}
},
"持久化文件" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Persistent files"
}
}
}
},
"按名称" : {
"localizations" : {
"en" : {
@@ -2060,6 +2117,7 @@
}
},
"未处理" : {
"extractionState" : "stale",
"localizations" : {
"en" : {
"stringUnit" : {
@@ -2070,6 +2128,7 @@
}
},
"未备份" : {
"extractionState" : "stale",
"localizations" : {
"en" : {
"stringUnit" : {
@@ -2090,7 +2149,6 @@
}
},
"未对 Setup 组件进行处理或者 Setup 组件不存在,无法使用安装功能\n你可以通过设置页面再次对 Setup 组件进行处理" : {
"extractionState" : "stale",
"localizations" : {
"en" : {
"stringUnit" : {
@@ -2101,6 +2159,7 @@
}
},
"未对 Setup 组件进行处理或者 Setup 组件不存在,无法使用安装功能\n你可以通过设置页面对 Setup 组件进行处理" : {
"extractionState" : "stale",
"localizations" : {
"en" : {
"stringUnit" : {
@@ -2197,17 +2256,6 @@
}
}
},
"查看持久化文件" : {
"extractionState" : "stale",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "View persistent files"
}
}
}
},
"检查中" : {
"localizations" : {
"en" : {
@@ -2534,7 +2582,7 @@
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Cleanup Utility"
"value" : "Cleanup"
}
}
}

View File

@@ -67,14 +67,14 @@ when prompted.
- For historical update logs, please go to [Update Log](update-log.md)
- 2025-04-06 Update Log
- 2025-04-23 Update Log
```markdown
1. Fixed an issue where the latest version would still be downloaded even when selecting any specific version
2. Fixed an issue where Intel-based devices were downloading arm64 packages
3. Fixed inconsistent architecture downloads for product package dependencies
4. Added a custom settings view
5. Significantly optimized overall rendering performance, resolving interface lag during dragging
1. Fixed an issue where dependency package detection on Intel-based models mistakenly identified osx10 as ARM architecture, leading to incorrect downloads.
2. Resolved text display issues in the settings interface header.
3. Adjusted the height of the download management interface from 500 to 600.
4. Added functionality to copy all product and package list information in download tasks.
5. Optimized display handling for the product Substance Alchemist.
```
### Language friendly
@@ -84,8 +84,6 @@ when prompted.
## ⚠️ Warning
**For all the SwiftUI seniors, I am just a SwiftUI newbie, some of the code comes from Claude, OpenAI and Apple, etc.**
\
**If you have any optimization suggestions or questions about Adobe Downloader, please open an issue or
contact [@X1a0He](https://t.me/X1a0He_bot)
via Telegram.**

View File

@@ -57,14 +57,14 @@
- 更多关于 App 的更新日志,请查看 [Update Log](update-log.md)
- 2025-04-06 更新日志
- 2025-04-23 更新日志
```markdown
1. 修复了选择任意版本的情况下仍下载最新版本的问题
2. 修复了在 Intel 机型下下载包为 arm64 的问题
3. 修复了产品包依赖下载架构不一致的问题
4. 新增了自定义设置页面
5. 大幅优化整体渲染性能,解决拖动界面造成卡顿的问题
1. 修复了 Intel 机型下依赖包判断遇到 osx10 被误判为 arm 导致下载错误的问题
2. 修复了设置界面上方的文字显示问题
3. 调整下载管理界面的高度: 500 -> 600
4. 新增下载任务复制所有产品和包列表信息
5. 优化产品 Substance Alchemist 的显示问题
```
### 语言支持
@@ -74,8 +74,6 @@
## ⚠️ 注意
**对于各位 SwiftUI 前辈来说,我只是一个 SwiftUI 新手,部分代码来自 Claude、OpenAI 和 Apple 等**
\
**如果你对 Adobe Downloader 有任何优化建议或疑问,请提出 issue 或通过 Telegram 联系 [@X1a0He](https://t.me/X1a0He_bot)**
## ✨ 特点

View File

@@ -1,5 +1,24 @@
# Change Log
## 2025-04-23 更新日志
[//]: # (2.0.2)
```markdown
1. 修复了 Intel 机型下依赖包判断遇到 osx10 被误判为 arm 导致下载错误的问题
2. 修复了设置界面上方的文字显示问题
3. 调整下载管理界面的高度: 500 -> 600
4. 新增下载任务复制所有产品和包列表信息
5. 优化产品 Substance Alchemist 的显示问题
====================
1. Fixed an issue where dependency package detection on Intel-based models mistakenly identified osx10 as ARM architecture, leading to incorrect downloads.
2. Resolved text display issues in the settings interface header.
3. Adjusted the height of the download management interface from 500 to 600.
4. Added functionality to copy all product and package list information in download tasks.
5. Optimized display handling for the product Substance Alchemist.
```
## 2025-04-06 更新日志
[//]: # (2.0.1)