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-09-02 16:50:11 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a91bb373b889a9c1178a6462032392dda31b2895
a91bb373
1 parent
4f52c7eb
fixes
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
8 deletions
app/src/main/java/warp/ly/android_sdk/activities/SplashActivity.java
warply_android_sdk/build.gradle
warply_android_sdk/proguard-rules.pro
warply_android_sdk/src/main/java/ly/warp/sdk/io/volley/toolbox/HurlStack.java
warply_android_sdk/src/main/java/ly/warp/sdk/io/volley/toolbox/Volley.java
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyManagerHelper.java
app/src/main/java/warp/ly/android_sdk/activities/SplashActivity.java
View file @
a91bb37
...
...
@@ -36,7 +36,7 @@ public class SplashActivity extends BaseActivity {
public
void
onWarplyReady
()
{
if
(!
WarplyDBHelper
.
getInstance
(
SplashActivity
.
this
).
isTableNotEmpty
(
"auth"
))
{
WarplyManager
.
getCosmoteUser
(
new
WarplyCosmoteUserRequest
()
.
setGuid
(
"6012049
139
"
),
//6012049321, 6012049322, 6012049323
.
setGuid
(
"6012049
321
"
),
//6012049321, 6012049322, 6012049323
mLoginReceiver
);
}
else
{
startNextActivity
();
...
...
warply_android_sdk/build.gradle
View file @
a91bb37
...
...
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext
{
PUBLISH_GROUP_ID
=
'ly.warp'
PUBLISH_VERSION
=
'4.5.4-cosbeta5
5
'
PUBLISH_VERSION
=
'4.5.4-cosbeta5
6
'
PUBLISH_ARTIFACT_ID
=
'warply-android-sdk'
}
...
...
@@ -13,6 +13,8 @@ android {
compileSdkVersion
31
buildToolsVersion
"31.0.0"
useLibrary
'org.apache.http.legacy'
defaultConfig
{
minSdkVersion
23
targetSdkVersion
31
...
...
@@ -32,7 +34,7 @@ android {
buildTypes
{
release
{
minifyEnabled
tru
e
minifyEnabled
fals
e
proguardFiles
getDefaultProguardFile
(
'proguard-android.txt'
),
'proguard-rules.pro'
}
}
...
...
warply_android_sdk/proguard-rules.pro
View file @
a91bb37
...
...
@@ -27,6 +27,5 @@
-
keep
class
com
.
huawei
.
hianalytics
.
**
{
*
;}
-
keep
class
com
.
huawei
.
updatesdk
.
**
{
*
;}
-
keep
class
com
.
huawei
.
hms
.
**
{
*
;}
-
keep
class
ly
.
warp
.
sdk
.
**
{
*
;}
-
keep
,
includedescriptorclasses
class
net
.
sqlcipher
.
**
{
*
;
}
-
keep
,
includedescriptorclasses
interface
net
.
sqlcipher
.
**
{
*
;
}
\ No newline at end of file
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/io/volley/toolbox/HurlStack.java
View file @
a91bb37
...
...
@@ -40,9 +40,12 @@ import java.util.Map.Entry;
import
javax.net.ssl.HttpsURLConnection
;
import
javax.net.ssl.SSLSocketFactory
;
import
ly.warp.sdk.Warply
;
import
ly.warp.sdk.db.WarplyDBHelper
;
import
ly.warp.sdk.io.volley.AuthFailureError
;
import
ly.warp.sdk.io.volley.Request
;
import
ly.warp.sdk.io.volley.Request.Method
;
import
ly.warp.sdk.utils.constants.WarpConstants
;
/**
* An {@link HttpStack} based on {@link HttpURLConnection}.
...
...
@@ -94,6 +97,13 @@ public class HurlStack implements HttpStack {
HashMap
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
map
.
putAll
(
request
.
getHeaders
());
map
.
putAll
(
additionalHeaders
);
if
(
request
.
getTag
()
!=
null
&&
request
.
getTag
().
equals
(
"true"
))
{
map
.
put
(
WarpConstants
.
HEADER_AUTHORIZATION
,
"Bearer "
+
WarplyDBHelper
.
getInstance
(
Warply
.
getWarplyContext
()).
getAuthValue
(
"access_token"
));
}
else
if
(
request
.
getTag
()
!=
null
&&
request
.
getTag
().
equals
(
"cosuser"
))
{
map
.
put
(
WarpConstants
.
HEADER_AUTHORIZATION
,
"Basic MWlTM0EyNjcxT2Q0a1B5QkIydEs1ZU5uRENhR0NWQjQ6MjI4MjA4ZTliMTQzNGQ2MmIxNGI3ZDAzYjM2ZjUwMzg="
);
}
if
(
mUrlRewriter
!=
null
)
{
String
rewritten
=
mUrlRewriter
.
rewriteUrl
(
url
);
if
(
rewritten
==
null
)
{
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/io/volley/toolbox/Volley.java
View file @
a91bb37
...
...
@@ -46,10 +46,10 @@ public class Volley {
// HTTP connection reuse which was buggy pre-froyo
/*if (Build.VERSION.SDK_INT < Build.VERSION_CODES.FROYO) {
System.setProperty("http.keepAlive", "false");
}
stack = new HurlStack();
*/
}
*/
stack
=
new
HurlStack
();
stack
=
new
HttpClientStack
();
//
stack = new HttpClientStack();
}
Network
network
=
new
BasicNetwork
(
stack
);
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyManagerHelper.java
View file @
a91bb37
...
...
@@ -44,6 +44,7 @@ import java.util.HashMap;
import
ly.warp.sdk.R
;
import
ly.warp.sdk.Warply
;
import
ly.warp.sdk.activities.ContextualActivity
;
import
ly.warp.sdk.activities.CouponsetInfoActivity
;
import
ly.warp.sdk.activities.GiftsForYouActivity
;
import
ly.warp.sdk.activities.TelcoActivity
;
...
...
@@ -526,7 +527,11 @@ public class WarplyManagerHelper {
public
static
void
handleContextualCampaigns
(
Context
context
,
LoyaltyContextualOfferModel
item
)
{
if
(
item
!=
null
)
{
if
(
mCampaignListAll
!=
null
&&
mCampaignListAll
.
size
()
>
0
)
{
if
(
TextUtils
.
isEmpty
(
item
.
getLoyaltyCampaignId
())
||
item
.
getLoyaltyCampaignId
().
equals
(
"NA"
))
{
Intent
intent
=
new
Intent
(
context
,
ContextualActivity
.
class
);
intent
.
putExtra
(
"ccms"
,
item
);
context
.
startActivity
(
intent
);
}
else
if
(
mCampaignListAll
!=
null
&&
mCampaignListAll
.
size
()
>
0
)
{
for
(
Campaign
camp
:
mCampaignListAll
)
{
try
{
JSONObject
extraFields
=
WarpJSONParser
.
getJSONFromString
(
camp
.
getExtraFields
());
...
...
Please
register
or
login
to post a comment