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
2026-03-10 12:26:18 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ff808b31e059a128443d5db5c3e0f985d8bf3dfb
ff808b31
1 parent
47e1f512
new sdk version, migration db to the new sqlcipher lib
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
24 deletions
gradle/wrapper/gradle-wrapper.properties
warply_android_sdk/build.gradle
warply_android_sdk/src/main/java/ly/warp/sdk/db/WarplyDBHelper.java
gradle/wrapper/gradle-wrapper.properties
View file @
ff808b3
#Fri Jul 26 17:08:44 EEST 2024
distributionBase
=
GRADLE_USER_HOME
distributionPath
=
wrapper/dists
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-8.1
2-all
.zip
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-8.1
3-bin
.zip
zipStoreBase
=
GRADLE_USER_HOME
zipStorePath
=
wrapper/dists
...
...
warply_android_sdk/build.gradle
View file @
ff808b3
...
...
@@ -5,7 +5,7 @@ android.buildFeatures.buildConfig = true
ext
{
PUBLISH_GROUP_ID
=
'ly.warp'
PUBLISH_VERSION
=
'4.5.5.4m
7
'
PUBLISH_VERSION
=
'4.5.5.4m
8
'
PUBLISH_ARTIFACT_ID
=
'warply-android-sdk'
}
...
...
@@ -97,9 +97,9 @@ dependencies {
implementation
'com.huawei.hms:ads-identifier:3.4.56.300'
//------------------------------ SQLCipher -----------------------------//
api
"net.zetetic:
android-database-sqlcipher:4.5.2
"
api
"net.zetetic:
sqlcipher-android:4.13.0
"
api
"androidx.sqlite:sqlite:2.2.0"
api
'com.getkeepsafe.relinker:relinker:1.4.
4
'
api
'com.getkeepsafe.relinker:relinker:1.4.
5
'
//------------------------------ Retrofit -----------------------------//
implementation
'com.squareup.retrofit2:retrofit:2.9.0'
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/db/WarplyDBHelper.java
View file @
ff808b3
...
...
@@ -13,10 +13,9 @@ import androidx.annotation.Nullable;
import
com.getkeepsafe.relinker.ReLinker
;
import
net.sqlcipher.DatabaseUtils
;
import
net.sqlcipher.database.SQLiteDatabase
;
import
net.sqlcipher.database.SQLiteOpenHelper
;
import
net.sqlcipher.database.SQLiteStatement
;
import
net.zetetic.database.sqlcipher.SQLiteDatabase
;
import
net.zetetic.database.sqlcipher.SQLiteOpenHelper
;
import
net.zetetic.database.sqlcipher.SQLiteStatement
;
import
org.json.JSONArray
;
import
org.json.JSONObject
;
...
...
@@ -45,7 +44,7 @@ public class WarplyDBHelper extends SQLiteOpenHelper {
}
private
static
final
String
DB_NAME
=
"warply.db"
;
private
static
final
int
DB_VERSION
=
1
4
;
private
static
final
int
DB_VERSION
=
1
5
;
private
static
final
String
KEY_CIPHER
=
"tn#mpOl3v3Dy1pr@W"
;
// Timeout constants
...
...
@@ -137,19 +136,14 @@ public class WarplyDBHelper extends SQLiteOpenHelper {
public
static
synchronized
WarplyDBHelper
getInstance
(
Context
context
)
{
if
(
mDBHelperInstance
==
null
)
{
// SQLiteDatabase.loadLibs(context); //old implementation
SQLiteDatabase
.
loadLibs
(
context
,
libraries
->
{
for
(
String
library
:
libraries
)
{
ReLinker
.
loadLibrary
(
context
,
library
);
}
});
ReLinker
.
loadLibrary
(
context
,
"sqlcipher"
);
mDBHelperInstance
=
new
WarplyDBHelper
(
context
);
}
return
mDBHelperInstance
;
}
private
WarplyDBHelper
(
Context
context
)
{
super
(
context
,
DB_NAME
,
null
,
DB_VERSION
);
super
(
context
,
DB_NAME
,
KEY_CIPHER
,
null
,
DB_VERSION
,
0
,
null
,
null
,
false
);
State
tempDatabaseState
=
getDatabaseState
(
context
,
DB_NAME
);
if
(
tempDatabaseState
.
equals
(
State
.
UNENCRYPTED
))
{
encrypt
(
context
,
context
.
getDatabasePath
(
DB_NAME
),
KEY_CIPHER
.
getBytes
());
...
...
@@ -164,7 +158,7 @@ public class WarplyDBHelper extends SQLiteOpenHelper {
if
(
mDb
==
null
||
!
mDb
.
isOpen
())
{
try
{
// Submit task to executor and get future
Future
<
SQLiteDatabase
>
future
=
dbExecutor
.
submit
(()
->
getWritableDatabase
(
KEY_CIPHER
));
Future
<
SQLiteDatabase
>
future
=
dbExecutor
.
submit
(()
->
getWritableDatabase
());
// Wait for result with timeout
mDb
=
future
.
get
(
CONNECTION_TIMEOUT_MS
,
TimeUnit
.
MILLISECONDS
);
...
...
@@ -192,7 +186,7 @@ public class WarplyDBHelper extends SQLiteOpenHelper {
if
(
mDb
==
null
||
!
mDb
.
isOpen
())
{
try
{
// Submit task to executor and get future
Future
<
SQLiteDatabase
>
future
=
dbExecutor
.
submit
(()
->
getReadableDatabase
(
KEY_CIPHER
));
Future
<
SQLiteDatabase
>
future
=
dbExecutor
.
submit
(()
->
getReadableDatabase
());
// Wait for result with timeout
mDb
=
future
.
get
(
CONNECTION_TIMEOUT_MS
,
TimeUnit
.
MILLISECONDS
);
...
...
@@ -214,7 +208,7 @@ public class WarplyDBHelper extends SQLiteOpenHelper {
private
SQLiteDatabase
getReadableDbInner
()
{
if
(
mDb
==
null
)
mDb
=
getReadableDatabase
(
KEY_CIPHER
);
mDb
=
getReadableDatabase
();
return
mDb
;
}
...
...
@@ -237,7 +231,7 @@ public class WarplyDBHelper extends SQLiteOpenHelper {
if
(
mDb
==
null
||
!
mDb
.
isOpen
())
{
try
{
// Submit task to executor and get future
Future
<
SQLiteDatabase
>
future
=
dbExecutor
.
submit
(()
->
getWritableDatabase
(
KEY_CIPHER
));
Future
<
SQLiteDatabase
>
future
=
dbExecutor
.
submit
(()
->
getWritableDatabase
());
// Wait for result with timeout
mDb
=
future
.
get
(
CONNECTION_TIMEOUT_MS
,
TimeUnit
.
MILLISECONDS
);
...
...
@@ -834,7 +828,7 @@ public class WarplyDBHelper extends SQLiteOpenHelper {
}
private
State
getDatabaseState
(
Context
context
,
String
dbName
)
{
SQLiteDatabase
.
loadLibs
(
context
);
ReLinker
.
loadLibrary
(
context
,
"sqlcipher"
);
return
(
getDatabaseState
(
context
.
getDatabasePath
(
dbName
)));
}
...
...
@@ -843,7 +837,7 @@ public class WarplyDBHelper extends SQLiteOpenHelper {
if
(
dbPath
.
exists
())
{
SQLiteDatabase
db
=
null
;
try
{
db
=
SQLiteDatabase
.
openDatabase
(
dbPath
.
getAbsolutePath
(),
""
,
null
,
SQLiteDatabase
.
OPEN_READONLY
);
db
=
SQLiteDatabase
.
openDatabase
(
dbPath
.
getAbsolutePath
(),
""
,
null
,
SQLiteDatabase
.
OPEN_READONLY
,
null
,
null
);
db
.
getVersion
();
return
(
State
.
UNENCRYPTED
);
...
...
@@ -860,13 +854,13 @@ public class WarplyDBHelper extends SQLiteOpenHelper {
}
private
void
encrypt
(
Context
context
,
File
originalFile
,
byte
[]
passphrase
)
{
SQLiteDatabase
.
loadLibs
(
context
);
ReLinker
.
loadLibrary
(
context
,
"sqlcipher"
);
try
{
if
(
originalFile
.
exists
())
{
File
newFile
=
File
.
createTempFile
(
"sqlcipherutils"
,
"tmp"
,
context
.
getCacheDir
());
SQLiteDatabase
db
=
SQLiteDatabase
.
openDatabase
(
originalFile
.
getAbsolutePath
(),
""
,
null
,
SQLiteDatabase
.
OPEN_READWRITE
);
""
,
null
,
SQLiteDatabase
.
OPEN_READWRITE
,
null
,
null
);
int
version
=
db
.
getVersion
();
db
.
close
();
...
...
Please
register
or
login
to post a comment