Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 36 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ final ANDROID_SDK_PATH = {
}()

ext {
MIN_SDK_VERSION = 16
SDK_VERSION = 28
MIN_SDK_VERSION = 21
SDK_VERSION = 31
BUILD_TOOLS_VERSION = '28.0.3'
ANDROIDX_CORE_VERSION = '1.0.0'
ANDROIDX_ANNOTATION_VERSION = '1.0.0'
Expand All @@ -26,21 +26,51 @@ ext {
}

buildscript {
ext {
agp_version = '7.3.1'
}
repositories {
google()
jcenter()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
maven { url 'https://repo.grails.org/grails/core/' }
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
maven {
url 'https://dl.bintray.com/realm/maven/'
}
maven {
url 'https://maven.aliyun.com/repository/public/'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath "com.android.tools.build:gradle:$agp_version"
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath "gradle.plugin.org.ec4j.gradle:editorconfig-gradle-plugin:0.0.3"
//classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
}

allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
maven { url 'https://repo.grails.org/grails/core/' }
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
maven {
url 'https://dl.bintray.com/realm/maven/'
}
maven {
url 'https://maven.aliyun.com/repository/public/'
}
}

gradle.projectsEvaluated {
Expand Down Expand Up @@ -118,7 +148,6 @@ class TimingsListener implements TaskExecutionListener, BuildListener {
}
}

@Override
void buildStarted(Gradle gradle) {}

@Override
Expand Down
2 changes: 1 addition & 1 deletion core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
//apply plugin: 'com.github.dcendents.android-maven'

android {
compileSdkVersion SDK_VERSION
Expand Down
6 changes: 4 additions & 2 deletions encryption/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
//apply plugin: 'com.github.dcendents.android-maven'

android {
compileSdkVersion SDK_VERSION
Expand Down Expand Up @@ -43,7 +43,9 @@ dependencies {
api "androidx.annotation:annotation:${ANDROIDX_ANNOTATION_VERSION}"

// https://github.com/sqlcipher/android-database-sqlcipher
implementation 'net.zetetic:android-database-sqlcipher:4.3.0'
implementation 'androidx.sqlite:sqlite:2.2.0'
// implementation 'net.zetetic:android-database-sqlcipher:4.5.4'
implementation 'net.zetetic:sqlcipher-android:4.7.2@aar'
}

archivesBaseName = 'orma-encryption'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
import com.github.gfx.android.orma.core.DatabaseProvider;
import com.github.gfx.android.orma.core.DatabaseStatement;

import net.sqlcipher.DatabaseUtils;
import net.sqlcipher.database.SQLiteDatabase;

import net.zetetic.database.DatabaseUtils;
import net.zetetic.database.sqlcipher.SQLiteDatabase;

import android.content.ContentValues;
import android.content.Context;
Expand Down Expand Up @@ -165,16 +166,16 @@ public Provider(@NonNull String password) {
@NonNull
@Override
public Database provideOnDiskDatabase(@NonNull Context context, @NonNull String name, int mode) {
SQLiteDatabase.loadLibs(context);
System.loadLibrary("sqlcipher");
File path = context.getDatabasePath(name);
return new EncryptedDatabase(SQLiteDatabase.openOrCreateDatabase(path, password, null));
return new EncryptedDatabase(SQLiteDatabase.openOrCreateDatabase(path, password, null,null));
}

@NonNull
@Override
public Database provideOnMemoryDatabase(@NonNull Context context) {
SQLiteDatabase.loadLibs(context);
return new EncryptedDatabase(SQLiteDatabase.create(null, password));
System.loadLibrary("sqlcipher");
return new EncryptedDatabase(SQLiteDatabase.create(null));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@

import com.github.gfx.android.orma.core.DatabaseStatement;

import net.sqlcipher.database.SQLiteStatement;
import net.zetetic.database.sqlcipher.SQLiteStatement;


class EncryptedDatabaseStatement implements DatabaseStatement {

Expand Down
12 changes: 9 additions & 3 deletions example/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
buildscript {
repositories {
google()
jcenter()
mavenCentral()
maven {
url 'https://dl.bintray.com/realm/maven/'
}
maven {
url 'https://maven.aliyun.com/repository/public/'
}
}
dependencies {
classpath 'io.realm:realm-gradle-plugin:3.7.2'
Expand Down Expand Up @@ -36,14 +42,14 @@ android {
buildTypes {
release {
minifyEnabled true
useProguard true
//useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.debug
resValue "string", "app_name", "Orma ${rootProject.ext.versionName} (release)"
}
debug {
minifyEnabled true
useProguard false
//useProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.debug
resValue "string", "app_name", "Orma ${rootProject.ext.versionName} (release)"
Expand Down

This file was deleted.

This file was deleted.

Loading