From 2c908dc5f95df11c36f2779a43767768dec350ec Mon Sep 17 00:00:00 2001 From: Sergey Eremin Date: Tue, 31 Jan 2017 15:11:37 +0300 Subject: [PATCH] Minor uploadDeviceConfig fix --- .../yeriomin/yalpstore/NativeDeviceInfoProvider.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/github/yeriomin/yalpstore/NativeDeviceInfoProvider.java b/app/src/main/java/com/github/yeriomin/yalpstore/NativeDeviceInfoProvider.java index 71e224218..3d2fa13b7 100644 --- a/app/src/main/java/com/github/yeriomin/yalpstore/NativeDeviceInfoProvider.java +++ b/app/src/main/java/com/github/yeriomin/yalpstore/NativeDeviceInfoProvider.java @@ -20,6 +20,9 @@ import java.util.TimeZone; public class NativeDeviceInfoProvider implements DeviceInfoProvider { + // Getting this requires a permission and google services to be installed + static private final int GOOGLE_SERVICES_VERSION_CODE = 80711500; + private Context context; private String localeString; @@ -38,7 +41,7 @@ public class NativeDeviceInfoProvider implements DeviceInfoProvider { public String getUserAgentString() { return "Android-Finsky/7.1.15 (" + "api=3" - + ",versionCode=80711500" + + ",versionCode=" + GOOGLE_SERVICES_VERSION_CODE + ",sdk=" + Build.VERSION.SDK_INT + ",device=" + Build.DEVICE + ",hardware=" + Build.HARDWARE @@ -67,7 +70,7 @@ public class NativeDeviceInfoProvider implements DeviceInfoProvider { .setClient("android-google") .setOtaInstalled(false) .setTimestamp(System.currentTimeMillis() / 1000) - .setGoogleServices(16) + .setGoogleServices(GOOGLE_SERVICES_VERSION_CODE) ) .setLastCheckinMsec(0) .setCellOperator("310260") // Getting this and the next two requires permission @@ -95,7 +98,10 @@ public class NativeDeviceInfoProvider implements DeviceInfoProvider { } List localeStringList = new ArrayList<>(); for (Locale locale : Locale.getAvailableLocales()) { - localeStringList.add(locale.toString()); + String localeString = locale.toString(); + if (localeString.length() <= 5) { + localeStringList.add(localeString); + } } List platforms = new ArrayList<>(); if (Build.VERSION.SDK_INT >= 21) {