Skip to content
This repository has been archived by the owner on May 9, 2019. It is now read-only.

Commit

Permalink
Fix for iOS 11.3.1 users!
Browse files Browse the repository at this point in the history
  • Loading branch information
iKilledAppl3 committed Jul 31, 2018
1 parent c9940cd commit 0487dbb
Show file tree
Hide file tree
Showing 8 changed files with 449 additions and 87 deletions.
63 changes: 62 additions & 1 deletion CCWallCustomizer2.xm
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#import "CCWallCustomizer2Classes.h"
#import <sys/stat.h>
#import <dlfcn.h>

#define customImgPath @"/var/mobile/Documents/ccwall.png"
#define cImgPath @"/var/mobile/CCWallCustomizer2/ccwall.png"
#define plist @"/var/mobile/Library/Preferences/com.ikilledappl3.ccwallcustomizer2.plist"

static BOOL kEnabled;
Expand All @@ -13,6 +16,61 @@ UIImageView *ccImageView;
//Created by iKilledAppl3 :P


%hook SBFluidSwitcherViewController
-(void)viewDidLoad {
if (kEnabled && isiPad) {
%orig;
ccImageView = [[UIImageView alloc] init];
ccImageView.frame = self.view.frame;
ccImageView.bounds = self.view.bounds;

ccImageView.image = [UIImage imageWithContentsOfFile:cImgPath];
if ([[NSFileManager defaultManager] fileExistsAtPath:customImgPath]) {
system("mv /var/mobile/Documents/ccwall.png /var/mobile/CCWallCustomizer2/");
}
//fit to the view
ccImageView.contentMode = UIViewContentModeScaleAspectFill;
//make the image clips to bounds
//imgView.clipsToBounds = YES;
//fix landscape bug
ccImageView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin;


ccImageView.alpha = 1.0;
[ccImageView.layer setOpaque:NO];
//add the image view as a sub view of the background view
[self.view addSubview:ccImageView];
[self.view sendSubviewToBack:ccImageView];

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.8];
[ccImageView setAlpha:1];
[UIView commitAnimations];




}
else {
%orig;
}
}

-(void)willMoveToParentViewController:(id)arg1 {
if (kEnabled && isiPad) {
%orig;
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.8];
[ccImageView setAlpha:0];
[UIView commitAnimations];
}
else {
%orig;
}
}
%end


%hook CCUIModularControlCenterOverlayViewController

-(void)viewDidLoad {
Expand All @@ -29,7 +87,10 @@ UIImageView *ccImageView;
ccImageView.frame = self.view.frame;
ccImageView.bounds = self.view.bounds;

ccImageView.image = [UIImage imageWithContentsOfFile:customImgPath];
ccImageView.image = [UIImage imageWithContentsOfFile:cImgPath];
if ([[NSFileManager defaultManager] fileExistsAtPath:customImgPath]) {
system("mv /var/mobile/Documents/ccwall.png /var/mobile/CCWallCustomizer2/");
}

//fit to the view
ccImageView.contentMode = UIViewContentModeScaleAspectFill;
Expand Down
12 changes: 12 additions & 0 deletions CCWallCustomizer2Classes.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@
}
@end

@interface SBFluidSwitcherViewController : UIViewController {

}
@end

@interface _MTBackdropView : UIView {

}
@property (assign,nonatomic) double blurRadius;
@end


@interface SBControlCenterController : NSObject {

}
Expand Down
7 changes: 1 addition & 6 deletions ColorMyCCModules_header.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
HBPreferences *preferences;
//see if tweak is enabled!
static BOOL kIsEnabled;
NSMutableDictionary *prefs = [[NSMutableDictionary alloc] initWithContentsOfFile:@"/var/mobile/Library/Preferences/com.ikilledappl3.colormyccmodules.plist"];
static NSString *kChosenColor;

@class NSString, UIColor;
Expand All @@ -22,12 +23,6 @@ static NSString *kChosenColor;
@interface _UIBackdropView : UIView
@end

@interface _MTBackdropView : UIView {

}
@property (assign,nonatomic) double blurRadius;
@end

@interface NCMaterialView : UIView
@end

Expand Down
5 changes: 2 additions & 3 deletions Tweak.xm
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,8 @@ dlopen ("/usr/lib/TweakInject/Haystack.dylib", RTLD_NOW);
preferences = [[HBPreferences alloc] initWithIdentifier:@"com.ikilledappl3.colormyccmodules"];

[preferences registerBool:&kIsEnabled default:NO forKey:@"kIsEnabled"];

NSMutableDictionary *prefs = [[NSMutableDictionary alloc] initWithContentsOfFile:@"/var/mobile/Library/Preferences/com.ikilledappl3.colormyccmodules.plist"];
kChosenColor = ([prefs objectForKey:@"kChosenColor"] ? [prefs objectForKey:@"kChosenColor"] : @"#000000");
[preferences registerObject:&kChosenColor default:nil forKey:@"kChosenColor"];



}
Expand Down
Loading

0 comments on commit 0487dbb

Please sign in to comment.