Skip to content

Commit b361da9

Browse files
authored
feat: build attestation via signature (#29)
2 parents 9b92967 + 7670eef commit b361da9

25 files changed

+623
-261
lines changed

.clang-format

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,6 @@ IncludeCategories:
6666
# Local/Project headers
6767
- Regex: '^"'
6868
Priority: 3
69+
70+
# File formatting
71+
InsertNewlineAtEOF: true

.github/workflows/build.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ jobs:
6969
outputs:
7070
deb_url: ${{ steps.upload-deb.outputs.artifact-url }}
7171
deb_filename: ${{ steps.set-deb-filename.outputs.filename }}
72-
7372
env:
7473
DEB_DOWNLOADED: false
74+
UNBOUND_PK: ${{ secrets.UNBOUND_PK }}
7575

7676
steps:
7777
- name: Checkout code
@@ -162,6 +162,11 @@ jobs:
162162
with:
163163
submodules: recursive
164164

165+
- name: Select Xcode Version
166+
uses: maxim-lobanov/setup-xcode@v1
167+
with:
168+
xcode-version: '16.4'
169+
165170
- name: Download build artifacts
166171
uses: actions/download-artifact@v5
167172
with:

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
.theos
33
.DS_Store
44
packages
5-
binaries
65
venv
76
patcher-ios
7+
private_key.pem

Makefile

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ INSTALL_TARGET_PROCESSES = Discord
44

55
ARCHS := arm64 arm64e
66
TARGET := iphone:clang:latest:15.0
7+
COMMIT_HASH := $(shell git rev-parse HEAD)
78

89
include $(THEOS)/makefiles/common.mk
910

1011
TWEAK_NAME = Unbound
1112
$(TWEAK_NAME)_FILES = $(shell find sources -name "*.x*" -o -name "*.m*")
12-
$(TWEAK_NAME)_CFLAGS = -fobjc-arc -DPACKAGE_VERSION='@"$(THEOS_PACKAGE_BASE_VERSION)"' -I$(THEOS_PROJECT_DIR)/headers
13-
$(TWEAK_NAME)_FRAMEWORKS = UIKit Foundation UniformTypeIdentifiers UserNotifications
13+
$(TWEAK_NAME)_CFLAGS = -fobjc-arc -DPACKAGE_VERSION='@"$(THEOS_PACKAGE_BASE_VERSION)"' -DCOMMIT_HASH='@"$(COMMIT_HASH)"' -I$(THEOS_PROJECT_DIR)/headers
14+
$(TWEAK_NAME)_FRAMEWORKS = UIKit Foundation UniformTypeIdentifiers UserNotifications Security
1415

1516
BUNDLE_NAME = UnboundResources
1617
$(BUNDLE_NAME)_INSTALL_PATH = "/Library/Application\ Support/"
@@ -19,17 +20,23 @@ $(BUNDLE_NAME)_RESOURCE_DIRS = "resources"
1920
include $(THEOS_MAKE_PATH)/tweak.mk
2021
include $(THEOS_MAKE_PATH)/bundle.mk
2122

23+
SHELL := /bin/bash
24+
2225
before-all::
2326
@if [ ! -d "resources" ] || [ -z "$$(ls -A resources 2>/dev/null)" ]; then \
24-
echo "Resources folder empty or missing, initializing submodule..."; \
2527
git submodule update --init --recursive || exit 1; \
2628
fi
2729

28-
$(ECHO_NOTHING)VERSION_NUM=$$(echo "$(THEOS_PACKAGE_BASE_VERSION)" | cut -d'.' -f1,2) && \
29-
sed "s/VERSION_PLACEHOLDER/$$VERSION_NUM/" sources/preload.js > resources/preload.js$(ECHO_END)
30+
sed "s/VERSION_PLACEHOLDER/'$(THEOS_PACKAGE_BASE_VERSION)'/" sources/preload.js > resources/preload.js
31+
32+
@if [ -n "$$UNBOUND_PK" ]; then \
33+
echo -n "$(COMMIT_HASH)" | openssl dgst -sha256 -sign <(printf '%s' "$$UNBOUND_PK" | tr -d '\r') -out resources/signature.bin 2>/dev/null; \
34+
elif [ -f "private_key.pem" ]; then \
35+
echo -n "$(COMMIT_HASH)" | openssl dgst -sha256 -sign private_key.pem -out resources/signature.bin 2>/dev/null; \
36+
fi
3037

3138
after-stage::
32-
$(ECHO_NOTHING)find $(THEOS_STAGING_DIR) -name ".DS_Store" -delete$(ECHO_END)
39+
find $(THEOS_STAGING_DIR) -name ".DS_Store" -delete
3340

3441
after-package::
35-
$(ECHO_NOTHING)rm resources/preload.js$(ECHO_END)
42+
rm -f resources/preload.js resources/signature.bin

control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Name: Unbound
22
Description: Discord mobile client aimed at providing the user control, stability and customizability.
3-
Version: 1.6.0
3+
Version: 1.6.1
44
Package: app.unbound.ios
55
Architecture: iphoneos-arm
66
Maintainer: eternal, acquitelol, Adrian Castro

headers/FileSystem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@
2828

2929
+ (NSString *)documents;
3030

31-
@end
31+
@end

headers/Fonts.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@
2323

2424
+ (NSMutableDictionary<NSString *, NSString *> *)overrides;
2525

26-
@end
26+
@end

headers/Plugins.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
+ (NSString *)makeJSON;
99
+ (void)init;
1010

11-
@end
11+
@end
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66

77
- (void)executeApplicationScript:(NSData *)script url:(NSURL *)url async:(BOOL)async;
88

9-
@end
9+
@end

headers/Recovery.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ extern id gBridge;
2626

2727
@interface UnboundMenuViewController ()
2828
@property (nonatomic, strong) NSArray<NSDictionary *> *menuSections;
29-
@end
29+
@end

0 commit comments

Comments
 (0)