@efffrida/gplayapi 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,36 @@
1
+ UserReadableName=Google Pixel 7a
2
+ Build.BOOTLOADER=lynx-1.0-9716681
3
+ Build.BRAND=google
4
+ Build.DEVICE=lynx
5
+ Build.FINGERPRINT=google/lynx/lynx\:13/TQ2B.230505.005.A1/9808202\:user/release-keys
6
+ Build.HARDWARE=lynx
7
+ Build.ID=TQ2A.230505.002
8
+ Build.MANUFACTURER=Google
9
+ Build.MODEL=Pixel 7a
10
+ Build.PRODUCT=lynx
11
+ Build.RADIO=g5300n-230203-230323-B-9801058,g5300n-230203-230323-B-9801058
12
+ Build.VERSION.RELEASE=13
13
+ Build.VERSION.SDK_INT=33
14
+ CellOperator=310
15
+ Client=android-google
16
+ Features=android.hardware.sensor.proximity,android.hardware.telephony.ims.singlereg,android.hardware.sensor.accelerometer,android.software.controls,android.hardware.faketouch,android.software.telecom,android.hardware.telephony.subscription,android.hardware.telephony.euicc,android.hardware.usb.accessory,android.hardware.telephony.data,android.hardware.sensor.dynamic.head_tracker,android.software.backup,android.hardware.touchscreen,android.hardware.touchscreen.multitouch,android.software.erofs,android.software.print,android.software.activities_on_secondary_displays,android.hardware.wifi.rtt,com.google.android.feature.PIXEL_2017_EXPERIENCE,android.software.voice_recognizers,android.software.picture_in_picture,android.hardware.fingerprint,android.hardware.sensor.gyroscope,android.hardware.audio.low_latency,android.software.vulkan.deqp.level,android.software.cant_save_state,com.google.android.feature.PIXEL_2018_EXPERIENCE,android.hardware.security.model.compatible,android.hardware.telephony.messaging,com.google.android.feature.PIXEL_2019_EXPERIENCE,android.hardware.telephony.calling,android.hardware.opengles.aep,org.lineageos.livedisplay,android.hardware.bluetooth,android.software.window_magnification,android.hardware.telephony.radio.access,android.hardware.camera.autofocus,android.hardware.telephony.gsm,android.hardware.telephony.ims,android.software.incremental_delivery,android.hardware.se.omapi.ese,android.software.opengles.deqp.level,vendor.android.hardware.camera.preview-dis.front,com.google.android.feature.PIXEL_2022_MIDYEAR_EXPERIENCE,android.hardware.camera.concurrent,android.hardware.usb.host,android.hardware.audio.output,android.software.verified_boot,android.hardware.camera.flash,android.hardware.camera.front,android.hardware.sensor.hifi_sensors,android.hardware.se.omapi.uicc,android.hardware.strongbox_keystore,android.hardware.screen.portrait,android.hardware.nfc,com.nxp.mifare,com.google.android.feature.PIXEL_2021_MIDYEAR_EXPERIENCE,android.hardware.sensor.stepdetector,android.software.home_screen,android.hardware.context_hub,vendor.android.hardware.camera.preview-dis.back,android.hardware.microphone,android.software.autofill,org.lineageos.hardware,org.lineageos.globalactions,android.software.securely_removes_users,com.google.android.feature.PIXEL_EXPERIENCE,android.hardware.bluetooth_le,android.hardware.sensor.compass,android.hardware.touchscreen.multitouch.jazzhand,android.hardware.sensor.barometer,android.software.app_widgets,com.google.android.feature.PIXEL_2020_MIDYEAR_EXPERIENCE,android.hardware.telephony.carrierlock,android.software.input_methods,android.hardware.sensor.light,android.hardware.vulkan.version,android.software.companion_device_setup,android.software.device_admin,android.hardware.wifi.passpoint,android.hardware.camera,org.lineageos.trust,android.hardware.device_unique_attestation,android.hardware.screen.landscape,android.software.device_id_attestation,android.hardware.ram.normal,com.google.android.feature.PIXEL_2019_MIDYEAR_EXPERIENCE,android.software.managed_users,android.software.webview,android.hardware.sensor.stepcounter,android.hardware.camera.capability.manual_post_processing,android.hardware.camera.any,android.hardware.camera.capability.raw,android.hardware.vulkan.compute,android.hardware.touchscreen.multitouch.distinct,android.hardware.location.network,android.software.cts,android.hardware.camera.capability.manual_sensor,android.software.app_enumeration,android.hardware.camera.level.full,android.hardware.identity_credential,android.hardware.wifi.direct,android.software.live_wallpaper,com.google.android.feature.GOOGLE_EXPERIENCE,android.software.ipsec_tunnels,org.lineageos.settings,android.hardware.audio.pro,android.hardware.nfc.hcef,android.hardware.location.gps,android.software.midi,android.hardware.nfc.any,android.hardware.nfc.ese,android.hardware.nfc.hce,android.hardware.hardware_keystore,com.google.android.feature.PIXEL_2020_EXPERIENCE,android.hardware.telephony.euicc.mep,android.hardware.wifi,android.hardware.location,android.hardware.vulkan.level,com.google.android.feature.PIXEL_2021_EXPERIENCE,android.hardware.keystore.app_attest_key,android.hardware.wifi.aware,com.google.android.feature.PIXEL_2022_EXPERIENCE,android.software.secure_lock_screen,android.hardware.telephony,android.software.file_based_encryption
17
+ GL.Extensions=GL_ANDROID_extension_pack_es31a,GL_ARM_mali_program_binary,GL_ARM_mali_shader_binary,GL_ARM_rgba8,GL_ARM_shader_framebuffer_fetch,GL_ARM_shader_framebuffer_fetch_depth_stencil,GL_ARM_texture_unnormalized_coordinates,GL_EXT_EGL_image_array,GL_EXT_YUV_target,GL_EXT_blend_minmax,GL_EXT_buffer_storage,GL_EXT_clip_control,GL_EXT_color_buffer_float,GL_EXT_color_buffer_half_float,GL_EXT_copy_image,GL_EXT_debug_marker,GL_EXT_discard_framebuffer,GL_EXT_disjoint_timer_query,GL_EXT_draw_buffers_indexed,GL_EXT_draw_elements_base_vertex,GL_EXT_external_buffer,GL_EXT_float_blend,GL_EXT_geometry_shader,GL_EXT_gpu_shader5,GL_EXT_multisampled_render_to_texture,GL_EXT_multisampled_render_to_texture2,GL_EXT_occlusion_query_boolean,GL_EXT_primitive_bounding_box,GL_EXT_protected_textures,GL_EXT_read_format_bgra,GL_EXT_robustness,GL_EXT_sRGB,GL_EXT_sRGB_write_control,GL_EXT_shader_framebuffer_fetch,GL_EXT_shader_io_blocks,GL_EXT_shader_non_constant_global_initializers,GL_EXT_shader_pixel_local_storage,GL_EXT_shadow_samplers,GL_EXT_tessellation_shader,GL_EXT_texture_border_clamp,GL_EXT_texture_buffer,GL_EXT_texture_compression_astc_decode_mode,GL_EXT_texture_compression_astc_decode_mode_rgb9e5,GL_EXT_texture_cube_map_array,GL_EXT_texture_filter_anisotropic,GL_EXT_texture_format_BGRA8888,GL_EXT_texture_rg,GL_EXT_texture_sRGB_R8,GL_EXT_texture_sRGB_RG8,GL_EXT_texture_sRGB_decode,GL_EXT_texture_storage,GL_EXT_texture_type_2_10_10_10_REV,GL_EXT_unpack_subimage,GL_KHR_blend_equation_advanced,GL_KHR_blend_equation_advanced_coherent,GL_KHR_debug,GL_KHR_robust_buffer_access_behavior,GL_KHR_robustness,GL_KHR_texture_compression_astc_hdr,GL_KHR_texture_compression_astc_ldr,GL_KHR_texture_compression_astc_sliced_3d,GL_OES_EGL_image,GL_OES_EGL_image_external,GL_OES_EGL_image_external_essl3,GL_OES_EGL_sync,GL_OES_blend_equation_separate,GL_OES_blend_func_separate,GL_OES_blend_subtract,GL_OES_byte_coordinates,GL_OES_compressed_ETC1_RGB8_texture,GL_OES_compressed_paletted_texture,GL_OES_copy_image,GL_OES_depth24,GL_OES_depth_texture,GL_OES_depth_texture_cube_map,GL_OES_draw_buffers_indexed,GL_OES_draw_elements_base_vertex,GL_OES_draw_texture,GL_OES_element_index_uint,GL_OES_extended_matrix_palette,GL_OES_fbo_render_mipmap,GL_OES_fixed_point,GL_OES_framebuffer_object,GL_OES_geometry_shader,GL_OES_get_program_binary,GL_OES_gpu_shader5,GL_OES_mapbuffer,GL_OES_matrix_get,GL_OES_matrix_palette,GL_OES_packed_depth_stencil,GL_OES_point_size_array,GL_OES_point_sprite,GL_OES_primitive_bounding_box,GL_OES_query_matrix,GL_OES_read_format,GL_OES_required_internalformat,GL_OES_rgb8_rgba8,GL_OES_sample_shading,GL_OES_sample_variables,GL_OES_shader_image_atomic,GL_OES_shader_io_blocks,GL_OES_shader_multisample_interpolation,GL_OES_single_precision,GL_OES_standard_derivatives,GL_OES_stencil8,GL_OES_stencil_wrap,GL_OES_surfaceless_context,GL_OES_tessellation_shader,GL_OES_texture_3D,GL_OES_texture_border_clamp,GL_OES_texture_buffer,GL_OES_texture_compression_astc,GL_OES_texture_cube_map,GL_OES_texture_cube_map_array,GL_OES_texture_float_linear,GL_OES_texture_mirrored_repeat,GL_OES_texture_npot,GL_OES_texture_stencil8,GL_OES_texture_storage_multisample_2d_array,GL_OES_vertex_array_object,GL_OES_vertex_half_float,GL_OVR_multiview,GL_OVR_multiview2,GL_OVR_multiview_multisampled_render_to_texture
18
+ GL.Version=196610
19
+ GSF.version=203615037
20
+ HasFiveWayNavigation=false
21
+ HasHardKeyboard=false
22
+ Keyboard=1
23
+ Locales=af,af_ZA,am,am_ET,ar,ar_EG,ar_XB,as,ast,ast_ES,az,be,bg,bg_BG,bn,bs,ca,ca_ES,ckb,cs,cs_CZ,cy,da,da_DK,de,de_DE,el,el_GR,en,en_AU,en_CA,en_GB,en_IN,en_US,en_XA,en_XC,eo,es,es_419,es_ES,es_US,et,eu,fa,fa_IR,fi,fi_FI,fil,fil_PH,fr,fr_CA,fr_FR,gd,gl,gu,he,hi,hi_IN,hr,hr_HR,ht,hu,hu_HU,hy,ia,id,in,in_ID,is,it,it_IT,iw,iw_IL,ja,ja_JP,ka,kab,kk,km,kmr,kn,ko,ko_KR,ky,lo,lt,lt_LT,lv,lv_LV,mk,ml,mn,mr,ms,ms_MY,my,nb,nb_NO,ne,nl,nl_NL,or,pa,pl,pl_PL,pt,pt_BR,pt_PT,ro,ro_RO,ru,ru_RU,sc,si,sk,sk_SK,sl,sl_SI,so,sq,sr,sr_Latn,sr_RS,sv,sv_SE,sw,sw_TZ,ta,te,th,th_TH,tr,tr_TR,uk,uk_UA,ur,uz,vi,vi_VN,zh_CN,zh_HK,zh_TW,zu,zu_ZA
24
+ Navigation=1
25
+ Platforms=arm64-v8a
26
+ Roaming=mobile-notroaming
27
+ Screen.Density=420
28
+ Screen.Height=2156
29
+ Screen.Width=1080
30
+ ScreenLayout=2
31
+ SharedLibraries=android.test.base,android.test.mock,android.hidl.manager-V1.0-java,google-ril,libedgetpu_client.google.so,libedgetpu_util.so,android.hidl.base-V1.0-java,com.google.android.camera.experimental2022,libOpenCL-pixel.so,com.android.location.provider,oemrilhook,android.net.ipsec.ike,com.android.future.usb.accessory,android.ext.shared,javax.obex,com.google.android.gms,lib_aion_buffer.so,libgxp.so,gxp_metrics_logger.so,android.test.runner,org.apache.http.legacy,com.android.cts.ctsshim.shared_library,com.android.nfc_extras,com.android.media.remotedisplay,com.android.mediadrm.signer,android.system.virtualmachine
32
+ SimOperator=38
33
+ TimeZone=UTC-10
34
+ TouchScreen=3
35
+ Vending.version=82201710
36
+ Vending.versionString=22.0.17-21 [0] [PR] 332555730
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Unofficial Google Play Store API for downloading APKs directly from Google
3
+ * Play Store.
4
+ *
5
+ * @since 1.0.0
6
+ */
7
+ import type * as HttpClientError from "@effect/platform/HttpClientError";
8
+ import * as FileSystem from "@effect/platform/FileSystem";
9
+ import * as HttpClient from "@effect/platform/HttpClient";
10
+ import * as Effect from "effect/Effect";
11
+ import * as Layer from "effect/Layer";
12
+ import { type BulkDetailsResponse, type BuyResponse, type DetailsResponse } from "./generated/GooglePlay_pb.js";
13
+ export {
14
+ /**
15
+ * @since 1.0.0
16
+ * @category Auth
17
+ */
18
+ makeHttpClient, } from "./internal/auth.ts";
19
+ export {
20
+ /**
21
+ * @since 1.0.0
22
+ * @category Device
23
+ */
24
+ Device, } from "./internal/device.js";
25
+ /**
26
+ * @since 1.0.0
27
+ * @category Auth
28
+ */
29
+ export declare const defaultHttpClient: Layer.Layer<HttpClient.HttpClient, import("@effect/platform/Error").PlatformError | import("effect/ParseResult").ParseError | HttpClientError.HttpClientError, FileSystem.FileSystem>;
30
+ /**
31
+ * @since 1.0.0
32
+ * @category API
33
+ */
34
+ export declare const details: (bundleIdentifier: string) => Effect.Effect<DetailsResponse, HttpClientError.HttpClientError, HttpClient.HttpClient>;
35
+ /**
36
+ * @since 1.0.0
37
+ * @category API
38
+ */
39
+ export declare const bulkDetails: (bundleIdentifier: string) => Effect.Effect<BulkDetailsResponse, HttpClientError.HttpClientError, HttpClient.HttpClient>;
40
+ /**
41
+ * @since 1.0.0
42
+ * @category API
43
+ */
44
+ export declare const purchase: (bundleIdentifier: string, options: {
45
+ offerType: number;
46
+ versionCode: number | bigint;
47
+ certificateHash?: string | undefined;
48
+ }) => Effect.Effect<BuyResponse, HttpClientError.HttpClientError, HttpClient.HttpClient>;
49
+ /**
50
+ * @since 1.0.0
51
+ * @category API
52
+ */
53
+ export declare const delivery: (bundleIdentifier: string, options: {
54
+ offerType: number;
55
+ deliveryToken: string;
56
+ versionCode: number | bigint;
57
+ certificateHash?: string | undefined;
58
+ }) => Effect.Effect<import("./generated/GooglePlay_pb.js").DeliveryResponse, HttpClientError.HttpClientError, HttpClient.HttpClient>;
59
+ /**
60
+ * @since 1.0.0
61
+ * @category API
62
+ */
63
+ export declare const download: (bundleIdentifier: string) => Effect.Effect<[{
64
+ file: string;
65
+ name: string;
66
+ url: string;
67
+ size: bigint;
68
+ integrity: {
69
+ sha256: string;
70
+ };
71
+ }, ...({
72
+ file: string;
73
+ url: string;
74
+ size: bigint;
75
+ name: string;
76
+ integrity: {
77
+ sha256: string;
78
+ };
79
+ } | {
80
+ file: string;
81
+ name: string;
82
+ size: bigint;
83
+ url: string;
84
+ integrity: {
85
+ sha1: string;
86
+ };
87
+ })[]], import("@effect/platform/Error").PlatformError | Error | HttpClientError.HttpClientError, FileSystem.FileSystem | HttpClient.HttpClient | import("effect/Scope").Scope>;
88
+ //# sourceMappingURL=GooglePlayApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GooglePlayApi.d.ts","sourceRoot":"","sources":["../src/GooglePlayApi.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,KAAK,eAAe,MAAM,kCAAkC,CAAC;AAGzE,OAAO,KAAK,UAAU,MAAM,6BAA6B,CAAC;AAC1D,OAAO,KAAK,UAAU,MAAM,6BAA6B,CAAC;AAI1D,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAItC,OAAO,EAEH,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,eA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@since 1.0.0
6
+ */
7
+ import * as FetchHttpClient from "@effect/platform/FetchHttpClient";
8
+ import * as FileSystem from "@effect/platform/FileSystem";
9
+ import * as HttpClient from "@effect/platform/HttpClient";
10
+ import * as HttpClientRequest from "@effect/platform/HttpClientRequest";
11
+ import * as HttpClientResponse from "@effect/platform/HttpClientResponse";
12
+ import * as Array from "effect/Array";
13
+ import * as Effect from "effect/Effect";
14
+ import * as Function from "effect/Function";
15
+ import * as Layer from "effect/Layer";
16
+ import * as Stream from "effect/Stream";
17
+ import * as url from "node:url";
18
+ import { BulkDetailsRequestSchema } from "./generated/GooglePlay_pb.js";
19
+ import { makeHttpClient } from "./internal/auth.js";
20
+ import { Device } from "./internal/device.js";
21
+ import { decodeResponseFromResponseWrapper, encodeRequest } from "./internal/http.js";
22
+ export {
23
+ /**
24
+ * @since 1.0.0
25
+ * @category Auth
26
+ */
27
+ makeHttpClient } from "./internal/auth.js";
28
+ export {
29
+ /**
30
+ * @since 1.0.0
31
+ * @category Device
32
+ */
33
+ Device } from "./internal/device.js";
34
+ /**
35
+ * @since 1.0.0
36
+ * @category Auth
37
+ */
38
+ export const defaultHttpClient = /*#__PURE__*/Function.pipe(/*#__PURE__*/Device.fromPropertiesFile(/*#__PURE__*/url.fileURLToPath(/*#__PURE__*/new URL("../devices/arm64_xxhdpi.properties", import.meta.url))), /*#__PURE__*/Effect.map(makeHttpClient), Layer.unwrapEffect, /*#__PURE__*/Layer.provide(FetchHttpClient.layer));
39
+ /**
40
+ * @since 1.0.0
41
+ * @category API
42
+ */
43
+ export const details = bundleIdentifier => Effect.flatMap(HttpClient.get("/fdfe/details", {
44
+ urlParams: {
45
+ doc: bundleIdentifier
46
+ }
47
+ }), decodeResponseFromResponseWrapper("detailsResponse"));
48
+ /**
49
+ * @since 1.0.0
50
+ * @category API
51
+ */
52
+ export const bulkDetails = bundleIdentifier => Function.pipe(HttpClientRequest.post("/fdfe/bulkDetails"), encodeRequest(BulkDetailsRequestSchema, {
53
+ includeDetails: true,
54
+ includeChildDocs: true,
55
+ DocId: [bundleIdentifier]
56
+ }), Effect.flatMap(HttpClient.execute), Effect.flatMap(decodeResponseFromResponseWrapper("bulkDetailsResponse")));
57
+ /**
58
+ * @since 1.0.0
59
+ * @category API
60
+ */
61
+ export const purchase = (bundleIdentifier, options) => Effect.flatMap(HttpClient.post("/fdfe/purchase", {
62
+ urlParams: {
63
+ doc: bundleIdentifier,
64
+ ch: options.certificateHash ?? "",
65
+ ot: options.offerType.toString(),
66
+ vc: options.versionCode.toString()
67
+ }
68
+ }), decodeResponseFromResponseWrapper("buyResponse"));
69
+ /**
70
+ * @since 1.0.0
71
+ * @category API
72
+ */
73
+ export const delivery = (bundleIdentifier, options) => Effect.flatMap(HttpClient.get("/fdfe/delivery", {
74
+ urlParams: {
75
+ doc: bundleIdentifier,
76
+ dtok: options.deliveryToken,
77
+ ch: options.certificateHash ?? "",
78
+ ot: options.offerType.toString(),
79
+ vc: options.versionCode.toString()
80
+ }
81
+ }), decodeResponseFromResponseWrapper("deliveryResponse"));
82
+ /**
83
+ * @since 1.0.0
84
+ * @category API
85
+ */
86
+ export const download = /*#__PURE__*/Effect.fnUntraced(function* (bundleIdentifier) {
87
+ const fileSystem = yield* FileSystem.FileSystem;
88
+ const {
89
+ item
90
+ } = yield* details(bundleIdentifier);
91
+ const {
92
+ encodedDeliveryToken
93
+ } = yield* purchase(bundleIdentifier, {
94
+ offerType: item?.offer[0].offerType ?? 1,
95
+ versionCode: item?.details?.appDetails?.versionCode ?? 0
96
+ });
97
+ const deliveryResult = yield* delivery(bundleIdentifier, {
98
+ deliveryToken: encodedDeliveryToken,
99
+ offerType: item?.offer[0].offerType ?? 1,
100
+ versionCode: item?.details?.appDetails?.versionCode ?? 0
101
+ });
102
+ const mainDeliveryData = deliveryResult?.appDeliveryData;
103
+ if (mainDeliveryData === undefined) {
104
+ return yield* Effect.fail(new Error("No delivery data available"));
105
+ }
106
+ const main = Effect.gen(function* () {
107
+ const file = yield* fileSystem.makeTempFileScoped({
108
+ suffix: ".apk"
109
+ });
110
+ const stream = HttpClientResponse.stream(HttpClient.get(mainDeliveryData.downloadUrl));
111
+ yield* Stream.run(stream, fileSystem.sink(file));
112
+ yield* Effect.logDebug(`main APK of ${mainDeliveryData.downloadSize}bytes from ${mainDeliveryData.downloadUrl} with integrity ${mainDeliveryData.sha256}(sha256) downloaded to ${file}`);
113
+ return {
114
+ file,
115
+ name: `${bundleIdentifier}.apk`,
116
+ url: mainDeliveryData.downloadUrl,
117
+ size: mainDeliveryData.downloadSize,
118
+ integrity: {
119
+ sha256: mainDeliveryData.sha256
120
+ }
121
+ };
122
+ });
123
+ const splits = Array.map(mainDeliveryData.splitDeliveryData, split => Effect.gen(function* () {
124
+ const file = yield* fileSystem.makeTempFileScoped({
125
+ suffix: ".apk"
126
+ });
127
+ const stream = HttpClientResponse.stream(HttpClient.get(split.downloadUrl));
128
+ yield* Stream.run(stream, fileSystem.sink(file));
129
+ yield* Effect.logDebug(`split ${split.name} of ${split.downloadSize}bytes from ${split.downloadUrl} with integrity ${split.sha256}(sha256) downloaded to ${file}`);
130
+ return {
131
+ file,
132
+ url: split.downloadUrl,
133
+ size: split.downloadSize,
134
+ name: `${split.name}.apk`,
135
+ integrity: {
136
+ sha256: split.sha256
137
+ }
138
+ };
139
+ }));
140
+ const expansions = Array.map(mainDeliveryData.additionalFile, expansion => Effect.gen(function* () {
141
+ const typeStr = expansion.fileType === 1 ? "main" : "patch";
142
+ const name = `${typeStr}.${expansion.versionCode}.${bundleIdentifier}.obb`;
143
+ const file = yield* fileSystem.makeTempFileScoped({
144
+ suffix: ".obb"
145
+ });
146
+ const stream = HttpClientResponse.stream(HttpClient.get(expansion.downloadUrl));
147
+ yield* Stream.run(stream, fileSystem.sink(file));
148
+ yield* Effect.logDebug(`expansion file ${name} of ${expansion.size}bytes from ${expansion.downloadUrl} with integrity ${expansion.sha1}(sha1) downloaded to ${file}`);
149
+ return {
150
+ file,
151
+ name,
152
+ size: expansion.size,
153
+ url: expansion.downloadUrl,
154
+ integrity: {
155
+ sha1: expansion.sha1
156
+ }
157
+ };
158
+ }));
159
+ return yield* Effect.all([main, ...splits, ...expansions]);
160
+ });
161
+ //# sourceMappingURL=GooglePlayApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GooglePlayApi.js","names":["FetchHttpClient","FileSystem","HttpClient","HttpClientRequest","HttpClientResponse","Array","Effect","Function","Layer","Stream","url","BulkDetailsRequestSchema","makeHttpClient","Device","decodeResponseFromResponseWrapper","encodeRequest","defaultHttpClient","pipe","fromPropertiesFile","fileURLToPath","URL","import","meta","map","unwrapEffect","provide","layer","details","bundleIdentifier","flatMap","get","urlParams","doc","bulkDetails","post","includeDetails","includeChildDocs","DocId","execute","purchase","options","ch","certificateHash","ot","offerType","toString","vc","versionCode","delivery","dtok","deliveryToken","download","fnUntraced","fileSystem","item","encodedDeliveryToken","offer","appDetails","deliveryResult","mainDeliveryData","appDeliveryData","undefined","fail","Error","main","gen","file","makeTempFileScoped","suffix","stream","downloadUrl","run","sink","logDebug","downloadSize","sha256","name","size","integrity","splits","splitDeliveryData","split","expansions","additionalFile","expansion","typeStr","fileType","sha1","all"],"sources":["../src/GooglePlayApi.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;AASA,OAAO,KAAKA,eAAe,MAAM,kCAAkC;AACnE,OAAO,KAAKC,UAAU,MAAM,6BAA6B;AACzD,OAAO,KAAKC,UAAU,MAAM,6BAA6B;AACzD,OAAO,KAAKC,iBAAiB,MAAM,oCAAoC;AACvE,OAAO,KAAKC,kBAAkB,MAAM,qCAAqC;AACzE,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,QAAQ,MAAM,iBAAiB;AAC3C,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,GAAG,MAAM,UAAU;AAE/B,SACIC,w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