Skip to content

Commit

Permalink
Add Apple Silicon support and fix #1
Browse files Browse the repository at this point in the history
  • Loading branch information
Dadoum committed Oct 22, 2023
1 parent 78852c3 commit 323db37
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 12 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,68 @@ jobs:
path: |
${{github.workspace}}/bin/sideloader-macOS-x86_64
build-macos-arm64:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- uses: dlang-community/setup-dlang@v1
with:
compiler: ldc-1.33.0

- name: Set-up macOS cross-compilation
run: |
mkdir -p $HOME/.ldc/
curl -LO https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.0.sdk.tar.xz
tar -xf ./MacOSX11.0.sdk.tar.xz -C $HOME
cat << EOF | tee $HOME/.ldc/ldc2.conf
"arm64-apple-macos":
{
// default switches injected before all explicit command-line switches
switches = [
"-gcc=clang",
"-linker=lld",
"-Xcc=-target",
"-Xcc=arm64-apple-macos",
"-Xcc=-isysroot",
"-Xcc=$HOME/MacOSX11.0.sdk",
"-defaultlib=phobos2-ldc,druntime-ldc",
];
// default switches appended after all explicit command-line switches
post-switches = [
"-I$HOME/ldc2-1.33.0-osx-arm64/import",
];
// default directories to be searched for libraries when linking
lib-dirs = [
"$HOME/ldc2-1.33.0-osx-arm64/lib",
];
};
EOF
mkdir $HOME/ldc-macos
curl -LO https://github.com/ldc-developers/ldc/releases/download/v1.33.0/ldc2-1.33.0-osx-arm64.tar.xz
tar -xf ./ldc2-1.33.0-osx-arm64.tar.xz -C $HOME
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y libz-dev elfutils clang lld

- name: Write version file
run: echo 'module version_string; enum versionStr = "Sideloader automated build, branch ${{ github.ref_name }}, commit ${{ github.sha }}";' > source/version_string.d

- name: Build
run: dub build -b release-debug -c cli --compiler=ldc2 --arch arm64-apple-macos

- name: Rename
run: mv "${{github.workspace}}/bin/sideloader" "${{github.workspace}}/bin/sideloader-macOS-arm64" # TODO make an app bundle

- uses: actions/upload-artifact@v3
with:
name: sideloader-macOS-arm64
path: |
${{github.workspace}}/bin/sideloader-macOS-arm64
build-windows-x86_64:
runs-on: ubuntu-22.04

Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Sideloader is an application made to install third-party applications on iOS dev
You can see it as an open-source replacement of _Cydia Impactor_.

Currently only working on Linux (it was the priority since no easy alternatives exists). \
Windows support is planned (it should not depend on iCloud!).
Windows support is planned (it should not depend on iCloud!). \
The CLI works too on all systems.

I tried to make the code as readable as possible, if you struggle to understand anything
I am here to help!
Expand Down Expand Up @@ -91,11 +92,9 @@ reason. OpenSSL is also required for networking, unfortunately.

### macOS

On Apple Silicon, it does not work at all.
Only the CLI tool is available yet.

On Intel macs, there is only a CLI tool.

Support is feasible but low-priority as macOS generally has more tools to install and
GUI support is planned but low-priority as macOS already has more tools to install and
manage iOS apps.

## Acknowledgements and references
Expand Down
2 changes: 1 addition & 1 deletion cli/frontend.d
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ shared class CLIFrontend: Frontend {
}

initializeADI();
scope app = new Application(appPath);

write("Enter your Apple ID: ");
stdout.flush();
Expand Down Expand Up @@ -94,7 +95,6 @@ shared class CLIFrontend: Frontend {
string udid = iDevice.deviceList()[0].udid;
log.infoF!"Initiating connection the device (UUID: %s)"(udid);
auto device = new iDevice(udid);
scope app = new Application(appPath);
sideloadFull(device, appleAccount, app, (progress, action) {
log.infoF!"%s (%.2f%%)"(action, progress * 100);
});
Expand Down
6 changes: 3 additions & 3 deletions dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@
},
"dynamic-loader": {
"repository": "git+https://github.com/Dadoum/dynamicloader.git",
"version": "b62f6f5f1cd5cc71c3ffb3689cd11d4fc80a0556"
"version": "65a8b8b8a6d44d47e63bddc985268592ecf47764"
},
"intel-intrinsics": "~>1.11.15",
"plist-d": {
"repository": "git+https://github.com/Dadoum/libplist-d.git",
"version": "d4b3793d9ff5f64325cd1cedb2ced31b51523ec1"
"version": "30d152e88767611e10048b25777ecb5f9075f87c"
},
"provision": {
"repository": "git+https://github.com/Dadoum/Provision.git",
"version": "90f5c9df9d987acc795ba5338af50a7f0764034e"
"version": "533dca306b86f9c7801354b78f5187addb58b740"
},
"requests": "~>2.1.1",
"slf4d": "~>2.4.2"
Expand Down
6 changes: 3 additions & 3 deletions dub.selections.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dlangui": "0.10.4",
"dsfml": "2.1.1",
"dxml": "0.4.4",
"dynamic-loader": {"version":"b62f6f5f1cd5cc71c3ffb3689cd11d4fc80a0556","repository":"git+https://github.com/Dadoum/dynamicloader.git"},
"dynamic-loader": {"version":"65a8b8b8a6d44d47e63bddc985268592ecf47764","repository":"git+https://github.com/Dadoum/dynamicloader.git"},
"glx-d": "1.1.0",
"gtk_d": "1.0.3",
"icontheme": "1.2.3",
Expand All @@ -23,8 +23,8 @@
"isfreedesktop": "0.1.1",
"memutils": "1.0.9",
"plist": "~master",
"plist-d": {"version":"d4b3793d9ff5f64325cd1cedb2ced31b51523ec1","repository":"git+https://github.com/Dadoum/libplist-d.git"},
"provision": {"version":"90f5c9df9d987acc795ba5338af50a7f0764034e","repository":"git+https://github.com/Dadoum/Provision.git"},
"plist-d": {"version":"30d152e88767611e10048b25777ecb5f9075f87c","repository":"git+https://github.com/Dadoum/libplist-d.git"},
"provision": {"version":"533dca306b86f9c7801354b78f5187addb58b740","repository":"git+https://github.com/Dadoum/Provision.git"},
"requests": "2.1.1",
"silly": "1.2.0-dev.2",
"slf4d": "2.4.3",
Expand Down

0 comments on commit 323db37

Please sign in to comment.