From 3aa4f93bf3fe2e77792536d2a8df86dcf05a31c1 Mon Sep 17 00:00:00 2001 From: Sergey Eremin Date: Tue, 31 Jan 2017 13:36:44 +0300 Subject: [PATCH] uploadDeviceConfig should work properly now --- build.gradle | 2 +- .../com/github/yeriomin/playstoreapi/GooglePlayAPI.java | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 9fa457d..6f5fdfc 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'java' group = 'com.github.yeriomin' -version = '0.5' +version = '0.6' sourceCompatibility = JavaVersion.VERSION_1_7 targetCompatibility = JavaVersion.VERSION_1_7 diff --git a/src/main/java/com/github/yeriomin/playstoreapi/GooglePlayAPI.java b/src/main/java/com/github/yeriomin/playstoreapi/GooglePlayAPI.java index 51abad9..5edbffc 100644 --- a/src/main/java/com/github/yeriomin/playstoreapi/GooglePlayAPI.java +++ b/src/main/java/com/github/yeriomin/playstoreapi/GooglePlayAPI.java @@ -435,7 +435,13 @@ public UploadDeviceConfigResponse uploadDeviceConfig() throws IOException { UploadDeviceConfigRequest request = UploadDeviceConfigRequest.newBuilder() .setDeviceConfiguration(this.deviceInfoProvider.getDeviceConfigurationProto()) .build(); - byte[] responseBytes = getClient().post(UPLOADDEVICECONFIG_URL, request.toByteArray(), getDefaultHeaders()); + Map headers = getDefaultHeaders(); + headers.put("X-DFE-Enabled-Experiments", "cl:billing.select_add_instrument_by_default"); + headers.put("X-DFE-Unsupported-Experiments", "nocache:billing.use_charging_poller,market_emails,buyer_currency,prod_baseline,checkin.set_asset_paid_app_field,shekel_test,content_ratings,buyer_currency_in_app,nocache:encrypted_apk,recent_changes"); + headers.put("X-DFE-Client-Id", "am-android-google"); + headers.put("X-DFE-SmallestScreenWidthDp", "320"); + headers.put("X-DFE-Filter-Level", "3"); + byte[] responseBytes = getClient().post(UPLOADDEVICECONFIG_URL, request.toByteArray(), headers); return ResponseWrapper.parseFrom(responseBytes).getPayload().getUploadDeviceConfigResponse(); }