Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

Android x 3 #203

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
d263cf5
sdk update
jairrab Apr 2, 2018
583eadf
<fix> Caused by java.lang.NullPointerException: Attempt to invoke vir…
jairrab Apr 2, 2018
e313b83
<fix> Caused by java.lang.NullPointerException: Attempt to invoke vir…
jairrab Apr 2, 2018
459b544
<ui> date picker will follow day of week settings
jairrab Apr 2, 2018
00f0d59
updated libraries to v27.1.1
jairrab Apr 12, 2018
61dcfc8
fix for Fatal Exception: java.lang.RuntimeException: Unable to resume…
jairrab Apr 12, 2018
df60c99
fix for Fatal Exception: java.lang.RuntimeException: Unable to resume…
jairrab Apr 12, 2018
da2c7ef
fix for Fatal Exception: java.lang.RuntimeException: Unable to resume…
jairrab Apr 12, 2018
7ecec46
gradle update
jairrab May 9, 2018
877611b
<fix> android.security.KeyStore.getKeyStoreException (Unknown Source:29)
jairrab May 30, 2018
59e90a7
gradle update
jairrab Jun 20, 2018
7674c88
Merge remote-tracking branch 'origin/sdk27' into sdk27
jairrab Jun 20, 2018
44bf57e
gradle update
jairrab Jun 20, 2018
45abeb1
<gradle> updated
jairrab Aug 27, 2018
1f24c64
<gradle> update
jairrab Aug 28, 2018
d2a2c0a
Merge remote-tracking branch 'origin/sdk27' into sdk27
jairrab Aug 31, 2018
cd8a194
gradle update
jairrab Sep 1, 2018
62632fc
<library> updated support libraries to V28
jairrab Sep 23, 2018
566bfaa
<library> revert support libraries to V27
jairrab Sep 24, 2018
488c21f
<gradle> updated buildToolsVersion
jairrab Oct 11, 2018
f8a37aa
changed compile to implementation
jairrab Oct 13, 2018
7acb544
updated classpath
jairrab Oct 13, 2018
78ea407
<fix> NPE
jairrab Oct 25, 2018
73e6707
<androidx> auto-refactor
jairrab Dec 6, 2018
89fa930
<fixed> RebindReportingHolder auto-refactoring issue
jairrab Dec 7, 2018
78c10ee
<gradle> update target SDK to 28
jairrab Dec 10, 2018
bc9e4ae
<gradle> updated compile to implementation
jairrab Dec 10, 2018
79953f2
speed improvements
jairrab Feb 15, 2019
22d4ab6
optimize BasePresenter
jairrab Mar 5, 2019
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
14 changes: 7 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
buildToolsVersion '26.0.3'

defaultConfig {
applicationId "com.github.orangegangsters.lollipin"
minSdkVersion 14
targetSdkVersion 24
targetSdkVersion 28
versionCode 1
versionName "1.0"
}
Expand All @@ -20,16 +20,16 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
implementation fileTree(dir: 'libs', include: ['*.jar'])

compile project(':lib')
compile 'com.android.support:appcompat-v7:26.0.2'
implementation project(':lib')
implementation 'com.android.support:appcompat-v7:26.1.0'

//Lollipop dialogs https://github.com/lewisjdeane/L-Dialogs and buttons, animations etc...
compile 'uk.me.lewisdeane.ldialogs:ldialogs:1.2.0@aar'
implementation 'uk.me.lewisdeane.ldialogs:ldialogs:1.2.0@aar'

//test
androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.5.2'
androidTestImplementation 'com.jayway.android.robotium:robotium-solo:5.5.2'
}

// REQUIRED: Google's new Maven repo is required for the latest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.github.omadahealth.lollipin;

import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import androidx.appcompat.widget.Toolbar;
import com.github.omadahealth.lollipin.lib.PinCompatActivity;
import lollipin.orangegangsters.github.com.lollipin.R;

Expand Down
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.2.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -14,7 +15,8 @@ buildscript {

allprojects {
repositories {
maven{
google()
maven {
url "https://github.com/omadahealth/omada-nexus/raw/master/release"
}
jcenter()
Expand Down
File renamed without changes.
20 changes: 11 additions & 9 deletions lib/build.gradle → lollipin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 26
buildToolsVersion '26.0.1'
compileSdkVersion 28
buildToolsVersion '28.0.3'

defaultConfig {
minSdkVersion 14
targetSdkVersion 26
targetSdkVersion 28
versionCode 2
versionName VERSION_NAME
}
Expand All @@ -19,16 +19,18 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
implementation fileTree(dir: 'libs', include: ['*.jar'])
//RippleView
compile 'com.github.traex.rippleeffect:ripple:1.3.1-OG'
implementation 'com.github.traex.rippleeffect:ripple:1.3.1-OG'
//TypefaceView
compile 'com.github.omadahealth.typefaceview:typefaceview:1.5.0@aar' //TypefaceTextView
implementation 'com.github.omadahealth.typefaceview:typefaceview:1.5.0@aar' //TypefaceTextView

//implementation 'androidx.fragment:fragment:1.0.0'

//Compat
compile 'com.android.support:support-v4:26.0.2'
compile 'com.android.support:appcompat-v7:26.0.2'
compile "com.android.support:support-v13:26.0.2"
//implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.2'
//implementation "androidx.legacy:legacy-support-v13:1.0.0"
}
repositories {
maven {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.support.v4.content.LocalBroadcastManager;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;

import com.github.omadahealth.lollipin.lib.interfaces.LifeCycleInterface;
import com.github.omadahealth.lollipin.lib.managers.AppLockActivity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v7.app.AppCompatActivity;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.appcompat.app.AppCompatActivity;

import com.github.omadahealth.lollipin.lib.interfaces.LifeCycleInterface;
import com.github.omadahealth.lollipin.lib.managers.AppLockActivity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.content.LocalBroadcastManager;
import androidx.fragment.app.FragmentActivity;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;

import com.github.omadahealth.lollipin.lib.interfaces.LifeCycleInterface;
import com.github.omadahealth.lollipin.lib.managers.AppLockActivity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import android.hardware.fingerprint.FingerprintManager;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.content.LocalBroadcastManager;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import android.util.Log;
import android.view.View;
import android.view.animation.Animation;
Expand All @@ -20,6 +20,7 @@
import com.github.omadahealth.lollipin.lib.views.KeyboardView;
import com.github.omadahealth.lollipin.lib.views.PinCodeRoundView;

import java.security.ProviderException;
import java.util.Arrays;
import java.util.List;

Expand All @@ -29,7 +30,8 @@
* Call this activity in normal or singleTop mode (not singleTask or singleInstance, it does not work
* with {@link android.app.Activity#startActivityForResult(android.content.Intent, int)}).
*/
public abstract class AppLockActivity extends PinActivity implements KeyboardButtonClickedListener, View.OnClickListener, FingerprintUiHelper.Callback {
public abstract class AppLockActivity extends PinActivity implements KeyboardButtonClickedListener, View.OnClickListener, FingerprintUiHelper
.Callback {

public static final String TAG = AppLockActivity.class.getSimpleName();
public static final String ACTION_CANCEL = TAG + ".actionCancelled";
Expand All @@ -44,7 +46,6 @@ public abstract class AppLockActivity extends PinActivity implements KeyboardBut

protected LockManager mLockManager;


protected FingerprintManager mFingerprintManager;
protected FingerprintUiHelper mFingerprintUiHelper;

Expand All @@ -62,7 +63,6 @@ public abstract class AppLockActivity extends PinActivity implements KeyboardBut
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

setContentView(getContentView());
initLayout(getIntent());
}
Expand All @@ -73,7 +73,6 @@ protected void onCreate(Bundle savedInstanceState) {
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);

initLayout(intent);
}

Expand All @@ -96,10 +95,8 @@ protected void onPause() {
* Init completely the layout, depending of the extra {@link com.github.omadahealth.lollipin.lib.managers.AppLock#EXTRA_TYPE}
*/
private void initLayout(Intent intent) {
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.GINGERBREAD_MR1) {
//Animate if greater than 2.3.3
overridePendingTransition(R.anim.nothing, R.anim.nothing);
}
//Animate if greater than 2.3.3
overridePendingTransition(R.anim.nothing, R.anim.nothing);

Bundle extras = intent.getExtras();
if (extras != null) {
Expand All @@ -113,16 +110,16 @@ private void initLayout(Intent intent) {
enableAppLockerIfDoesNotExist();
mLockManager.getAppLock().setPinChallengeCancelled(false);

mStepTextView = (TextView) this.findViewById(R.id.pin_code_step_textview);
mPinCodeRoundView = (PinCodeRoundView) this.findViewById(R.id.pin_code_round_view);
mPinCodeRoundView.setPinLength(this.getPinLength());
mForgotTextView = (TextView) this.findViewById(R.id.pin_code_forgot_textview);
mStepTextView = findViewById(R.id.pin_code_step_textview);
mPinCodeRoundView = findViewById(R.id.pin_code_round_view);
mPinCodeRoundView.setPinLength(getPinLength());
mForgotTextView = findViewById(R.id.pin_code_forgot_textview);
mForgotTextView.setOnClickListener(this);
mKeyboardView = (KeyboardView) this.findViewById(R.id.pin_code_keyboard_view);
mKeyboardView = findViewById(R.id.pin_code_keyboard_view);
mKeyboardView.setKeyboardButtonClickedListener(this);

int logoId = mLockManager.getAppLock().getLogoId();
ImageView logoImage = ((ImageView) findViewById(R.id.pin_code_logo_imageview));
ImageView logoImage = findViewById(R.id.pin_code_logo_imageview);
if (logoId != AppLock.LOGO_ID_NONE) {
logoImage.setVisibility(View.VISIBLE);
logoImage.setImageResource(logoId);
Expand All @@ -138,23 +135,25 @@ private void initLayout(Intent intent) {
* and {@link FingerprintManager#isHardwareDetected()}.
*/
private void initLayoutForFingerprint() {
mFingerprintImageView = (ImageView) this.findViewById(R.id.pin_code_fingerprint_imageview);
mFingerprintTextView = (TextView) this.findViewById(R.id.pin_code_fingerprint_textview);
mFingerprintImageView = findViewById(R.id.pin_code_fingerprint_imageview);
mFingerprintTextView = findViewById(R.id.pin_code_fingerprint_textview);
if (mType == AppLock.UNLOCK_PIN && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
mFingerprintManager = (FingerprintManager) getSystemService(Context.FINGERPRINT_SERVICE);
mFingerprintUiHelper = new FingerprintUiHelper.FingerprintUiHelperBuilder(mFingerprintManager).build(mFingerprintImageView, mFingerprintTextView, this);
mFingerprintUiHelper = new FingerprintUiHelper.FingerprintUiHelperBuilder(mFingerprintManager).build(mFingerprintImageView,
mFingerprintTextView, this);
try {
if (mFingerprintManager.isHardwareDetected() && mFingerprintUiHelper.isFingerprintAuthAvailable()
&& mLockManager.getAppLock().isFingerprintAuthEnabled()) {
//mFingerprintManager != null added by Jay
if (mFingerprintManager != null && mFingerprintManager.isHardwareDetected() && mFingerprintUiHelper.isFingerprintAuthAvailable()
&& mLockManager.getAppLock() != null && mLockManager.getAppLock().isFingerprintAuthEnabled()) {
mFingerprintImageView.setVisibility(View.VISIBLE);
mFingerprintTextView.setVisibility(View.VISIBLE);
mFingerprintUiHelper.startListening();
} else {
mFingerprintImageView.setVisibility(View.GONE);
mFingerprintTextView.setVisibility(View.GONE);
}
} catch (SecurityException e) {
Log.e(TAG, e.toString());
//} catch (SecurityException e) {
} catch (SecurityException | ProviderException e) {//added ProviderException to resolve field issues
mFingerprintImageView.setVisibility(View.GONE);
mFingerprintTextView.setVisibility(View.GONE);
}
Expand Down Expand Up @@ -218,7 +217,7 @@ public String getForgotText() {
return getString(R.string.pin_code_forgot_text);
}

private void setForgotTextVisibility(){
private void setForgotTextVisibility() {
mForgotTextView.setVisibility(mLockManager.getAppLock().shouldShowForgot(mType) ? View.VISIBLE : View.GONE);
}

Expand All @@ -239,10 +238,8 @@ public void finish() {
}
}

if (Build.VERSION.SDK_INT > Build.VERSION_CODES.GINGERBREAD_MR1) {
//Animate if greater than 2.3.3
overridePendingTransition(R.anim.nothing, R.anim.slide_down);
}
//Animate if greater than 2.3.3
overridePendingTransition(R.anim.nothing, R.anim.slide_down);
}

/**
Expand All @@ -267,7 +264,7 @@ public void onKeyboardClick(KeyboardButtonEnum keyboardButtonEnum) {
}

/**
* Called at the end of the animation of the {@link com.andexert.library.RippleView}
* Called at the end of the animation of the @link com.andexert.library.RippleView
* Calls {@link #onPinCodeInputed} when {@link #mPinCode}
*/
@Override
Expand Down Expand Up @@ -415,7 +412,6 @@ public void setPinCode(String pinCode) {
mPinCodeRoundView.refresh(mPinCode.length());
}


/**
* Returns the type of this {@link com.github.omadahealth.lollipin.lib.managers.AppLockActivity}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,13 @@ public void run() {
/**
* Tells if the {@link FingerprintManager#isHardwareDetected()}, {@link FingerprintManager#hasEnrolledFingerprints()},
* and {@link KeyguardManager#isDeviceSecure()}
*
*
* @return true if yes, false otherwise
* @throws SecurityException If the hardware is not available, or the permission are not set
*/
public boolean isFingerprintAuthAvailable() throws SecurityException {
return mFingerprintManager.isHardwareDetected()
//mFingerprintManager != null added by Jay
return mFingerprintManager != null && mFingerprintManager.isHardwareDetected()
&& mFingerprintManager.hasEnrolledFingerprints()
&& ((KeyguardManager) mIcon.getContext().getSystemService(Context.KEYGUARD_SERVICE)).isDeviceSecure();
}
Expand Down Expand Up @@ -267,13 +268,22 @@ public void createKey() {
KeyProperties.PURPOSE_ENCRYPT |
KeyProperties.PURPOSE_DECRYPT)
.setBlockModes(KeyProperties.BLOCK_MODE_CBC)
// Require the user to authenticate with a fingerprint to authorize every use
// of the key
// Require the user to authenticate with a fingerprint to authorize every use
// of the key
.setUserAuthenticationRequired(true)
.setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_PKCS7)
.build());
mKeyGenerator.generateKey();
} catch (NoSuchProviderException | NoSuchAlgorithmException | InvalidAlgorithmParameterException e) {

} catch (InvalidAlgorithmParameterException e){
// added by Jay. Appears to be an issue specific to Sony Experia Z5
// Fatal Exception: java.lang.RuntimeException: Unable to resume activity {com.rammigsoftware.bluecoins/com.rammigsoftware.bluecoins
// .pinsecurity.CustomPinActivity}: java.lang.RuntimeException: java.security.InvalidAlgorithmParameterException: java.lang
// .IllegalStateException: At least one fingerprint must be enrolled to create keys requiring user authentication for every use
// at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3493)
e.printStackTrace();

} catch (NoSuchProviderException | NoSuchAlgorithmException e) {
throw new RuntimeException(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageView;

/**
* An ImageView that shrinks its larger dimension to become square.
*/
public class SquareImageView extends android.support.v7.widget.AppCompatImageView {
public class SquareImageView extends androidx.appcompat.widget.AppCompatImageView {
public SquareImageView(Context context) {
super(context);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:duration="250"
android:fromXDelta="0"
android:toXDelta="0" />
Loading