Skip to content

Commit 71f02af

Browse files
committed
Initial commit.
1 parent a01b8dd commit 71f02af

File tree

7 files changed

+130
-50
lines changed

7 files changed

+130
-50
lines changed

PMreally.xcodeproj/project.pbxproj

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
/* Begin PBXBuildFile section */
1010
3B4D91041A3A97D800FE6438 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B4D91031A3A97D800FE6438 /* Foundation.framework */; };
1111
3B4D910F1A3A97D800FE6438 /* PMreally.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3B4D910E1A3A97D800FE6438 /* PMreally.mm */; };
12+
3B4D911A1A3A982600FE6438 /* libsubstrate.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B4D91191A3A982600FE6438 /* libsubstrate.dylib */; };
13+
3B4D911C1A3A9C6500FE6438 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B4D911B1A3A9C6500FE6438 /* UIKit.framework */; };
1214
/* End PBXBuildFile section */
1315

1416
/* Begin PBXFileReference section */
@@ -18,16 +20,20 @@
1820
3B4D91091A3A97D800FE6438 /* control */ = {isa = PBXFileReference; lastKnownFileType = text; name = control; path = Package/DEBIAN/control; sourceTree = "<group>"; };
1921
3B4D910B1A3A97D800FE6438 /* PackageVersion.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = PackageVersion.plist; sourceTree = "<group>"; };
2022
3B4D910C1A3A97D800FE6438 /* PMreally-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "PMreally-Prefix.pch"; sourceTree = "<group>"; };
21-
3B4D910D1A3A97D800FE6438 /* PMreally.xm */ = {isa = PBXFileReference; lastKnownFileType = text; path = PMreally.xm; sourceTree = "<group>"; };
23+
3B4D910D1A3A97D800FE6438 /* PMreally.xm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc.preprocessed; path = PMreally.xm; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
2224
3B4D910E1A3A97D800FE6438 /* PMreally.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = PMreally.mm; sourceTree = "<group>"; };
2325
3B4D91131A3A97D800FE6438 /* PMreally.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = PMreally.plist; path = Package/Library/MobileSubstrate/DynamicLibraries/PMreally.plist; sourceTree = "<group>"; };
26+
3B4D91191A3A982600FE6438 /* libsubstrate.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsubstrate.dylib; path = ../../../../../opt/iOSOpenDev/lib/libsubstrate.dylib; sourceTree = "<group>"; };
27+
3B4D911B1A3A9C6500FE6438 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
2428
/* End PBXFileReference section */
2529

2630
/* Begin PBXFrameworksBuildPhase section */
2731
3B4D90FC1A3A97D800FE6438 /* Frameworks */ = {
2832
isa = PBXFrameworksBuildPhase;
2933
buildActionMask = 2147483647;
3034
files = (
35+
3B4D911C1A3A9C6500FE6438 /* UIKit.framework in Frameworks */,
36+
3B4D911A1A3A982600FE6438 /* libsubstrate.dylib in Frameworks */,
3137
3B4D91041A3A97D800FE6438 /* Foundation.framework in Frameworks */,
3238
);
3339
runOnlyForDeploymentPostprocessing = 0;
@@ -55,6 +61,8 @@
5561
3B4D91021A3A97D800FE6438 /* Frameworks */ = {
5662
isa = PBXGroup;
5763
children = (
64+
3B4D911B1A3A9C6500FE6438 /* UIKit.framework */,
65+
3B4D91191A3A982600FE6438 /* libsubstrate.dylib */,
5866
3B4D91031A3A97D800FE6438 /* Foundation.framework */,
5967
);
6068
name = Frameworks;
@@ -287,6 +295,10 @@
287295
GCC_PRECOMPILE_PREFIX_HEADER = YES;
288296
GCC_PREFIX_HEADER = "PMreally/PMreally-Prefix.pch";
289297
INSTALL_PATH = /Library/MobileSubstrate/DynamicLibraries;
298+
LIBRARY_SEARCH_PATHS = (
299+
"$(inherited)",
300+
/opt/iOSOpenDev/lib,
301+
);
290302
PRODUCT_NAME = "$(TARGET_NAME)";
291303
iOSOpenDevBuildPackageOnAnyBuild = NO;
292304
iOSOpenDevCopyOnBuild = NO;
@@ -307,6 +319,10 @@
307319
GCC_PRECOMPILE_PREFIX_HEADER = YES;
308320
GCC_PREFIX_HEADER = "PMreally/PMreally-Prefix.pch";
309321
INSTALL_PATH = /Library/MobileSubstrate/DynamicLibraries;
322+
LIBRARY_SEARCH_PATHS = (
323+
"$(inherited)",
324+
/opt/iOSOpenDev/lib,
325+
);
310326
PRODUCT_NAME = "$(TARGET_NAME)";
311327
iOSOpenDevBuildPackageOnAnyBuild = NO;
312328
iOSOpenDevCopyOnBuild = NO;
@@ -337,6 +353,7 @@
337353
3B4D91181A3A97D800FE6438 /* Release */,
338354
);
339355
defaultConfigurationIsVisible = 0;
356+
defaultConfigurationName = Release;
340357
};
341358
/* End XCConfigurationList section */
342359
};

PMreally/PMreally.mm

Lines changed: 72 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,74 @@
1+
#line 1 "/Users/jzplusplus/Documents/jailbreak/PMreally/PMreally/PMreally.xm"
12

2-
// *** DO NOT EDIT THIS FILE! ***
3-
// This file is generated by Logos processing using PMreally.xm during each build.
43

5-
// Logos by Dustin Howett
6-
// See http://iphonedevwiki.net/index.php/Logos
4+
5+
6+
#include <UIKit/UIKit.h>
7+
8+
9+
10+
11+
12+
13+
14+
15+
16+
17+
18+
19+
20+
21+
22+
23+
24+
25+
26+
27+
28+
#include <logos/logos.h>
29+
#include <substrate.h>
30+
@class EditAlarmViewController;
31+
static void (*_logos_orig$_ungrouped$EditAlarmViewController$_doneButtonClicked$)(EditAlarmViewController*, SEL, id); static void _logos_method$_ungrouped$EditAlarmViewController$_doneButtonClicked$(EditAlarmViewController*, SEL, id);
32+
33+
#line 27 "/Users/jzplusplus/Documents/jailbreak/PMreally/PMreally/PMreally.xm"
34+
35+
36+
37+
static void _logos_method$_ungrouped$EditAlarmViewController$_doneButtonClicked$(EditAlarmViewController* self, SEL _cmd, id arg) {
38+
39+
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
40+
[formatter setDateFormat:@"a"];
41+
NSString * ampm = [formatter stringFromDate:[[[self view] timePicker] date]];
42+
[formatter release];
43+
44+
if([ampm characterAtIndex:0] == 'P')
45+
{
46+
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"PM, really?"
47+
message:@"Did you really mean to set this alarm for PM?"
48+
preferredStyle:UIAlertControllerStyleAlert];
49+
50+
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Yes, I did."
51+
style:UIAlertActionStyleCancel
52+
handler:^(UIAlertAction *action)
53+
{
54+
_logos_orig$_ungrouped$EditAlarmViewController$_doneButtonClicked$(self, _cmd, arg);
55+
}
56+
];
57+
58+
UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"Nope!"
59+
style:UIAlertActionStyleDefault
60+
handler:^(UIAlertAction *action){}
61+
];
62+
63+
[alertController addAction:cancelAction];
64+
[alertController addAction:okAction];
65+
66+
[self presentViewController:alertController animated:YES completion:nil];
67+
}
68+
else _logos_orig$_ungrouped$EditAlarmViewController$_doneButtonClicked$(self, _cmd, arg);
69+
}
70+
71+
72+
static __attribute__((constructor)) void _logosLocalInit() {
73+
{Class _logos_class$_ungrouped$EditAlarmViewController = objc_getClass("EditAlarmViewController"); MSHookMessageEx(_logos_class$_ungrouped$EditAlarmViewController, @selector(_doneButtonClicked:), (IMP)&_logos_method$_ungrouped$EditAlarmViewController$_doneButtonClicked$, (IMP*)&_logos_orig$_ungrouped$EditAlarmViewController$_doneButtonClicked$);} }
74+
#line 65 "/Users/jzplusplus/Documents/jailbreak/PMreally/PMreally/PMreally.xm"

PMreally/PMreally.xm

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,43 @@
22
// Logos by Dustin Howett
33
// See http://iphonedevwiki.net/index.php/Logos
44

5-
#error iOSOpenDev post-project creation from template requirements (remove these lines after completed) -- \
6-
Link to libsubstrate.dylib: \
7-
(1) go to TARGETS > Build Phases > Link Binary With Libraries and add /opt/iOSOpenDev/lib/libsubstrate.dylib \
8-
(2) remove these lines from *.xm files (not *.mm files as they're automatically generated from *.xm files)
5+
#include <UIKit/UIKit.h>
96

10-
%hook ClassName
7+
%hook EditAlarmViewController
118

12-
+ (id)sharedInstance
9+
- (void)_doneButtonClicked: (id)arg
1310
{
14-
%log;
15-
16-
return %orig;
17-
}
18-
19-
- (void)messageWithNoReturnAndOneArgument:(id)originalArgument
20-
{
21-
%log;
22-
23-
%orig(originalArgument);
24-
25-
// or, for exmaple, you could use a custom value instead of the original argument: %orig(customValue);
26-
}
27-
28-
- (id)messageWithReturnAndNoArguments
29-
{
30-
%log;
31-
32-
id originalReturnOfMessage = %orig;
33-
34-
// for example, you could modify the original return value before returning it: [SomeOtherClass doSomethingToThisObject:originalReturnOfMessage];
35-
36-
return originalReturnOfMessage;
11+
12+
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
13+
[formatter setDateFormat:@"a"];
14+
NSString * ampm = [formatter stringFromDate:[[[self view] timePicker] date]];
15+
[formatter release];
16+
17+
if([ampm characterAtIndex:0] == 'P')
18+
{
19+
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"PM, really?"
20+
message:@"Did you really mean to set this alarm for PM?"
21+
preferredStyle:UIAlertControllerStyleAlert];
22+
23+
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Yes, I did."
24+
style:UIAlertActionStyleCancel
25+
handler:^(UIAlertAction *action)
26+
{
27+
%orig(arg);
28+
}
29+
];
30+
31+
UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"Nope!"
32+
style:UIAlertActionStyleDefault
33+
handler:^(UIAlertAction *action){}
34+
];
35+
36+
[alertController addAction:cancelAction];
37+
[alertController addAction:okAction];
38+
39+
[self presentViewController:alertController animated:YES completion:nil];
40+
}
41+
else %orig(arg);
3742
}
3843

39-
%end
44+
%end

PMreally/Package/DEBIAN/control

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Package: jzplusplus.PMreally
22
Name: PMreally
3-
Version: 0.1-1
4-
Description:
3+
Version: 1.0-1
4+
Description: Prompts you to confirm if you ever set an alarm for any PM time, to prevent accidentally setting your alarm to PM when you meant AM.
55
Section: System
6-
Depends: firmware (>= 5.0), mobilesubstrate
6+
Depends: firmware (>= 8.0), mobilesubstrate
77
Conflicts:
88
Replaces:
99
Priority: optional
@@ -13,5 +13,5 @@ dev:
1313
Homepage:
1414
Depiction:
1515
Maintainer:
16-
Icon:
16+
Icon:
1717

PMreally/Package/DEBIAN/control.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.
Binary file not shown.

PMreally/Package/Library/MobileSubstrate/DynamicLibraries/PMreally.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<dict>
77
<key>Bundles</key>
88
<array>
9-
<string>com.apple.springboard</string>
9+
<string>com.apple.mobiletimer</string>
1010
</array>
1111
</dict>
1212
</dict>

0 commit comments

Comments
 (0)