Skip to content

Commit

Permalink
🚀 v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
semvis123 committed Aug 14, 2021
1 parent 9811272 commit 9fe0f93
Show file tree
Hide file tree
Showing 40 changed files with 715 additions and 484 deletions.
1 change: 0 additions & 1 deletion Bose.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@
@interface BoseController : NSObject
+(BoseController *)sharedInstance;
-(void)setCurrentBluetoothListeningMode:(NSString *)listeningMode forAccessory:(EAAccessory *)accessory v2: (BOOL) v2;
-(void)useSettings:(NSMutableDictionary *)settings;
-(NSString *)getCurrentListeningModeOfAccessory:(EAAccessory *)accessory;
@end
6 changes: 2 additions & 4 deletions Bose.mm
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,11 @@ +(BoseController *)sharedInstance {
return boseController;
}

-(void)useSettings: (NSMutableDictionary *)settings {
}

-(void)setCurrentBluetoothListeningMode:(NSString *)listeningMode forAccessory:(EAAccessory *)accessory v2: (BOOL) v2 {
[[SessionController sharedController] setupControllerForAccessory:accessory withProtocolString: v2 ? @"com.bose.bmap2" : @"com.bose.bmap"];
[[SessionController sharedController] openSession];
// create a new dispatch queue
dispatch_queue_t queue = dispatch_queue_create("com.semvis123.headphonify.queue", NULL);
dispatch_queue_t queue = dispatch_queue_create("com.semvis.sonitus.queue", NULL);

dispatch_async(queue, ^{
[[[SessionController sharedController] writeDataCondition] lock];
Expand Down Expand Up @@ -58,4 +55,5 @@ -(void)setCurrentBluetoothListeningMode:(NSString *)listeningMode forAccessory:(
-(NSString *)getCurrentListeningModeOfAccessory: (EAAccessory *)accessory {
return nil;
}

@end
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 semvis123
Copyright (c) 2021 Semvis

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ TARGET := iphone:clang:13.3.1
INSTALL_TARGET_PROCESSES = SpringBoard
# INSTALL_TARGET_PROCESSES = Preferences

THEOS_DEVICE_IP = 192.168.2.9
THEOS_DEVICE_IP = 192.168.2.15
include $(THEOS)/makefiles/common.mk
ARCHS = arm64 arm64e
TWEAK_NAME = Headphonify
$(TWEAK_NAME)_FILES = Tweak.xm SessionController.mm Sony.mm Bose.mm Soundcore.mm
TWEAK_NAME = Sonitus
$(TWEAK_NAME)_FILES = Tweak.xm SessionController.mm Sony.mm Bose.mm Soundcore.mm Sennheiser.mm
SUBPROJECTS += Preferences
$(TWEAK_NAME)_CFLAGS = -fobjc-arc -std=c++17
$(TWEAK_NAME)_FRAMEWORKS = Foundation ExternalAccessory CoreBluetooth
$(TWEAK_NAME)_EXTRA_FRAMEWORKS = Cephei
include $(THEOS_MAKE_PATH)/tweak.mk
include $(THEOS_MAKE_PATH)/aggregate.mk
14 changes: 0 additions & 14 deletions Preferences/HPBRootListController.h

This file was deleted.

67 changes: 0 additions & 67 deletions Preferences/HPBRootListController.m

This file was deleted.

15 changes: 8 additions & 7 deletions Preferences/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ TARGET := iphone:clang:13.3.1

include $(THEOS)/makefiles/common.mk

BUNDLE_NAME = headphonifyPreferences

headphonifyPreferences_FILES = HPBRootListController.m
headphonifyPreferences_FRAMEWORKS = UIKit BluetoothManager
headphonifyPreferences_PRIVATE_FRAMEWORKS = Preferences
headphonifyPreferences_INSTALL_PATH = /Library/PreferenceBundles
headphonifyPreferences_CFLAGS = -fobjc-arc
BUNDLE_NAME = sonitusPreferences

$(BUNDLE_NAME)_FILES = SPBRootListController.m SPBSonyListController.m PackageNameHeaderCell.m
$(BUNDLE_NAME)_FRAMEWORKS = UIKit BluetoothManager
$(BUNDLE_NAME)_EXTRA_FRAMEWORKS = Cephei CepheiPrefs
$(BUNDLE_NAME)_PRIVATE_FRAMEWORKS = Preferences
$(BUNDLE_NAME)_INSTALL_PATH = /Library/PreferenceBundles
$(BUNDLE_NAME)_CFLAGS = -fobjc-arc

include $(THEOS_MAKE_PATH)/bundle.mk
5 changes: 5 additions & 0 deletions Preferences/PackageNameHeaderCell.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#import <CepheiPrefs/HBPackageNameHeaderCell.h>
#import "SPBRootListController.h"

@interface PackageNameHeaderCell : HBPackageNameHeaderCell
@end
19 changes: 19 additions & 0 deletions Preferences/PackageNameHeaderCell.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#import "PackageNameHeaderCell.h"

@implementation PackageNameHeaderCell
- (void)setFrame:(CGRect)frame {
CGFloat contentOffset = ((UIScrollView *)[self.superview valueForKey:@"scrollView"]).contentOffset.y;
UINavigationBar *navigationBar = ((SPBRootListController *)[self.superview.superview valueForKey:@"viewDelegate"]).navigationController.navigationController.navigationBar;
CGFloat navBarCompensation = navigationBar.frame.size.height + navigationBar.frame.origin.y;
CGFloat sum = navBarCompensation + contentOffset;
if (sum < 0) {
frame = CGRectMake( 0, sum, frame.size.width, frame.size.height - sum);
float magic = -sum / frame.size.height;
((CAGradientLayer *)self.layer).colors = @[
(id)[UIColor colorWithRed: fmin(1, 0.02+magic*0.02) green: fmin(1, 0.29+magic*0.29) blue: fmin(1, 0.37+magic*0.37) alpha: 1.00].CGColor,
(id)[UIColor colorWithRed: 0.01 green: 0.08 blue: 0.09 alpha: 1.00].CGColor
];
}
[super setFrame:frame];
}
@end
6 changes: 3 additions & 3 deletions Preferences/Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>headphonifyPreferences</string>
<string>sonitusPreferences</string>
<key>CFBundleIdentifier</key>
<string>com.semvis123.headphonifyPreferences</string>
<string>com.semvis.sonituspreferences</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
Expand All @@ -19,6 +19,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSPrincipalClass</key>
<string>HPBRootListController</string>
<string>SPBRootListController</string>
</dict>
</plist>
Loading

0 comments on commit 9fe0f93

Please sign in to comment.