@@ -28,18 +28,18 @@ void main(string[] args) {
28
28
bool onlyInit = false ;
29
29
bool apkDownloadAllowed = true ;
30
30
auto helpInformation = getopt(
31
- args,
32
- " n|host" , format! " The hostname to bind to (default: %s)" (serverConfig.hostname), &serverConfig.hostname,
33
- " p|port" , format! " The port to bind to (default: %s)" (serverConfig.hostname), &serverConfig.port,
34
- " r|remember-machine" , format! " Whether this machine should be remembered (default: %s)" (rememberMachine), &rememberMachine,
35
- " a|adi-path" , format! " Where the provisioning information should be stored on the computer (default: %s)" (path), &path,
36
- " init-only" , format! " Download libraries and exit (default: %s)" (onlyInit), &onlyInit,
37
- " can-download" , format! " If turned on, may download the dependencies automatically (default: %s)" (apkDownloadAllowed), &apkDownloadAllowed,
31
+ args,
32
+ " n|host" , format! " The hostname to bind to (default: %s)" (serverConfig.hostname), &serverConfig.hostname,
33
+ " p|port" , format! " The port to bind to (default: %s)" (serverConfig.hostname), &serverConfig.port,
34
+ " r|remember-machine" , format! " Whether this machine should be remembered (default: %s)" (rememberMachine), &rememberMachine,
35
+ " a|adi-path" , format! " Where the provisioning information should be stored on the computer (default: %s)" (path), &path,
36
+ " init-only" , format! " Download libraries and exit (default: %s)" (onlyInit), &onlyInit,
37
+ " can-download" , format! " If turned on, may download the dependencies automatically (default: %s)" (apkDownloadAllowed), &apkDownloadAllowed,
38
38
);
39
39
40
40
if (helpInformation.helpWanted) {
41
41
defaultGetoptPrinter(" This program allows you to host anisette through libprovision!" , helpInformation.options);
42
- return ;
42
+ return ;
43
43
}
44
44
45
45
auto coreADIPath = libraryPath.buildPath(" libCoreADI.so" );
@@ -103,12 +103,8 @@ void main(string[] args) {
103
103
auto s = new HttpServer((ref ctx) {
104
104
auto req = ctx.request;
105
105
auto res = ctx.response;
106
- if (req.url == " /version" ) {
107
- writeln(" [<<] GET /version" );
108
- res.writeBodyString(anisetteServerVersion);
109
- writeln(" [>>] 200 OK" );
110
- res.setStatus(200 );
111
- } else if (req.url == " /reprovision" ) {
106
+ res.addHeader(" Implementation-Version" , anisetteServerBranding ~ " " ~ anisetteServerVersion);
107
+ if (req.url == " /reprovision" ) {
112
108
writeln(" [<<] GET /reprovision" );
113
109
adi.provisionDevice(rinfo);
114
110
writeln(" [>>] 200 OK" );
@@ -136,16 +132,16 @@ void main(string[] args) {
136
132
import std.json ;
137
133
138
134
JSONValue response = [
139
- " X-Apple-I-Client-Time" : time.toISOExtString.split(' .' )[0 ] ~ " Z" ,
140
- " X-Apple-I-MD" : Base64.encode(otp),
141
- " X-Apple-I-MD-M" : Base64.encode(mid),
142
- " X-Apple-I-MD-RINFO" : to! string (rinfo),
143
- " X-Apple-I-MD-LU" : adi.localUserUUID,
144
- " X-Apple-I-SRL-NO" : adi.serialNo,
145
- " X-MMe-Client-Info" : adi.clientInfo,
146
- " X-Apple-I-TimeZone" : time.timezone.dstName,
147
- " X-Apple-Locale" : " en_US" ,
148
- " X-Mme-Device-Id" : adi.deviceId,
135
+ " X-Apple-I-Client-Time" : time.toISOExtString.split(' .' )[0 ] ~ " Z" ,
136
+ " X-Apple-I-MD" : Base64.encode(otp),
137
+ " X-Apple-I-MD-M" : Base64.encode(mid),
138
+ " X-Apple-I-MD-RINFO" : to! string (rinfo),
139
+ " X-Apple-I-MD-LU" : adi.localUserUUID,
140
+ " X-Apple-I-SRL-NO" : adi.serialNo,
141
+ " X-MMe-Client-Info" : adi.clientInfo,
142
+ " X-Apple-I-TimeZone" : time.timezone.dstName,
143
+ " X-Apple-Locale" : " en_US" ,
144
+ " X-Mme-Device-Id" : adi.deviceId,
149
145
];
150
146
151
147
writefln! " [>>] 200 OK %s" (response);
@@ -163,4 +159,3 @@ void main(string[] args) {
163
159
writeln(" Ready! Serving data." );
164
160
s.start();
165
161
}
166
-
0 commit comments