Showing
5 changed files
with
44 additions
and
63 deletions
... | @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' | ... | @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' |
2 | 2 | ||
3 | ext { | 3 | ext { |
4 | PUBLISH_GROUP_ID = 'ly.warp' | 4 | PUBLISH_GROUP_ID = 'ly.warp' |
5 | - PUBLISH_VERSION = '4.5.4-cosbeta99' | 5 | + PUBLISH_VERSION = '4.5.4-cosbeta100' |
6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' | 6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' |
7 | } | 7 | } |
8 | 8 | ... | ... |
... | @@ -886,11 +886,14 @@ public enum Warply { | ... | @@ -886,11 +886,14 @@ public enum Warply { |
886 | WarpUtils.log("**************************************************"); | 886 | WarpUtils.log("**************************************************"); |
887 | JSONObject object = new JSONObject(); | 887 | JSONObject object = new JSONObject(); |
888 | try { | 888 | try { |
889 | - object.putOpt("sdk_version", WarpConstants.SDK_VERSION); | ||
890 | - object.putOpt("bundle_identifier", mContext.get().getApplicationContext().getPackageName()); | ||
891 | PackageInfo info = mContext.get().getPackageManager().getPackageInfo(mContext.get().getApplicationContext().getPackageName(), 0); | 889 | PackageInfo info = mContext.get().getPackageManager().getPackageInfo(mContext.get().getApplicationContext().getPackageName(), 0); |
892 | - object.putOpt("app_version", info.versionName); | 890 | + |
893 | - object.putOpt("app_build", info.versionCode); | 891 | + if (WarpUtils.getTrackersEnabled(mContext.get())) { |
892 | + object.putOpt("app_version", info.versionName); | ||
893 | + object.putOpt("sdk_version", WarpConstants.SDK_VERSION); | ||
894 | + object.putOpt("app_build", info.versionCode); | ||
895 | + } | ||
896 | +// object.putOpt("bundle_identifier", mContext.get().getApplicationContext().getPackageName()); | ||
894 | if (!WarpUtils.getHasApplicationInfo(mContext.get())) { | 897 | if (!WarpUtils.getHasApplicationInfo(mContext.get())) { |
895 | WarpUtils.setHasApplicationInfo(mContext.get(), true); | 898 | WarpUtils.setHasApplicationInfo(mContext.get(), true); |
896 | WarpUtils.setAppDataObject(mContext.get(), object); | 899 | WarpUtils.setAppDataObject(mContext.get(), object); | ... | ... |
... | @@ -6,7 +6,6 @@ import android.content.Context; | ... | @@ -6,7 +6,6 @@ import android.content.Context; |
6 | import android.content.pm.PackageInfo; | 6 | import android.content.pm.PackageInfo; |
7 | import android.content.pm.PackageManager; | 7 | import android.content.pm.PackageManager; |
8 | import android.graphics.Point; | 8 | import android.graphics.Point; |
9 | -import android.os.AsyncTask; | ||
10 | import android.os.Build; | 9 | import android.os.Build; |
11 | import android.provider.Settings; | 10 | import android.provider.Settings; |
12 | import android.telephony.TelephonyManager; | 11 | import android.telephony.TelephonyManager; |
... | @@ -60,27 +59,17 @@ public class WarplyDeviceInfoCollector { | ... | @@ -60,27 +59,17 @@ public class WarplyDeviceInfoCollector { |
60 | if (isPackageInstalled("com.android.vending", mContext.getPackageManager())) { | 59 | if (isPackageInstalled("com.android.vending", mContext.getPackageManager())) { |
61 | //Google Play Services are available | 60 | //Google Play Services are available |
62 | try { | 61 | try { |
63 | - jObj.putOpt("platform", "android"); | 62 | + if (WarpUtils.getTrackersEnabled(mContext)) { |
64 | - jObj.putOpt("vendor", "google"); | 63 | + jObj.putOpt("platform", "android"); |
65 | - jObj.putOpt("development", isInDevelopmentMode()); | 64 | + jObj.putOpt("manufacturer", getDeviceManufacturer()); |
66 | - jObj.putOpt("carrier_name", getCarrierName()); | 65 | + jObj.putOpt("android_phone_model", getDeviceModel()); |
66 | + jObj.putOpt("os_version", getOsVersion()); | ||
67 | + jObj.putOpt("app_version", getAppVersion()); | ||
68 | + } | ||
69 | + | ||
67 | jObj.putOpt("registration_gcm", getRegistrationGCM()); | 70 | jObj.putOpt("registration_gcm", getRegistrationGCM()); |
68 | - jObj.putOpt("absolute_android_device_id", getAndroidDeviceId()); | 71 | + jObj.putOpt("vendor", "google"); |
69 | - jObj.putOpt("android_device_id", getHardwareId()); | ||
70 | - jObj.putOpt("android_device_id_new", getUniqueDeviceId()); | ||
71 | - jObj.putOpt("manufacturer", getDeviceManufacturer()); | ||
72 | - jObj.putOpt("android_phone_model", getDeviceModel()); | ||
73 | - jObj.putOpt("android_os_version", getOsVersion()); | ||
74 | - jObj.putOpt("android_os_api_level", getAndroidSDKVersion()); | ||
75 | - jObj.putOpt("android_device", getDeviceName()); | ||
76 | - jObj.putOpt("screen_resolution", getDisplayWidth() + "x" + getDisplayHeight()); | ||
77 | - GoogleAdInfoClient.GoogleAdInfo adInfo = GoogleAdInfoClient.getGoogleAdvertisingInfo(mContext); | ||
78 | - jObj.putOpt("advertising_id", adInfo != null ? adInfo.getId() : ""); | ||
79 | - jObj.putOpt("opt_out_of_interest_based_ads_enabled", adInfo != null ? | ||
80 | - adInfo.isLimitAdTrackingEnabled() : ""); | ||
81 | jObj.putOpt("unique_device_id", getUniqueDeviceId()); | 72 | jObj.putOpt("unique_device_id", getUniqueDeviceId()); |
82 | - jObj.putOpt("os_version", getOsVersion()); | ||
83 | - jObj.putOpt("app_version", getAppVersion()); | ||
84 | } catch (JSONException e) { | 73 | } catch (JSONException e) { |
85 | WarpUtils.log("************* WARPLY Warning ********************"); | 74 | WarpUtils.log("************* WARPLY Warning ********************"); |
86 | WarpUtils.log("Problem when creating Device Info JSON", e); | 75 | WarpUtils.log("Problem when creating Device Info JSON", e); |
... | @@ -89,28 +78,18 @@ public class WarplyDeviceInfoCollector { | ... | @@ -89,28 +78,18 @@ public class WarplyDeviceInfoCollector { |
89 | } else { | 78 | } else { |
90 | //Google Play Services are not available, or not updated | 79 | //Google Play Services are not available, or not updated |
91 | try { | 80 | try { |
92 | - jObj.putOpt("platform", "android"); | 81 | + if (WarpUtils.getTrackersEnabled(mContext)) { |
82 | + jObj.putOpt("platform", "android"); | ||
83 | + jObj.putOpt("manufacturer", getDeviceManufacturer()); | ||
84 | + jObj.putOpt("android_phone_model", getDeviceModel()); | ||
85 | + jObj.putOpt("os_version", getOsVersion()); | ||
86 | + jObj.putOpt("app_version", getAppVersion()); | ||
87 | + } | ||
88 | + | ||
93 | jObj.putOpt("vendor", "huawei"); | 89 | jObj.putOpt("vendor", "huawei"); |
94 | - jObj.putOpt("development", isInDevelopmentMode()); | ||
95 | - jObj.putOpt("carrier_name", getCarrierName()); | ||
96 | jObj.putOpt("registration_gcm", getRegistrationGCM()); | 90 | jObj.putOpt("registration_gcm", getRegistrationGCM()); |
97 | - jObj.putOpt("absolute_android_device_id", getAndroidDeviceId()); | ||
98 | - jObj.putOpt("android_device_id", getHardwareId()); | ||
99 | - jObj.putOpt("android_device_id_new", getUniqueDeviceId()); | ||
100 | - jObj.putOpt("manufacturer", getDeviceManufacturer()); | ||
101 | - jObj.putOpt("android_phone_model", getDeviceModel()); | ||
102 | - jObj.putOpt("android_os_version", getOsVersion()); | ||
103 | - jObj.putOpt("android_os_api_level", getAndroidSDKVersion()); | ||
104 | - jObj.putOpt("android_device", getDeviceName()); | ||
105 | - jObj.putOpt("screen_resolution", getDisplayWidth() + "x" + getDisplayHeight()); | ||
106 | - com.huawei.hms.ads.identifier.AdvertisingIdClient.Info info = com.huawei.hms.ads.identifier.AdvertisingIdClient.getAdvertisingIdInfo(mContext); | ||
107 | - jObj.putOpt("advertising_id", info != null ? info.getId() : ""); | ||
108 | jObj.putOpt("unique_device_id", getUniqueDeviceId()); | 91 | jObj.putOpt("unique_device_id", getUniqueDeviceId()); |
109 | - jObj.putOpt("os_version", getOsVersion()); | 92 | + } catch (JSONException e) { |
110 | - jObj.putOpt("app_version", getAppVersion()); | ||
111 | - //jObj.putOpt("opt_out_of_interest_based_ads_enabled", info != null ? | ||
112 | - //info.isLimitAdTrackingEnabled() : ""); | ||
113 | - } catch (JSONException | IOException e) { | ||
114 | WarpUtils.log("************* WARPLY Warning ********************"); | 93 | WarpUtils.log("************* WARPLY Warning ********************"); |
115 | WarpUtils.log("Problem when creating Device Info JSON", e); | 94 | WarpUtils.log("Problem when creating Device Info JSON", e); |
116 | WarpUtils.log("*************************************************"); | 95 | WarpUtils.log("*************************************************"); |
... | @@ -130,16 +109,16 @@ public class WarplyDeviceInfoCollector { | ... | @@ -130,16 +109,16 @@ public class WarplyDeviceInfoCollector { |
130 | if (isPackageInstalled("com.android.vending", mContext.getPackageManager())) { | 109 | if (isPackageInstalled("com.android.vending", mContext.getPackageManager())) { |
131 | //Google Play Services are available | 110 | //Google Play Services are available |
132 | try { | 111 | try { |
133 | - GoogleAdInfoClient.GoogleAdInfo adInfo = GoogleAdInfoClient.getGoogleAdvertisingInfo(mContext); | 112 | + if (WarpUtils.getTrackersEnabled(mContext)) { |
134 | - jObj.putOpt("advertising_identifier", adInfo != null ? adInfo.getId() : ""); | 113 | + jObj.putOpt("platform", "android"); |
135 | - jObj.putOpt("absolute_android_device_id", getAndroidDeviceId()); | 114 | + jObj.putOpt("manufacturer", getDeviceManufacturer()); |
136 | - jObj.putOpt("android_device_id", getHardwareId()); | 115 | + jObj.putOpt("android_phone_model", getDeviceModel()); |
137 | - jObj.putOpt("android_device_id_new", getUniqueDeviceId()); | 116 | + jObj.putOpt("os_version", getOsVersion()); |
117 | + jObj.putOpt("app_version", getAppVersion()); | ||
118 | + } | ||
119 | + | ||
138 | jObj.putOpt("unique_device_id", getUniqueDeviceId()); | 120 | jObj.putOpt("unique_device_id", getUniqueDeviceId()); |
139 | - jObj.putOpt("platform", "android"); | ||
140 | - jObj.putOpt("os_version", getOsVersion()); | ||
141 | jObj.putOpt("vendor", "google"); | 121 | jObj.putOpt("vendor", "google"); |
142 | - jObj.putOpt("app_version", getAppVersion()); | ||
143 | } catch (JSONException e) { | 122 | } catch (JSONException e) { |
144 | WarpUtils.log("************* WARPLY Warning ********************"); | 123 | WarpUtils.log("************* WARPLY Warning ********************"); |
145 | WarpUtils.log("Problem when creating Device Info JSON", e); | 124 | WarpUtils.log("Problem when creating Device Info JSON", e); |
... | @@ -148,18 +127,16 @@ public class WarplyDeviceInfoCollector { | ... | @@ -148,18 +127,16 @@ public class WarplyDeviceInfoCollector { |
148 | } else { | 127 | } else { |
149 | //Google Play Services are not available, or not updated | 128 | //Google Play Services are not available, or not updated |
150 | try { | 129 | try { |
151 | - com.huawei.hms.ads.identifier.AdvertisingIdClient.Info info = com.huawei.hms.ads.identifier.AdvertisingIdClient.getAdvertisingIdInfo(mContext); | 130 | + if (WarpUtils.getTrackersEnabled(mContext)) { |
152 | - jObj.putOpt("advertising_identifier", info != null ? info.getId() : ""); | 131 | + jObj.putOpt("platform", "android"); |
153 | - jObj.putOpt("absolute_android_device_id", getAndroidDeviceId()); | 132 | + jObj.putOpt("manufacturer", getDeviceManufacturer()); |
154 | - jObj.putOpt("android_device_id", getHardwareId()); | 133 | + jObj.putOpt("android_phone_model", getDeviceModel()); |
155 | - jObj.putOpt("android_device_id_new", getUniqueDeviceId()); | 134 | + jObj.putOpt("os_version", getOsVersion()); |
135 | + jObj.putOpt("app_version", getAppVersion()); | ||
136 | + } | ||
137 | + | ||
156 | jObj.putOpt("unique_device_id", getUniqueDeviceId()); | 138 | jObj.putOpt("unique_device_id", getUniqueDeviceId()); |
157 | - jObj.putOpt("platform", "android"); | ||
158 | - jObj.putOpt("os_version", getOsVersion()); | ||
159 | jObj.putOpt("vendor", "huawei"); | 139 | jObj.putOpt("vendor", "huawei"); |
160 | - jObj.putOpt("app_version", getAppVersion()); | ||
161 | - } catch (IOException e) { | ||
162 | - e.printStackTrace(); | ||
163 | } catch (JSONException e) { | 140 | } catch (JSONException e) { |
164 | WarpUtils.log("************* WARPLY Warning ********************"); | 141 | WarpUtils.log("************* WARPLY Warning ********************"); |
165 | WarpUtils.log("Problem when creating Registration Device Info JSON", e); | 142 | WarpUtils.log("Problem when creating Registration Device Info JSON", e); | ... | ... |
... | @@ -33,7 +33,7 @@ public class WarpConstants { | ... | @@ -33,7 +33,7 @@ public class WarpConstants { |
33 | /** | 33 | /** |
34 | * The version of the SDK installed in the device | 34 | * The version of the SDK installed in the device |
35 | */ | 35 | */ |
36 | - public static final String SDK_VERSION = "4.5.4.4"; | 36 | + public static final String SDK_VERSION = "4.5.4.6"; |
37 | 37 | ||
38 | /** | 38 | /** |
39 | * The URL of the server where it should ping | 39 | * The URL of the server where it should ping | ... | ... |
... | @@ -106,6 +106,7 @@ | ... | @@ -106,6 +106,7 @@ |
106 | android:background="@drawable/banner_border_light_grey" | 106 | android:background="@drawable/banner_border_light_grey" |
107 | android:gravity="center" | 107 | android:gravity="center" |
108 | android:textColor="@color/grey" | 108 | android:textColor="@color/grey" |
109 | + android:textIsSelectable="true" | ||
109 | android:textSize="25dp" | 110 | android:textSize="25dp" |
110 | tools:text="1A2C378" /> | 111 | tools:text="1A2C378" /> |
111 | 112 | ... | ... |
-
Please register or login to post a comment