Skip to content
This repository was archived by the owner on Apr 12, 2020. It is now read-only.

Commit 6eac9ad

Browse files
committed
Added referer to download function
This is necessary for h3lix and it doesn't cause problems for others
1 parent a7910c8 commit 6eac9ad

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

AltDeploy.xcodeproj/xcshareddata/xcschemes/AltDeploy.xcscheme

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
</Testables>
3232
</TestAction>
3333
<LaunchAction
34-
buildConfiguration = "Release"
35-
selectedDebuggerIdentifier = ""
36-
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
34+
buildConfiguration = "Debug"
35+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
3737
launchStyle = "0"
3838
useCustomWorkingDirectory = "NO"
3939
ignoresPersistentStateOnLaunch = "NO"

AltDeploy/ViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ + (BOOL)setAppleIDUsername:(NSString *)username password:(NSString *)password {
263263
- (void)fetchUtilities {
264264
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
265265
NSArray<NSMenuItem *> * __block menuItems = nil;
266-
NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:@"https://api.pixelomer.com/ALTImpactor/v0/utilities"]];
266+
NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:@"https://api.pixelomer.com/ALTImpactor/v1/utilities"]];
267267
if (data) {
268268
NSError *error;
269269
NSArray *array = [NSJSONSerialization

AltServer/ALTDeviceManager+Installation.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,10 @@ extension ALTDeviceManager
203203
}
204204
}
205205
else {
206-
let downloadTask = URLSession.shared.downloadTask(with: applicationURL) { (fileURL, response, error) in
206+
let request = NSMutableURLRequest.init(url: applicationURL)
207+
request.addValue(applicationURL.host!, forHTTPHeaderField: "Referer")
208+
let finalRequest = request.copy() as! URLRequest
209+
let downloadTask = URLSession.shared.downloadTask(with: finalRequest) { (fileURL, response, error) in
207210
do
208211
{
209212
let (fileURL, _) = try Result((fileURL, response), error).get()

0 commit comments

Comments
 (0)