diff --git a/.gitignore b/.gitignore index b2f0ea8..c11acc7 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,7 @@ DerivedData/ .netrc /build TVBox-*.dmg -*.py \ No newline at end of file +*.py +/IOS-key +/TVBox.ipa +/ExportOptions.plist \ No newline at end of file diff --git a/ExportOptions.plist b/ExportOptions.plist index 5b2cc30..aa8ca55 100644 --- a/ExportOptions.plist +++ b/ExportOptions.plist @@ -3,13 +3,18 @@ method - development + enterprise signingStyle - automatic + manual stripSwiftSymbols teamID - + ZDV8SQG3XZ + provisioningProfiles + + xyz.appinstall.nov.carbon.lam + CarbonLAM_Dist_Jan262026 + thinning <none> diff --git a/package_ios.sh b/package_ios.sh index 6f65943..c566dfb 100755 --- a/package_ios.sh +++ b/package_ios.sh @@ -9,6 +9,31 @@ rm -rf build rm -rf tvbox.xcarchive rm -f TVBox.ipa +# 证书和配置 (从 secrets.sh 加载,此文件在 IOS-key 中已 gitignore) +if [ -f "IOS-key/secrets.sh" ]; then + source "IOS-key/secrets.sh" +else + echo "❌ 错误: 未找到 IOS-key/secrets.sh,请确保该文件存在。" + exit 1 +fi + +P12_PATH="IOS-key/cert.p12" +PROVISION_PATH="IOS-key/cert.mobileprovision" +# 变量已从 secrets.sh 加载: $P12_PASSWORD, $PROVISION_UUID, $TEAM_ID, $BUNDLE_ID, $SIGNING_IDENTITY + +echo "安装 Provisioning Profile..." +mkdir -p "$HOME/Library/MobileDevice/Provisioning Profiles" +cp "$PROVISION_PATH" "$HOME/Library/MobileDevice/Provisioning Profiles/$PROVISION_UUID.mobileprovision" + +echo "导入 P12 证书..." +# 将证书导入当前用户的默认钥匙串 (login.keychain) +security import "$P12_PATH" -k ~/Library/Keychains/login.keychain-db -P "$P12_PASSWORD" -T /usr/bin/codesign || true +# 解锁钥匙串以防超时 +security unlock-keychain -p "" ~/Library/Keychains/login.keychain-db + +echo "Regenerating project with XcodeGen..." +xcodegen generate + SCHEME="tvbox" CONFIGURATION="Release" ARCHIVE_PATH="build/tvbox.xcarchive" @@ -21,7 +46,12 @@ xcodebuild archive \ -scheme "$SCHEME" \ -configuration "$CONFIGURATION" \ -destination "generic/platform=iOS" \ - -archivePath "$ARCHIVE_PATH" + -archivePath "$ARCHIVE_PATH" \ + CODE_SIGN_STYLE=Manual \ + CODE_SIGN_IDENTITY="$SIGNING_IDENTITY" \ + PROVISIONING_PROFILE_SPECIFIER="$PROVISION_UUID" \ + DEVELOPMENT_TEAM="$TEAM_ID" \ + PRODUCT_BUNDLE_IDENTIFIER="$BUNDLE_ID" if [ -f "$EXPORT_OPTIONS" ]; then echo "发现 $EXPORT_OPTIONS,尝试导出 IPA..." diff --git a/project.yml b/project.yml index db3ca14..6457231 100644 --- a/project.yml +++ b/project.yml @@ -39,7 +39,7 @@ targets: INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone: "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight" GENERATE_INFOPLIST_FILE: YES CURRENT_PROJECT_VERSION: "1" - MARKETING_VERSION: "1.0.0" + MARKETING_VERSION: "1.0.3" PRODUCT_NAME: TVBox ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME: AccentColor @@ -69,7 +69,7 @@ targets: INFOPLIST_FILE: tvbox/Info.plist GENERATE_INFOPLIST_FILE: YES CURRENT_PROJECT_VERSION: "1" - MARKETING_VERSION: "1.0.0" + MARKETING_VERSION: "1.0.3" PRODUCT_NAME: TVBox ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME: AccentColor