Permalink
Browse files

no require respring. on-demand setting read.

  • Loading branch information...
1 parent bb7c99e commit c73b019566878c0c5cd69d09de76a5f6e94d15e3 @r-plus r-plus committed Apr 18, 2011
Showing with 17 additions and 16 deletions.
  1. +1 −7 FakeClockUp.plist
  2. +1 −0 Makefile
  3. +14 −8 Tweak.xm
  4. +1 −1 layout/DEBIAN/control
View
8 FakeClockUp.plist
@@ -1,7 +1 @@
-{
- Filter = {
- Bundles = (
- "com.apple.UIKit",
- );
- };
-}
+{ Filter = { Bundles = ( "com.apple.UIKit" ); }; }
View
1 Makefile
@@ -1,3 +1,4 @@
+SDKVERSION = latest
include theos/makefiles/common.mk
TWEAK_NAME = FakeClockUp
View
22 Tweak.xm
@@ -10,21 +10,27 @@ static float durMulti = 1.0;
duration *= durMulti;
%orig;
}
+
%end
+static void LoadSettings(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo)
+{
+ NSDictionary *udDict = [NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/jp.novi.FakeClockUp.plist"];
+ if (udDict) {
+ float durm = [[udDict objectForKey:@"duration"] floatValue];
+ if (durm != 0.0 && durm >= 0.001 && durm <= 20) {
+ durMulti = durm;
+ }
+ }
+}
+
__attribute__((constructor))
static void FakeClockUp_initializer()
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
- NSDictionary *udDict = [NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/jp.novi.FakeClockUp.plist"];
- if (udDict) {
- float durm = [[udDict objectForKey:@"duration"] floatValue];
- if (durm != 0.0 && durm >= 0.001 && durm <= 20) {
- durMulti = durm;
- }
- }
+ CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, LoadSettings, CFSTR("jp.novi.FakeClockUp.preferencechanged"), NULL, CFNotificationSuspensionBehaviorCoalesce);
+ LoadSettings(nil,nil,nil,nil,nil);
[pool release];
}
View
2 layout/DEBIAN/control
@@ -1,7 +1,7 @@
Package: jp.novi.FakeClockUp
Name: FakeClockUp
Homepage: http://hitoriblog.com/?p=1967
-Version: 0.1.1
+Version: 0.2
Section: Tweaks
Maintainer: moyashi <hitoriblog_NO_NO_SPAM@gmail.com>
Depends: mobilesubstrate, preferenceloader

0 comments on commit c73b019

Please sign in to comment.