Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OTA ID Fallback #190

Merged
merged 3 commits into from
Feb 5, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/app/core/services/device-manager.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,28 @@ export class DeviceManagerService extends BackendClient {
async getDeviceInfo(device: DeviceLike): Promise<Partial<DeviceInfo>> {
const systemInfo = await this.luna.call<SystemInfo>(device, 'luna://com.webos.service.tv.systemproperty/getSystemInfo', {
keys: ['firmwareVersion', 'modelName', 'sdkVersion', 'otaId']
}).catch((reason) => {
if (reason instanceof LunaResponseError) {
return this.luna.call<SystemInfo>(device, 'luna://com.webos.service.tv.systemproperty/getSystemInfo', {
keys: ['firmwareVersion', 'modelName', 'sdkVersion']
});
}
throw reason;
});
const osInfo = await this.luna.call<Partial<OsInfo>>(device, 'luna://com.webos.service.systemservice/osInfo/query', {
parameters: ['webos_manufacturing_version', 'webos_release']
}).catch(() => null);
return {
modelName: systemInfo.modelName,
osVersion: osInfo?.webos_release || systemInfo.sdkVersion,
otaId: systemInfo.otaId,
otaId: systemInfo.otaId || await this.luna.call<{
billingId?: string
}>(device, 'luna://com.webos.service.sdx/getDeviceUuid', {}).then((ret) => {
if (!ret.billingId) {
return undefined;
}
return new URLSearchParams(ret.billingId).get('modelName') ?? undefined;
}).catch(() => undefined),
firmwareVersion: systemInfo.firmwareVersion
};
}
Expand Down
Loading