Skip to content

Commit 593b4a6

Browse files
committed
Make code public.
1 parent a866141 commit 593b4a6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+5505
-2
lines changed

README.md

+45-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,47 @@
1-
WhoCall
1+
WhoCall - 谁CALL我
22
=======
33

4-
谁CALL我 - iOS来电信息语音提醒
4+
iOS来电信息语音提醒,无需越狱。(需要iOS 7.0及以上版本。)
5+
6+
骚扰电话预警、来电归属地提醒、联系人姓名播报,这些~~有中国特色~~人性化的电话功能,iOS上也应该有!
7+
8+
9+
功能介绍
10+
-------
11+
12+
那个陌生的来电号码是我的快递来了?是卖保险的?还是骗钱的电话?一听就知道!“谁CALL我”自动查询来电号码详细信息,在响铃的同时通过语音念给你听,让你接电话前心中有数。尤其适用于戴耳机的时候,不用掏出手机就能知道是谁打来电话。
13+
14+
超级简单易用,点两下开关即可完成设置。然后就可以把我忘掉,我会默默保护你。
15+
16+
* 骚扰电话预警 - 广告推销电话、诈骗电话、骚扰电话预警,还有部分快递号码、中介号码也会提醒。
17+
* 来电归属地提醒 - 收录最新的全国手机号码归属地+各省市固话区号数据。
18+
* 联系人姓名播报 - 如果是号码簿中的联系人来电,会在响铃的同时念出联系人姓名,防止漏接重要电话。
19+
20+
注:“骚扰电话预警”和“来电归属地”功能仅对中国大陆地区电话号码有效。
21+
22+
23+
给开发者看的
24+
-------
25+
26+
不要试图把这个App提交到App Store,我试过,不行,所以才干脆开源了。
27+
28+
此App使用了私有API获取来电号码,虽然API的调用经过伪装,能绕过自动检测,但是审核员会对此类App做特别关照,仍然有办法查出来调用的私有API。另外App常驻后台的做法也可能违反审核条例。
29+
30+
以下代码可能对你有用:
31+
32+
* `WCCallCenter` - 展示了如何用`dlsym`调用私有的C接口,并对函数名字符串做简单的加密,以绕过App提交过程中的自动检查。
33+
* `WCLiarPhoneList` - 通过百度搜索电话号码,判断电话是否是骚扰电话,并提取出具体的类型(广告推销、诈骗……)。
34+
* `WCPhoneLocator` - 电话号码归属地查询。
35+
36+
37+
License
38+
-------
39+
You may use this project under the terms of the MIT License.
40+
41+
42+
Acknowledgement
43+
--------
44+
* [FMDB](https://github.com/ccgus/fmdb)
45+
* [UIKitCategoryAdditions](https://github.com/MugunthKumar/UIKitCategoryAdditions)
46+
* [MMPDeepSleepPreventer](https://github.com/mruegenberg/MMPDeepSleepPreventer)
47+
* [moquery](https://github.com/roymax/moquery)

WhoCall.xcworkspace/contents.xcworkspacedata

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "iphone",
5+
"size" : "29x29",
6+
"scale" : "2x"
7+
},
8+
{
9+
"size" : "40x40",
10+
"idiom" : "iphone",
11+
"filename" : "AppIcon-80.png",
12+
"scale" : "2x"
13+
},
14+
{
15+
"size" : "60x60",
16+
"idiom" : "iphone",
17+
"filename" : "AppIcon-120.png",
18+
"scale" : "2x"
19+
}
20+
],
21+
"info" : {
22+
"version" : 1,
23+
"author" : "xcode"
24+
},
25+
"properties" : {
26+
"pre-rendered" : true
27+
}
28+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"images" : [
3+
{
4+
"orientation" : "portrait",
5+
"idiom" : "iphone",
6+
"extent" : "full-screen",
7+
"minimum-system-version" : "7.0",
8+
"filename" : "LaunchImage-iPhone4.png",
9+
"scale" : "2x"
10+
},
11+
{
12+
"extent" : "full-screen",
13+
"idiom" : "iphone",
14+
"subtype" : "retina4",
15+
"filename" : "LaunchImage-iPhone5.png",
16+
"minimum-system-version" : "7.0",
17+
"orientation" : "portrait",
18+
"scale" : "2x"
19+
}
20+
],
21+
"info" : {
22+
"version" : 1,
23+
"author" : "xcode"
24+
}
25+
}
Loading
Loading

WhoCall/Image/icon_contact.png

1.79 KB
Loading

WhoCall/Image/[email protected]

1.07 KB
Loading

WhoCall/Image/icon_location.png

1.7 KB
Loading

WhoCall/Image/[email protected]

799 Bytes
Loading

WhoCall/Image/icon_nobody.png

5.08 KB
Loading

WhoCall/Image/[email protected]

9.48 KB
Loading

WhoCall/Image/icon_spam.png

1.7 KB
Loading

WhoCall/Image/[email protected]

856 Bytes
Loading

WhoCall/Src/3rd/FMDB/FMDatabase.h

+218
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
#import <Foundation/Foundation.h>
2+
#import "sqlite3.h"
3+
#import "FMResultSet.h"
4+
#import "FMDatabasePool.h"
5+
6+
7+
#if ! __has_feature(objc_arc)
8+
#define FMDBAutorelease(__v) ([__v autorelease]);
9+
#define FMDBReturnAutoreleased FMDBAutorelease
10+
11+
#define FMDBRetain(__v) ([__v retain]);
12+
#define FMDBReturnRetained FMDBRetain
13+
14+
#define FMDBRelease(__v) ([__v release]);
15+
16+
#define FMDBDispatchQueueRelease(__v) (dispatch_release(__v));
17+
#else
18+
// -fobjc-arc
19+
#define FMDBAutorelease(__v)
20+
#define FMDBReturnAutoreleased(__v) (__v)
21+
22+
#define FMDBRetain(__v)
23+
#define FMDBReturnRetained(__v) (__v)
24+
25+
#define FMDBRelease(__v)
26+
27+
#if TARGET_OS_IPHONE
28+
// Compiling for iOS
29+
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000
30+
// iOS 6.0 or later
31+
#define FMDBDispatchQueueRelease(__v)
32+
#else
33+
// iOS 5.X or earlier
34+
#define FMDBDispatchQueueRelease(__v) (dispatch_release(__v));
35+
#endif
36+
#else
37+
// Compiling for Mac OS X
38+
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
39+
// Mac OS X 10.8 or later
40+
#define FMDBDispatchQueueRelease(__v)
41+
#else
42+
// Mac OS X 10.7 or earlier
43+
#define FMDBDispatchQueueRelease(__v) (dispatch_release(__v));
44+
#endif
45+
#endif
46+
#endif
47+
48+
49+
@interface FMDatabase : NSObject {
50+
51+
sqlite3* _db;
52+
NSString* _databasePath;
53+
BOOL _logsErrors;
54+
BOOL _crashOnErrors;
55+
BOOL _traceExecution;
56+
BOOL _checkedOut;
57+
BOOL _shouldCacheStatements;
58+
BOOL _isExecutingStatement;
59+
BOOL _inTransaction;
60+
int _busyRetryTimeout;
61+
62+
NSMutableDictionary *_cachedStatements;
63+
NSMutableSet *_openResultSets;
64+
NSMutableSet *_openFunctions;
65+
66+
NSDateFormatter *_dateFormat;
67+
}
68+
69+
70+
@property (atomic, assign) BOOL traceExecution;
71+
@property (atomic, assign) BOOL checkedOut;
72+
@property (atomic, assign) int busyRetryTimeout;
73+
@property (atomic, assign) BOOL crashOnErrors;
74+
@property (atomic, assign) BOOL logsErrors;
75+
@property (atomic, retain) NSMutableDictionary *cachedStatements;
76+
77+
+ (id)databaseWithPath:(NSString*)inPath;
78+
- (id)initWithPath:(NSString*)inPath;
79+
80+
- (BOOL)open;
81+
#if SQLITE_VERSION_NUMBER >= 3005000
82+
- (BOOL)openWithFlags:(int)flags;
83+
#endif
84+
- (BOOL)close;
85+
- (BOOL)goodConnection;
86+
- (void)clearCachedStatements;
87+
- (void)closeOpenResultSets;
88+
- (BOOL)hasOpenResultSets;
89+
90+
// encryption methods. You need to have purchased the sqlite encryption extensions for these to work.
91+
- (BOOL)setKey:(NSString*)key;
92+
- (BOOL)rekey:(NSString*)key;
93+
- (BOOL)setKeyWithData:(NSData *)keyData;
94+
- (BOOL)rekeyWithData:(NSData *)keyData;
95+
96+
- (NSString *)databasePath;
97+
98+
- (NSString*)lastErrorMessage;
99+
100+
- (int)lastErrorCode;
101+
- (BOOL)hadError;
102+
- (NSError*)lastError;
103+
104+
- (sqlite_int64)lastInsertRowId;
105+
106+
- (sqlite3*)sqliteHandle;
107+
108+
- (BOOL)update:(NSString*)sql withErrorAndBindings:(NSError**)outErr, ...;
109+
- (BOOL)executeUpdate:(NSString*)sql, ...;
110+
- (BOOL)executeUpdateWithFormat:(NSString *)format, ...;
111+
- (BOOL)executeUpdate:(NSString*)sql withArgumentsInArray:(NSArray *)arguments;
112+
- (BOOL)executeUpdate:(NSString*)sql withParameterDictionary:(NSDictionary *)arguments;
113+
114+
- (FMResultSet *)executeQuery:(NSString*)sql, ...;
115+
- (FMResultSet *)executeQueryWithFormat:(NSString*)format, ...;
116+
- (FMResultSet *)executeQuery:(NSString *)sql withArgumentsInArray:(NSArray *)arguments;
117+
- (FMResultSet *)executeQuery:(NSString *)sql withParameterDictionary:(NSDictionary *)arguments;
118+
119+
- (BOOL)rollback;
120+
- (BOOL)commit;
121+
- (BOOL)beginTransaction;
122+
- (BOOL)beginDeferredTransaction;
123+
- (BOOL)inTransaction;
124+
- (BOOL)shouldCacheStatements;
125+
- (void)setShouldCacheStatements:(BOOL)value;
126+
127+
#if SQLITE_VERSION_NUMBER >= 3007000
128+
- (BOOL)startSavePointWithName:(NSString*)name error:(NSError**)outErr;
129+
- (BOOL)releaseSavePointWithName:(NSString*)name error:(NSError**)outErr;
130+
- (BOOL)rollbackToSavePointWithName:(NSString*)name error:(NSError**)outErr;
131+
- (NSError*)inSavePoint:(void (^)(BOOL *rollback))block;
132+
#endif
133+
134+
+ (BOOL)isSQLiteThreadSafe;
135+
+ (NSString*)sqliteLibVersion;
136+
137+
- (int)changes;
138+
139+
- (void)makeFunctionNamed:(NSString*)name maximumArguments:(int)count withBlock:(void (^)(sqlite3_context *context, int argc, sqlite3_value **argv))block;
140+
141+
142+
143+
/** Generate an NSDateFormat that won't be broken by timezone or locale changes.
144+
145+
Use this method to generate values to set the dateFormat property.
146+
147+
@param dateFormat A valid NSDateFormatter format string.
148+
149+
Example:
150+
151+
myDB.dateFormat = [FMDatabase storeableDateFormat:@"yyyy-MM-dd HH:mm:ss"];
152+
153+
Note that NSDateFormatter is not thread-safe, so the formatter generated by this method should be assigned to only one FMDB instance and should not be used for other purposes.
154+
155+
*/
156+
+ (NSDateFormatter *)storeableDateFormat:(NSString *)format;
157+
158+
159+
/** Test whether the database has a date formatter assigned.
160+
161+
*/
162+
- (BOOL)hasDateFormatter;
163+
164+
165+
/** Set to a date formatter to use string dates with sqlite instead of the default UNIX timestamps.
166+
167+
Set to nil to use UNIX timestamps.
168+
169+
Defaults to nil.
170+
171+
Should be set using a formatter generated using FMDatabase::storeableDateFormat.
172+
173+
Note there is no direct getter for the NSDateFormatter, and you should not use the formatter you pass to FMDB for other purposes, as NSDateFormatter is not thread-safe.
174+
175+
*/
176+
- (void)setDateFormat:(NSDateFormatter *)format;
177+
178+
179+
/** Convert the supplied NSString to NSDate, using the current database formatter.
180+
181+
Returns nil if no formatter is set.
182+
183+
*/
184+
- (NSDate *)dateFromString:(NSString *)s;
185+
186+
/** Convert the supplied NSDate to NSString, using the current database formatter.
187+
188+
Returns nil if no formatter is set.
189+
190+
*/
191+
- (NSString *)stringFromDate:(NSDate *)date;
192+
193+
194+
195+
196+
197+
198+
199+
200+
201+
202+
@end
203+
204+
@interface FMStatement : NSObject {
205+
sqlite3_stmt *_statement;
206+
NSString *_query;
207+
long _useCount;
208+
}
209+
210+
@property (atomic, assign) long useCount;
211+
@property (atomic, retain) NSString *query;
212+
@property (atomic, assign) sqlite3_stmt *statement;
213+
214+
- (void)close;
215+
- (void)reset;
216+
217+
@end
218+

0 commit comments

Comments
 (0)