All Projects → openMF → mifos-passcode

openMF / mifos-passcode

Licence: other
Library for passcode generation on different mobile apps.

Programming Languages

java
68154 projects - #9 most used programming language
kotlin
9241 projects

mobile-passcode

Library for passcode implementation along with an optional additional feature to ask for passcode when your app resumes from background. (Works with minSDK >= 15)

Usage

In order to use the library

1. Gradle dependency

  • Add the following to your project level build.gradle:
allprojects {
	repositories {
		jcenter()
	}
}
  • Add this to your app build.gradle:
dependencies {
	implementation 'com.mifos.mobile:mifos-passcode:1.0.0'
}

Example

For a basic implementation of the PassCode Screen

public class PassCodeActivity extends MifosPassCodeActivity {

    @Override
    public int getLogo() {
        //logo to be shown on the top
        return R.drawable.your_logo;
    }

    @Override
    public void startNextActivity() {
        //start intent for the next activity
    }

    @Override
    public void startLoginActivity() {
        //start intent for the login or previous activity
    }

    @Override
    public void showToaster(View view, int msg) {
        //show prompts in toast or using snackbar
    }

    @Override
    public int getEncryptionType() {
        return EncryptionUtil.DEFAULT;
    }

}

There are 4 different types of encryption methods available with respect to our Android Projects:

  • DEFAULT
  • MOBILE_BANKING
  • ANDROID_CLIENT
  • FINERACT_CN

To access the passcode stored use PasscodePreferencesHelper

PasscodePreferencesHelper pref = new PasscodePreferencesHelper(context);
pref.getPassCode();// it will return encrypted passcode according to the encryption type chosen.

Asking for the passcode when your app resumes from background

Create a BaseActivity which should extend BasePassCodeActivity and extend this class for all your activities

public class BaseActivity extends BasePassCodeActivity {

    @Override
    public Class getPassCodeClass() {
        //name of the activity which extends MifosPassCodeActivity
        return PassCodeActivity.class;
    }
}

In your application class add:

public class MifosApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
        //Initialize ForegroundChecker
        ForegroundChecker.init(this);
    }
}

For complete example click here

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].