-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtelephony.c
190 lines (152 loc) · 4.32 KB
/
telephony.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
/*++
Copyright (C) 2011, Velocity Limitless Organization
Licensed under the GNU General Public License v2.
File name:
telephony.c
Abstract:
Override CoreTelephony's functions.
--*/
#include <voodoo.h>
CFStringRef kCTMobileEquipmentInfoIMEI = CFSTR("99 000087 191876 1");
CT_SERVER_COPY_FIRMWARE_VERSION pCTServerConnectionCopyFirmwareVersion;
CT_SERVER_COPY_MOBILE_EQUIPMENT_INFO pCTServerConnectionCopyMobileEquipmentInfo;
CT_SERVER_COPY_MOBILE_IDENTITY pCTServerConnectionCopyMobileIdentity;
//
// Sparsely documented functions follow.
//
CFStringRef
CTRegistrationCopyLocalizedOperatorName(
VOID
)
{
return CFSTR(CARRIER);
}
CFStringRef
CTRegistrationCopyOperatorName(
VOID
)
{
return CFSTR(CARRIER);
}
CFStringRef
CTRegistrationCopyAbbreviatedOperatorName(
VOID
)
{
return CFSTR(CARRIER);
}
CFNumberRef
CTGetSignalStrength(
VOID
)
{
INT SignalStrength[3] = {2, -100, 20};
INT Parameter2 = 20;
return CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &Parameter2);
}
CFStringRef
CTRegistrationGetStatus(
VOID
)
{
return CFSTR("kCTRegistrationStatusDenied");
}
CFStringRef
CTRegistrationGetDataIndicator(
VOID
)
{
return CFSTR("kCTRegistrationDataIndicator" DATA_TYPE);
}
CFStringRef
CTSettingCopyMyPhoneNumber(
VOID
)
{
return CFSTR("972-364-4415");
}
CFNumberRef kCTIndicatorsGradedSignalStrength;
CFNumberRef kCTIndicatorsSignalStrength;
CFNumberRef kCTIndicatorsRawSignalStrength;
CFNumberRef
CTIndicatorsGetSignalStrength(
__in INT Parameter1,
__in INT Parameter2,
__in INT Parameter3
)
{
INT SignalStrength[3] = {2, -100, 20};
Parameter2 = 20;
kCTIndicatorsGradedSignalStrength = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &SignalStrength[0]);
kCTIndicatorsSignalStrength = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &SignalStrength[1]);
kCTIndicatorsRawSignalStrength = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &SignalStrength[2]);
return CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &Parameter2);
}
CFStringRef
CTSIMSupportGetSIMStatus(
VOID
)
{
return CFSTR("kCTSIMSupportSIMStatusReady");
}
CFStringRef
CTSIMSupportGetSIMTrayStatus(
VOID
)
{
return CFSTR("kCTSIMSupportSIMTrayInsertedWithSIM");
}
PINT
_CTServerConnectionCopyFirmwareVersion(
PCORE_TELEPHONY_ERROR_STATUS Status,
PVOID Connection,
CFStringRef *FirmwareVersion
)
{
PINT Data;
if(!pCTServerConnectionCopyFirmwareVersion)
pCTServerConnectionCopyFirmwareVersion = dlsym(RTLD_NEXT, "_CTServerConnectionCopyFirmwareVersion");
Data = pCTServerConnectionCopyFirmwareVersion(Status, Connection, FirmwareVersion);
*FirmwareVersion = CFStringCreateWithCString(0, FIRMWARE_VERSION, kCFStringEncodingMacRoman);
return Data;
}
PINT
_CTServerConnectionCopyMobileEquipmentInfo(
PCORE_TELEPHONY_ERROR_STATUS Status,
PVOID Connection,
CFMutableDictionaryRef *Dictionary
)
{
PINT Data;
INT i;
CFStringRef Keys[3];
CFStringRef Values[3];
Keys[0] = CFSTR("kCTMobileEquipmentInfoIMEI");
Keys[1] = CFSTR("kCTMobileEquipmentInfoICCID");
Keys[2] = CFSTR("kCTMobileEquipmentInfoIMSI");
Values[0] = CFSTR(IMEI);
Values[1] = CFSTR(ICCID);
Values[2] = CFSTR(IMSI);
if(!pCTServerConnectionCopyMobileEquipmentInfo)
pCTServerConnectionCopyMobileEquipmentInfo = dlsym(RTLD_NEXT, "_CTServerConnectionCopyMobileEquipmentInfo");
Data = pCTServerConnectionCopyMobileEquipmentInfo(Status, Connection, Dictionary);
NSLog(CFSTR("%@"), *Dictionary);
*Dictionary = CFDictionaryCreateMutable(NULL, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
for(i = 0; i < 3; i++)
CFDictionaryAddValue(*Dictionary, Keys[i], Values[i]);
return Data;
}
PINT
_CTServerConnectionCopyMobileIdentity(
PCORE_TELEPHONY_ERROR_STATUS Status,
PVOID Connection,
CFStringRef *Imei
)
{
PINT Data;
if(!pCTServerConnectionCopyMobileIdentity)
pCTServerConnectionCopyMobileIdentity = dlsym(RTLD_NEXT, "_CTServerConnectionCopyMobileIdentity");
Data = pCTServerConnectionCopyMobileIdentity(Status, Connection, Imei);
*Imei = CFStringCreateWithCString(0, IMEI, kCFStringEncodingMacRoman);
return Data;
}