Skip to content
This repository has been archived by the owner on Mar 1, 2022. It is now read-only.

Commit

Permalink
Gradle changes for publishing to maven central
Browse files Browse the repository at this point in the history
  • Loading branch information
scottyab committed Mar 5, 2015
1 parent 9f13856 commit 7e5edde
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ local.properties
.project

# Gradle Related
.gradle
.gradle/
/local.properties
/.idea/workspace.xml
.DS_Store
Expand Down
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.14.0'
classpath 'com.android.tools.build:gradle:1.1.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -16,11 +16,11 @@ def isReleaseBuild() {
}

allprojects {
// version = VERSION_NAME
// group = GROUP
version = VERSION_NAME
group = GROUP

repositories {
jcenter()
mavenCentral()
}
}

Expand Down
18 changes: 18 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
VERSION_NAME=0.0.4-SNAPSHOT
VERSION_CODE=4
GROUP=com.scottyab


POM_DESCRIPTION=Android Shared preference wrapper than encrypts the keys and values of Shared Preferences. It's not bullet proof security but rather a quick win for incrementally making your android app more secure.
POM_URL=https://github.com/scottyab/secure-preferences.git
POM_SCM_URL=https://github.com/scottyab/secure-preferences.git
POM_SCM_CONNECTION=scm:[email protected]:scottyab/secure-preferences.git
POM_SCM_DEV_CONNECTION=scm:[email protected]:scottyab/secure-preferences.git
POM_LICENCE_NAME=The Apache Software License, Version 2.0
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=scottyab
POM_DEVELOPER_NAME=Scott Alexander-Bown
RELEASE_REPOSITORY_URL=https://oss.sonatype.org/service/local/staging/deploy/maven2
SNAPSHOT_REPOSITORY_URL=https://oss.sonatype.org/content/repositories/snapshots
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sat Feb 08 11:00:57 MMT 2014
#Wed Mar 04 17:19:53 GMT 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
2 changes: 1 addition & 1 deletion library/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
android:minSdkVersion="7"
android:targetSdkVersion="21" />

<application android:allowBackup="false" >
<application>
</application>

</manifest>
8 changes: 5 additions & 3 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ apply plugin: 'com.android.library'

android {
compileSdkVersion 21
buildToolsVersion '21.1.0'
buildToolsVersion '21.1.2'

defaultConfig {
minSdkVersion 8
targetSdkVersion 21
versionCode 1
versionName "1.0"
versionCode versionCode
versionName version
}

sourceSets {
Expand All @@ -22,4 +22,6 @@ android {
manifest.srcFile 'AndroidManifest.xml'
}
}

apply from: 'https://raw.github.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle'
}
4 changes: 4 additions & 0 deletions library/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Module Gradle settings.
POM_NAME=secure-preferences
POM_ARTIFACT_ID=secure-preferences-lib
POM_PACKAGING=jar
11 changes: 7 additions & 4 deletions library/src/com/securepreferences/SecurePreferences.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,16 @@ public class SecurePreferences implements SharedPreferences {
private static final int KEY_SIZE = 256;
// requires Spongycastle crypto libraries
// private static final String AES_KEY_ALG = "AES/GCM/NoPadding";
// private static final String AES_KEY_ALG = "AES/CBC/PKCS5Padding";
//private static final String AES_KEY_ALG = "AES/CBC/PKCS5Padding";

private static final String AES_KEY_ALG = "AES";
private static final String PRIMARY_PBE_KEY_ALG = "PBKDF2WithHmacSHA1";

// change to SC if using Spongycastle crypto libraries
private static final String PROVIDER = "BC";

private static final String PRIMARY_PBE_KEY_ALG = "PBKDF2WithHmacSHA1";
private static final String BACKUP_PBE_KEY_ALG = "PBEWithMD5AndDES";
private static final int ITERATIONS = 2000;
// change to SC if using Spongycastle crypto libraries
private static final String PROVIDER = "BC";

private static SharedPreferences sFile;
private static byte[] sKey;
Expand Down
15 changes: 8 additions & 7 deletions sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 21
buildToolsVersion '21.1.0'
Expand All @@ -13,12 +12,12 @@ android {

sourceSets {
main {
assets.srcDirs = ['assets']
res.srcDirs = ['res']
aidl.srcDirs = ['src']
resources.srcDirs = ['src']
assets.srcDirs = ['assets']
res.srcDirs = ['res']
aidl.srcDirs = ['src']
resources.srcDirs = ['src']
renderscript.srcDirs = ['src']
java.srcDirs = ['src']
java.srcDirs = ['src']
manifest.srcFile 'AndroidManifest.xml'
}
}
Expand All @@ -28,5 +27,7 @@ android {
compile project(':library')
}


}
dependencies {
compile project(':library')
}
4 changes: 4 additions & 0 deletions sample/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Module Gradle settings.
POM_NAME=secure-preferences
POM_ARTIFACT_ID=secure-preferences-sample
POM_PACKAGING=apk

0 comments on commit 7e5edde

Please sign in to comment.