Skip to content
This repository was archived by the owner on Nov 22, 2022. It is now read-only.

Commit b134879

Browse files
author
Naville
committed
EDIT Docs. Remove RemoteLogging Completely as it brings too much trouble
1 parent f2c727c commit b134879

File tree

12 files changed

+52
-180
lines changed

12 files changed

+52
-180
lines changed

BasePreferences.plist

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -33,34 +33,6 @@
3333
<key>label</key>
3434
<string>Verbose Logging</string>
3535
</dict>
36-
<dict>
37-
<key>cell</key>
38-
<string>PSEditTextCell</string>
39-
<key>isURL</key>
40-
<true/>
41-
<key>noAutoCorrect</key>
42-
<true/>
43-
<key>placeholder</key>
44-
<string>127.0.0.1</string>
45-
<key>defaults</key>
46-
<string>naville.wtfjh</string>
47-
<key>key</key>
48-
<string>LogServerIP</string>
49-
<key>label</key>
50-
<string>RemoteLogServerURL</string>
51-
</dict>
52-
<dict>
53-
<key>cell</key>
54-
<string>PSSwitchCell</string>
55-
<key>default</key>
56-
<false/>
57-
<key>defaults</key>
58-
<string>naville.wtfjh</string>
59-
<key>key</key>
60-
<string>RemoteSendLog</string>
61-
<key>label</key>
62-
<string>RemoteSendLog</string>
63-
</dict>
6436
<dict>
6537
<key>cell</key>
6638
<string>PSSwitchCell</string>

DOCS/HackingGuide.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ Current Types:
1212
3. ThirdPartyTools
1313
4. Utils
1414

15-
For now, it only divides modules into seperate folders to make the modules look tidy.
16-
17-
In the future we'll group settings based on those types.
15+
~~For now, it only divides modules into seperate folders to make the modules look tidy.In the future we'll group settings based on those types.~~ ***It's live now.***
1816

1917
**Please Make Sure The Types Are Correct**
2018

Hooks/API/NSURLConnection.xm

Lines changed: 41 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,48 +5,60 @@
55

66
+ (NSData *)sendSynchronousRequest:(NSURLRequest *)request returningResponse:(NSURLResponse **)response error:(NSError **)error {
77
NSData *origResult = %orig(request, response, error);
8-
WTInit(@"NSURLConnection",@"sendSynchronousRequest:returningResponse:error:");
9-
WTAdd([PlistObjectConverter convertNSURLRequest:request],@"request");
10-
if(response!=nil){
11-
WTAdd([PlistObjectConverter convertNSURLResponse:*response],@"response");
8+
if(WTShouldLog){
9+
WTInit(@"NSURLConnection",@"sendSynchronousRequest:returningResponse:error:");
10+
WTAdd([PlistObjectConverter convertNSURLRequest:request],@"request");
11+
if(response!=nil){
12+
WTAdd([PlistObjectConverter convertNSURLResponse:*response],@"response");
13+
}
14+
if(error!=nil){
15+
WTAdd([PlistObjectConverter convertNSError:*error],@"error");
16+
}
17+
WTReturn(origResult);
18+
WTSave;
19+
WTRelease;
1220
}
13-
if(error!=nil){
14-
WTAdd([PlistObjectConverter convertNSError:*error],@"error");
15-
}
16-
WTReturn(origResult);
17-
WTSave;
18-
WTRelease;
1921
return origResult;
2022
}
2123

2224
- (id)initWithRequest:(NSURLRequest *)request delegate:(id < NSURLConnectionDelegate >)delegate {
2325
// Proxy the delegate so we can hook it
24-
NSURLConnectionDelegateProx *delegateProxy = [[NSURLConnectionDelegateProx alloc] initWithOriginalDelegate:delegate];
25-
id origResult = %orig(request, delegateProxy);
26+
id origResult;
27+
if(WTShouldLog){
28+
NSURLConnectionDelegateProx *delegateProxy = [[NSURLConnectionDelegateProx alloc] initWithOriginalDelegate:delegate];
29+
origResult = %orig(request, delegateProxy);
2630

27-
WTInit(@"NSURLConnection",@"initWithRequest:delegate:");
28-
WTAdd([PlistObjectConverter convertNSURLRequest:request],@"request");
29-
WTAdd([PlistObjectConverter convertDelegate:delegate followingProtocol:@"NSURLConnectionDelegate"],@"delegate");
30-
WTReturn(objectTypeNotSupported);
31-
WTSave;
32-
WTRelease;
33-
31+
WTInit(@"NSURLConnection",@"initWithRequest:delegate:");
32+
WTAdd([PlistObjectConverter convertNSURLRequest:request],@"request");
33+
WTAdd([PlistObjectConverter convertDelegate:delegate followingProtocol:@"NSURLConnectionDelegate"],@"delegate");
34+
WTReturn(objectTypeNotSupported);
35+
WTSave;
36+
WTRelease;
37+
}
38+
else{
39+
origResult = %orig;
40+
}
3441
return origResult;
3542
}
3643

3744
- (id)initWithRequest:(NSURLRequest *)request delegate:(id < NSURLConnectionDelegate >)delegate startImmediately:(BOOL)startImmediately {
38-
45+
id origResult;
3946
// Proxy the delegate so we can hook it
40-
NSURLConnectionDelegateProx *delegateProxy = [[NSURLConnectionDelegateProx alloc] initWithOriginalDelegate:delegate];
41-
id origResult = %orig(request, delegateProxy, startImmediately);
47+
if(WTShouldLog){
48+
NSURLConnectionDelegateProx *delegateProxy = [[NSURLConnectionDelegateProx alloc] initWithOriginalDelegate:delegate];
49+
origResult = %orig(request, delegateProxy, startImmediately);
4250

43-
WTInit(@"NSURLConnection",@"initWithRequest:delegate:startImmediately:");
44-
WTAdd([PlistObjectConverter convertNSURLRequest:request],@"request");
45-
WTAdd([PlistObjectConverter convertDelegate:delegate followingProtocol:@"NSURLConnectionDelegate"],@"delegate");
46-
WTAdd([NSNumber numberWithBool:startImmediately] ,@"startImmediately");
47-
WTReturn(objectTypeNotSupported);
48-
WTSave;
49-
WTRelease;
51+
WTInit(@"NSURLConnection",@"initWithRequest:delegate:startImmediately:");
52+
WTAdd([PlistObjectConverter convertNSURLRequest:request],@"request");
53+
WTAdd([PlistObjectConverter convertDelegate:delegate followingProtocol:@"NSURLConnectionDelegate"],@"delegate");
54+
WTAdd([NSNumber numberWithBool:startImmediately] ,@"startImmediately");
55+
WTReturn(objectTypeNotSupported);
56+
WTSave;
57+
WTRelease;
58+
}
59+
else{
60+
origResult = %orig;
61+
}
5062
return origResult;
5163
}
5264

Hooks/Utils/RemoteLogSender.h

Lines changed: 0 additions & 14 deletions
This file was deleted.

Hooks/Utils/RemoteLogSender.m

Lines changed: 0 additions & 55 deletions
This file was deleted.

Hooks/Utils/SQLiteStorage.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,5 @@ extern void WTFJHLog(id Obj1, ... );
1212
- (SQLiteStorage *)initWithDBFilePath:(NSString *) DBFilePath andLogToConsole: (BOOL) shouldLog;
1313
- (BOOL)saveTracedCall: (CallTracer*) tracedCall;
1414
- (void)dealloc;
15-
@property (atomic) BOOL ShouldRemoteLog;
1615
@end
1716

Hooks/Utils/SQLiteStorage.m

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#import "SQLiteStorage.h"
22
#include <sqlite3.h>
3-
#import "RemoteLogSender.h"
43
@implementation SQLiteStorage
54

65

@@ -58,7 +57,6 @@ - (SQLiteStorage *)initWithDefaultDBFilePathAndLogToConsole: (BOOL) shouldLog {
5857
- (SQLiteStorage *)initWithDBFilePath:(NSString *) DBFilePath andLogToConsole: (BOOL) shouldLog {
5958
self = [super init];
6059
sqlite3 *dbConn;
61-
self.ShouldRemoteLog=NO;
6260
ApplyCallStack=getBoolFromPreferences(@"AddCallStackToDatabase");
6361
// Open the DB file if it's already there
6462
if (sqlite3_open_v2([DBFilePath UTF8String], &dbConn, SQLITE_OPEN_READWRITE, NULL) != SQLITE_OK) {
@@ -118,22 +116,6 @@ - (BOOL)saveTracedCall: (CallTracer*) tracedCall {
118116
}
119117

120118
queryResult = sqlite3_step(saveTracedCallStmt);
121-
#ifdef PROTOTYPE
122-
if(self.ShouldRemoteLog){
123-
NSString* SQLQuery=[saveTracedCallStmtStr stringByReplacingOccurrencesOfString:@"?1" withString:[tracedCall className]];
124-
SQLQuery=[SQLQuery stringByReplacingOccurrencesOfString:@"?2" withString:[tracedCall methodName]];
125-
SQLQuery=[SQLQuery stringByReplacingOccurrencesOfString:@"?3" withString:argsAndReturnValueStr];
126-
if(ApplyCallStack==YES){
127-
SQLQuery=[SQLQuery stringByReplacingOccurrencesOfString:@"?4" withString:[[NSThread callStackSymbols] componentsJoinedByString:@"\n"] ];
128-
}
129-
else{
130-
SQLQuery=[SQLQuery stringByReplacingOccurrencesOfString:@"?4" withString:@"WTFJH-StackNotEnabled"];
131-
}
132-
[[RemoteLogSender sharedInstance] sendCommand:SQLQuery];
133-
134-
[SQLQuery release];
135-
}
136-
#endif
137119
}
138120

139121
if (logToConsole) {

Tools/RemoteLogger/HTTPHandler.py

Lines changed: 0 additions & 14 deletions
This file was deleted.

Tools/RemoteLogger/LoggingServer.py

Lines changed: 0 additions & 13 deletions
This file was deleted.

Tools/RemoteLogger/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)