UNPKG

gplayapi-ts

Version:
83 lines 3.19 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var common_exports = {}; __export(common_exports, { AndroidDevice: () => AndroidDevice, createDeviceFeature: () => createDeviceFeature }); module.exports = __toCommonJS(common_exports); var import_googleplay_pb = require("../../gen_proto/googleplay_pb"); const createDeviceFeature = (name, value) => ({ name, value }); class AndroidDevice { get userAgent() { return `Android-Finsky/15.8.23-all [0] [PR] 259261889 (api=3,versionCode=81582300,sdk=28,device=${this.build.device},hardware=${this.build.device},product=${this.build.product},platformVersionRelease=${this.versionRelease},model=${this.build.model},buildId=${this.build.id},isWideScreen=0,supportedAbis=${this.platforms.join(";")})`; } get authUserAgent() { return `GoogleAuth/1.4 ${this.build.device} ${this.build.id}`; } generateAndroidCheckInRequest() { this.build.timestamp = BigInt(Math.floor(Date.now() / 1e3)); return new import_googleplay_pb.AndroidCheckinRequest({ id: 0n, checkin: { build: this.build, lastCheckinMsec: 0n, cellOperator: this.cellOperator || "", simOperator: this.simOperator || "", roaming: this.roaming || "", userNumber: 0 }, locale: "en_GB", timeZone: this.timeZone, version: 3, deviceConfiguration: this.getDeviceConfigProto(), fragment: 0 }); } getDeviceConfigProto() { return new import_googleplay_pb.DeviceConfigurationProto({ touchScreen: this.touchScreen, keyboard: this.keyboard, navigation: this.navigation, screenLayout: this.screenLayout, hasHardKeyboard: false, hasFiveWayNavigation: false, screenDensity: this.screen.density, glEsVersion: this.glVersion, systemSharedLibrary: this.libraries, systemAvailableFeature: this.deviceFeatures.map((feature) => feature.name), nativePlatform: this.platforms, screenWidth: this.screen.width, screenHeight: this.screen.height, systemSupportedLocale: this.locales, glExtension: this.glExtensions, deviceClass: 0, lowRamDevice: 0, totalMemoryBytes: 8589935000n, maxNumOfCPUCores: 8, deviceFeature: this.deviceFeatures }); } } // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { AndroidDevice, createDeviceFeature }); //# sourceMappingURL=common.js.map