mirror of
https://github.com/Burrit0z/kai
synced 2025-07-01 14:26:48 +00:00
rebrand
This commit is contained in:
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2021 Burrit0z
|
Copyright (c) 2021 ren7995
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
Package: com.burritoz.kai
|
Package: com.burritoz.kai
|
||||||
Name: Kai
|
Name: Kai
|
||||||
Version: 1.5.0
|
Version: 1.5.1
|
||||||
Architecture: iphoneos-arm
|
Architecture: iphoneos-arm
|
||||||
Description: Device battery indicators on your lock screen!
|
Description: Device battery indicators on your lock screen!
|
||||||
Maintainer: burrit0z
|
Maintainer: ren7995
|
||||||
Author: burrit0z
|
Author: ren7995
|
||||||
Section: Tweaks
|
Section: Tweaks
|
||||||
Depends: mobilesubstrate (>= 0.9.5000), preferenceloader, ws.hbang.common (>=1.14)
|
Depends: mobilesubstrate (>= 0.9.5000), preferenceloader, ws.hbang.common (>=1.14)
|
||||||
Icon: https://chariz.com/cdn/icon/kai/icon@3x.png
|
Icon: https://chariz.com/cdn/icon/kai/icon@3x.png
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
# kai
|
# kai
|
||||||
|
Oh my gosh this code is so bad
|
||||||
|
|
||||||
## All Your Batteries, at a Glance
|
## All Your Batteries, at a Glance
|
||||||
kai will show any Bluetooth device that provides battery information, meaning you can check the battery of your iPhone, your Apple Watch, your AirPods, and your AirPods case, all from the lockscreen. Quickly and easily.
|
kai will show any Bluetooth device that provides battery information, meaning you can check the battery of your iPhone, your Apple Watch, your AirPods, and your AirPods case, all from the lockscreen. Quickly and easily.
|
||||||
@ -47,4 +48,4 @@ kai offers two main options for displaying battery information. (a) Vertical mod
|
|||||||
Special thanks to my amazing beta testers in the server I co-own with Thomz. I could not have tested kai so extensively and brought it to where it is today without them. Thanks to Thomz (@Thomzi07 on Twitter) for making kai's icon, and depiction screenshots, and Thenatis (@thenatis1 on Twitter) for helping with design, and for making the banner for kai. Additionally, kai is inspired by LaughingQuoll's Maple tweak series and Apple's AirPower design. kai was built with inspiration from this. However, the main reason I made kai is because the Maple series does not work with notification grouping tweaks like Axon and Grupi. Additionally, kai features a wider range of customization options.
|
Special thanks to my amazing beta testers in the server I co-own with Thomz. I could not have tested kai so extensively and brought it to where it is today without them. Thanks to Thomz (@Thomzi07 on Twitter) for making kai's icon, and depiction screenshots, and Thenatis (@thenatis1 on Twitter) for helping with design, and for making the banner for kai. Additionally, kai is inspired by LaughingQuoll's Maple tweak series and Apple's AirPower design. kai was built with inspiration from this. However, the main reason I made kai is because the Maple series does not work with notification grouping tweaks like Axon and Grupi. Additionally, kai features a wider range of customization options.
|
||||||
|
|
||||||
## Socials and Support
|
## Socials and Support
|
||||||
If you are encountering issues, or simply wish to reach out, you can contact me at my email (burrit0ztweaks@gmail.com) or join the discord server I co-own with Thomz to get support. Discord server invite link: https://discord.gg/NQ3uXtJ
|
If you are encountering issues, or simply wish to reach out, you can contact me at my email (lau7995ren@gmail.com) or join the discord server I co-own with Thomz to get support. Discord server invite link: https://discord.gg/NQ3uXtJ
|
||||||
|
@ -3,278 +3,358 @@
|
|||||||
KAIRootListController *controller;
|
KAIRootListController *controller;
|
||||||
NSBundle *tweakBundle;
|
NSBundle *tweakBundle;
|
||||||
|
|
||||||
//thank god for renai
|
// thank god for renai
|
||||||
static inline NSString *getPackageVersion() {
|
static inline NSString *getPackageVersion() {
|
||||||
NSString *packageVersion = [NSString stringWithFormat:@"${%@}", @"Version"];
|
NSString *packageVersion = [NSString stringWithFormat:@"${%@}", @"Version"];
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
NSMutableArray<NSString *> *argsv0 = [NSMutableArray array];
|
NSMutableArray<NSString *> *argsv0 = [NSMutableArray array];
|
||||||
for (NSString *string in @[ @"/usr/bin/dpkg-query", @"-Wf", packageVersion, @"com.burritoz.kai" ]) {
|
for (NSString *string in @[
|
||||||
[argsv0
|
@"/usr/bin/dpkg-query", @"-Wf", packageVersion, @"com.burritoz.kai"
|
||||||
addObject:[NSString stringWithFormat:@"'%@'",
|
]) {
|
||||||
[string stringByReplacingOccurrencesOfString:@"'"
|
[argsv0
|
||||||
withString:@"\\'"
|
addObject:
|
||||||
options:NSRegularExpressionSearch
|
[NSString
|
||||||
range:NSMakeRange(
|
stringWithFormat:
|
||||||
0, string.length)]]];
|
@"'%@'",
|
||||||
}
|
[string
|
||||||
|
stringByReplacingOccurrencesOfString:@"'"
|
||||||
|
withString:@"\\'"
|
||||||
|
options:
|
||||||
|
NSRegularExpressionSearch
|
||||||
|
range:
|
||||||
|
NSMakeRange(
|
||||||
|
0,
|
||||||
|
string
|
||||||
|
.length)]]];
|
||||||
|
}
|
||||||
|
|
||||||
NSString *argsv1 = [argsv0 componentsJoinedByString:@" "];
|
NSString *argsv1 = [argsv0 componentsJoinedByString:@" "];
|
||||||
FILE *file = popen(argsv1.UTF8String, "r");
|
FILE *file = popen(argsv1.UTF8String, "r");
|
||||||
if (!file) {
|
if (!file) {
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
char data[1024];
|
char data[1024];
|
||||||
NSMutableString *output = [NSMutableString string];
|
NSMutableString *output = [NSMutableString string];
|
||||||
|
|
||||||
while (fgets(data, 1024, file) != NULL) {
|
while (fgets(data, 1024, file) != NULL) {
|
||||||
[output appendString:[NSString stringWithUTF8String:data]];
|
[output appendString:[NSString stringWithUTF8String:data]];
|
||||||
}
|
}
|
||||||
|
|
||||||
int result = pclose(file);
|
int result = pclose(file);
|
||||||
status = result;
|
status = result;
|
||||||
|
|
||||||
if (status == 0) {
|
if (status == 0) {
|
||||||
return output ?: @"🏴☠️ Pirated";
|
return output ?: @"🏴☠️ Pirated";
|
||||||
}
|
}
|
||||||
|
|
||||||
return @"🏴☠️ Pirated";
|
return @"🏴☠️ Pirated";
|
||||||
}
|
}
|
||||||
|
|
||||||
////////
|
////////
|
||||||
|
|
||||||
static void respringNeeded() {
|
static void respringNeeded() {
|
||||||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Respring"
|
UIAlertController *alert = [UIAlertController
|
||||||
message:@"Changing this requires a respring for it to take effect. Would you like to respring now?"
|
alertControllerWithTitle:@"Respring"
|
||||||
preferredStyle:UIAlertControllerStyleActionSheet];
|
message:@"Changing this requires a respring for it to "
|
||||||
|
@"take effect. Would you like to respring now?"
|
||||||
|
preferredStyle:UIAlertControllerStyleActionSheet];
|
||||||
|
|
||||||
UIAlertAction *defaultAction = [UIAlertAction actionWithTitle:@"No"
|
UIAlertAction *defaultAction =
|
||||||
style:UIAlertActionStyleCancel
|
[UIAlertAction actionWithTitle:@"No"
|
||||||
handler:^(UIAlertAction *action){
|
style:UIAlertActionStyleCancel
|
||||||
}];
|
handler:^(UIAlertAction *action){
|
||||||
|
}];
|
||||||
|
|
||||||
UIAlertAction *yes = [UIAlertAction actionWithTitle:@"Respring"
|
UIAlertAction *yes = [UIAlertAction
|
||||||
style:UIAlertActionStyleDestructive
|
actionWithTitle:@"Respring"
|
||||||
handler:^(UIAlertAction *action) {
|
style:UIAlertActionStyleDestructive
|
||||||
NSTask *t = [[NSTask alloc] init];
|
handler:^(UIAlertAction *action) {
|
||||||
[t setLaunchPath:@"usr/bin/killall"];
|
NSTask *t = [[NSTask alloc] init];
|
||||||
[t setArguments:[NSArray arrayWithObjects:@"backboardd", nil]];
|
[t setLaunchPath:@"usr/bin/killall"];
|
||||||
[t launch];
|
[t setArguments:[NSArray arrayWithObjects:@"backboardd", nil]];
|
||||||
}];
|
[t launch];
|
||||||
|
}];
|
||||||
|
|
||||||
[alert addAction:defaultAction];
|
[alert addAction:defaultAction];
|
||||||
[alert addAction:yes];
|
[alert addAction:yes];
|
||||||
[controller presentViewController:alert animated:YES completion:nil];
|
[controller presentViewController:alert animated:YES completion:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void applyPrefs() {
|
static void applyPrefs() {
|
||||||
CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter(), CFSTR("com.burritoz.kaiprefs/reload"), nil, nil, true);
|
CFNotificationCenterPostNotification(
|
||||||
|
CFNotificationCenterGetDarwinNotifyCenter(),
|
||||||
|
CFSTR("com.burritoz.kaiprefs/reload"), nil, nil, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@implementation KAIRootListController
|
@implementation KAIRootListController
|
||||||
|
|
||||||
- (NSArray *)specifiers {
|
- (NSArray *)specifiers {
|
||||||
if (!_specifiers) {
|
if (!_specifiers) {
|
||||||
_specifiers = [self loadSpecifiersFromPlistName:@"Root" target:self];
|
_specifiers = [self loadSpecifiersFromPlistName:@"Root" target:self];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _specifiers;
|
return _specifiers;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)viewWillAppear:(BOOL)arg1 {
|
- (void)viewWillAppear:(BOOL)arg1 {
|
||||||
[[UISegmentedControl appearanceWhenContainedInInstancesOfClasses:@[ self.class ]] setTintColor:[UIColor colorWithRed:0.00 green:0.82 blue:1.00 alpha:1.00]];
|
[[UISegmentedControl
|
||||||
[[UISwitch appearanceWhenContainedInInstancesOfClasses:@[ self.class ]] setOnTintColor:[UIColor colorWithRed:0.00 green:0.82 blue:1.00 alpha:1.00]];
|
appearanceWhenContainedInInstancesOfClasses:@[ self.class ]]
|
||||||
[[UISlider appearanceWhenContainedInInstancesOfClasses:@[ self.class ]] setTintColor:[UIColor colorWithRed:0.00 green:0.82 blue:1.00 alpha:1.00]];
|
setTintColor:[UIColor colorWithRed:0.00 green:0.82 blue:1.00 alpha:1.00]];
|
||||||
|
[[UISwitch appearanceWhenContainedInInstancesOfClasses:@[ self.class ]]
|
||||||
|
setOnTintColor:[UIColor colorWithRed:0.00
|
||||||
|
green:0.82
|
||||||
|
blue:1.00
|
||||||
|
alpha:1.00]];
|
||||||
|
[[UISlider appearanceWhenContainedInInstancesOfClasses:@[ self.class ]]
|
||||||
|
setTintColor:[UIColor colorWithRed:0.00 green:0.82 blue:1.00 alpha:1.00]];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)viewWillDisappear:(BOOL)arg1 {
|
- (void)viewWillDisappear:(BOOL)arg1 {
|
||||||
[super viewWillDisappear:arg1];
|
[super viewWillDisappear:arg1];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)viewDidLoad {
|
- (void)viewDidLoad {
|
||||||
[super viewDidLoad];
|
[super viewDidLoad];
|
||||||
|
|
||||||
self.navigationItem.titleView = [UIView new];
|
self.navigationItem.titleView = [UIView new];
|
||||||
self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 10, 10)];
|
self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 10, 10)];
|
||||||
self.titleLabel.font = [UIFont systemFontOfSize:17.5];
|
self.titleLabel.font = [UIFont systemFontOfSize:17.5];
|
||||||
self.titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
|
self.titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
|
||||||
self.titleLabel.text = @"kai";
|
self.titleLabel.text = @"kai";
|
||||||
self.titleLabel.alpha = 0.0;
|
self.titleLabel.alpha = 0.0;
|
||||||
self.titleLabel.textAlignment = NSTextAlignmentCenter;
|
self.titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||||
[self.navigationItem.titleView addSubview:self.titleLabel];
|
[self.navigationItem.titleView addSubview:self.titleLabel];
|
||||||
|
|
||||||
self.iconView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 10, 10)];
|
self.iconView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 10, 10)];
|
||||||
self.iconView.contentMode = UIViewContentModeScaleAspectFit;
|
self.iconView.contentMode = UIViewContentModeScaleAspectFit;
|
||||||
self.iconView.image = [UIImage imageWithContentsOfFile:@"/Library/PreferenceBundles/kaiPrefs.bundle/icon.png"];
|
self.iconView.image =
|
||||||
self.iconView.translatesAutoresizingMaskIntoConstraints = NO;
|
[UIImage imageWithContentsOfFile:
|
||||||
self.iconView.alpha = 1.0;
|
@"/Library/PreferenceBundles/kaiPrefs.bundle/icon.png"];
|
||||||
[self.navigationItem.titleView addSubview:self.iconView];
|
self.iconView.translatesAutoresizingMaskIntoConstraints = NO;
|
||||||
|
self.iconView.alpha = 1.0;
|
||||||
|
[self.navigationItem.titleView addSubview:self.iconView];
|
||||||
|
|
||||||
[NSLayoutConstraint activateConstraints:@[
|
[NSLayoutConstraint activateConstraints:@[
|
||||||
[self.titleLabel.topAnchor constraintEqualToAnchor:self.navigationItem.titleView.topAnchor],
|
[self.titleLabel.topAnchor
|
||||||
[self.titleLabel.leadingAnchor constraintEqualToAnchor:self.navigationItem.titleView.leadingAnchor],
|
constraintEqualToAnchor:self.navigationItem.titleView.topAnchor],
|
||||||
[self.titleLabel.trailingAnchor constraintEqualToAnchor:self.navigationItem.titleView.trailingAnchor],
|
[self.titleLabel.leadingAnchor
|
||||||
[self.titleLabel.bottomAnchor constraintEqualToAnchor:self.navigationItem.titleView.bottomAnchor],
|
constraintEqualToAnchor:self.navigationItem.titleView.leadingAnchor],
|
||||||
[self.iconView.topAnchor constraintEqualToAnchor:self.navigationItem.titleView.topAnchor],
|
[self.titleLabel.trailingAnchor
|
||||||
[self.iconView.leadingAnchor constraintEqualToAnchor:self.navigationItem.titleView.leadingAnchor],
|
constraintEqualToAnchor:self.navigationItem.titleView.trailingAnchor],
|
||||||
[self.iconView.trailingAnchor constraintEqualToAnchor:self.navigationItem.titleView.trailingAnchor],
|
[self.titleLabel.bottomAnchor
|
||||||
[self.iconView.bottomAnchor constraintEqualToAnchor:self.navigationItem.titleView.bottomAnchor],
|
constraintEqualToAnchor:self.navigationItem.titleView.bottomAnchor],
|
||||||
]];
|
[self.iconView.topAnchor
|
||||||
|
constraintEqualToAnchor:self.navigationItem.titleView.topAnchor],
|
||||||
|
[self.iconView.leadingAnchor
|
||||||
|
constraintEqualToAnchor:self.navigationItem.titleView.leadingAnchor],
|
||||||
|
[self.iconView.trailingAnchor
|
||||||
|
constraintEqualToAnchor:self.navigationItem.titleView.trailingAnchor],
|
||||||
|
[self.iconView.bottomAnchor
|
||||||
|
constraintEqualToAnchor:self.navigationItem.titleView.bottomAnchor],
|
||||||
|
]];
|
||||||
|
|
||||||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Pirated :("
|
UIAlertController *alert = [UIAlertController
|
||||||
message:@"Please install kai from Chariz repository."
|
alertControllerWithTitle:@"Pirated :("
|
||||||
preferredStyle:UIAlertControllerStyleAlert];
|
message:@"Please install kai from Chariz repository."
|
||||||
|
preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
|
||||||
if ([[NSFileManager defaultManager] fileExistsAtPath:@"/var/lib/dpkg/info/com.burritoz.kai.list"] && [[NSFileManager defaultManager] fileExistsAtPath:@"/var/lib/dpkg/info/com.burritoz.kai.md5sums"]) {
|
if ([[NSFileManager defaultManager]
|
||||||
// nothing
|
fileExistsAtPath:@"/var/lib/dpkg/info/com.burritoz.kai.list"] &&
|
||||||
} else {
|
[[NSFileManager defaultManager]
|
||||||
[self presentViewController:alert animated:YES completion:nil];
|
fileExistsAtPath:@"/var/lib/dpkg/info/com.burritoz.kai.md5sums"]) {
|
||||||
}
|
// nothing
|
||||||
|
} else {
|
||||||
|
[self presentViewController:alert animated:YES completion:nil];
|
||||||
|
}
|
||||||
|
|
||||||
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, (CFNotificationCallback)respringNeeded, CFSTR("com.burritoz.kaiprefs.respringneeded"), NULL, CFNotificationSuspensionBehaviorDeliverImmediately);
|
CFNotificationCenterAddObserver(
|
||||||
|
CFNotificationCenterGetDarwinNotifyCenter(), NULL,
|
||||||
|
(CFNotificationCallback)respringNeeded,
|
||||||
|
CFSTR("com.burritoz.kaiprefs.respringneeded"), NULL,
|
||||||
|
CFNotificationSuspensionBehaviorDeliverImmediately);
|
||||||
|
|
||||||
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, (CFNotificationCallback)applyPrefs, CFSTR("com.burritoz.kaiprefs.apply"), NULL, CFNotificationSuspensionBehaviorDeliverImmediately);
|
CFNotificationCenterAddObserver(
|
||||||
|
CFNotificationCenterGetDarwinNotifyCenter(), NULL,
|
||||||
|
(CFNotificationCallback)applyPrefs, CFSTR("com.burritoz.kaiprefs.apply"),
|
||||||
|
NULL, CFNotificationSuspensionBehaviorDeliverImmediately);
|
||||||
|
|
||||||
controller = self;
|
controller = self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)resetPrefs:(id)sender {
|
- (void)resetPrefs:(id)sender {
|
||||||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Reset Preferences"
|
UIAlertController *alert = [UIAlertController
|
||||||
message:@"Are you sure you want to reset all of your preferences? This action CANNOT be undone! Your device will respring."
|
alertControllerWithTitle:@"Reset Preferences"
|
||||||
preferredStyle:UIAlertControllerStyleAlert];
|
message:@"Are you sure you want to reset all of your "
|
||||||
|
@"preferences? This action CANNOT be undone! "
|
||||||
|
@"Your device will respring."
|
||||||
|
preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
|
||||||
UIAlertAction *defaultAction = [UIAlertAction actionWithTitle:@"No"
|
UIAlertAction *defaultAction =
|
||||||
style:UIAlertActionStyleDefault
|
[UIAlertAction actionWithTitle:@"No"
|
||||||
handler:^(UIAlertAction *action){
|
style:UIAlertActionStyleDefault
|
||||||
}];
|
handler:^(UIAlertAction *action){
|
||||||
UIAlertAction *yes = [UIAlertAction actionWithTitle:@"Yes"
|
}];
|
||||||
style:UIAlertActionStyleDestructive
|
UIAlertAction *yes = [UIAlertAction
|
||||||
handler:^(UIAlertAction *action) {
|
actionWithTitle:@"Yes"
|
||||||
NSUserDefaults *prefs = [[NSUserDefaults standardUserDefaults] init];
|
style:UIAlertActionStyleDestructive
|
||||||
[prefs removePersistentDomainForName:@"com.burritoz.kaiprefs"];
|
handler:^(UIAlertAction *action) {
|
||||||
|
NSUserDefaults *prefs =
|
||||||
|
[[NSUserDefaults standardUserDefaults] init];
|
||||||
|
[prefs removePersistentDomainForName:@"com.burritoz.kaiprefs"];
|
||||||
|
|
||||||
NSTask *f = [[NSTask alloc] init];
|
NSTask *f = [[NSTask alloc] init];
|
||||||
[f setLaunchPath:@"/usr/bin/killall"];
|
[f setLaunchPath:@"/usr/bin/killall"];
|
||||||
[f setArguments:[NSArray arrayWithObjects:@"backboardd", nil]];
|
[f setArguments:[NSArray arrayWithObjects:@"backboardd", nil]];
|
||||||
[f launch];
|
[f launch];
|
||||||
}];
|
}];
|
||||||
|
|
||||||
[alert addAction:defaultAction];
|
[alert addAction:defaultAction];
|
||||||
[alert addAction:yes];
|
[alert addAction:yes];
|
||||||
[self presentViewController:alert animated:YES completion:nil];
|
[self presentViewController:alert animated:YES completion:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
|
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
|
||||||
CGFloat offsetY = scrollView.contentOffset.y;
|
CGFloat offsetY = scrollView.contentOffset.y;
|
||||||
|
|
||||||
if (offsetY > 120) {
|
if (offsetY > 120) {
|
||||||
[UIView animateWithDuration:0.2
|
[UIView animateWithDuration:0.2
|
||||||
animations:^{
|
animations:^{
|
||||||
self.iconView.alpha = 1.0;
|
self.iconView.alpha = 1.0;
|
||||||
self.titleLabel.alpha = 0.0;
|
self.titleLabel.alpha = 0.0;
|
||||||
}];
|
}];
|
||||||
} else {
|
} else {
|
||||||
[UIView animateWithDuration:0.2
|
[UIView animateWithDuration:0.2
|
||||||
animations:^{
|
animations:^{
|
||||||
self.iconView.alpha = 0.0;
|
self.iconView.alpha = 0.0;
|
||||||
self.titleLabel.alpha = 1.0;
|
self.titleLabel.alpha = 1.0;
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)followMeBurritoz {
|
- (void)followMeRen {
|
||||||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://twitter.com/burrit0ztweaks"]];
|
[[UIApplication sharedApplication]
|
||||||
|
openURL:[NSURL URLWithString:@"https://twitter.com/ren7995"]];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)followMeOnTwitterThomz {
|
- (void)followMeOnTwitterThomz {
|
||||||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://twitter.com/thomzi07"]];
|
[[UIApplication sharedApplication]
|
||||||
|
openURL:[NSURL URLWithString:@"https://twitter.com/thomzi07"]];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation KaiHeaderCell // Header Cell
|
@implementation KaiHeaderCell // Header Cell
|
||||||
|
|
||||||
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(id)reuseIdentifier specifier:(id)specifier {
|
- (instancetype)initWithStyle:(UITableViewCellStyle)style
|
||||||
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier specifier:specifier];
|
reuseIdentifier:(id)reuseIdentifier
|
||||||
|
specifier:(id)specifier {
|
||||||
|
self = [super initWithStyle:style
|
||||||
|
reuseIdentifier:reuseIdentifier
|
||||||
|
specifier:specifier];
|
||||||
|
|
||||||
if (self) {
|
if (self) {
|
||||||
UILabel *tweakLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 30, self.contentView.bounds.size.width + 30, 50)];
|
UILabel *tweakLabel = [[UILabel alloc]
|
||||||
[tweakLabel setTextAlignment:NSTextAlignmentLeft];
|
initWithFrame:CGRectMake(20, 30,
|
||||||
[tweakLabel setFont:[UIFont systemFontOfSize:50 weight:UIFontWeightRegular]];
|
self.contentView.bounds.size.width + 30, 50)];
|
||||||
tweakLabel.text = @"kai";
|
[tweakLabel setTextAlignment:NSTextAlignmentLeft];
|
||||||
|
[tweakLabel setFont:[UIFont systemFontOfSize:50
|
||||||
|
weight:UIFontWeightRegular]];
|
||||||
|
tweakLabel.text = @"kai";
|
||||||
|
|
||||||
UILabel *devLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 70, self.contentView.bounds.size.width + 30, 50)];
|
UILabel *devLabel = [[UILabel alloc]
|
||||||
[devLabel setTextAlignment:NSTextAlignmentLeft];
|
initWithFrame:CGRectMake(20, 70,
|
||||||
[devLabel setFont:[UIFont systemFontOfSize:20 weight:UIFontWeightMedium]];
|
self.contentView.bounds.size.width + 30, 50)];
|
||||||
devLabel.alpha = 0.8;
|
[devLabel setTextAlignment:NSTextAlignmentLeft];
|
||||||
devLabel.text = getPackageVersion();
|
[devLabel setFont:[UIFont systemFontOfSize:20 weight:UIFontWeightMedium]];
|
||||||
|
devLabel.alpha = 0.8;
|
||||||
|
devLabel.text = getPackageVersion();
|
||||||
|
|
||||||
NSBundle *bundle = [[NSBundle alloc] initWithPath:@"/Library/PreferenceBundles/kaiPrefs.bundle"];
|
NSBundle *bundle = [[NSBundle alloc]
|
||||||
UIImage *logo = [UIImage imageWithContentsOfFile:[bundle pathForResource:@"iconFullSize" ofType:@"png"]];
|
initWithPath:@"/Library/PreferenceBundles/kaiPrefs.bundle"];
|
||||||
UIImageView *icon = [[UIImageView alloc] initWithImage:logo];
|
UIImage *logo =
|
||||||
icon.frame = CGRectMake(self.contentView.bounds.size.width - 35, 35, 70, 70);
|
[UIImage imageWithContentsOfFile:[bundle pathForResource:@"iconFullSize"
|
||||||
icon.translatesAutoresizingMaskIntoConstraints = NO;
|
ofType:@"png"]];
|
||||||
|
UIImageView *icon = [[UIImageView alloc] initWithImage:logo];
|
||||||
|
icon.frame =
|
||||||
|
CGRectMake(self.contentView.bounds.size.width - 35, 35, 70, 70);
|
||||||
|
icon.translatesAutoresizingMaskIntoConstraints = NO;
|
||||||
|
|
||||||
[self addSubview:tweakLabel];
|
[self addSubview:tweakLabel];
|
||||||
[self addSubview:devLabel];
|
[self addSubview:devLabel];
|
||||||
[self addSubview:icon];
|
[self addSubview:icon];
|
||||||
|
|
||||||
[icon.rightAnchor constraintEqualToAnchor:self.rightAnchor constant:-20].active = YES;
|
[icon.rightAnchor constraintEqualToAnchor:self.rightAnchor constant:-20]
|
||||||
[icon.centerYAnchor constraintEqualToAnchor:self.centerYAnchor].active = YES;
|
.active = YES;
|
||||||
[icon.widthAnchor constraintEqualToConstant:70].active = YES;
|
[icon.centerYAnchor constraintEqualToAnchor:self.centerYAnchor].active =
|
||||||
[icon.heightAnchor constraintEqualToConstant:70].active = YES;
|
YES;
|
||||||
|
[icon.widthAnchor constraintEqualToConstant:70].active = YES;
|
||||||
|
[icon.heightAnchor constraintEqualToConstant:70].active = YES;
|
||||||
|
|
||||||
icon.layer.masksToBounds = YES;
|
icon.layer.masksToBounds = YES;
|
||||||
icon.layer.cornerRadius = 15;
|
icon.layer.cornerRadius = 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithSpecifier:(PSSpecifier *)specifier {
|
- (instancetype)initWithSpecifier:(PSSpecifier *)specifier {
|
||||||
return [self initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"KaiHeaderCell" specifier:specifier];
|
return [self initWithStyle:UITableViewCellStyleDefault
|
||||||
|
reuseIdentifier:@"KaiHeaderCell"
|
||||||
|
specifier:specifier];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setFrame:(CGRect)frame {
|
- (void)setFrame:(CGRect)frame {
|
||||||
frame.origin.x = 0;
|
frame.origin.x = 0;
|
||||||
[super setFrame:frame];
|
[super setFrame:frame];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (CGFloat)preferredHeightForWidth:(CGFloat)arg1 {
|
- (CGFloat)preferredHeightForWidth:(CGFloat)arg1 {
|
||||||
return 140.0f;
|
return 140.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation Thomz_TwitterCell // lil copy of HBTwitterCell from Cephei
|
@implementation Thomz_TwitterCell // lil copy of HBTwitterCell from Cephei
|
||||||
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier specifier:(PSSpecifier *)specifier {
|
- (instancetype)initWithStyle:(UITableViewCellStyle)style
|
||||||
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier specifier:specifier];
|
reuseIdentifier:(NSString *)reuseIdentifier
|
||||||
|
specifier:(PSSpecifier *)specifier {
|
||||||
|
self = [super initWithStyle:style
|
||||||
|
reuseIdentifier:reuseIdentifier
|
||||||
|
specifier:specifier];
|
||||||
|
|
||||||
if (self) {
|
if (self) {
|
||||||
UILabel *User = [[UILabel alloc] initWithFrame:CGRectMake(70, 15, 200, 20)];
|
UILabel *User = [[UILabel alloc] initWithFrame:CGRectMake(70, 15, 200, 20)];
|
||||||
[User setText:specifier.properties[@"user"]];
|
[User setText:specifier.properties[@"user"]];
|
||||||
[User setFont:[User.font fontWithSize:15]];
|
[User setFont:[User.font fontWithSize:15]];
|
||||||
|
|
||||||
UILabel *Description = [[UILabel alloc] initWithFrame:CGRectMake(70, 35, 200, 20)];
|
UILabel *Description =
|
||||||
[Description setText:specifier.properties[@"description"]];
|
[[UILabel alloc] initWithFrame:CGRectMake(70, 35, 200, 20)];
|
||||||
[Description setFont:[Description.font fontWithSize:10]];
|
[Description setText:specifier.properties[@"description"]];
|
||||||
|
[Description setFont:[Description.font fontWithSize:10]];
|
||||||
|
|
||||||
NSBundle *bundle = [[NSBundle alloc] initWithPath:@"/Library/PreferenceBundles/kaiPrefs.bundle"];
|
NSBundle *bundle = [[NSBundle alloc]
|
||||||
|
initWithPath:@"/Library/PreferenceBundles/kaiPrefs.bundle"];
|
||||||
|
|
||||||
UIImage *profilePicture;
|
UIImage *profilePicture;
|
||||||
profilePicture = [UIImage imageWithContentsOfFile:[bundle pathForResource:specifier.properties[@"image"] ofType:@"jpg"]];
|
profilePicture = [UIImage
|
||||||
UIImageView *profilePictureView = [[UIImageView alloc] initWithImage:profilePicture];
|
imageWithContentsOfFile:[bundle
|
||||||
[profilePictureView.layer setMasksToBounds:YES];
|
pathForResource:specifier
|
||||||
[profilePictureView.layer setCornerRadius:20];
|
.properties[@"image"]
|
||||||
[profilePictureView setFrame:CGRectMake(15, 15, 40, 40)];
|
ofType:@"jpg"]];
|
||||||
|
UIImageView *profilePictureView =
|
||||||
|
[[UIImageView alloc] initWithImage:profilePicture];
|
||||||
|
[profilePictureView.layer setMasksToBounds:YES];
|
||||||
|
[profilePictureView.layer setCornerRadius:20];
|
||||||
|
[profilePictureView setFrame:CGRectMake(15, 15, 40, 40)];
|
||||||
|
|
||||||
[self addSubview:User];
|
[self addSubview:User];
|
||||||
[self addSubview:Description];
|
[self addSubview:Description];
|
||||||
[self addSubview:profilePictureView];
|
[self addSubview:profilePictureView];
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
@ -18,15 +18,15 @@
|
|||||||
<key>cellClass</key>
|
<key>cellClass</key>
|
||||||
<string>Thomz_TwitterCell</string>
|
<string>Thomz_TwitterCell</string>
|
||||||
<key>user</key>
|
<key>user</key>
|
||||||
<string>Burrit0z</string>
|
<string>ren7995</string>
|
||||||
<key>description</key>
|
<key>description</key>
|
||||||
<string>Developer</string>
|
<string>Developer</string>
|
||||||
<key>height</key>
|
<key>height</key>
|
||||||
<integer>70</integer>
|
<integer>70</integer>
|
||||||
<key>image</key>
|
<key>image</key>
|
||||||
<string>burritoz</string>
|
<string>ren7995</string>
|
||||||
<key>action</key>
|
<key>action</key>
|
||||||
<string>followMeBurritoz</string>
|
<string>followMeRen</string>
|
||||||
</dict>
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
<key>cell</key>
|
<key>cell</key>
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 13 KiB |
BIN
kaiprefs/Resources/ren7995.jpg
Normal file
BIN
kaiprefs/Resources/ren7995.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 30 KiB |
Reference in New Issue
Block a user