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

Commit

Permalink
Gradle and version update
Browse files Browse the repository at this point in the history
  • Loading branch information
scottyab committed Aug 30, 2019
1 parent b4f9c92 commit 6e367d8
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 30 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.1'
classpath 'com.android.tools.build:gradle:3.5.0'
}
}

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION_NAME=0.1.7
VERSION_CODE=17
VERSION_NAME=0.1.8
VERSION_CODE=18
GROUP=com.scottyab


Expand Down
13 changes: 4 additions & 9 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
org.gradle.daemon=true
zipStorePath=wrapper/dists
org.gradle.parallel.threads=4
org.gradle.parallel=true
zipStoreBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
org.gradle.configureondemand=true
distributionPath=wrapper/dists
distributionBase=GRADLE_USER_HOME

distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
2 changes: 1 addition & 1 deletion library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ android {

dependencies {

compile 'com.scottyab:aes-crypto:0.0.5'
api 'com.scottyab:aes-crypto:0.0.5'

//used when referencing a local copy of aes-crypto
//compile project(':aes-crypto-release')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.stream.Stream;

/**
* Wrapper class for Android's {@link SharedPreferences} interface, which adds a
Expand Down Expand Up @@ -238,6 +237,7 @@ private String generateAesKeyName(Context context, int iterationCount) throws Ge
*/
private String getSalt(Context context) {
if (TextUtils.isEmpty(this.salt)) {
Log.w(TAG, "Using the default generated Salt, it's more forward compatible to pass your own salt or use password");
return Utils.getDefaultSalt(context);
} else {
return this.salt;
Expand Down
4 changes: 2 additions & 2 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 28
versionCode 8
versionName "1.0.5"
versionCode 9
versionName "0.1.8"
}

sourceSets {
Expand Down
8 changes: 7 additions & 1 deletion sample/res/menu/menu_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,10 @@
android:orderInCategory="100"
app:showAsAction="never"
/>
</menu>

<item
android:id="@+id/action_version"
android:title="@string/action_change_password_user_prefs"
android:orderInCategory="100"
app:showAsAction="never" />
</menu>
3 changes: 2 additions & 1 deletion sample/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<string name="action_github">Get it on Github</string>
<string name="action_create_user_prefs">Create user prefs</string>
<string name="action_change_password_user_prefs">Change password on user prefs</string>
<string name="version">App version %s</string>

<string-array name="list_entries">
<item>One</item>
Expand All @@ -51,4 +52,4 @@
<item>4</item>
</string-array>

</resources>
</resources>
19 changes: 7 additions & 12 deletions sample/src/com/securepreferences/sample/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.TextUtils;
Expand Down Expand Up @@ -75,7 +74,7 @@ public void onSharedPreferenceChanged(
}

private void initViews() {
encValuesTextView = (TextView) findViewById(R.id.fooValueEncTV);
encValuesTextView = findViewById(R.id.fooValueEncTV);
}

private SharedPreferences getSharedPref(){
Expand Down Expand Up @@ -157,19 +156,15 @@ public void onActivityButtonClick(View v) {
}

public void onFragmentButtonClick(View v) {
// TODO: show an example with something like unified prefs
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
startActivity(new Intent(this, ActivityWithPreferenceFragment.class));
} else {
toast("PreferenceFragment not support before Android 3.0");
}
}
startActivity(new Intent(this, ActivityWithPreferenceFragment.class));
}


@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
menu.findItem(R.id.action_version).setTitle(getString(R.string.version, BuildConfig.VERSION_NAME));
return super.onCreateOptionsMenu(menu);
}

@Override
Expand Down Expand Up @@ -197,8 +192,8 @@ private void showCreateUserPrefsDialog(boolean chnagePassword) {
LayoutInflater li = LayoutInflater.from(this);
View dialogContent = li.inflate(R.layout.dialog_password, null);

TextView messageTV = (TextView)dialogContent.findViewById(R.id.message);
final EditText passwordET = (EditText)dialogContent.findViewById(R.id.passwordET);
TextView messageTV = dialogContent.findViewById(R.id.message);
final EditText passwordET = dialogContent.findViewById(R.id.passwordET);

builder.setView(dialogContent);

Expand Down

0 comments on commit 6e367d8

Please sign in to comment.