Skip to content

Commit

Permalink
Merge pull request #83 from SUPLA/develop
Browse files Browse the repository at this point in the history
v2.3.15
  • Loading branch information
przemyslawzygmunt authored Jul 8, 2019
2 parents fbee73e + 6c69a27 commit 6e66904
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
applicationId "org.supla.android"
minSdkVersion Integer.parseInt(project.ANDROID_BUILD_MIN_SDK_VERSION)
targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION)
versionCode 68
versionName "2.3.14"
versionCode 69
versionName "2.3.15"

sourceSets.main {
jniLibs.srcDir 'src/main/libs'
Expand Down
7 changes: 5 additions & 2 deletions app/src/main/java/org/supla/android/Encryption.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,17 @@ public class Encryption {
private static SecretKey generateKey(String password)
throws NoSuchAlgorithmException, InvalidKeySpecException
{
password = password.substring(0, 32);
String alignment = "";
if (password == null) {
password = "";
}

String alignment = "";
for(int a=0;a<32-password.length();a++) {
alignment+="0";
}

password+=alignment;
password = password.substring(0, 32);

return new SecretKeySpec(password.getBytes(), "AES");
}
Expand Down

0 comments on commit 6e66904

Please sign in to comment.