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-12-06 16:34:51 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
78dfd2540aee79df0749d240388747ed5a4e6c5b
78dfd254
1 parent
cfbe8290
crash fixes
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
36 additions
and
18 deletions
warply_android_sdk/build.gradle
warply_android_sdk/src/main/AndroidManifest.xml
warply_android_sdk/src/main/java/ly/warp/sdk/Warply.java
warply_android_sdk/src/main/java/ly/warp/sdk/db/WarplyDBHelper.java
warply_android_sdk/src/main/java/ly/warp/sdk/io/volley/toolbox/DiskBasedCache.java
warply_android_sdk/src/main/java/ly/warp/sdk/services/UpdateUserLocationService.java
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyInitializer.java
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplySessionManager.java
warply_android_sdk/build.gradle
View file @
78dfd25
...
...
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext
{
PUBLISH_GROUP_ID
=
'ly.warp'
PUBLISH_VERSION
=
'4.5.4.6rc3
0
'
PUBLISH_VERSION
=
'4.5.4.6rc3
1
'
PUBLISH_ARTIFACT_ID
=
'warply-android-sdk'
}
...
...
@@ -32,6 +32,12 @@ android {
abortOnError
false
}
sourceSets
{
main
{
jniLibs
.
srcDirs
=
[
'src/main/jniLibs'
]
}
}
buildTypes
{
release
{
minifyEnabled
false
...
...
@@ -85,8 +91,9 @@ dependencies {
implementation
'com.huawei.hms:ads-identifier:3.4.56.300'
//------------------------------ SQLCipher -----------------------------//
api
"net.zetetic:android-database-sqlcipher:4.5.
0
"
api
"net.zetetic:android-database-sqlcipher:4.5.
2
"
api
"androidx.sqlite:sqlite:2.2.0"
api
'com.getkeepsafe.relinker:relinker:1.4.4'
//------------------------------ Calligraphy -----------------------------//
api
'io.github.inflationx:calligraphy3:3.1.1'
...
...
warply_android_sdk/src/main/AndroidManifest.xml
View file @
78dfd25
...
...
@@ -13,7 +13,7 @@
android:name=
"android.permission.REQUEST_INSTALL_PACKAGES"
tools:node=
"remove"
/>
<application>
<application
android:largeHeap=
"true"
>
<!-- <meta-data-->
<!-- android:name="com.google.android.geo.API_KEY"-->
<!-- android:value="@string/google_maps_key" />-->
...
...
@@ -207,14 +207,14 @@
android:name=
"ly.warp.sdk.receivers.LocationChangedReceiver"
android:exported=
"false"
/>
<receiver
android:name=
"ly.warp.sdk.receivers.ConnectivityChangedReceiver"
android:exported=
"false"
>
<intent-filter
>
<action
android:name=
"android.net.conn.CONNECTIVITY_CHANGE"
/
>
<category
android:name=
"${applicationId}"
/
>
</intent-filter
>
</receiver
>
<!-- <receiver-->
<!-- android:name="ly.warp.sdk.receivers.ConnectivityChangedReceiver"-->
<!-- android:exported="false">--
>
<!-- <intent-filter>--
>
<!-- <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />--
>
<!-- <category android:name="${applicationId}" />--
>
<!-- </intent-filter>--
>
<!-- </receiver>--
>
<receiver
android:name=
"ly.warp.sdk.receivers.BluetoothStateChangeReceiver"
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/Warply.java
View file @
78dfd25
...
...
@@ -129,7 +129,9 @@ public enum Warply {
@Override
public
void
onInit
(
Context
context
)
{
INSTANCE
.
mContext
=
new
WeakReference
<>(
context
.
getApplicationContext
());
if
(
context
!=
null
)
{
INSTANCE
.
mContext
=
new
WeakReference
<>(
context
.
getApplicationContext
());
}
initInternal
(
context
);
}
});
...
...
@@ -140,7 +142,8 @@ public enum Warply {
INSTANCE
.
check
();
return
;
}
INSTANCE
.
mRequestQueue
=
Volley
.
newRequestQueue
(
context
);
if
(
INSTANCE
.
mRequestQueue
==
null
)
INSTANCE
.
mRequestQueue
=
Volley
.
newRequestQueue
(
context
);
INSTANCE
.
mContext
=
new
WeakReference
<>(
context
.
getApplicationContext
());
WarpConstants
.
DEBUG
=
WarplyProperty
.
isDebugMode
(
INSTANCE
.
mContext
.
get
());
INSTANCE
.
isInitializedOrThrow
();
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/db/WarplyDBHelper.java
View file @
78dfd25
...
...
@@ -11,6 +11,8 @@ import android.util.Log;
import
androidx.annotation.Nullable
;
import
com.getkeepsafe.relinker.ReLinker
;
import
net.sqlcipher.DatabaseUtils
;
import
net.sqlcipher.database.SQLiteDatabase
;
import
net.sqlcipher.database.SQLiteOpenHelper
;
...
...
@@ -35,7 +37,7 @@ public class WarplyDBHelper extends SQLiteOpenHelper {
}
private
static
final
String
DB_NAME
=
"warply.db"
;
private
static
final
int
DB_VERSION
=
7
;
private
static
final
int
DB_VERSION
=
8
;
private
static
final
String
KEY_CIPHER
=
"tn#mpOl3v3Dy1pr@W"
;
//------------------------------ Fields -----------------------------//
...
...
@@ -110,7 +112,12 @@ public class WarplyDBHelper extends SQLiteOpenHelper {
public
static
synchronized
WarplyDBHelper
getInstance
(
Context
context
)
{
if
(
mDBHelperInstance
==
null
)
{
SQLiteDatabase
.
loadLibs
(
context
);
// SQLiteDatabase.loadLibs(context); //old implementation
SQLiteDatabase
.
loadLibs
(
context
,
libraries
->
{
for
(
String
library
:
libraries
)
{
ReLinker
.
loadLibrary
(
context
,
library
);
}
});
mDBHelperInstance
=
new
WarplyDBHelper
(
context
);
}
return
mDBHelperInstance
;
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/io/volley/toolbox/DiskBasedCache.java
View file @
78dfd25
...
...
@@ -113,7 +113,7 @@ public class DiskBasedCache implements Cache {
try
{
cis
=
new
CountingInputStream
(
new
FileInputStream
(
file
));
CacheHeader
.
readHeader
(
cis
);
// eat header
byte
[]
data
=
streamToBytes
(
cis
,
(
int
)
(
file
.
length
()
-
cis
.
bytesRead
));
byte
[]
data
=
streamToBytes
(
cis
,
(
int
)
Math
.
abs
((
int
)(
file
.
length
()
-
cis
.
bytesRead
)
));
return
entry
.
toCacheEntry
(
data
);
}
catch
(
IOException
e
)
{
VolleyLog
.
d
(
"%s: %s"
,
file
.
getAbsolutePath
(),
e
.
toString
());
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/services/UpdateUserLocationService.java
View file @
78dfd25
...
...
@@ -256,7 +256,7 @@ public class UpdateUserLocationService extends Worker {
&&
backgroundProvider
==
WarpConstants
.
LocationModes
.
OFF
.
ordinal
())
{
WarplyLocationManager
.
stopReportingLocation
(
context
);
WarplyLocationManager
.
disableConnectivityChangedReceiver
(
context
);
//
WarplyLocationManager.disableConnectivityChangedReceiver(context);
}
else
if
(
foregroundProvider
==
WarpConstants
.
LocationModes
.
OFF
.
ordinal
())
{
/*
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyInitializer.java
View file @
78dfd25
...
...
@@ -172,6 +172,7 @@ public class WarplyInitializer extends Thread /*implements ActivityCompat.OnRequ
}
public
synchronized
void
initWithPermissions
(
Activity
activity
)
{
mContext
=
activity
;
// this.mPermissionsActivity = activity;
//
// int result;
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplySessionManager.java
View file @
78dfd25
...
...
@@ -74,7 +74,7 @@ public class WarplySessionManager {
*/
public
static
void
onStartActivity
(
Activity
activity
)
{
synchronized
(
_activities
)
{
Warply
.
getInitializer
(
activity
).
init
();
//
Warply.getInitializer(activity).init();
_activities
.
add
(
activity
);
if
(
_activities
.
size
()
==
1
)
onApplicationEnterForeground
();
...
...
Please
register
or
login
to post a comment