Panagiotis Triantafyllou

new keys

......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.4-cosbeta99'
PUBLISH_VERSION = '4.5.4-cosbeta100'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......
......@@ -886,11 +886,14 @@ public enum Warply {
WarpUtils.log("**************************************************");
JSONObject object = new JSONObject();
try {
object.putOpt("sdk_version", WarpConstants.SDK_VERSION);
object.putOpt("bundle_identifier", mContext.get().getApplicationContext().getPackageName());
PackageInfo info = mContext.get().getPackageManager().getPackageInfo(mContext.get().getApplicationContext().getPackageName(), 0);
object.putOpt("app_version", info.versionName);
object.putOpt("app_build", info.versionCode);
if (WarpUtils.getTrackersEnabled(mContext.get())) {
object.putOpt("app_version", info.versionName);
object.putOpt("sdk_version", WarpConstants.SDK_VERSION);
object.putOpt("app_build", info.versionCode);
}
// object.putOpt("bundle_identifier", mContext.get().getApplicationContext().getPackageName());
if (!WarpUtils.getHasApplicationInfo(mContext.get())) {
WarpUtils.setHasApplicationInfo(mContext.get(), true);
WarpUtils.setAppDataObject(mContext.get(), object);
......
......@@ -6,7 +6,6 @@ import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.graphics.Point;
import android.os.AsyncTask;
import android.os.Build;
import android.provider.Settings;
import android.telephony.TelephonyManager;
......@@ -60,27 +59,17 @@ public class WarplyDeviceInfoCollector {
if (isPackageInstalled("com.android.vending", mContext.getPackageManager())) {
//Google Play Services are available
try {
jObj.putOpt("platform", "android");
jObj.putOpt("vendor", "google");
jObj.putOpt("development", isInDevelopmentMode());
jObj.putOpt("carrier_name", getCarrierName());
if (WarpUtils.getTrackersEnabled(mContext)) {
jObj.putOpt("platform", "android");
jObj.putOpt("manufacturer", getDeviceManufacturer());
jObj.putOpt("android_phone_model", getDeviceModel());
jObj.putOpt("os_version", getOsVersion());
jObj.putOpt("app_version", getAppVersion());
}
jObj.putOpt("registration_gcm", getRegistrationGCM());
jObj.putOpt("absolute_android_device_id", getAndroidDeviceId());
jObj.putOpt("android_device_id", getHardwareId());
jObj.putOpt("android_device_id_new", getUniqueDeviceId());
jObj.putOpt("manufacturer", getDeviceManufacturer());
jObj.putOpt("android_phone_model", getDeviceModel());
jObj.putOpt("android_os_version", getOsVersion());
jObj.putOpt("android_os_api_level", getAndroidSDKVersion());
jObj.putOpt("android_device", getDeviceName());
jObj.putOpt("screen_resolution", getDisplayWidth() + "x" + getDisplayHeight());
GoogleAdInfoClient.GoogleAdInfo adInfo = GoogleAdInfoClient.getGoogleAdvertisingInfo(mContext);
jObj.putOpt("advertising_id", adInfo != null ? adInfo.getId() : "");
jObj.putOpt("opt_out_of_interest_based_ads_enabled", adInfo != null ?
adInfo.isLimitAdTrackingEnabled() : "");
jObj.putOpt("vendor", "google");
jObj.putOpt("unique_device_id", getUniqueDeviceId());
jObj.putOpt("os_version", getOsVersion());
jObj.putOpt("app_version", getAppVersion());
} catch (JSONException e) {
WarpUtils.log("************* WARPLY Warning ********************");
WarpUtils.log("Problem when creating Device Info JSON", e);
......@@ -89,28 +78,18 @@ public class WarplyDeviceInfoCollector {
} else {
//Google Play Services are not available, or not updated
try {
jObj.putOpt("platform", "android");
if (WarpUtils.getTrackersEnabled(mContext)) {
jObj.putOpt("platform", "android");
jObj.putOpt("manufacturer", getDeviceManufacturer());
jObj.putOpt("android_phone_model", getDeviceModel());
jObj.putOpt("os_version", getOsVersion());
jObj.putOpt("app_version", getAppVersion());
}
jObj.putOpt("vendor", "huawei");
jObj.putOpt("development", isInDevelopmentMode());
jObj.putOpt("carrier_name", getCarrierName());
jObj.putOpt("registration_gcm", getRegistrationGCM());
jObj.putOpt("absolute_android_device_id", getAndroidDeviceId());
jObj.putOpt("android_device_id", getHardwareId());
jObj.putOpt("android_device_id_new", getUniqueDeviceId());
jObj.putOpt("manufacturer", getDeviceManufacturer());
jObj.putOpt("android_phone_model", getDeviceModel());
jObj.putOpt("android_os_version", getOsVersion());
jObj.putOpt("android_os_api_level", getAndroidSDKVersion());
jObj.putOpt("android_device", getDeviceName());
jObj.putOpt("screen_resolution", getDisplayWidth() + "x" + getDisplayHeight());
com.huawei.hms.ads.identifier.AdvertisingIdClient.Info info = com.huawei.hms.ads.identifier.AdvertisingIdClient.getAdvertisingIdInfo(mContext);
jObj.putOpt("advertising_id", info != null ? info.getId() : "");
jObj.putOpt("unique_device_id", getUniqueDeviceId());
jObj.putOpt("os_version", getOsVersion());
jObj.putOpt("app_version", getAppVersion());
//jObj.putOpt("opt_out_of_interest_based_ads_enabled", info != null ?
//info.isLimitAdTrackingEnabled() : "");
} catch (JSONException | IOException e) {
} catch (JSONException e) {
WarpUtils.log("************* WARPLY Warning ********************");
WarpUtils.log("Problem when creating Device Info JSON", e);
WarpUtils.log("*************************************************");
......@@ -130,16 +109,16 @@ public class WarplyDeviceInfoCollector {
if (isPackageInstalled("com.android.vending", mContext.getPackageManager())) {
//Google Play Services are available
try {
GoogleAdInfoClient.GoogleAdInfo adInfo = GoogleAdInfoClient.getGoogleAdvertisingInfo(mContext);
jObj.putOpt("advertising_identifier", adInfo != null ? adInfo.getId() : "");
jObj.putOpt("absolute_android_device_id", getAndroidDeviceId());
jObj.putOpt("android_device_id", getHardwareId());
jObj.putOpt("android_device_id_new", getUniqueDeviceId());
if (WarpUtils.getTrackersEnabled(mContext)) {
jObj.putOpt("platform", "android");
jObj.putOpt("manufacturer", getDeviceManufacturer());
jObj.putOpt("android_phone_model", getDeviceModel());
jObj.putOpt("os_version", getOsVersion());
jObj.putOpt("app_version", getAppVersion());
}
jObj.putOpt("unique_device_id", getUniqueDeviceId());
jObj.putOpt("platform", "android");
jObj.putOpt("os_version", getOsVersion());
jObj.putOpt("vendor", "google");
jObj.putOpt("app_version", getAppVersion());
} catch (JSONException e) {
WarpUtils.log("************* WARPLY Warning ********************");
WarpUtils.log("Problem when creating Device Info JSON", e);
......@@ -148,18 +127,16 @@ public class WarplyDeviceInfoCollector {
} else {
//Google Play Services are not available, or not updated
try {
com.huawei.hms.ads.identifier.AdvertisingIdClient.Info info = com.huawei.hms.ads.identifier.AdvertisingIdClient.getAdvertisingIdInfo(mContext);
jObj.putOpt("advertising_identifier", info != null ? info.getId() : "");
jObj.putOpt("absolute_android_device_id", getAndroidDeviceId());
jObj.putOpt("android_device_id", getHardwareId());
jObj.putOpt("android_device_id_new", getUniqueDeviceId());
if (WarpUtils.getTrackersEnabled(mContext)) {
jObj.putOpt("platform", "android");
jObj.putOpt("manufacturer", getDeviceManufacturer());
jObj.putOpt("android_phone_model", getDeviceModel());
jObj.putOpt("os_version", getOsVersion());
jObj.putOpt("app_version", getAppVersion());
}
jObj.putOpt("unique_device_id", getUniqueDeviceId());
jObj.putOpt("platform", "android");
jObj.putOpt("os_version", getOsVersion());
jObj.putOpt("vendor", "huawei");
jObj.putOpt("app_version", getAppVersion());
} catch (IOException e) {
e.printStackTrace();
} catch (JSONException e) {
WarpUtils.log("************* WARPLY Warning ********************");
WarpUtils.log("Problem when creating Registration Device Info JSON", e);
......
......@@ -33,7 +33,7 @@ public class WarpConstants {
/**
* The version of the SDK installed in the device
*/
public static final String SDK_VERSION = "4.5.4.4";
public static final String SDK_VERSION = "4.5.4.6";
/**
* The URL of the server where it should ping
......
......@@ -106,6 +106,7 @@
android:background="@drawable/banner_border_light_grey"
android:gravity="center"
android:textColor="@color/grey"
android:textIsSelectable="true"
android:textSize="25dp"
tools:text="1A2C378" />
......