diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 08d47507..0dec182a 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -1,16 +1,12 @@ name: Beta SideStore build on: push: - branches: - - develop + tags: + - '[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+' # example: 1.0.0-beta.1 jobs: build: name: Build and upload SideStore Beta - if: startsWith(github.event.head_commit.message, '[beta]') - concurrency: - group: ${{ github.ref }} - cancel-in-progress: true strategy: fail-fast: false matrix: @@ -25,63 +21,11 @@ jobs: with: submodules: recursive - # - name: Cache rust cargo - # id: cache-rust-cargo - # uses: actions/cache@v3 - # env: - # cache-name: cache-rust-cargo - # with: - # path: ~/.cargo - # key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - # restore-keys: | - # ${{ runner.os }}-build-${{ env.cache-name }}- - # ${{ runner.os }}-build- - # ${{ runner.os }}- - - # - name: Cache rust minimuxer - # id: cache-rust-minimuxer - # uses: actions/cache@v3 - # env: - # cache-name: cache-rust-minimuxer - # with: - # path: ./Dependencies/minimuxer/target - # key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - # restore-keys: | - # ${{ runner.os }}-build-${{ env.cache-name }}- - # ${{ runner.os }}-build- - # ${{ runner.os }}- - - # - name: Cache rust em_proxy - # id: cache-rust-em_proxy - # uses: actions/cache@v3 - # env: - # cache-name: cache-rust-em_proxy - # with: - # path: ./Dependencies/em_proxy/target - # key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - # restore-keys: | - # ${{ runner.os }}-build-${{ env.cache-name }}- - # ${{ runner.os }}-build- - # ${{ runner.os }}- - - name: Install dependencies run: brew install ldid - - name: Install rustup - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - target: aarch64-apple-ios - - # - name: Create emotional damage - # run: cd Dependencies/em_proxy && cargo build --release --target aarch64-apple-ios - - # - name: Build minimuxer - # run: cd Dependencies/minimuxer && cargo build --release --target aarch64-apple-ios - - - name: Add beta suffix to version - run: sed -e '/MARKETING_VERSION = .*/s/$/-beta.${{ github.run_number }}/' -i '' Build.xcconfig + - name: Change version to tag + run: sed -e '/MARKETING_VERSION = .*/s/= .*/= ${{ github.ref_name }}/' -i '' Build.xcconfig - name: Setup Xcode uses: maxim-lobanov/setup-xcode@v1.4.1 @@ -89,36 +33,26 @@ jobs: xcode-version: ${{ matrix.version }} - name: Build SideStore - run: | - xcodebuild -project AltStore.xcodeproj \ - -scheme AltStore \ - -sdk iphoneos \ - archive -archivePath ./archive \ - CODE_SIGNING_REQUIRED=NO \ - AD_HOC_CODE_SIGNING_ALLOWED=YES \ - CODE_SIGNING_ALLOWED=NO \ - DEVELOPMENT_TEAM=XYZ0123456 \ - ORG_IDENTIFIER=com.SideStore \ - | xcpretty && exit ${PIPESTATUS[0]} + run: make build | xcpretty && exit ${PIPESTATUS[0]} - name: Fakesign app - run: | - rm -rf archive.xcarchive/Products/Applications/SideStore.app/Frameworks/AltStoreCore.framework/Frameworks/ - ldid -SAltStore/Resources/tempEnt.plist archive.xcarchive/Products/Applications/SideStore.app/SideStore + run: make fakesign - name: Convert to IPA - run: | - mkdir Payload - mkdir Payload/SideStore.app - cp -R archive.xcarchive/Products/Applications/SideStore.app/ Payload/SideStore.app/ - zip -r SideStore.ipa Payload + run: make ipa - - name: Upload Artifact + - name: Upload SideStore.ipa Artifact uses: actions/upload-artifact@v3.1.0 with: name: SideStore.ipa path: SideStore.ipa + - name: Upload *.dSYM Artifact + uses: actions/upload-artifact@v3.1.0 + with: + name: SideStore-dSYM + path: ./*.dSYM/ + - name: Get version id: version run: echo "version=$(grep MARKETING_VERSION Build.xcconfig | sed -e "s/MARKETING_VERSION = //g")" >> $GITHUB_OUTPUT @@ -131,22 +65,22 @@ jobs: id: date_altstore run: echo "date=$(date -u +'%Y-%m-%d')" >> $GITHUB_OUTPUT - - name: Upload to beta release - uses: IsaacShelton/update-existing-release@v1.3.1 + - name: Upload to new beta release + uses: softprops/action-gh-release@v1 with: token: ${{ secrets.GITHUB_TOKEN }} - release: "Beta" - tag: "beta" + name: ${{ steps.version.outputs.version }} + tag_name: ${{ github.ref_name }} + draft: true prerelease: true files: SideStore.ipa body: | - This is an ⚠️ **EXPERIMENTAL** ⚠️ beta build for commit [${{ github.sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }}). + + Beta builds are hand-picked builds from development commits that will allow you to try out new features earlier than normal. However, **they might contain bugs and other issues. Use at your own risk!** + + ## Changelog - Beta builds are hand-picked builds from development commits that will allow you to try out new features earlier than normal, but with a lower chance of bugs than if you used nightly builds. However, since these changes are newer and less tested, they still have a good chance of bugs, so **use at your own risk**. - - If you want to be on the bleeding edge and use the latest development builds, you can look at [SideStore Nightly](https://github.com/${{ github.repository }}/releases/tag/nightly). **Please be aware that these builds have a much higher chance of bugs than beta or stable**. - - If you use the `SideStore (Beta)` app, it will use the latest beta build (make sure to update it in "My Apps"). + - TODO ## Build Info diff --git a/.github/workflows/increase-nightly-build-num.sh b/.github/workflows/increase-nightly-build-num.sh new file mode 100644 index 00000000..4be78710 --- /dev/null +++ b/.github/workflows/increase-nightly-build-num.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +# Ensure we are in root directory +cd "$(dirname "$0")/../.." + +DATE=`date -u +'%Y.%m.%d'` +BUILD_NUM=1 + +write() { + sed -e "/MARKETING_VERSION = .*/s/$/-nightly.$DATE.$BUILD_NUM/" -i '' Build.xcconfig + echo "$DATE,$BUILD_NUM" > .nightly-build-num +} + +if [ ! -f ".nightly-build-num" ]; then + write + exit 0 +fi + +LAST_DATE=`cat .nightly-build-num | perl -n -e '/([^,]*),([^ ]*)$/ && print $1'` +LAST_BUILD_NUM=`cat .nightly-build-num | perl -n -e '/([^,]*),([^ ]*)$/ && print $2'` + +if [[ "$DATE" != "$LAST_DATE" ]]; then + write +else + BUILD_NUM=`expr $LAST_BUILD_NUM + 1` + write +fi + diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 2f8d62ba..42555c0f 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -24,63 +24,17 @@ jobs: with: submodules: recursive - # - name: Cache rust cargo - # id: cache-rust-cargo - # uses: actions/cache@v3 - # env: - # cache-name: cache-rust-cargo - # with: - # path: ~/.cargo - # key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - # restore-keys: | - # ${{ runner.os }}-build-${{ env.cache-name }}- - # ${{ runner.os }}-build- - # ${{ runner.os }}- - - # - name: Cache rust minimuxer - # id: cache-rust-minimuxer - # uses: actions/cache@v3 - # env: - # cache-name: cache-rust-minimuxer - # with: - # path: ./Dependencies/minimuxer/target - # key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - # restore-keys: | - # ${{ runner.os }}-build-${{ env.cache-name }}- - # ${{ runner.os }}-build- - # ${{ runner.os }}- - - # - name: Cache rust em_proxy - # id: cache-rust-em_proxy - # uses: actions/cache@v3 - # env: - # cache-name: cache-rust-em_proxy - # with: - # path: ./Dependencies/em_proxy/target - # key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - # restore-keys: | - # ${{ runner.os }}-build-${{ env.cache-name }}- - # ${{ runner.os }}-build- - # ${{ runner.os }}- - - name: Install dependencies run: brew install ldid - - name: Install rustup - uses: actions-rs/toolchain@v1 + - name: Cache .nightly-build-num + uses: actions/cache@v3 with: - toolchain: stable - override: true - target: aarch64-apple-ios + path: .nightly-build-num + key: nightly-build-num - # - name: Create emotional damage - # run: cd Dependencies/em_proxy && cargo build --release --target aarch64-apple-ios - - # - name: Build minimuxer - # run: cd Dependencies/minimuxer && cargo build --release --target aarch64-apple-ios - - - name: Add nightly suffix to version - run: sed -e '/MARKETING_VERSION = .*/s/$/-nightly.${{ github.run_number }}/' -i '' Build.xcconfig + - name: Increase nightly build number and set as version + run: bash .github/workflows/increase-nightly-build-num.sh - name: Setup Xcode uses: maxim-lobanov/setup-xcode@v1.4.1 @@ -88,36 +42,26 @@ jobs: xcode-version: ${{ matrix.version }} - name: Build SideStore - run: | - xcodebuild -project AltStore.xcodeproj \ - -scheme AltStore \ - -sdk iphoneos \ - archive -archivePath ./archive \ - CODE_SIGNING_REQUIRED=NO \ - AD_HOC_CODE_SIGNING_ALLOWED=YES \ - CODE_SIGNING_ALLOWED=NO \ - DEVELOPMENT_TEAM=XYZ0123456 \ - ORG_IDENTIFIER=com.SideStore \ - | xcpretty && exit ${PIPESTATUS[0]} + run: make build | xcpretty && exit ${PIPESTATUS[0]} - name: Fakesign app - run: | - rm -rf archive.xcarchive/Products/Applications/SideStore.app/Frameworks/AltStoreCore.framework/Frameworks/ - ldid -SAltStore/Resources/tempEnt.plist archive.xcarchive/Products/Applications/SideStore.app/SideStore + run: make fakesign - name: Convert to IPA - run: | - mkdir Payload - mkdir Payload/SideStore.app - cp -R archive.xcarchive/Products/Applications/SideStore.app/ Payload/SideStore.app/ - zip -r SideStore.ipa Payload + run: make ipa - - name: Upload Artifact + - name: Upload SideStore.ipa Artifact uses: actions/upload-artifact@v3.1.0 with: name: SideStore.ipa path: SideStore.ipa + - name: Upload *.dSYM Artifact + uses: actions/upload-artifact@v3.1.0 + with: + name: SideStore-dSYM + path: ./*.dSYM/ + - name: Get version id: version run: echo "version=$(grep MARKETING_VERSION Build.xcconfig | sed -e "s/MARKETING_VERSION = //g")" >> $GITHUB_OUTPUT @@ -141,11 +85,9 @@ jobs: body: | This is an ⚠️ **EXPERIMENTAL** ⚠️ nightly build for commit [${{ github.sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }}). - Nightly builds are built from the most recent commit which means you'll be able to try out new features very early. However, since these changes are much newer and less tested, they have a much higher chance of bugs, so **use at your own risk**. + Nightly builds are **extremely experimental builds only meant to be used by developers and alpha testers. They often contain bugs and experimental features. Use at your own risk!** - If you want to try out new features early but want a lower chance of bugs, you can look at [SideStore Beta](https://github.com/${{ github.repository }}/releases/tag/beta). - - If you use the `SideStore (Nightly)` app, it will use the latest nightly build (make sure to update it in "My Apps"). + If you want to try out new features early but want a lower chance of bugs, you can look at [SideStore Beta](https://github.com/${{ github.repository }}/releases?q=beta). ## Build Info @@ -153,3 +95,6 @@ jobs: Built at (UTC date): `${{ steps.date_altstore.outputs.date }}` Commit SHA: `${{ github.sha }}` Version: `${{ steps.version.outputs.version }}` + + - name: Reset cache for apps.sidestore.io/nightly + run: sleep 10 && curl https://apps.sidestore.io/reset-cache/nightly/${{ secrets.SIDESOURCE_KEY }} diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 74f32311..b91318e5 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -19,63 +19,11 @@ jobs: with: submodules: recursive - # - name: Cache rust cargo - # id: cache-rust-cargo - # uses: actions/cache@v3 - # env: - # cache-name: cache-rust-cargo - # with: - # path: ~/.cargo - # key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - # restore-keys: | - # ${{ runner.os }}-build-${{ env.cache-name }}- - # ${{ runner.os }}-build- - # ${{ runner.os }}- - - # - name: Cache rust minimuxer - # id: cache-rust-minimuxer - # uses: actions/cache@v3 - # env: - # cache-name: cache-rust-minimuxer - # with: - # path: ./Dependencies/minimuxer/target - # key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - # restore-keys: | - # ${{ runner.os }}-build-${{ env.cache-name }}- - # ${{ runner.os }}-build- - # ${{ runner.os }}- - - # - name: Cache rust em_proxy - # id: cache-rust-em_proxy - # uses: actions/cache@v3 - # env: - # cache-name: cache-rust-em_proxy - # with: - # path: ./Dependencies/em_proxy/target - # key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - # restore-keys: | - # ${{ runner.os }}-build-${{ env.cache-name }}- - # ${{ runner.os }}-build- - # ${{ runner.os }}- - - name: Install dependencies run: brew install ldid - - name: Install rustup - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - target: aarch64-apple-ios - - # - name: Create emotional damage - # run: cd Dependencies/em_proxy && cargo build --release --target aarch64-apple-ios - - # - name: Build minimuxer - # run: cd Dependencies/minimuxer && cargo build --release --target aarch64-apple-ios - - name: Add PR suffix to version - run: sed -e '/MARKETING_VERSION = .*/s/$/-pr.${{ github.event.pull_request.number }}/' -i '' Build.xcconfig + run: sed -e "/MARKETING_VERSION = .*/s/\$/-pr.${{ github.event.pull_request.number }}+$(git rev-parse --short HEAD)/" -i '' Build.xcconfig - name: Setup Xcode uses: maxim-lobanov/setup-xcode@v1.4.1 @@ -83,32 +31,22 @@ jobs: xcode-version: ${{ matrix.version }} - name: Build SideStore - run: | - xcodebuild -project AltStore.xcodeproj \ - -scheme AltStore \ - -sdk iphoneos \ - archive -archivePath ./archive \ - CODE_SIGNING_REQUIRED=NO \ - AD_HOC_CODE_SIGNING_ALLOWED=YES \ - CODE_SIGNING_ALLOWED=NO \ - DEVELOPMENT_TEAM=XYZ0123456 \ - ORG_IDENTIFIER=com.SideStore \ - | xcpretty && exit ${PIPESTATUS[0]} + run: make build | xcpretty && exit ${PIPESTATUS[0]} - name: Fakesign app - run: | - rm -rf archive.xcarchive/Products/Applications/SideStore.app/Frameworks/AltStoreCore.framework/Frameworks/ - ldid -SAltStore/Resources/tempEnt.plist archive.xcarchive/Products/Applications/SideStore.app/SideStore + run: make fakesign - name: Convert to IPA - run: | - mkdir Payload - mkdir Payload/SideStore.app - cp -R archive.xcarchive/Products/Applications/SideStore.app/ Payload/SideStore.app/ - zip -r SideStore.ipa Payload + run: make ipa - - name: Upload Artifact + - name: Upload SideStore.ipa Artifact uses: actions/upload-artifact@v3.1.0 with: name: SideStore.ipa path: SideStore.ipa + + - name: Upload *.dSYM Artifact + uses: actions/upload-artifact@v3.1.0 + with: + name: SideStore-dSYM + path: ./*.dSYM/ diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml index a49bfa42..7db5cd49 100644 --- a/.github/workflows/stable.yml +++ b/.github/workflows/stable.yml @@ -2,7 +2,7 @@ name: Stable SideStore build on: push: tags: - - '[0-9]+.[0-9]+.[0-9]+*' + - '[0-9]+.[0-9]+.[0-9]+' # example: 1.0.0 jobs: build: @@ -21,60 +21,11 @@ jobs: with: submodules: recursive - # - name: Cache rust cargo - # id: cache-rust-cargo - # uses: actions/cache@v3 - # env: - # cache-name: cache-rust-cargo - # with: - # path: ~/.cargo - # key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - # restore-keys: | - # ${{ runner.os }}-build-${{ env.cache-name }}- - # ${{ runner.os }}-build- - # ${{ runner.os }}- - - # - name: Cache rust minimuxer - # id: cache-rust-minimuxer - # uses: actions/cache@v3 - # env: - # cache-name: cache-rust-minimuxer - # with: - # path: ./Dependencies/minimuxer/target - # key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - # restore-keys: | - # ${{ runner.os }}-build-${{ env.cache-name }}- - # ${{ runner.os }}-build- - # ${{ runner.os }}- - - # - name: Cache rust em_proxy - # id: cache-rust-em_proxy - # uses: actions/cache@v3 - # env: - # cache-name: cache-rust-em_proxy - # with: - # path: ./Dependencies/em_proxy/target - # key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - # restore-keys: | - # ${{ runner.os }}-build-${{ env.cache-name }}- - # ${{ runner.os }}-build- - # ${{ runner.os }}- - - name: Install dependencies run: brew install ldid - - name: Install rustup - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - target: aarch64-apple-ios - - # - name: Create emotional damage - # run: cd Dependencies/em_proxy && cargo build --release --target aarch64-apple-ios - - # - name: Build minimuxer - # run: cd Dependencies/minimuxer && cargo build --release --target aarch64-apple-ios + - name: Change version to tag + run: sed -e '/MARKETING_VERSION = .*/s/= .*/= ${{ github.ref_name }}/' -i '' Build.xcconfig - name: Setup Xcode uses: maxim-lobanov/setup-xcode@v1.4.1 @@ -82,36 +33,26 @@ jobs: xcode-version: ${{ matrix.version }} - name: Build SideStore - run: | - xcodebuild -project AltStore.xcodeproj \ - -scheme AltStore \ - -sdk iphoneos \ - archive -archivePath ./archive \ - CODE_SIGNING_REQUIRED=NO \ - AD_HOC_CODE_SIGNING_ALLOWED=YES \ - CODE_SIGNING_ALLOWED=NO \ - DEVELOPMENT_TEAM=XYZ0123456 \ - ORG_IDENTIFIER=com.SideStore \ - | xcpretty && exit ${PIPESTATUS[0]} + run: make build | xcpretty && exit ${PIPESTATUS[0]} - name: Fakesign app - run: | - rm -rf archive.xcarchive/Products/Applications/SideStore.app/Frameworks/AltStoreCore.framework/Frameworks/ - ldid -SAltStore/Resources/tempEnt.plist archive.xcarchive/Products/Applications/SideStore.app/SideStore + run: make fakesign - name: Convert to IPA - run: | - mkdir Payload - mkdir Payload/SideStore.app - cp -R archive.xcarchive/Products/Applications/SideStore.app/ Payload/SideStore.app/ - zip -r SideStore.ipa Payload + run: make ipa - - name: Upload Artifact + - name: Upload SideStore.ipa Artifact uses: actions/upload-artifact@v3.1.0 with: name: SideStore.ipa path: SideStore.ipa + - name: Upload *.dSYM Artifact + uses: actions/upload-artifact@v3.1.0 + with: + name: SideStore-dSYM + path: ./*.dSYM/ + - name: Get version id: version run: echo "version=$(grep MARKETING_VERSION Build.xcconfig | sed -e "s/MARKETING_VERSION = //g")" >> $GITHUB_OUTPUT @@ -129,10 +70,11 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} name: ${{ steps.version.outputs.version }} - tag_name: ${{ github.ref }} + tag_name: ${{ github.ref_name }} draft: true files: SideStore.ipa body: | + ## Changelog - TODO diff --git a/.gitignore b/.gitignore index 152b1fc5..9e0fcf89 100644 --- a/.gitignore +++ b/.gitignore @@ -35,10 +35,12 @@ xcuserdata ## AppCode specific .idea/ -Payload -*.ipa -*.zip.ipa -*.ipa.zip -xcodebuild.log +Payload/ +SideStore.ipa +*.dSYM -build.sh +Dependencies/.*-prebuilt-fetch-* +Dependencies/minimuxer/* +Dependencies/em_proxy/* +!Dependencies/**/.gitkeep +.nightly-build-num diff --git a/.gitmodules b/.gitmodules index c40a8c62..4ca1ebdb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,15 +13,9 @@ [submodule "Dependencies/MarkdownAttributedString"] path = Dependencies/MarkdownAttributedString url = https://github.com/chockenberry/MarkdownAttributedString.git -[submodule "Dependencies/em_proxy"] - path = Dependencies/em_proxy - url = https://github.com/jkcoxson/em_proxy [submodule "Dependencies/libimobiledevice-glue"] path = Dependencies/libimobiledevice-glue url = https://github.com/libimobiledevice/libimobiledevice-glue -[submodule "Dependencies/minimuxer"] - path = Dependencies/minimuxer - url = https://github.com/SideStore/minimuxer [submodule "Dependencies/libfragmentzip"] path = Dependencies/libfragmentzip url = https://github.com/SideStore/libfragmentzip.git diff --git a/AltStore.xcconfig b/AltStore.xcconfig index b2085eae..3366003e 100644 --- a/AltStore.xcconfig +++ b/AltStore.xcconfig @@ -1,3 +1,3 @@ #include "Build.xcconfig" -PRODUCT_BUNDLE_IDENTIFIER = $(ORG_PREFIX).$(PRODUCT_NAME) +PRODUCT_BUNDLE_IDENTIFIER = $(PRODUCT_BUNDLE_IDENTIFIER) diff --git a/AltStore.xcodeproj/project.pbxproj b/AltStore.xcodeproj/project.pbxproj index f428cb8d..9cde79ba 100644 --- a/AltStore.xcodeproj/project.pbxproj +++ b/AltStore.xcodeproj/project.pbxproj @@ -505,7 +505,6 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 19104DA92909BC7100C49C7B /* em_proxy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = em_proxy.h; sourceTree = ""; }; 19104DB22909C06C00C49C7B /* libEmotionalDamage.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libEmotionalDamage.a; sourceTree = BUILT_PRODUCTS_DIR; }; 19104DB42909C06D00C49C7B /* EmotionalDamage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmotionalDamage.swift; sourceTree = ""; }; 191E5FAB290A5D92001A3B7C /* libminimuxer.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libminimuxer.a; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -514,7 +513,6 @@ 191E5FCF290A651D001A3B7C /* jplist.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = jplist.c; path = Dependencies/libplist/src/jplist.c; sourceTree = SOURCE_ROOT; }; 191E5FD0290A651D001A3B7C /* jsmn.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = jsmn.c; path = Dependencies/libplist/src/jsmn.c; sourceTree = SOURCE_ROOT; }; 191E5FD1290A651D001A3B7C /* jsmn.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = jsmn.h; path = Dependencies/libplist/src/jsmn.h; sourceTree = SOURCE_ROOT; }; - 191E5FD7290A6EFB001A3B7C /* minimuxer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = minimuxer.h; path = ../Dependencies/minimuxer/minimuxer.h; sourceTree = ""; }; 1920B04E2924AC8300744F60 /* Settings.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Settings.bundle; sourceTree = ""; }; 19B9B7442845E6DF0076EF69 /* SelectTeamViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectTeamViewController.swift; sourceTree = ""; }; 7DBDF4B62991727000C18375 /* helping_tools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = helping_tools.h; sourceTree = ""; }; @@ -950,7 +948,6 @@ isa = PBXGroup; children = ( B343F84D295F6323002B1159 /* em_proxy.xcodeproj */, - 19104DA92909BC7100C49C7B /* em_proxy.h */, 19104DB42909C06D00C49C7B /* EmotionalDamage.swift */, ); path = EmotionalDamage; @@ -960,7 +957,6 @@ isa = PBXGroup; children = ( B343F847295F6321002B1159 /* minimuxer.xcodeproj */, - 191E5FD7290A6EFB001A3B7C /* minimuxer.h */, 191E5FAD290A5D92001A3B7C /* minimuxer.swift */, ); path = minimuxer; @@ -2649,15 +2645,14 @@ IPHONEOS_DEPLOYMENT_TARGET = 14.0; LIBRARY_SEARCH_PATHS = ( "$(inherited)", - "$(PROJECT_DIR)/Dependencies/em_proxy/target/aarch64-apple-ios/release", - "$(PROJECT_DIR)/Dependencies/em_proxy/target/aarch64-apple-ios/debug", + "$(PROJECT_DIR)/Dependencies/em_proxy", ); MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)"; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OBJC_BRIDGING_HEADER = EmotionalDamage/em_proxy.h; + SWIFT_OBJC_BRIDGING_HEADER = Dependencies/em_proxy/em_proxy.h; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; TVOS_DEPLOYMENT_TARGET = 14.0; @@ -2676,14 +2671,13 @@ IPHONEOS_DEPLOYMENT_TARGET = 14.0; LIBRARY_SEARCH_PATHS = ( "$(inherited)", - "$(PROJECT_DIR)/Dependencies/em_proxy/target/aarch64-apple-ios/release", - "$(PROJECT_DIR)/Dependencies/em_proxy/target/aarch64-apple-ios/debug", + "$(PROJECT_DIR)/Dependencies/em_proxy", ); MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)"; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_OBJC_BRIDGING_HEADER = EmotionalDamage/em_proxy.h; + SWIFT_OBJC_BRIDGING_HEADER = Dependencies/em_proxy/em_proxy.h; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; TVOS_DEPLOYMENT_TARGET = 14.0; @@ -2703,14 +2697,13 @@ IPHONEOS_DEPLOYMENT_TARGET = 14.0; LIBRARY_SEARCH_PATHS = ( "$(inherited)", - "$(PROJECT_DIR)/Dependencies/minimuxer/target/aarch64-apple-ios/release", - "$(PROJECT_DIR)/Dependencies/minimuxer/target/aarch64-apple-ios/debug", + "$(PROJECT_DIR)/Dependencies/minimuxer", ); OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OBJC_BRIDGING_HEADER = minimuxer/minimuxer.h; + SWIFT_OBJC_BRIDGING_HEADER = Dependencies/minimuxer/minimuxer.h; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -2727,13 +2720,12 @@ IPHONEOS_DEPLOYMENT_TARGET = 14.0; LIBRARY_SEARCH_PATHS = ( "$(inherited)", - "$(PROJECT_DIR)/Dependencies/minimuxer/target/aarch64-apple-ios/release", - "$(PROJECT_DIR)/Dependencies/minimuxer/target/aarch64-apple-ios/debug", + "$(PROJECT_DIR)/Dependencies/minimuxer", ); OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_OBJC_BRIDGING_HEADER = minimuxer/minimuxer.h; + SWIFT_OBJC_BRIDGING_HEADER = Dependencies/minimuxer/minimuxer.h; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -3233,8 +3225,6 @@ "$(inherited)", "$(PROJECT_DIR)/Dependencies/fragmentzip", "$(PROJECT_DIR)/Dependencies/libcurl", - "$(PROJECT_DIR)/Dependencies/minimuxer/target/aarch64-apple-ios/debug", - "$(PROJECT_DIR)/Dependencies/minimuxer/target/aarch64-apple-ios/release", ); PRODUCT_BUNDLE_IDENTIFIER = "$(PRODUCT_BUNDLE_IDENTIFIER)"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -3269,8 +3259,6 @@ "$(inherited)", "$(PROJECT_DIR)/Dependencies/fragmentzip", "$(PROJECT_DIR)/Dependencies/libcurl", - "$(PROJECT_DIR)/Dependencies/minimuxer/target/aarch64-apple-ios/debug", - "$(PROJECT_DIR)/Dependencies/minimuxer/target/aarch64-apple-ios/release", ); PRODUCT_BUNDLE_IDENTIFIER = "$(PRODUCT_BUNDLE_IDENTIFIER)"; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/AltStore/Info.plist b/AltStore/Info.plist index 4142265c..02248948 100644 --- a/AltStore/Info.plist +++ b/AltStore/Info.plist @@ -1,212 +1,212 @@ - - ALTAnisetteURL - https://sideloadly.io/anisette/irGb3Quww8zrhgqnzmrx - ALTAppGroups - - group.$(APP_GROUP_IDENTIFIER) - group.com.SideStore.SideStore - - ALTDeviceID - 00008101-000129D63698001E - ALTPairingFile - <insert pairing file here> - ALTServerID - 1F7D5B55-79CE-4546-A029-D4DDC4AF3B6D - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleDocumentTypes - - - CFBundleTypeIconFiles - - CFBundleTypeName - iOS App - CFBundleTypeRole - Viewer - LSHandlerRank - Alternate - LSItemContentTypes - - com.apple.itunes.ipa - - - - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - $(MARKETING_VERSION) - CFBundleURLTypes - - - CFBundleTypeRole - Editor - CFBundleURLName - AltStore General - CFBundleURLSchemes - - altstore - sidestore - - - - CFBundleTypeRole - Editor - CFBundleURLName - AltStore Backup - CFBundleURLSchemes - - altstore-com.rileytestut.AltStore - sidestore-com.SideStore.SideStore - - - - CFBundleVersion - 1 - INIntentsSupported - - RefreshAllIntent - ViewAppIntent - - LSApplicationQueriesSchemes - - altstore-com.rileytestut.AltStore - altstore-com.rileytestut.AltStore.Beta - altstore-com.rileytestut.Delta - altstore-com.rileytestut.Delta.Beta - altstore-com.rileytestut.Delta.Lite - altstore-com.rileytestut.Delta.Lite.Beta - altstore-com.rileytestut.Clip - altstore-com.rileytestut.Clip.Beta - - LSRequiresIPhoneOS - - LSSupportsOpeningDocumentsInPlace - - NSAppTransportSecurity - NSAllowsArbitraryLoads - - - NSAppleMusicUsageDescription - So that we can bypass the 3 app limit and disable revokes. - NSBonjourServices - - _altserver._tcp - - NSLocalNetworkUsageDescription - SideStore uses the local network to find and communicate with your device. - NSUserActivityTypes - - RefreshAllIntent - ViewAppIntent - - UIApplicationSceneManifest - - UIApplicationSupportsMultipleScenes - - UISceneConfigurations - - UIWindowSceneSessionRoleApplication - - - UILaunchStoryboardName - LaunchScreen - UISceneConfigurationName - Default Configuration - UISceneDelegateClassName - $(PRODUCT_MODULE_NAME).SceneDelegate - UISceneStoryboardFile - Main - - - - - UIBackgroundModes - - audio - fetch - remote-notification - - UIFileSharingEnabled - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UIStatusBarTintParameters - - UINavigationBar - - Style - UIBarStyleDefault - Translucent - - - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UTImportedTypeDeclarations - - - UTTypeConformsTo - - public.data - - UTTypeDescription - iOS App - UTTypeIconFiles - - UTTypeIdentifier - com.apple.itunes.ipa - UTTypeTagSpecification + ALTAppGroups + + group.$(APP_GROUP_IDENTIFIER) + group.com.SideStore.SideStore + + ALTDeviceID + 00008101-000129D63698001E + ALTPairingFile + <insert pairing file here> + ALTServerID + 1F7D5B55-79CE-4546-A029-D4DDC4AF3B6D + ALTAnisetteURL + https://ani.sidestore.io + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDocumentTypes + - public.filename-extension - ipa - - - - UTTypeConformsTo - - com.apple.plist - - UTTypeDescription - Mobile Device Pairing - UTTypeIconFiles - - UTTypeIdentifier - org.sidestore.mobiledevicepairing - UTTypeTagSpecification - - public.filename-extension + CFBundleTypeIconFiles + + CFBundleTypeName + iOS App + CFBundleTypeRole + Viewer + LSHandlerRank + Alternate + LSItemContentTypes - mobiledevicepairing + com.apple.itunes.ipa + + + + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(MARKETING_VERSION) + CFBundleURLTypes + + + CFBundleTypeRole + Editor + CFBundleURLName + AltStore General + CFBundleURLSchemes + + altstore + sidestore + + + + CFBundleTypeRole + Editor + CFBundleURLName + AltStore Backup + CFBundleURLSchemes + + altstore-com.rileytestut.AltStore + sidestore-com.SideStore.SideStore + + + + CFBundleVersion + 1 + INIntentsSupported + + RefreshAllIntent + ViewAppIntent + + LSApplicationQueriesSchemes + + altstore-com.rileytestut.AltStore + altstore-com.rileytestut.AltStore.Beta + altstore-com.rileytestut.Delta + altstore-com.rileytestut.Delta.Beta + altstore-com.rileytestut.Delta.Lite + altstore-com.rileytestut.Delta.Lite.Beta + altstore-com.rileytestut.Clip + altstore-com.rileytestut.Clip.Beta + + LSRequiresIPhoneOS + + LSSupportsOpeningDocumentsInPlace + + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + + NSAppleMusicUsageDescription + So that we can bypass the 3 app limit and disable revokes. + NSBonjourServices + + _altserver._tcp + + NSLocalNetworkUsageDescription + SideStore uses the local network to find and communicate with your device. + NSUserActivityTypes + + RefreshAllIntent + ViewAppIntent + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UILaunchStoryboardName + LaunchScreen + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneStoryboardFile + Main + - - - + UIBackgroundModes + + audio + fetch + remote-notification + + UIFileSharingEnabled + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UIStatusBarTintParameters + + UINavigationBar + + Style + UIBarStyleDefault + Translucent + + + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UTImportedTypeDeclarations + + + UTTypeConformsTo + + public.data + + UTTypeDescription + iOS App + UTTypeIconFiles + + UTTypeIdentifier + com.apple.itunes.ipa + UTTypeTagSpecification + + public.filename-extension + ipa + + + + UTTypeConformsTo + + com.apple.plist + + UTTypeDescription + Mobile Device Pairing + UTTypeIconFiles + + UTTypeIdentifier + org.sidestore.mobiledevicepairing + UTTypeTagSpecification + + public.filename-extension + + mobiledevicepairing + + + + + + \ No newline at end of file diff --git a/AltStore/Managing Apps/AppManager.swift b/AltStore/Managing Apps/AppManager.swift index d85fa339..5bf39ed2 100644 --- a/AltStore/Managing Apps/AppManager.swift +++ b/AltStore/Managing Apps/AppManager.swift @@ -392,7 +392,8 @@ extension AppManager func fetchAppIDs(completionHandler: @escaping (Result<([AppID], NSManagedObjectContext), Error>) -> Void) { let authenticationOperation = self.authenticate(presentingViewController: nil) { (result) in - print("Authenticated for fetching App IDs with result:", result) + // result contains name, email, auth token, OTP and other possibly personal/account specific info. we don't want this logged + //print("Authenticated for fetching App IDs with result:", result) } let fetchAppIDsOperation = FetchAppIDsOperation(context: authenticationOperation.context) diff --git a/AltStore/Operations/FetchProvisioningProfilesOperation.swift b/AltStore/Operations/FetchProvisioningProfilesOperation.swift index e7b0eb30..182cedec 100644 --- a/AltStore/Operations/FetchProvisioningProfilesOperation.swift +++ b/AltStore/Operations/FetchProvisioningProfilesOperation.swift @@ -478,10 +478,13 @@ extension FetchProvisioningProfilesOperation ALTAppleAPI.shared.delete(profile, for: team, session: session) { (success, error) in switch Result(success, error) { - case .failure(let error): completionHandler(.failure(error)) - case .success: + case .failure: + // As of March 20, 2023, the free provisioning profile is re-generated each fetch, and you can no longer delete it. + // So instead, we just return the fetched profile from above. + completionHandler(.success(profile)) - // Fetch new provisiong profile + case .success: + // Fetch new provisioning profile ALTAppleAPI.shared.fetchProvisioningProfile(for: appID, deviceType: .iphone, team: team, session: session) { (profile, error) in completionHandler(Result(profile, error)) } diff --git a/AltStore/Operations/OperationError.swift b/AltStore/Operations/OperationError.swift index 2c76995e..c97c70da 100644 --- a/AltStore/Operations/OperationError.swift +++ b/AltStore/Operations/OperationError.swift @@ -119,45 +119,45 @@ enum OperationError: LocalizedError { func minimuxer_to_operation(code: Int32) -> OperationError { switch code { - case -1: + case 1: return OperationError.noDevice - case -2: + case 2: return OperationError.createService(name: "debug") - case -3: + case 3: return OperationError.createService(name: "instproxy") - case -4: + case 4: return OperationError.getFromDevice(name: "installed apps") - case -5: + case 5: return OperationError.getFromDevice(name: "path to the app") - case -6: + case 6: return OperationError.getFromDevice(name: "bundle path") - case -7: + case 7: return OperationError.setArgument(name: "max packet") - case -8: + case 8: return OperationError.setArgument(name: "working directory") - case -9: + case 9: return OperationError.setArgument(name: "argv") - case -10: + case 10: return OperationError.getFromDevice(name: "launch success") - case -11: + case 11: return OperationError.detach - case -12: + case 12: return OperationError.functionArguments - case -13: + case 13: return OperationError.createService(name: "AFC") - case -14: + case 14: return OperationError.afc - case -15: + case 15: return OperationError.install - case -16: + case 16: return OperationError.uninstall - case -17: + case 17: return OperationError.createService(name: "misagent") - case -18: + case 18: return OperationError.profileInstall - case -19: + case 19: return OperationError.profileInstall - case -20: + case 20: return OperationError.noConnection default: return OperationError.unknown diff --git a/AltStore/Settings.bundle/Root.plist b/AltStore/Settings.bundle/Root.plist index b6d57f44..cad6e004 100644 --- a/AltStore/Settings.bundle/Root.plist +++ b/AltStore/Settings.bundle/Root.plist @@ -16,15 +16,13 @@ Key customAnisetteURL DefaultValue - http://ani.sidestore.io + https://ani.sidestore.io Titles SideStore Macley (US) Macley (DE) DrPudding - jkcoxson (AltServer) - jkcoxson (Provision) Sideloadly Nick Jawshoeadan @@ -32,12 +30,10 @@ Values - http://ani.sidestore.io + https://ani.sidestore.io http://us1.sternserv.tech http://de1.sternserv.tech https://sign.rheaa.xyz - http://jkcoxson.com:2095 - http://jkcoxson.com:2052 https://sideloadly.io/anisette/irGb3Quww8zrhgqnzmrx http://45.33.29.114 https://anisette.jawshoeadan.me diff --git a/Build.xcconfig b/Build.xcconfig index 201cd2fa..d2f0e479 100644 --- a/Build.xcconfig +++ b/Build.xcconfig @@ -1,8 +1,8 @@ // Configuration settings file format documentation can be found at: // https://help.apple.com/xcode/#/dev745c5c974 -MARKETING_VERSION = 0.3.0-m-f1shy-cow.15 -CURRENT_PROJECT_VERSION = 3020 +MARKETING_VERSION = 0.3.2-f1shy-mdc-16 +CURRENT_PROJECT_VERSION = 3050 // Vars to be overwritten by `CodeSigning.xcconfig` if exists DEVELOPMENT_TEAM = S32Z3HMYVQ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..f71e494a --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,61 @@ +# Contributing to SideStore + +Thank you for your interest in contributing to SideStore! SideStore is a community driven project, and it's made possible by people like you. + +There are many ways to contribute to SideStore, so if you aren't a developer, there are still many other ways you can help out: + +- [Writing documentation](https://github.com/SideStore/SideStore-Docs) +- [Submitting detailed bug reports and suggesting new features](https://github.com/SideStore/SideStore/issues/new/choose) +- Helping out with support + - [Discord](https://discord.gg/RgpFBX3Q3k) + - [GitHub Discussions](https://github.com/SideStore/SideStore/discussions) + +However, this guide will focus on the development side of things. For now, we will only have setup information here, but you can [join our Discord](https://discord.gg/RgpFBX3Q3k) if you need help +after setup. + +## Requirements + +This guide assumes you: + +- are on a Mac +- have Xcode installed +- have basic command line knowledge (know how to run commands, cd into a directory) +- have basic Git knowledge ([GitHub Desktop](https://desktop.github.com) is a great tool for beginners, and greatly simplifies working with Git) +- have basic Swift/iOS development knowledge + +## Setup + +1. Fork the SideStore repo on GitHub. +2. Clone the fork: `git clone https://github.com//SideStore.git --recurse-submodules` + + If you are using GitHub Desktop, refer to + [this guide](https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/adding-and-cloning-repositories/cloning-and-forking-repositories-from-github-desktop). + +3. Copy `CodeSigning.xcconfig.sample` to `CodeSigning.xcconfig` and fill in the values. +4. **(Development only)** Change the value for `ALTDeviceID` in the Info.plist to your device's UDID. Normally, SideServer embeds the device's UDID in SideStore's Info.plist during installation. When + running through Xcode you'll need to set the value yourself or else SideStore won't resign (or even install) apps for the proper device. You can achieve this by changing a few things to be able to + build and use SideStore. +5. Finally, open `AltStore.xcodeproj` in Xcode. + +Next, make and test your changes. Then, commit and push your changes using git and make a pull request. + +## Prebuilt binary information + +minimuxer and em_proxy use prebuilt static library binaries built by GitHub Actions to speed up builds and remove the need for Rust to be installed when working on SideStore. +[`Dependencies/fetch-prebuilt.sh`](./Dependencies/fetch-prebuilt.sh) will be run before each build by Xcode, and it will check if the downloaded binaries are up-to-date once every 6 hours. If you want +to force it to check for new binaries, run `bash ./Dependencies/fetch-prebuilt.sh force`. + +## Building an IPA for distribution + +You can use the Makefile: `make build fakesign ipa` + +This will create SideStore.ipa. + +> **Warning** +> +> The binary created will contain paths to Xcode's DerivedData, and if you built minimuxer on your machine, paths to $HOME/.cargo. This will include your username. If you want to keep your user's +> username private, you might want to get GitHub Actions to build the IPA instead. + +## Developing minimuxer alongside SideStore + +Please see [minimuxer's README](https://github.com/SideStore/minimuxer) for development instructions. diff --git a/Dependencies/em_proxy b/Dependencies/em_proxy deleted file mode 160000 index c8a280e5..00000000 --- a/Dependencies/em_proxy +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c8a280e54c93be130b7087c41eba83b1c15f96be diff --git a/Dependencies/em_proxy.xcodeproj/project.pbxproj b/Dependencies/em_proxy.xcodeproj/project.pbxproj index aefb2bd6..d35e5c8c 100644 --- a/Dependencies/em_proxy.xcodeproj/project.pbxproj +++ b/Dependencies/em_proxy.xcodeproj/project.pbxproj @@ -7,16 +7,14 @@ objects = { /* Begin PBXBuildFile section */ - CA60E4E02AAA37FC563E4BCC /* Cargo.toml in Sources */ = {isa = PBXBuildFile; fileRef = CA6094FFF6923EF4668187A5 /* Cargo.toml */; settings = {COMPILER_FLAGS = "--bin 'run'"; }; }; - CA60E4E02AAAA30E3695DD59 /* Cargo.toml in Sources */ = {isa = PBXBuildFile; fileRef = CA6094FFF6923EF4668187A5 /* Cargo.toml */; settings = {COMPILER_FLAGS = "--lib"; }; }; + 9987603429A4555300818586 /* em_proxy.h in Sources */ = {isa = PBXBuildFile; fileRef = 9999259129A45319005CF020 /* em_proxy.h */; }; /* End PBXBuildFile section */ /* Begin PBXBuildRule section */ CA6094FFF692AC6C1400ACA8 /* PBXBuildRule */ = { isa = PBXBuildRule; compilerSpec = com.apple.compilers.proxy.script; - dependencyFile = "$(DERIVED_FILE_DIR)/$(CARGO_XCODE_TARGET_ARCH)-$(EXECUTABLE_NAME).d"; - filePatterns = "*/Cargo.toml"; + filePatterns = "*/em_proxy.h"; fileType = pattern.proxy; inputFiles = ( ); @@ -25,14 +23,14 @@ outputFiles = ( "$(OBJECT_FILE_DIR)/$(CARGO_XCODE_TARGET_ARCH)-$(EXECUTABLE_NAME)", ); - script = "# generated with cargo-xcode 1.5.0\n\nset -eu; export PATH=\"$PATH:$HOME/.cargo/bin:/usr/local/bin\";\nif [ \"${IS_MACCATALYST-NO}\" = YES ]; then\n CARGO_XCODE_TARGET_TRIPLE=\"${CARGO_XCODE_TARGET_ARCH}-apple-ios-macabi\"\nelse\n CARGO_XCODE_TARGET_TRIPLE=\"${CARGO_XCODE_TARGET_ARCH}-apple-${CARGO_XCODE_TARGET_OS}\"\nfi\nif [ \"$CARGO_XCODE_TARGET_OS\" != \"darwin\" ]; then\n PATH=\"${PATH/\\/Contents\\/Developer\\/Toolchains\\/XcodeDefault.xctoolchain\\/usr\\/bin:/xcode-provided-ld-cant-link-lSystem-for-the-host-build-script:}\"\nfi\nPATH=\"$PATH:/opt/homebrew/bin\" # Rust projects often depend on extra tools like nasm, which Xcode lacks\nif [ \"$CARGO_XCODE_BUILD_MODE\" == release ]; then\n OTHER_INPUT_FILE_FLAGS=\"${OTHER_INPUT_FILE_FLAGS} --release\"\nfi\nif command -v rustup &> /dev/null; then\n if ! rustup target list --installed | egrep -q \"${CARGO_XCODE_TARGET_TRIPLE}\"; then\n echo \"warning: this build requires rustup toolchain for $CARGO_XCODE_TARGET_TRIPLE, but it isn't installed\"\n rustup target add \"${CARGO_XCODE_TARGET_TRIPLE}\" || echo >&2 \"warning: can't install $CARGO_XCODE_TARGET_TRIPLE\"\n fi\nfi\nif [ \"$ACTION\" = clean ]; then\n #( set -x; cargo clean --manifest-path=\"$SCRIPT_INPUT_FILE\" ${OTHER_INPUT_FILE_FLAGS} --target=\"${CARGO_XCODE_TARGET_TRIPLE}\"; );\n (set -x; echo \"yay\";);\nelse\nexport XCOUTDIR=\"${CARGO_TARGET_DIR}/${CARGO_XCODE_TARGET_TRIPLE}/${CARGO_XCODE_BUILD_MODE}\"\necho \"pwd is $PWD, xcoutdir is $XCOUTDIR\"\n ( set -x; cargo build --manifest-path=\"$SCRIPT_INPUT_FILE\" --features=\"${CARGO_XCODE_FEATURES:-}\" ${OTHER_INPUT_FILE_FLAGS} --target=\"${CARGO_XCODE_TARGET_TRIPLE}\" --target-dir=\"/Users/vrishank/Desktop/master-mdc/Dependencies/em_proxy/target\" --out-dir=\"$XCOUTDIR\" -Z unstable-options; );\nfi\n# it's too hard to explain Cargo's actual exe path to Xcode build graph, so hardlink to a known-good path instead\nBUILT_SRC=\"${CARGO_TARGET_DIR}/${CARGO_XCODE_TARGET_TRIPLE}/${CARGO_XCODE_BUILD_MODE}/${CARGO_XCODE_CARGO_FILE_NAME}\"\nln -f -- \"$BUILT_SRC\" \"$SCRIPT_OUTPUT_FILE_0\"\n\n# xcode generates dep file, but for its own path, so append our rename to it\n#DEP_FILE_SRC=\"${CARGO_TARGET_DIR}/${CARGO_XCODE_TARGET_TRIPLE}/${CARGO_XCODE_BUILD_MODE}/${CARGO_XCODE_CARGO_DEP_FILE_NAME}\"\n\nDEP_FILE_SRC=\"/Users/vrishank/Desktop/master-mdc/Dependencies/em_proxy/target/aarch64-apple-ios/release/${CARGO_XCODE_CARGO_DEP_FILE_NAME}\"\necho \"depfilesrc $DEP_FILE_SRC\"\nif [ -f \"$DEP_FILE_SRC\" ]; then\n DEP_FILE_DST=\"${DERIVED_FILE_DIR}/${CARGO_XCODE_TARGET_ARCH}-${EXECUTABLE_NAME}.d\"\n cp -f \"$DEP_FILE_SRC\" \"$DEP_FILE_DST\"\n echo >> \"$DEP_FILE_DST\" \"$SCRIPT_OUTPUT_FILE_0: $BUILT_SRC\"\nfi\n\n# lipo script needs to know all the platform-specific files that have been built\n# archs is in the file name, so that paths don't stay around after archs change\n# must match input for LipoScript\nFILE_LIST=\"${DERIVED_FILE_DIR}/${ARCHS}-${EXECUTABLE_NAME}.xcfilelist\"\ntouch \"$FILE_LIST\"\nif ! egrep -q \"$SCRIPT_OUTPUT_FILE_0\" \"$FILE_LIST\" ; then\n echo >> \"$FILE_LIST\" \"$SCRIPT_OUTPUT_FILE_0\"\nfi\n"; + script = "# generated with cargo-xcode 1.5.0\n# modified to use prebuilt binaries\n\nset -eu;\n\nBUILT_SRC=\"./em_proxy/$LIB_FILE_NAME.a\"\nln -f -- \"$BUILT_SRC\" \"$TARGET_BUILD_DIR/$EXECUTABLE_PATH\" || cp \"$BUILT_SRC\" \"$TARGET_BUILD_DIR/$EXECUTABLE_PATH\"\necho \"$BUILT_SRC -> $TARGET_BUILD_DIR/$EXECUTABLE_PATH\"\n\n# xcode generates dep file, but for its own path, so append our rename to it\n#DEP_FILE_SRC=\"minimuxer/target/${CARGO_XCODE_TARGET_TRIPLE}/release/${CARGO_XCODE_CARGO_DEP_FILE_NAME}\"\n#if [ -f \"$DEP_FILE_SRC\" ]; then\n# DEP_FILE_DST=\"${DERIVED_FILE_DIR}/${CARGO_XCODE_TARGET_ARCH}-${EXECUTABLE_NAME}.d\"\n# cp -f \"$DEP_FILE_SRC\" \"$DEP_FILE_DST\"\n# echo >> \"$DEP_FILE_DST\" \"$SCRIPT_OUTPUT_FILE_0: $BUILT_SRC\"\n#fi\n\n# lipo script needs to know all the platform-specific files that have been built\n# archs is in the file name, so that paths don't stay around after archs change\n# must match input for LipoScript\n#FILE_LIST=\"${DERIVED_FILE_DIR}/${ARCHS}-${EXECUTABLE_NAME}.xcfilelist\"\n#touch \"$FILE_LIST\"\n#if ! egrep -q \"$SCRIPT_OUTPUT_FILE_0\" \"$FILE_LIST\" ; then\n# echo >> \"$FILE_LIST\" \"$SCRIPT_OUTPUT_FILE_0\"\n#fi\n"; }; /* End PBXBuildRule section */ /* Begin PBXFileReference section */ + 9999259129A45319005CF020 /* em_proxy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = em_proxy.h; path = em_proxy/em_proxy.h; sourceTree = ""; }; ADDEDBA66A6E1 /* libresolv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libresolv.tbd; path = usr/lib/libresolv.tbd; sourceTree = SDKROOT; }; CA60058A9FBE4D17AF51A7D5 /* run */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = run; sourceTree = BUILT_PRODUCTS_DIR; }; - CA6094FFF6923EF4668187A5 /* Cargo.toml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Cargo.toml; path = em_proxy/Cargo.toml; sourceTree = ""; }; CA60C44C93D7916DE57E6EBD /* libem_proxy_static.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libem_proxy_static.a; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -65,7 +63,7 @@ CA6094FFF692D65BC3C892A8 = { isa = PBXGroup; children = ( - CA6094FFF6923EF4668187A5 /* Cargo.toml */, + 9999259129A45319005CF020 /* em_proxy.h */, CA6094FFF69222869D176AE5 /* Products */, CA6094FFF69298AF0B5890DB /* Frameworks */, ); @@ -95,6 +93,7 @@ isa = PBXNativeTarget; buildConfigurationList = CA603DD75FB4A30E3695DD59 /* Build configuration list for PBXNativeTarget "em_proxy-staticlib" */; buildPhases = ( + 9987603529A4610700818586 /* ShellScript */, CA60445C3036A30E3695DD59 /* Sources */, CA6094FFF692AF6EBB7F357C /* Universal Binary lipo */, ); @@ -146,6 +145,24 @@ /* End PBXProject section */ /* Begin PBXShellScriptBuildPhase section */ + 9987603529A4610700818586 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ./em_proxy/em_proxy.h, + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "bash ./fetch-prebuilt.sh em_proxy\n"; + }; CA6094FFF692AF6EBB7F357C /* Universal Binary lipo */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -164,7 +181,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "# generated with cargo-xcode 1.5.0\n\n set -eux; cat \"$DERIVED_FILE_DIR/$ARCHS-$EXECUTABLE_NAME.xcfilelist\" | tr '\\n' '\\0' | xargs -0 lipo -create -output \"$TARGET_BUILD_DIR/$EXECUTABLE_PATH\"\n if [ ${LD_DYLIB_INSTALL_NAME:+1} ]; then\n install_name_tool -id \"$LD_DYLIB_INSTALL_NAME\" \"$TARGET_BUILD_DIR/$EXECUTABLE_PATH\"\n fi\n "; + shellScript = "# generated with cargo-xcode 1.5.0\n\n#set -eux; cat \"$DERIVED_FILE_DIR/$ARCHS-$EXECUTABLE_NAME.xcfilelist\" | tr '\\n' '\\0' | xargs -0 lipo -create -output \"$TARGET_BUILD_DIR/$EXECUTABLE_PATH\"\n#if [ ${LD_DYLIB_INSTALL_NAME:+1} ]; then\n# install_name_tool -id \"$LD_DYLIB_INSTALL_NAME\" \"$TARGET_BUILD_DIR/$EXECUTABLE_PATH\"\n#fi\n"; }; /* End PBXShellScriptBuildPhase section */ @@ -173,7 +190,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - CA60E4E02AAA37FC563E4BCC /* Cargo.toml in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -181,7 +197,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - CA60E4E02AAAA30E3695DD59 /* Cargo.toml in Sources */, + 9987603429A4555300818586 /* em_proxy.h in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -206,6 +222,9 @@ INSTALL_GROUP = ""; INSTALL_MODE_FLAG = ""; INSTALL_OWNER = ""; + LIB_FILE_NAME = ""; + "LIB_FILE_NAME[sdk=iphoneos*]" = libem_proxy; + "LIB_FILE_NAME[sdk=iphonesimulator*]" = "libem_proxy-sim"; PRODUCT_NAME = em_proxy_static; SKIP_INSTALL = YES; SUPPORTED_PLATFORMS = "macosx iphonesimulator iphoneos appletvsimulator appletvos"; @@ -279,6 +298,9 @@ INSTALL_GROUP = ""; INSTALL_MODE_FLAG = ""; INSTALL_OWNER = ""; + LIB_FILE_NAME = ""; + "LIB_FILE_NAME[sdk=iphoneos*]" = libem_proxy; + "LIB_FILE_NAME[sdk=iphonesimulator*]" = "libem_proxy-sim"; PRODUCT_NAME = em_proxy_static; SKIP_INSTALL = YES; SUPPORTED_PLATFORMS = "macosx iphonesimulator iphoneos appletvsimulator appletvos"; diff --git a/Dependencies/em_proxy/.gitkeep b/Dependencies/em_proxy/.gitkeep new file mode 100644 index 00000000..d338f61d --- /dev/null +++ b/Dependencies/em_proxy/.gitkeep @@ -0,0 +1 @@ +Use ../fetch-prebuilt.sh to fetch prebuilt Rust dependencies \ No newline at end of file diff --git a/Dependencies/fetch-prebuilt.sh b/Dependencies/fetch-prebuilt.sh new file mode 100644 index 00000000..0acbfae3 --- /dev/null +++ b/Dependencies/fetch-prebuilt.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash + +# Ensure we are in Dependencies directory +cd "$(dirname "$0")" + +check_for_update() { + if [ -f ".skip-prebuilt-fetch-$1" ]; then + echo "Skipping prebuilt fetch for $1 since .skip-prebuilt-fetch-$1 exists. If you are developing $1 alongside SideStore, don't remove this file, or this script will replace your locally built binaries with the ones built by GitHub Actions." + return + fi + + if [ ! -f ".last-prebuilt-fetch-$1" ]; then + echo "0,none" > ".last-prebuilt-fetch-$1" + fi + + LAST_FETCH=`cat .last-prebuilt-fetch-$1 | perl -n -e '/([0-9]*),([^ ]*)$/ && print $1'` + LAST_COMMIT=`cat .last-prebuilt-fetch-$1 | perl -n -e '/([0-9]*),([^ ]*)$/ && print $2'` + + # fetch if last fetch was over 6 hours ago + if [[ $LAST_FETCH -lt $(expr $(date +%s) - 21600) ]] || [[ "$2" == "force" ]]; then + echo "Checking $1 for update" + echo + LATEST_COMMIT=`curl https://api.github.com/repos/SideStore/$1/releases/latest | perl -n -e '/Commit: https:\\/\\/github\\.com\\/[^\\/]*\\/[^\\/]*\\/commit\\/([^"]*)/ && print $1'` + echo + echo "Last commit: $LAST_COMMIT" + echo "Latest commit: $LATEST_COMMIT" + if [[ "$LAST_COMMIT" != "$LATEST_COMMIT" ]]; then + echo "Found update, downloading binaries" + echo + wget -O "$1/lib$1.a" "https://github.com/SideStore/$1/releases/latest/download/lib$1.a" + wget -O "$1/lib$1-sim.a" "https://github.com/SideStore/$1/releases/latest/download/lib$1-sim.a" + wget -O "$1/$1.h" "https://github.com/SideStore/$1/releases/latest/download/$1.h" + echo + else + echo "Up-to-date" + fi + echo "$(date +%s),$LATEST_COMMIT" > ".last-prebuilt-fetch-$1" + else + echo "It hasn't been 6 hours and force was not specified, skipping update check for $1" + fi +} + +# Allow for Xcode to check minimuxer and em_proxy separately by skipping the update check if the other one is specified as an argument +if [[ "$1" != "em_proxy" ]]; then + check_for_update minimuxer "$1" + if [[ "$1" != "minimuxer" ]]; then + echo + fi +fi +if [[ "$1" != "minimuxer" ]]; then + check_for_update em_proxy "$1" +fi diff --git a/Dependencies/minimuxer b/Dependencies/minimuxer deleted file mode 160000 index 6a5a5b4e..00000000 --- a/Dependencies/minimuxer +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6a5a5b4e730e5f5ed6e337e768da52bd93ed3457 diff --git a/Dependencies/minimuxer.xcodeproj/project.pbxproj b/Dependencies/minimuxer.xcodeproj/project.pbxproj index dbd94e30..062d1729 100644 --- a/Dependencies/minimuxer.xcodeproj/project.pbxproj +++ b/Dependencies/minimuxer.xcodeproj/project.pbxproj @@ -7,15 +7,14 @@ objects = { /* Begin PBXBuildFile section */ - CA6038F2DF2FA560B9642892 /* Cargo.toml in Sources */ = {isa = PBXBuildFile; fileRef = CA6012A875F93EF4668187A5 /* Cargo.toml */; settings = {COMPILER_FLAGS = "--lib"; }; }; + 9987603329A454B500818586 /* minimuxer.h in Sources */ = {isa = PBXBuildFile; fileRef = 9987603229A454B500818586 /* minimuxer.h */; }; /* End PBXBuildFile section */ /* Begin PBXBuildRule section */ CA6012A875F9AC6C1400ACA8 /* PBXBuildRule */ = { isa = PBXBuildRule; compilerSpec = com.apple.compilers.proxy.script; - dependencyFile = "$(DERIVED_FILE_DIR)/$(CARGO_XCODE_TARGET_ARCH)-$(EXECUTABLE_NAME).d"; - filePatterns = "*/Cargo.toml"; + filePatterns = "*/minimuxer.h"; fileType = pattern.proxy; inputFiles = ( ); @@ -24,13 +23,13 @@ outputFiles = ( "$(OBJECT_FILE_DIR)/$(CARGO_XCODE_TARGET_ARCH)-$(EXECUTABLE_NAME)", ); - script = "# generated with cargo-xcode 1.5.0\n\nset -eu; export PATH=\"$PATH:$HOME/.cargo/bin:/usr/local/bin\";\nif [ \"${IS_MACCATALYST-NO}\" = YES ]; then\n CARGO_XCODE_TARGET_TRIPLE=\"${CARGO_XCODE_TARGET_ARCH}-apple-ios-macabi\"\nelse\n CARGO_XCODE_TARGET_TRIPLE=\"${CARGO_XCODE_TARGET_ARCH}-apple-${CARGO_XCODE_TARGET_OS}\"\nfi\nif [ \"$CARGO_XCODE_TARGET_OS\" != \"darwin\" ]; then\n PATH=\"${PATH/\\/Contents\\/Developer\\/Toolchains\\/XcodeDefault.xctoolchain\\/usr\\/bin:/xcode-provided-ld-cant-link-lSystem-for-the-host-build-script:}\"\nfi\nPATH=\"$PATH:/opt/homebrew/bin\" # Rust projects often depend on extra tools like nasm, which Xcode lacks\nif [ \"$CARGO_XCODE_BUILD_MODE\" == release ]; then\n OTHER_INPUT_FILE_FLAGS=\"${OTHER_INPUT_FILE_FLAGS} --release\"\nfi\nif command -v rustup &> /dev/null; then\n if ! rustup target list --installed | egrep -q \"${CARGO_XCODE_TARGET_TRIPLE}\"; then\n echo \"warning: this build requires rustup toolchain for $CARGO_XCODE_TARGET_TRIPLE, but it isn't installed\"\n rustup target add \"${CARGO_XCODE_TARGET_TRIPLE}\" || echo >&2 \"warning: can't install $CARGO_XCODE_TARGET_TRIPLE\"\n fi\nfi\nif [ \"$ACTION\" = clean ]; then\n #( set -x; cargo clean --manifest-path=\"$SCRIPT_INPUT_FILE\" ${OTHER_INPUT_FILE_FLAGS} --target=\"${CARGO_XCODE_TARGET_TRIPLE}\"; );\n (set -x; echo \"yay\";);\nelse\nexport XCOUTDIR=\"${CARGO_TARGET_DIR}/${CARGO_XCODE_TARGET_TRIPLE}/${CARGO_XCODE_BUILD_MODE}\"\necho \"pwd is $PWD, xcoutdir is $XCOUTDIR\"\n ( set -x; cargo build --manifest-path=\"$SCRIPT_INPUT_FILE\" --features=\"${CARGO_XCODE_FEATURES:-}\" ${OTHER_INPUT_FILE_FLAGS} --target=\"${CARGO_XCODE_TARGET_TRIPLE}\" --target-dir=\"/Users/vrishank/Desktop/master-mdc/Dependencies/minimuxer/target\" --out-dir=\"$XCOUTDIR\" -Z unstable-options; );\nfi\n# it's too hard to explain Cargo's actual exe path to Xcode build graph, so hardlink to a known-good path instead\nBUILT_SRC=\"${CARGO_TARGET_DIR}/${CARGO_XCODE_TARGET_TRIPLE}/${CARGO_XCODE_BUILD_MODE}/${CARGO_XCODE_CARGO_FILE_NAME}\"\nln -f -- \"$BUILT_SRC\" \"$SCRIPT_OUTPUT_FILE_0\"\n\n# xcode generates dep file, but for its own path, so append our rename to it\n#DEP_FILE_SRC=\"${CARGO_TARGET_DIR}/${CARGO_XCODE_TARGET_TRIPLE}/${CARGO_XCODE_BUILD_MODE}/${CARGO_XCODE_CARGO_DEP_FILE_NAME}\"\n\nDEP_FILE_SRC=\"/Users/vrishank/Desktop/master-mdc/Dependencies/minimuxer/target/aarch64-apple-ios/release/libminimuxer.d\"\necho \"depfilesrc $DEP_FILE_SRC\"\nif [ -f \"$DEP_FILE_SRC\" ]; then\n DEP_FILE_DST=\"${DERIVED_FILE_DIR}/${CARGO_XCODE_TARGET_ARCH}-${EXECUTABLE_NAME}.d\"\n cp -f \"$DEP_FILE_SRC\" \"$DEP_FILE_DST\"\n echo >> \"$DEP_FILE_DST\" \"$SCRIPT_OUTPUT_FILE_0: $BUILT_SRC\"\nfi\n\n# lipo script needs to know all the platform-specific files that have been built\n# archs is in the file name, so that paths don't stay around after archs change\n# must match input for LipoScript\nFILE_LIST=\"${DERIVED_FILE_DIR}/${ARCHS}-${EXECUTABLE_NAME}.xcfilelist\"\ntouch \"$FILE_LIST\"\nif ! egrep -q \"$SCRIPT_OUTPUT_FILE_0\" \"$FILE_LIST\" ; then\n echo >> \"$FILE_LIST\" \"$SCRIPT_OUTPUT_FILE_0\"\nfi\n"; + script = "# generated with cargo-xcode 1.5.0\n# modified to use prebuilt binaries\n\nset -eu;\n\nBUILT_SRC=\"./minimuxer/$LIB_FILE_NAME.a\"\nln -f -- \"$BUILT_SRC\" \"$TARGET_BUILD_DIR/$EXECUTABLE_PATH\" || cp \"$BUILT_SRC\" \"$TARGET_BUILD_DIR/$EXECUTABLE_PATH\"\necho \"$BUILT_SRC -> $TARGET_BUILD_DIR/$EXECUTABLE_PATH\"\n\n# xcode generates dep file, but for its own path, so append our rename to it\n#DEP_FILE_SRC=\"minimuxer/target/${CARGO_XCODE_TARGET_TRIPLE}/release/${CARGO_XCODE_CARGO_DEP_FILE_NAME}\"\n#if [ -f \"$DEP_FILE_SRC\" ]; then\n# DEP_FILE_DST=\"${DERIVED_FILE_DIR}/${CARGO_XCODE_TARGET_ARCH}-${EXECUTABLE_NAME}.d\"\n# cp -f \"$DEP_FILE_SRC\" \"$DEP_FILE_DST\"\n# echo >> \"$DEP_FILE_DST\" \"$SCRIPT_OUTPUT_FILE_0: $BUILT_SRC\"\n#fi\n\n# lipo script needs to know all the platform-specific files that have been built\n# archs is in the file name, so that paths don't stay around after archs change\n# must match input for LipoScript\n#FILE_LIST=\"${DERIVED_FILE_DIR}/${ARCHS}-${EXECUTABLE_NAME}.xcfilelist\"\n#touch \"$FILE_LIST\"\n#if ! egrep -q \"$SCRIPT_OUTPUT_FILE_0\" \"$FILE_LIST\" ; then\n# echo >> \"$FILE_LIST\" \"$SCRIPT_OUTPUT_FILE_0\"\n#fi\n"; }; /* End PBXBuildRule section */ /* Begin PBXFileReference section */ + 9987603229A454B500818586 /* minimuxer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = minimuxer.h; path = minimuxer/minimuxer.h; sourceTree = ""; }; ADDEDBA66A6E1 /* libresolv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libresolv.tbd; path = usr/lib/libresolv.tbd; sourceTree = SDKROOT; }; - CA6012A875F93EF4668187A5 /* Cargo.toml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Cargo.toml; path = minimuxer/Cargo.toml; sourceTree = ""; }; CA609C732349C7AAD9FA67C4 /* libminimuxer_static.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libminimuxer_static.a; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -62,7 +61,7 @@ CA6012A875F9D65BC3C892A8 = { isa = PBXGroup; children = ( - CA6012A875F93EF4668187A5 /* Cargo.toml */, + 9987603229A454B500818586 /* minimuxer.h */, CA6012A875F922869D176AE5 /* Products */, CA6012A875F998AF0B5890DB /* Frameworks */, ); @@ -75,6 +74,7 @@ isa = PBXNativeTarget; buildConfigurationList = CA600589A243A560B9642892 /* Build configuration list for PBXNativeTarget "minimuxer-staticlib" */; buildPhases = ( + 9987603629A4611D00818586 /* ShellScript */, CA600F638141A560B9642892 /* Sources */, CA6012A875F9AF6EBB7F357C /* Universal Binary lipo */, ); @@ -121,6 +121,24 @@ /* End PBXProject section */ /* Begin PBXShellScriptBuildPhase section */ + 9987603629A4611D00818586 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ./minimuxer/minimuxer.h, + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "bash ./fetch-prebuilt.sh minimuxer\n"; + }; CA6012A875F9AF6EBB7F357C /* Universal Binary lipo */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -139,7 +157,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "# generated with cargo-xcode 1.5.0\n\n set -eux; cat \"$DERIVED_FILE_DIR/$ARCHS-$EXECUTABLE_NAME.xcfilelist\" | tr '\\n' '\\0' | xargs -0 lipo -create -output \"$TARGET_BUILD_DIR/$EXECUTABLE_PATH\"\n if [ ${LD_DYLIB_INSTALL_NAME:+1} ]; then\n install_name_tool -id \"$LD_DYLIB_INSTALL_NAME\" \"$TARGET_BUILD_DIR/$EXECUTABLE_PATH\"\n fi\n "; + shellScript = "# generated with cargo-xcode 1.5.0\n\n#set -eux; cat \"$DERIVED_FILE_DIR/$ARCHS-$EXECUTABLE_NAME.xcfilelist\" | tr '\\n' '\\0' | xargs -0 lipo -create -output \"$TARGET_BUILD_DIR/$EXECUTABLE_PATH\"\n#if [ ${LD_DYLIB_INSTALL_NAME:+1} ]; then\n# install_name_tool -id \"$LD_DYLIB_INSTALL_NAME\" \"$TARGET_BUILD_DIR/$EXECUTABLE_PATH\"\n#fi\n"; }; /* End PBXShellScriptBuildPhase section */ @@ -148,7 +166,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - CA6038F2DF2FA560B9642892 /* Cargo.toml in Sources */, + 9987603329A454B500818586 /* minimuxer.h in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -163,6 +181,9 @@ INSTALL_GROUP = ""; INSTALL_MODE_FLAG = ""; INSTALL_OWNER = ""; + LIB_FILE_NAME = ""; + "LIB_FILE_NAME[sdk=iphoneos*]" = libminimuxer; + "LIB_FILE_NAME[sdk=iphonesimulator*]" = "libminimuxer-sim"; PRODUCT_NAME = minimuxer_static; SKIP_INSTALL = YES; SUPPORTED_PLATFORMS = "macosx iphonesimulator iphoneos appletvsimulator appletvos"; @@ -177,6 +198,9 @@ INSTALL_GROUP = ""; INSTALL_MODE_FLAG = ""; INSTALL_OWNER = ""; + LIB_FILE_NAME = ""; + "LIB_FILE_NAME[sdk=iphoneos*]" = libminimuxer; + "LIB_FILE_NAME[sdk=iphonesimulator*]" = "libminimuxer-sim"; PRODUCT_NAME = minimuxer_static; SKIP_INSTALL = YES; SUPPORTED_PLATFORMS = "macosx iphonesimulator iphoneos appletvsimulator appletvos"; diff --git a/Dependencies/minimuxer/.gitkeep b/Dependencies/minimuxer/.gitkeep new file mode 100644 index 00000000..d338f61d --- /dev/null +++ b/Dependencies/minimuxer/.gitkeep @@ -0,0 +1 @@ +Use ../fetch-prebuilt.sh to fetch prebuilt Rust dependencies \ No newline at end of file diff --git a/Dependencies/update.sh b/Dependencies/update.sh deleted file mode 100755 index bdcea4c2..00000000 --- a/Dependencies/update.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash -set -e; set -o pipefail; set -x; - -echo "Building Rust projects..." -cd em_proxy -cargo xcode --output-dir ../ -cd ../ -cd minimuxer -cargo xcode --output-dir ../ -echo "Done!" diff --git a/EmotionalDamage/em_proxy.h b/EmotionalDamage/em_proxy.h deleted file mode 100644 index fd09f4fa..00000000 --- a/EmotionalDamage/em_proxy.h +++ /dev/null @@ -1,40 +0,0 @@ -// Jackson Coxson - -#include -#include -#include -#include -#include - - -/** - * Starts your emotional damage - * # Arguments - * * `bind_addr` - The UDP socket to listen to - * # Returns - * A handle to stop further emotional damage. - * Null on failure - * # Safety - * Don't be stupid - */ -int start_emotional_damage(const char *bind_addr); - -/** - * Stops further emotional damage - * # Arguments - * * `handle` - The coping mechanism generated by start_emotional_damage - * # Returns - * The knowledge of knowing that you couldn't handle failure - * # Safety - * Don't be stupid - */ -void stop_emotional_damage(void); - -/** - * Blocks until Wireguard is ready - * # Arguments - * * `timeout` - The timeout in miliseconds to wait for Wireguard - * # Returns - * 0 on success, -1 on failure - */ -int test_emotional_damage(int timeout); diff --git a/Makefile b/Makefile index 69952f3f..503859bf 100644 --- a/Makefile +++ b/Makefile @@ -2,8 +2,6 @@ SHELL := /bin/bash .PHONY: help ios update tvos RUBY := $(shell command -v ruby 2>/dev/null) -RUST := $(shell command -v rust 2>/dev/null) -RUSTUP := $(shell command -v rustup 2>/dev/null) HOMEBREW := $(shell command -v brew 2>/dev/null) BUNDLER := $(shell command -v bundle 2>/dev/null) @@ -72,11 +70,7 @@ help: ## Install dependencies. setup: \ - pre_setup \ - install_rust \ - install_rustup \ - install_rust_toolchain \ - build_rust_dependencies + pre_setup # check_for_homebrew \ # update_homebrew \ @@ -89,20 +83,6 @@ pull_request: \ pre_setup: $(info Project setup…) -check_for_rust: - $(info Checking for Rust…) - -ifeq ($(RUST),) - $(error Rust is not installed.) -endif - -check_for_rustup: - $(info Checking for Rustup…) - -ifeq ($(RUSTUP),) - $(error Rust is not installed.) -endif - check_for_ruby: $(info Checking for Ruby…) @@ -153,79 +133,12 @@ pull: ## -- Source Code Tasks -- ## Pull upstream and update 3rd party frameworks -# update: pull submodules build_rust_dependencies -update: submodules build_rust_dependencies +update: submodules submodules: $(info Updating submodules…) - git submodule update --init --recursive - -build_rust_dependencies: - $(info Building Rust dependencies…) - - pushd Dependencies/em_proxy - cargo build --release --target aarch64-apple-ios - popd - pushd Dependencies/minimuxer - cargo build --release --target aarch64-apple-ios - popd - -install_rustup: - $(info Installing Rustup…) - - curl https://sh.rustup.rs -sSf | sh - source "$(HOME)/.cargo/env" - rustup target add aarch64-apple-ios - -# TODO: Add x86, armv7? toolchains -# https://doc.rust-lang.org/nightly/rustc/platform-support.html - -install_cbindgen: - $(info Installing cbindgen…) - - cargo install cbindgen - -install_rust_toolchain: - $(info Installing Rust toolchain…) - - rustup target add aarch64-apple-ios - -install_rust_toolchain_ios_sim: - $(info Installing Rust iOS Sim toolchain…) - - rustup target add aarch64-apple-ios-sim - -install_rust_toolchain_tvos: - $(info Installing Rust tvOS toolchain…) - - rustup target add aarch64-apple-tvos - -install_rust_toolchain_tvos_sim: - $(info Installing Rust tvOS Sim toolchain…) - - rustup target add aarch64-apple-tvos-sim - -install_rust_toolchain_watchos_sim: - $(info Installing Rust watchOS Sim toolchain…) - - rustup target add aarch64-apple-watchos-sim - -install_rust_toolchain_watchos: - $(info Installing Rust watchOS toolchain…) - - rustup target add aarch64-apple-watchos - -install_rust_toolchain_catalyst: - $(info Installing Rust macOS Catalyst toolchain…) - - rustup target add aarch64-apple-ios-macabi - -install_rust: - $(info Installing Rust…) - - curl https://sh.rustup.rs -sSf | sh - source "$(HOME)/.cargo/env" + git submodule update --init --recursive --remote ## -- QA Task Runners -- @@ -243,32 +156,25 @@ test: ## -- Building -- -developer_ios: - $(info Building iOS for Developer profile…) +build: + @xcodebuild -project AltStore.xcodeproj \ + -scheme AltStore \ + -sdk iphoneos \ + archive -archivePath ./archive \ + CODE_SIGNING_REQUIRED=NO \ + AD_HOC_CODE_SIGNING_ALLOWED=YES \ + CODE_SIGNING_ALLOWED=NO \ + DEVELOPMENT_TEAM=XYZ0123456 \ + ORG_IDENTIFIER=com.SideStore \ + DWARF_DSYM_FOLDER_PATH="." - xcodebuild -project AltStore.xcodeproj -scheme AltStore -sdk iphoneos archive -archivePath ./archive CODE_SIGNING_REQUIRED=NO AD_HOC_CODE_SIGNING_ALLOWED=YES CODE_SIGNING_ALLOWED=NO DEVELOPMENT_TEAM=XYZ0123456 ORG_IDENTIFIER=com.SideStore | xcpretty +fakesign: + rm -rf archive.xcarchive/Products/Applications/SideStore.app/Frameworks/AltStoreCore.framework/Frameworks/ + ldid -SAltStore/Resources/tempEnt.plist archive.xcarchive/Products/Applications/SideStore.app/SideStore -developer_tvos: - $(info Building tvOS for Developer profile…) +ipa: + mkdir Payload + mkdir Payload/SideStore.app + cp -R archive.xcarchive/Products/Applications/SideStore.app/ Payload/SideStore.app/ + zip -r SideStore.ipa Payload - xcodebuild -project AltStore.xcodeproj -scheme AltStore -sdk tvos archive -archivePath ./archive CODE_SIGNING_REQUIRED=NO AD_HOC_CODE_SIGNING_ALLOWED=YES CODE_SIGNING_ALLOWED=NO DEVELOPMENT_TEAM=XYZ0123456 ORG_IDENTIFIER=com.SideStore | xcpretty - -## Update & build for iOS -ios: | update developer_ios - -## Update & build for tvOS -tvos: | update developer_tvos - -## Open the workspace -open: - open AltStore.xcodeproj - -## tag and release to github -release: | _var_VERSION - @if ! git diff --quiet HEAD; then \ - ( $(call _error,refusing to release with uncommitted changes) ; exit 1 ); \ - fi - test - package - make --no-print-directory _tag VERSION=$(VERSION) - make --no-print-directory _push VERSION=$(VERSION) diff --git a/README.md b/README.md index 06da08e6..66faf98d 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,10 @@ [![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://makeapullrequest.com) -[![Build and Upload SideStore](https://github.com/SideStore/SideStore/actions/workflows/build.yml/badge.svg)](https://github.com/SideStore/SideStore/actions/workflows/build.yml) +[![Nightly SideStore build](https://github.com/SideStore/SideStore/actions/workflows/nightly.yml/badge.svg)](https://github.com/SideStore/SideStore/actions/workflows/nightly.yml) +[![.github/workflows/beta.yml](https://github.com/SideStore/SideStore/actions/workflows/beta.yml/badge.svg)](https://github.com/SideStore/SideStore/actions/workflows/beta.yml) + +![Alt](https://repobeats.axiom.co/api/embed/3a329ce95955690b9a9366f8d5598626a847d96c.svg "Repobeats analytics image") SideStore is an iOS application that allows you to sideload apps onto your iOS device with just your Apple ID. SideStore resigns apps with your personal development certificate, and then uses a [specially designed VPN](https://github.com/jkcoxson/Secret-Tunnel) in order to trick iOS into installing them. SideStore will periodically "refresh" your apps in the background, to keep their normal 7-day development period from expiring. @@ -12,7 +15,6 @@ SideStore's goal is to provide an untethered sideloading experience. It's a comm (Contributions are welcome! 🙂) - ## Requirements - Xcode 14 - iOS 14+ @@ -35,21 +37,9 @@ SideStore is a just regular, sandboxed iOS application. The AltStore app target We're hoping to eventually eliminate our dependency on it, as it increases the amount of unnecessary Objective-C in the project. -## Compilation Instructions -SideStore is fairly straightforward to compile and run if you're already an iOS or macOS developer. Here are some basic instructions to get you started: +## Contributing/Compilation Instructions -1. Clone the repository - ``` - git clone https://github.com/SideStore/SideStore.git --recurse-submodules - ``` -2. After installing Rustup, run `rustup target add aarch64-apple-ios` -12. Within the Dependencies/em_proxy and Dependencies/minimuxer directories, run `cargo build --release --target aarch64-apple-ios` -2. Open `AltStore.xcodeproj` and select the AltStore project in the project navigator. On the `Signing & Capabilities` tab, change the team from to your own account. -3. **(Development only)** Change the value for `ALTDeviceID` in the Info.plist to your device's UDID. Normally, SideServer embeds the device's UDID in SideStore's Info.plist during installation. When running through Xcode you'll need to set the value yourself or else SideStore won't resign (or even install) apps for the proper device. You can achieve this by changing a few things to be able to build and use SideStore. -5. Copy `CodeSigning.xcconfig.sample` to `CodeSigning.xcconfig` -6. Fill out all of the properties in `CodeSigning.xcconfig` to match your account. -7. In `Shared/Extensions/Bundle+AltStore.swift`, replace "group.com.rileytestut.AltStore" with your own App Group ID. -8. Build + run app! 🎉 +Please see [CONTRIBUTING.md](./CONTRIBUTING.md) ## Licensing diff --git a/minimuxer/minimuxer.h b/minimuxer/minimuxer.h deleted file mode 100644 index 0abc5419..00000000 --- a/minimuxer/minimuxer.h +++ /dev/null @@ -1,76 +0,0 @@ -// Jackson Coxson - -#include -#include -#include -#include -#include - - -/** - * Mount iOS's developer DMG - * # Safety - * Don't be stupid - */ -void minimuxer_auto_mount(char *docs_path); - -/** - * Starts the muxer and heartbeat client - * # Arguments - * Pairing file as a list of chars and the length - * # Safety - * Don't be stupid - */ -int minimuxer_c_start(char *pairing_file, char *log_path); - -/** - * Debugs an app from an app ID - * # Safety - * Don't be stupid - */ -int minimuxer_debug_app(char *app_id); - -/** - * Installs an ipa with a bundle ID - * Expects the ipa to be in the afc jail from yeet_app_afc - * # Safety - * Don't be stupid - */ -int minimuxer_install_ipa(char *bundle_id); - -/** - * Installs a provisioning profile on the device - * # Arguments - * Pass a pointer to a plist - * # Returns - * 0 on success - * # Safety - * Don't be stupid - */ -int minimuxer_install_provisioning_profile(uint8_t *pointer, unsigned int len); - -/** - * Removes an app from the device - * # Safety - * Don't be stupid - */ -int minimuxer_remove_app(char *bundle_id); - -/** - * Removes a provisioning profile - * # Safety - * Don't be stupid - */ -int minimuxer_remove_provisioning_profile(char *id); - -/** - * Yeets an ipa to the afc jail - * # Safety - * Don't be stupid - */ -int minimuxer_yeet_app_afc(char *bundle_id, uint8_t *bytes_ptr, unsigned long bytes_len); - -/** - * Sets the current environment variable for libusbmuxd to localhost - */ -void target_minimuxer_address(void);