miroir de
https://github.com/Burrit0z/kai
synchronisé 2025-06-30 22:36:46 +00:00
prefs, a shit ton
Cette révision appartient à :
14
DragonMake
14
DragonMake
@ -8,3 +8,17 @@ kai:
|
||||
- Kai.xm
|
||||
frameworks:
|
||||
- BatteryCenter
|
||||
|
||||
kaiPrefs:
|
||||
dir: kaiprefs
|
||||
type: bundle
|
||||
files:
|
||||
- KAIRootListController.m
|
||||
archs:
|
||||
- arm64
|
||||
- arm64e
|
||||
frameworks:
|
||||
- Preferences
|
||||
stage:
|
||||
- mkdir -p .dragon/_/Library/PreferenceLoader/Preferences/
|
||||
- cp entry.plist .dragon/_/Library/PreferenceLoader/Preferences/$name.plist
|
||||
|
@ -11,6 +11,11 @@
|
||||
@property (nonatomic, assign) NSInteger chargingState;
|
||||
@end
|
||||
|
||||
@interface MTMaterialView : UIView
|
||||
@property (nonatomic, assign) BOOL recipeDynamic;
|
||||
-(id)_initWithRecipe:(NSInteger)arg1 configuration:(NSInteger)arg2 initialWeighting:(CGFloat)arg3 scaleAdjustment:(id)arg4;
|
||||
@end
|
||||
|
||||
@interface BCBatteryDeviceController
|
||||
@property (nonatomic, strong) NSArray *sortedDevices;
|
||||
-(id)_sortedDevices;
|
||||
|
@ -48,7 +48,7 @@ long long lastPercentage;
|
||||
|
||||
if(charging) {
|
||||
|
||||
UIVisualEffectView *blank;
|
||||
/*UIVisualEffectView *blank;
|
||||
if(@available(iOS 12.0, *)) {
|
||||
if(self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
|
||||
blank = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleDark]];
|
||||
@ -57,7 +57,9 @@ long long lastPercentage;
|
||||
}
|
||||
} else {
|
||||
blank = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]];
|
||||
}
|
||||
}*/
|
||||
MTMaterialView *blank = [[[objc_getClass("MTMaterialView") class] alloc] _initWithRecipe:1 configuration:1 initialWeighting:1 scaleAdjustment:nil];
|
||||
//blank.recipeDynamic = NO; //makes it stay light
|
||||
blank.frame = CGRectMake(0, 0 + y, self.superview.bounds.size.width - 16, 80);
|
||||
blank.layer.masksToBounds = YES;
|
||||
blank.layer.cornerRadius = 13;
|
||||
@ -97,8 +99,8 @@ long long lastPercentage;
|
||||
|
||||
label.frame = CGRectMake(65.5,27.5 + y,275,25);
|
||||
glyphView.frame = CGRectMake(20.5,18.5 + y,40,40);
|
||||
battery.frame = CGRectMake(310,35 + y,20,10);
|
||||
percentLabel.frame = CGRectMake(265,35 + y,36,12);
|
||||
battery.frame = CGRectMake(self.superview.bounds.size.width - 16 - 49,35 + y,20,10);
|
||||
percentLabel.frame = CGRectMake(self.superview.bounds.size.width - 16 - 94,35 + y,36,12);
|
||||
|
||||
y+=85;
|
||||
self.number +=1;
|
||||
@ -123,7 +125,7 @@ long long lastPercentage;
|
||||
}
|
||||
|
||||
-(void)darkLightMode {
|
||||
for(UIVisualEffectView *view in self.subviews) {
|
||||
/*for(UIVisualEffectView *view in self.subviews) {
|
||||
if(@available(iOS 12.0, *)) {
|
||||
if(self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
|
||||
if([view respondsToSelector:@selector(setEffect:)]) view.effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
|
||||
@ -132,7 +134,7 @@ long long lastPercentage;
|
||||
if([view respondsToSelector:@selector(setEffect:)]) view.effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
@end
|
91
Kai.h
Fichier normal
91
Kai.h
Fichier normal
@ -0,0 +1,91 @@
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#include <stdio.h>
|
||||
#import <objc/runtime.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "KAIBattery.mm"
|
||||
#define KAISelf ((CSAdjunctListView *)self)
|
||||
|
||||
@interface UIApplication (Kai)
|
||||
+(id)sharedApplication;
|
||||
-(BOOL)launchApplicationWithIdentifier:(id)arg1 suspended:(BOOL)arg2;
|
||||
@end
|
||||
|
||||
@interface CSAdjunctListView : UIView
|
||||
@property (nonatomic, assign) BOOL hasKai;
|
||||
-(UIStackView *)stackView;
|
||||
-(void)setStackView:(UIStackView *)arg1;
|
||||
-(void)KaiUpdate;
|
||||
@end
|
||||
|
||||
@interface SBDashBoardAdjunctListView : UIView
|
||||
@property (nonatomic, assign) BOOL hasKai;
|
||||
-(UIStackView *)stackView;
|
||||
-(void)setStackView:(UIStackView *)arg1;
|
||||
-(void)KaiUpdate;
|
||||
@end
|
||||
|
||||
@interface CSMainPageView : UIView
|
||||
-(void)updateForPresentation:(id)arg1;
|
||||
@end
|
||||
|
||||
@interface _CSSingleBatteryChargingView : UIView
|
||||
@end
|
||||
|
||||
@interface NSLayoutConstraint (Kai)
|
||||
+(id)constraintWithAnchor:(id)arg1 relatedBy:(long long)arg2 toAnchor:(id)arg3 multiplier:(double)arg4 constant:(double)arg5 ;
|
||||
@end
|
||||
|
||||
//prefs
|
||||
BOOL enabled;
|
||||
|
||||
|
||||
#define PLIST_PATH @"/User/Library/Preferences/com.burritoz.kaiprefs.plist"
|
||||
#define kIdentifier @"com.burritoz.kaiprefs"
|
||||
#define kSettingsChangedNotification (CFStringRef)@"com.burritoz.kaiprefs/reload"
|
||||
#define kSettingsPath @"/var/mobile/Library/Preferences/com.burritoz.kaiprefs.plist"
|
||||
|
||||
NSDictionary *prefs = nil;
|
||||
|
||||
static void *observer = NULL;
|
||||
|
||||
static void reloadPrefs()
|
||||
{
|
||||
if ([NSHomeDirectory() isEqualToString:@"/var/mobile"])
|
||||
{
|
||||
CFArrayRef keyList = CFPreferencesCopyKeyList((CFStringRef)kIdentifier, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
|
||||
|
||||
if (keyList)
|
||||
{
|
||||
prefs = (NSDictionary *)CFBridgingRelease(CFPreferencesCopyMultiple(keyList, (CFStringRef)kIdentifier, kCFPreferencesCurrentUser, kCFPreferencesAnyHost));
|
||||
|
||||
if (!prefs)
|
||||
{
|
||||
prefs = [NSDictionary new];
|
||||
}
|
||||
CFRelease(keyList);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
prefs = [NSDictionary dictionaryWithContentsOfFile:kSettingsPath];
|
||||
}
|
||||
}
|
||||
|
||||
static BOOL boolValueForKey(NSString *key, BOOL defaultValue) {
|
||||
return (prefs && [prefs objectForKey:key] ? [[prefs objectForKey:key] boolValue] : defaultValue);
|
||||
}
|
||||
|
||||
|
||||
/*static double numberForValue(NSString *key, double defaultValue) {
|
||||
return (prefs && [prefs objectForKey:key] ? [[prefs objectForKey:key] doubleValue] : defaultValue);
|
||||
}*/
|
||||
|
||||
static void preferencesChanged()
|
||||
{
|
||||
CFPreferencesAppSynchronize((CFStringRef)kIdentifier);
|
||||
reloadPrefs();
|
||||
|
||||
enabled = boolValueForKey(@"enabled", YES);
|
||||
}
|
45
Kai.xm
45
Kai.xm
@ -1,41 +1,4 @@
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#include <stdio.h>
|
||||
#import <objc/runtime.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "KAIBattery.mm"
|
||||
#define KAISelf ((CSAdjunctListView *)self)
|
||||
|
||||
@interface UIApplication (Kai)
|
||||
+(id)sharedApplication;
|
||||
-(BOOL)launchApplicationWithIdentifier:(id)arg1 suspended:(BOOL)arg2;
|
||||
@end
|
||||
|
||||
@interface CSAdjunctListView : UIView
|
||||
@property (nonatomic, assign) BOOL hasKai;
|
||||
-(UIStackView *)stackView;
|
||||
-(void)setStackView:(UIStackView *)arg1;
|
||||
-(void)KaiUpdate;
|
||||
@end
|
||||
|
||||
@interface SBDashBoardAdjunctListView : UIView
|
||||
@property (nonatomic, assign) BOOL hasKai;
|
||||
-(UIStackView *)stackView;
|
||||
-(void)setStackView:(UIStackView *)arg1;
|
||||
-(void)KaiUpdate;
|
||||
@end
|
||||
|
||||
@interface CSMainPageView : UIView
|
||||
-(void)updateForPresentation:(id)arg1;
|
||||
@end
|
||||
|
||||
@interface _CSSingleBatteryChargingView : UIView
|
||||
@end
|
||||
|
||||
@interface NSLayoutConstraint (Kai)
|
||||
+(id)constraintWithAnchor:(id)arg1 relatedBy:(long long)arg2 toAnchor:(id)arg3 multiplier:(double)arg4 constant:(double)arg5 ;
|
||||
@end
|
||||
#import "Kai.h"
|
||||
|
||||
|
||||
%hook KAITarget
|
||||
@ -113,7 +76,6 @@
|
||||
|
||||
- (id)initWithIdentifier:(id)arg1 vendor:(long long)arg2 productIdentifier:(long long)arg3 parts:(unsigned long long)arg4 matchIdentifier:(id)arg5 {
|
||||
|
||||
[self addObserver:self forKeyPath:@"name" options:NSKeyValueObservingOptionNew context:nil];
|
||||
[self addObserver:self forKeyPath:@"charging" options:NSKeyValueObservingOptionNew context:nil];
|
||||
[self addObserver:self forKeyPath:@"powerSourceState" options:NSKeyValueObservingOptionNew context:nil];
|
||||
[self addObserver:self forKeyPath:@"batterySaverModeActive" options:NSKeyValueObservingOptionNew context:nil];
|
||||
@ -148,6 +110,9 @@
|
||||
%end
|
||||
|
||||
%ctor {
|
||||
preferencesChanged();
|
||||
Class cls = kCFCoreFoundationVersionNumber > 1600 ? ([objc_getClass("CSAdjunctListView") class]) : ([objc_getClass("SBDashBoardAdjunctListView") class]);
|
||||
%init(KAITarget = cls);
|
||||
if(enabled) {
|
||||
%init(KAITarget = cls);
|
||||
}
|
||||
}
|
||||
|
181
build.ninja
181
build.ninja
@ -1,181 +0,0 @@
|
||||
name = kai
|
||||
lowername = kai
|
||||
|
||||
# Build file for kai
|
||||
# Generated at 05/20/20 09:51:19
|
||||
|
||||
pdirname = .dragon
|
||||
|
||||
location = /Library/MobileSubstrate/DynamicLibraries/
|
||||
resource_dir = Resources
|
||||
target = $pdirname/_$location$name.dylib
|
||||
|
||||
stage2 = cp $name.plist $
|
||||
.dragon/_/Library/MobileSubstrate/DynamicLibraries/$name.plist
|
||||
|
||||
builddir = $pdirname/build
|
||||
objdir = $pdirname/obj
|
||||
signdir = $pdirname/sign
|
||||
signtarget = $signdir/$target.unsigned
|
||||
symtarget = $signdir/$target.unsym
|
||||
|
||||
dragondir = $$DRAGONBUILD
|
||||
pwd = .
|
||||
sysroot = $dragondir/sdks/iPhoneOS.sdk
|
||||
|
||||
fwSearch = -F$sysroot/System/Library/Frameworks $
|
||||
-F$sysroot/System/Library/PrivateFrameworks -F$dragondir/frameworks
|
||||
libSearch = -L$dragondir/lib -L.
|
||||
|
||||
cc = clang++
|
||||
ccpp = clang++
|
||||
ld = clang++
|
||||
ldid = ldid
|
||||
dsym = dsymutil
|
||||
logos = $dragondir/bin/logos.pl
|
||||
plutil = plutil
|
||||
stage = true;
|
||||
|
||||
targetios = 10.0
|
||||
|
||||
frameworks = -framework BatteryCenter -framework CoreFoundation -framework $
|
||||
Foundation -framework UIKit -framework CoreGraphics -framework $
|
||||
QuartzCore -framework CoreImage -framework AudioToolbox
|
||||
|
||||
libs = -lsubstrate -lobjc -lc++
|
||||
|
||||
arc = -fobjc-arc
|
||||
btarg = -DTARGET_IPHONE=1
|
||||
warnings = -Wall
|
||||
optim = -O0
|
||||
debug = -fcolor-diagnostics
|
||||
|
||||
header_includes =
|
||||
cinclude = -I$dragondir/include -I$dragondir/vendor/include $
|
||||
-I$dragondir/include/_fallback -I$DRAGONBUILD/headers/ -I$pwd
|
||||
|
||||
usrCflags =
|
||||
usrLDflags =
|
||||
usrLDIDFlags = -S
|
||||
|
||||
lopt = -dynamiclib -ggdb -Xlinker -segalign -Xlinker 4000
|
||||
typeldflags = -install_name $location$name
|
||||
|
||||
cflags = $cinclude -fmodules -fcxx-modules -fmodule-name=$name $
|
||||
-fbuild-session-file=.dragon/modules/ -fmodules-prune-after=345600 $
|
||||
-fmodules-prune-interval=86400 $
|
||||
-fmodules-validate-once-per-build-session $arc $fwSearch $
|
||||
-miphoneos-version-min=$targetios -isysroot $sysroot $btarg $warnings $
|
||||
$optim $debug $usrCflags $header_includes
|
||||
|
||||
lflags = $cflags $typeldflags $frameworks $libs $lopt $libSearch $usrLDflags
|
||||
|
||||
ldflags = $usrLDFlags
|
||||
|
||||
pool solo
|
||||
depth = 1
|
||||
|
||||
rule prelogos
|
||||
command = cat $in | python3 $$DRAGONBUILD/bin/prelogos.py > $out
|
||||
description = Processing $in with Pre/Logos
|
||||
|
||||
rule logos
|
||||
command = $logos $in > $out
|
||||
description = Processing $in with Logos
|
||||
|
||||
rule compilearm64
|
||||
command = $cc -arch arm64 $cflags -c $in -o $out
|
||||
description = Compiling $in for arm64
|
||||
|
||||
rule compilexxarm64
|
||||
command = $cxx -arch arm64 $cflags -c $in -o $out
|
||||
description = Compiling $in for arm64
|
||||
|
||||
rule linkarm64
|
||||
command = $ld -arch arm64 $lflags -o $out $in
|
||||
description = Linking $name for arm64
|
||||
|
||||
rule compilearm64e
|
||||
command = $cc -arch arm64e $cflags -c $in -o $out
|
||||
description = Compiling $in for arm64e
|
||||
|
||||
rule compilexxarm64e
|
||||
command = $cxx -arch arm64e $cflags -c $in -o $out
|
||||
description = Compiling $in for arm64e
|
||||
|
||||
rule linkarm64e
|
||||
command = $ld -arch arm64e $lflags -o $out $in
|
||||
description = Linking $name for arm64e
|
||||
|
||||
rule compilearmv7
|
||||
command = $cc -arch armv7 $cflags -c $in -o $out
|
||||
description = Compiling $in for armv7
|
||||
|
||||
rule compilexxarmv7
|
||||
command = $cxx -arch armv7 $cflags -c $in -o $out
|
||||
description = Compiling $in for armv7
|
||||
|
||||
rule linkarmv7
|
||||
command = $ld -arch armv7 $lflags -o $out $in
|
||||
description = Linking $name for armv7
|
||||
|
||||
rule compilex86_64
|
||||
command = $cc -arch x86_64 $cflags -c $in -o $out
|
||||
description = Compiling $in for x86_64
|
||||
|
||||
rule compilexxx86_64
|
||||
command = $cxx -arch x86_64 $cflags -c $in -o $out
|
||||
description = Compiling $in for x86_64
|
||||
|
||||
rule linkx86_64
|
||||
command = $ld -arch x86_64 $lflags -o $out $in
|
||||
description = Linking $name for x86_64
|
||||
|
||||
rule lipo
|
||||
command = lipo -create $in -output $out
|
||||
description = Merging architectures
|
||||
|
||||
rule bundle
|
||||
command = mkdir -p ".dragon/_$location/" && cp -r "$resource_dir/" $
|
||||
".dragon/_$location" && cp $in $out
|
||||
description = Copying Bundle Resources
|
||||
pool = solo
|
||||
|
||||
rule plist
|
||||
command = $plutil -convert binary1 $in -o $out
|
||||
description = Converting $in
|
||||
|
||||
rule debug
|
||||
command = $dsym "$in" 2&> /dev/null; cp $in $out
|
||||
description = Generating Debug Symbols for $name
|
||||
|
||||
rule sign
|
||||
command = $ldid $usrLDIDFlags $in && cp $in $target
|
||||
description = Signing $name
|
||||
|
||||
rule stage
|
||||
command = $stage $stage2
|
||||
description = Running Stage for $name
|
||||
|
||||
build $builddir/logos/Kai.xm.mm: logos Kai.xm
|
||||
|
||||
build $builddir/armv7/Kai.xm.mm.o: compilearmv7 $builddir/logos/Kai.xm.mm
|
||||
|
||||
build $builddir/$name.armv7: linkarmv7 $builddir/armv7/Kai.xm.mm.o
|
||||
build $builddir/arm64/Kai.xm.mm.o: compilearm64 $builddir/logos/Kai.xm.mm
|
||||
|
||||
build $builddir/$name.arm64: linkarm64 $builddir/arm64/Kai.xm.mm.o
|
||||
build $builddir/arm64e/Kai.xm.mm.o: compilearm64e $builddir/logos/Kai.xm.mm
|
||||
|
||||
build $builddir/$name.arm64e: linkarm64e $builddir/arm64e/Kai.xm.mm.o
|
||||
build $builddir/trash/stage: stage $target
|
||||
|
||||
build $symtarget: lipo $builddir/$name.armv7 $builddir/$name.arm64 $
|
||||
$builddir/$name.arm64e
|
||||
|
||||
build $signtarget: debug $symtarget
|
||||
|
||||
build $target: sign $signtarget
|
||||
|
||||
default $target $builddir/trash/stage
|
||||
|
2
control
2
control
@ -1,6 +1,6 @@
|
||||
Package: com.burritoz.kai
|
||||
Name: Kai
|
||||
Version: 0.0.3
|
||||
Version: 0.0.4
|
||||
Architecture: iphoneos-arm
|
||||
Description: An awesome MobileSubstrate tweak!
|
||||
Maintainer: burrit0z
|
||||
|
24
kaiprefs/KAIRootListController.h
Fichier normal
24
kaiprefs/KAIRootListController.h
Fichier normal
@ -0,0 +1,24 @@
|
||||
#import <Preferences/PSListController.h>
|
||||
#import <Preferences/PSTableCell.h>
|
||||
#import <Preferences/PSSpecifier.h>
|
||||
#import <Preferences/PSListItemsController.h>
|
||||
#import <Foundation/NSUserDefaults.h>
|
||||
|
||||
@interface PSListController (kai)
|
||||
-(void)setFrame:(CGRect)frame;
|
||||
@end
|
||||
|
||||
@interface KAIRootListController : PSListController
|
||||
@end
|
||||
|
||||
@protocol PreferencesTableCustomView
|
||||
- (id)initWithSpecifier:(id)arg1;
|
||||
@end
|
||||
|
||||
@interface KaiHeaderCell : PSTableCell <PreferencesTableCustomView> {
|
||||
UIView *bgView;
|
||||
UILabel *packageNameLabel;
|
||||
UILabel *developerLabel;
|
||||
UILabel *versionLabel;
|
||||
}
|
||||
@end
|
122
kaiprefs/KAIRootListController.m
Fichier normal
122
kaiprefs/KAIRootListController.m
Fichier normal
@ -0,0 +1,122 @@
|
||||
#include "KAIRootListController.h"
|
||||
|
||||
NSBundle *tweakBundle;
|
||||
|
||||
@implementation KAIRootListController
|
||||
|
||||
- (NSArray *)specifiers {
|
||||
if (!_specifiers) {
|
||||
_specifiers = [self loadSpecifiersFromPlistName:@"Root" target:self];
|
||||
}
|
||||
|
||||
return _specifiers;
|
||||
}
|
||||
|
||||
-(void)viewWillAppear:(BOOL)arg1 {
|
||||
self.navigationController.navigationController.navigationBar.barTintColor = [UIColor colorWithRed: 0.00 green: 0.77 blue: 0.95 alpha: 1.00];
|
||||
[self.navigationController.navigationController.navigationBar setShadowImage: [UIImage new]];
|
||||
self.navigationController.navigationController.navigationBar.tintColor = [UIColor whiteColor];
|
||||
self.navigationController.navigationController.navigationBar.translucent = NO;
|
||||
|
||||
[[UISegmentedControl appearanceWhenContainedInInstancesOfClasses:@[self.class]] 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)animated {
|
||||
|
||||
[super viewWillDisappear:animated];
|
||||
|
||||
[self.navigationController.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor blackColor]}];
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation KaiHeaderCell // Header Cell
|
||||
|
||||
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(id)reuseIdentifier specifier:(id)specifier {
|
||||
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier specifier:specifier];
|
||||
|
||||
if (self) {
|
||||
|
||||
packageNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0,90,self.contentView.bounds.size.width+30,50)];
|
||||
[packageNameLabel setTextAlignment:NSTextAlignmentRight];
|
||||
[packageNameLabel setFont:[UIFont systemFontOfSize:50 weight: UIFontWeightSemibold] ];
|
||||
packageNameLabel.textColor = [UIColor whiteColor];
|
||||
packageNameLabel.text = @"kai";
|
||||
|
||||
developerLabel = [[UILabel alloc] initWithFrame:CGRectMake(0,50,self.contentView.bounds.size.width+30,50)];
|
||||
[developerLabel setTextAlignment:NSTextAlignmentRight];
|
||||
[developerLabel setFont:[UIFont systemFontOfSize:22.5 weight: UIFontWeightMedium] ];
|
||||
developerLabel.textColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:0.85];
|
||||
developerLabel.alpha = 0.8;
|
||||
developerLabel.text = @"Burrit0z";
|
||||
|
||||
|
||||
versionLabel = [[UILabel alloc] initWithFrame:CGRectMake(0,130,self.contentView.bounds.size.width+30,50)];
|
||||
[versionLabel setTextAlignment:NSTextAlignmentRight];
|
||||
[versionLabel setFont:[UIFont systemFontOfSize:22 weight: UIFontWeightMedium] ];
|
||||
versionLabel.textColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:0.8];
|
||||
versionLabel.alpha = 0.8;
|
||||
versionLabel.text = @"alpha";
|
||||
|
||||
NSBundle *bundle = [[NSBundle alloc]initWithPath:@"/Library/PreferenceBundles/KaiPrefs.bundle"];
|
||||
UIImage *phone = [UIImage imageWithContentsOfFile:[bundle pathForResource:@"kai" ofType:@"png"]];
|
||||
UIImageView *phoneImage = [[UIImageView alloc]initWithImage:phone];
|
||||
[phoneImage setFrame:self.frame];
|
||||
|
||||
bgView.backgroundColor = [UIColor colorWithRed: 0.00 green: 0.82 blue: 1.00 alpha: 1.00];
|
||||
|
||||
[self addSubview:packageNameLabel];
|
||||
[self addSubview:developerLabel];
|
||||
[self addSubview:versionLabel];
|
||||
[self addSubview:phoneImage];
|
||||
|
||||
}
|
||||
return self;
|
||||
|
||||
}
|
||||
|
||||
- (instancetype)initWithSpecifier:(PSSpecifier *)specifier {
|
||||
return [self initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"KaiHeaderCell" specifier:specifier];
|
||||
}
|
||||
|
||||
- (void)setFrame:(CGRect)frame {
|
||||
frame.origin.x = 0;
|
||||
//frame.origin.y = 43;
|
||||
[super setFrame:frame];
|
||||
}
|
||||
|
||||
- (CGFloat)preferredHeightForWidth:(CGFloat)arg1{
|
||||
return 200.0f;
|
||||
}
|
||||
|
||||
|
||||
-(void)layoutSubviews{
|
||||
[super layoutSubviews];
|
||||
|
||||
bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.contentView.bounds.size.width, 200)];
|
||||
|
||||
UIColor *topColor = [UIColor colorWithRed: 0.00 green: 0.82 blue: 1.00 alpha: 1.00];
|
||||
UIColor *bottomColor = [UIColor colorWithRed: 0.23 green: 0.48 blue: 0.84 alpha: 1.00];
|
||||
|
||||
CAGradientLayer *theViewGradient = [CAGradientLayer layer];
|
||||
theViewGradient.colors = [NSArray arrayWithObjects: (id)topColor.CGColor, (id)bottomColor.CGColor, nil];
|
||||
theViewGradient.startPoint = CGPointMake(0.5, 0.0);
|
||||
theViewGradient.endPoint = CGPointMake(0.5, 1.0);
|
||||
theViewGradient.frame = bgView.bounds;
|
||||
|
||||
//Add gradient to view
|
||||
[bgView.layer insertSublayer:theViewGradient atIndex:0];
|
||||
[self insertSubview:bgView atIndex:0];
|
||||
|
||||
}
|
||||
|
||||
|
||||
- (CGFloat)preferredHeightForWidth:(CGFloat)width inTableView:(id)tableView {
|
||||
return [self preferredHeightForWidth:width];
|
||||
}
|
||||
|
||||
@end
|
24
kaiprefs/Resources/Info.plist
Fichier normal
24
kaiprefs/Resources/Info.plist
Fichier normal
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>kaiPrefs</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.burritoz.kaiprefs</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>KAIRootListController</string>
|
||||
</dict>
|
||||
</plist>
|
31
kaiprefs/Resources/Root.plist
Fichier normal
31
kaiprefs/Resources/Root.plist
Fichier normal
@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>items</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>cell</key>
|
||||
<string>PSGroupCell</string>
|
||||
<key>headerCellClass</key>
|
||||
<string>KaiHeaderCell</string>
|
||||
<key>height</key>
|
||||
<integer>175</integer>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>cell</key>
|
||||
<string>PSSwitchCell</string>
|
||||
<key>default</key>
|
||||
<true/>
|
||||
<key>defaults</key>
|
||||
<string>com.burritoz.kaiprefs</string>
|
||||
<key>key</key>
|
||||
<string>enabled</string>
|
||||
<key>label</key>
|
||||
<string>Enable</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>title</key>
|
||||
<string>kai</string>
|
||||
</dict>
|
||||
</plist>
|
BIN
kaiprefs/Resources/kai.png
Fichier normal
BIN
kaiprefs/Resources/kai.png
Fichier normal
Fichier binaire non affiché.
Après Largeur: | Hauteur: | Taille: 3.7 KiB |
21
kaiprefs/entry.plist
Fichier normal
21
kaiprefs/entry.plist
Fichier normal
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>entry</key>
|
||||
<dict>
|
||||
<key>bundle</key>
|
||||
<string>kaiPrefs</string>
|
||||
<key>cell</key>
|
||||
<string>PSLinkCell</string>
|
||||
<key>detail</key>
|
||||
<string>KAIRootListController</string>
|
||||
<key>icon</key>
|
||||
<string>icon.png</string>
|
||||
<key>isController</key>
|
||||
<true/>
|
||||
<key>label</key>
|
||||
<string>kai</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
Référencer dans un nouveau ticket
Bloquer un utilisateur