Skip to content

Commit

Permalink
Add nightly build flag
Browse files Browse the repository at this point in the history
  • Loading branch information
opa334 committed Feb 19, 2024
1 parent e502121 commit b4a866c
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Application/Dopamine/Jailbreak/DOEnvironmentManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ NS_ASSUME_NONNULL_BEGIN

@property (nonatomic, readonly) NSData *bootManifestHash;

- (NSString *)appVersion;
- (NSString *)appVersionDisplayString;
- (NSString *)nightlyHash;

- (BOOL)isInstalledThroughTrollStore;
- (BOOL)isJailbroken;
- (BOOL)isBootstrapped;
Expand Down
26 changes: 26 additions & 0 deletions Application/Dopamine/Jailbreak/DOEnvironmentManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,31 @@ - (instancetype)init
return self;
}

- (NSString *)nightlyHash
{
#ifdef NIGHTLY
return [NSString stringWithUTF8String:COMMIT_HASH];
#else
return nil;
#endif
}

- (NSString *)appVersion
{
return [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
}

- (NSString *)appVersionDisplayString
{
NSString *nightlyHash = [self nightlyHash];
if (nightlyHash) {
return [NSString stringWithFormat:@"%@~%@", self.appVersion, [nightlyHash substringToIndex:6]];
}
else {
return [self appVersion];
}
}

- (NSData *)bootManifestHash
{
if (!_bootManifestHash) {
Expand Down Expand Up @@ -539,4 +564,5 @@ - (NSError *)reinstallPackageManagers
return error;
}


@end
3 changes: 2 additions & 1 deletion Application/Dopamine/UI/Settings/DOCreditsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#import "DOCreditsViewController.h"
#import "DOLicenseViewController.h"
#import "DOUIManager.h"
#import "DOEnvironmentManager.h"
#import <Preferences/PSSpecifier.h>

@interface DOCreditsViewController ()
Expand All @@ -27,7 +28,7 @@ - (id)specifiers
_specifiers = [self loadSpecifiersFromPlistName:@"Credits" target:self];

PSSpecifier *headerSpecifier = _specifiers[0];
[headerSpecifier setProperty:[NSString stringWithFormat:@"Dopamine %@ - %@", [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"], DOLocalizedString(@"Menu_Credits_Title")] forKey:@"title"];
[headerSpecifier setProperty:[NSString stringWithFormat:@"Dopamine %@ - %@", [DOEnvironmentManager sharedManager].appVersionDisplayString, DOLocalizedString(@"Menu_Credits_Title")] forKey:@"title"];
}
return _specifiers;
}
Expand Down
5 changes: 5 additions & 0 deletions Application/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ Dopamine.ipa: build/Build/Products/Debug-iphoneos/Dopamine.app
rm -rf Dopamine.tipa
cp Dopamine.ipa Dopamine.tipa

ifeq ($(NIGHTLY), 1)
build/Build/Products/Debug-iphoneos/Dopamine.app: FORCE
xcodebuild -scheme Dopamine -derivedDataPath build -destination 'generic/platform=iOS' CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO GCC_PREPROCESSOR_DEFINITIONS='NIGHTLY=1 COMMIT_HASH=\"$(COMMIT_HASH)\"'
else
build/Build/Products/Debug-iphoneos/Dopamine.app: FORCE
xcodebuild -scheme Dopamine -derivedDataPath build -destination 'generic/platform=iOS' CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
endif

clean:
rm -rf build Payload Dopamine.ipa Dopamine.tipa
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
export NIGHTLY ?= 0

ifeq ($(NIGHTLY), 1)
export COMMIT_HASH = $(shell git rev-parse HEAD)
endif

all:
@$(MAKE) -C BaseBin
@$(MAKE) -C Packages
Expand Down

0 comments on commit b4a866c

Please sign in to comment.