Skip to content

Commit

Permalink
Merge pull request #3552 from osmandapp/rzr-model
Browse files Browse the repository at this point in the history
Use uname() to get correct device model name
  • Loading branch information
alex-osm authored Apr 8, 2024
2 parents 43f3e89 + 7fdff7a commit d8df92b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Sources/Backup/Commands/OARegisterDeviceCommand.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2022 OsmAnd. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <sys/utsname.h>

#import "OARegisterDeviceCommand.h"
#import "OABackupListeners.h"
Expand Down Expand Up @@ -55,9 +55,11 @@ - (void) main
params[@"token"] = _token;
params[@"lang"] = [OAUtilities currentLang];
params[@"brand"] = @"Apple";
NSString *machine = UIDevice.machine;
if (machine)
params[@"model"] = machine;

struct utsname systemInfo;
if (uname(&systemInfo) == 0)
params[@"model"] = [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];

[OANetworkUtilities sendRequestWithUrl:OABackupHelper.DEVICE_REGISTER_URL params:params post:YES onComplete:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
int status;
NSString *message;
Expand Down

0 comments on commit d8df92b

Please sign in to comment.