Skip to content

Commit

Permalink
chore: naming conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
nsmle committed May 28, 2024
1 parent 7d91505 commit 33a1c55
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/core/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as builds from '../samples/builds.json';
import * as supportedCapabilities from '../samples/supported-capabilities.json';
import * as Constants from './constants';
import { ChallengeStateResponse, CheckpointResponse } from '../responses';
import { IgClientError, IgCookieNotFoundError, IgNoCheckpointError, IgUserIdNotFoundError } from '../errors';
import { IgCookieNotFoundError, IgNoCheckpointError, IgParseError, IgUserIdNotFoundError } from '../errors';
import { Enumerable } from '../decorators';
import debug from 'debug';

Expand Down Expand Up @@ -287,21 +287,21 @@ export class State {
}

public validateDevice(deviceString: string): string {
const parts = deviceString.split(';').map(part => part.trim());
const deviceParts = deviceString.split(';').map(part => part.trim());
const deviceInfo = {
androidVersion: parts[0].split('/')[0],
apiLevel: parts[0].split('/')[1],
dpi: parts[1].replace('dpi', ''),
resolution: parts[2],
brand: parts[3],
model: parts[4],
codename: parts[5],
chipset: parts[6],
android_version: deviceParts[0].split('/')[0],
android_release: deviceParts[0].split('/')[1],
dpi: deviceParts[1].replace('dpi', ''),
resolution: deviceParts[2],
manufacturer: deviceParts[3],
model: deviceParts[4],
codename: deviceParts[5],
chipset: deviceParts[6],
};

for (const valueInfo of Object.values(deviceInfo)) {
if (typeof valueInfo !== 'string' || valueInfo == '') {
throw new IgClientError(`Device invalid: "${deviceString}"`);
throw new IgParseError(`Device invalid: "${deviceString}"`);
}
}

Expand Down
Binary file added tools/images/igramapi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 33a1c55

Please sign in to comment.