Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_android_sdk_maven_plugin
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Panagiotis Triantafyllou
2022-10-25 13:25:33 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8eb0b964057208eb5c83546613330828b320fe44
8eb0b964
1 parent
caf6d474
new keys
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
54 deletions
warply_android_sdk/build.gradle
warply_android_sdk/src/main/java/ly/warp/sdk/Warply.java
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyDeviceInfoCollector.java
warply_android_sdk/src/main/java/ly/warp/sdk/utils/constants/WarpConstants.java
warply_android_sdk/src/main/res/layout/activity_coupon_info.xml
warply_android_sdk/build.gradle
View file @
8eb0b96
...
...
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext
{
PUBLISH_GROUP_ID
=
'ly.warp'
PUBLISH_VERSION
=
'4.5.4-cosbeta
99
'
PUBLISH_VERSION
=
'4.5.4-cosbeta
100
'
PUBLISH_ARTIFACT_ID
=
'warply-android-sdk'
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/Warply.java
View file @
8eb0b96
...
...
@@ -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
);
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
);
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyDeviceInfoCollector.java
View file @
8eb0b96
...
...
@@ -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
{
if
(
WarpUtils
.
getTrackersEnabled
(
mContext
))
{
jObj
.
putOpt
(
"platform"
,
"android"
);
jObj
.
putOpt
(
"vendor"
,
"google"
);
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
());
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
(
"unique_device_id"
,
getUniqueDeviceId
());
jObj
.
putOpt
(
"os_version"
,
getOsVersion
());
jObj
.
putOpt
(
"app_version"
,
getAppVersion
());
}
jObj
.
putOpt
(
"registration_gcm"
,
getRegistrationGCM
());
jObj
.
putOpt
(
"vendor"
,
"google"
);
jObj
.
putOpt
(
"unique_device_id"
,
getUniqueDeviceId
());
}
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
{
if
(
WarpUtils
.
getTrackersEnabled
(
mContext
))
{
jObj
.
putOpt
(
"platform"
,
"android"
);
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
)
{
}
jObj
.
putOpt
(
"vendor"
,
"huawei"
);
jObj
.
putOpt
(
"registration_gcm"
,
getRegistrationGCM
());
jObj
.
putOpt
(
"unique_device_id"
,
getUniqueDeviceId
());
}
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
());
jObj
.
putOpt
(
"unique_device_id"
,
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
(
"vendor"
,
"google"
);
jObj
.
putOpt
(
"app_version"
,
getAppVersion
());
}
jObj
.
putOpt
(
"unique_device_id"
,
getUniqueDeviceId
());
jObj
.
putOpt
(
"vendor"
,
"google"
);
}
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
());
jObj
.
putOpt
(
"unique_device_id"
,
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
(
"vendor"
,
"huawei"
);
jObj
.
putOpt
(
"app_version"
,
getAppVersion
());
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
jObj
.
putOpt
(
"unique_device_id"
,
getUniqueDeviceId
());
jObj
.
putOpt
(
"vendor"
,
"huawei"
);
}
catch
(
JSONException
e
)
{
WarpUtils
.
log
(
"************* WARPLY Warning ********************"
);
WarpUtils
.
log
(
"Problem when creating Registration Device Info JSON"
,
e
);
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/constants/WarpConstants.java
View file @
8eb0b96
...
...
@@ -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
...
...
warply_android_sdk/src/main/res/layout/activity_coupon_info.xml
View file @
8eb0b96
...
...
@@ -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"
/>
...
...
Please
register
or
login
to post a comment