Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
made the test banner a random app
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandra authored and Alexandra committed Nov 25, 2022
1 parent de2d4fd commit 6b7e5d6
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
20 changes: 20 additions & 0 deletions Tweak/Liddell.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,23 @@ NSString* pfCustomBorderColor;

@interface OS_dispatch_queue_serial : DispatchQueue
@end

@interface SBHIconModel : NSObject
@property(nonatomic, copy, readonly)NSSet* visibleIconIdentifiers;
@end

@interface SBIconModel : SBHIconModel
@end

@interface SBIconController : UIViewController
- (SBIconModel *)model;
@end

@interface SBApplicationController : NSObject
+ (instancetype)sharedInstance;
- (NSArray *)allInstalledApplications;
@end

@interface SBApplication : NSObject
@property(nonatomic, readonly)NSString* bundleIdentifier;
@end
9 changes: 6 additions & 3 deletions Tweak/Liddell.m
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,12 @@ static void show_test_banner() {
BBBulletin* bulletin = [[objc_getClass("BBBulletin") alloc] init];
NSProcessInfo* processInfo = [NSProcessInfo processInfo];

[bulletin setTitle:@"Alice"];
[bulletin setMessage:@"Another day, a different dream perhaps?"];
[bulletin setSectionID:@"com.apple.MobileSMS"];
SBIconModel* model = [(SBIconController *)[objc_getClass("SBIconController") sharedInstance] model];
NSArray* bundleIdentifiers = [[model visibleIconIdentifiers] allObjects];

[bulletin setTitle:@"Liddell"];
[bulletin setMessage:@"Little test banner coming your way!"];
[bulletin setSectionID:bundleIdentifiers[arc4random_uniform([bundleIdentifiers count])]];
[bulletin setBulletinID:[processInfo globallyUniqueString]];
[bulletin setRecordID:[processInfo globallyUniqueString]];
[bulletin setDate:[NSDate date]];
Expand Down
2 changes: 1 addition & 1 deletion control
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: dev.traurige.liddell
Name: Liddell
Depends: firmware (>= 14.0), mobilesubstrate, preferenceloader, dev.traurige.libkitten (>= 1.3.3), com.mrgcgamer.libgcuniversal
Conflicts: love.litten.liddell
Version: 1.3
Version: 1.4
Architecture: iphoneos-arm
Description: Little and colorful notification banners
Maintainer: Traurige
Expand Down

0 comments on commit 6b7e5d6

Please sign in to comment.