Skip to content

Commit

Permalink
Update gradle build
Browse files Browse the repository at this point in the history
  • Loading branch information
bpellin committed Mar 30, 2017
1 parent 9fa5eec commit dbebc8a
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 26 deletions.
49 changes: 27 additions & 22 deletions app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<facet type="android" name="Android">
<configuration>
<option name="SELECTED_BUILD_VARIANT" value="flavor1Debug" />
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
<option name="ASSEMBLE_TASK_NAME" value="assembleFlavor1Debug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileFlavor1DebugSources" />
<afterSyncTasks>
Expand Down Expand Up @@ -53,41 +52,44 @@
<sourceFolder url="file://$MODULE_DIR$/src/flavor1Debug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/flavor1Debug/renderscript" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/flavor1Debug/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/testFlavor1Debug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testFlavor1Debug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testFlavor1Debug/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testFlavor1Debug/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testFlavor1Debug/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testFlavor1Debug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testFlavor1Debug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/flavor1/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/flavor1/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/flavor1/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/flavor1/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/flavor1/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/flavor1/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/flavor1/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testFlavor1Debug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testFlavor1Debug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testFlavor1Debug/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testFlavor1Debug/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testFlavor1Debug/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testFlavor1Debug/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testFlavor1Debug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testFlavor1Debug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/flavor1/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/flavor1/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/flavor1/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/flavor1/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/flavor1/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/flavor1/renderscript" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/flavor1/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFlavor1/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFlavor1/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFlavor1/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFlavor1/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFlavor1/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFlavor1/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFlavor1/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testFlavor1/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testFlavor1/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testFlavor1/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testFlavor1/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testFlavor1/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testFlavor1/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testFlavor1/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testFlavor1/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFlavor1/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFlavor1/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFlavor1/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFlavor1/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFlavor1/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFlavor1/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFlavor1/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFlavor1/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
Expand All @@ -100,6 +102,7 @@
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
Expand All @@ -109,20 +112,22 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/renderscript" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/renderscript" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/renderscript" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/renderscript" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/binaries" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply plugin: 'com.android.model.application'
model {
android {
compileSdkVersion = 22
buildToolsVersion = "23.0.0"
buildToolsVersion = "25.0.0"

defaultConfig.with {
applicationId = "com.android.keepass"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.keepassdroid.crypto.engine;

/**
* Created by bpellin on 1/29/17.
*/

public class CipherEngine {
}
55 changes: 55 additions & 0 deletions app/src/main/java/com/keepassdroid/stream/HmacBlockStream.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Copyright 2017 Brian Pellin.
*
* This file is part of KeePassDroid.
*
* KeePassDroid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* KeePassDroid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with KeePassDroid. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.keepassdroid.stream;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.security.DigestOutputStream;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class HmacBlockStream {
public static byte[] GetHmacKey64(byte[] key, long blockIndex) {
MessageDigest hash;
try {
hash = MessageDigest.getInstance("SHA-512");
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException(e);
}

NullOutputStream nos = new NullOutputStream();
DigestOutputStream dos = new DigestOutputStream(nos, hash);
LEDataOutputStream leos = new LEDataOutputStream(dos);

try {
leos.writeLong(blockIndex);
leos.write(key);
leos.close();
} catch (IOException e) {
throw new RuntimeException(e);
}

byte[] hashKey = hash.digest();
assert(hashKey.length == 64);

return hashKey;
}

}
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle-experimental:0.8.3'
classpath 'com.android.tools.build:gradle-experimental:0.9.0'
}
}

Expand Down
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 @@
#Mon Oct 24 20:32:21 CDT 2016
#Sun Mar 26 15:21:55 CDT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip

0 comments on commit dbebc8a

Please sign in to comment.