Android Open Source - nfcunlocker Unlock Method Factory






From Project

Back to project page nfcunlocker.

License

The source code is released under:

Apache License

If you think the Android project nfcunlocker listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.steelrat.nfcunlocker.unlockmethods;
//from  ww w .j a  v  a  2s. c om
import android.app.Activity;

public class UnlockMethodFactory {
  public static UnlockMethod getUnlockMethod(Activity activity, String methodName) {
    UnlockMethod unlockMethod = null;
    
    if (methodName.equals("FlagUnlock")) {
      unlockMethod = new FlagUnlock(activity);
    } else if (methodName.equals("InputUnlock")) {
      unlockMethod = new InputUnlock(activity);
    } else if (methodName.equals("KeyguardUnlock")) {
      unlockMethod = new KeyguardUnlock(activity);
    }
    
    return unlockMethod;
  }
  
  public static String getUnlockMethodName(UnlockMethod unlockMethod) {
    String name = null;
    if (unlockMethod != null) {
      name = unlockMethod.getClass().getSimpleName();
    }
    
    return name;
  }
}




Java Source Code List

com.steelrat.nfcunlocker.AddActivity.java
com.steelrat.nfcunlocker.DiscoveredActivity.java
com.steelrat.nfcunlocker.MainActivity.java
com.steelrat.nfcunlocker.NFCApplication.java
com.steelrat.nfcunlocker.helpers.AppDeviceAdminReceiver.java
com.steelrat.nfcunlocker.helpers.TagsStorage.java
com.steelrat.nfcunlocker.settingsactivity.SettingsActivityBase.java
com.steelrat.nfcunlocker.settingsactivity.SettingsActivityOA.java
com.steelrat.nfcunlocker.settingsactivity.SettingsActivity.java
com.steelrat.nfcunlocker.unlockmethods.DevicePolicyUnlockMethod.java
com.steelrat.nfcunlocker.unlockmethods.FlagUnlock.java
com.steelrat.nfcunlocker.unlockmethods.InputUnlock.java
com.steelrat.nfcunlocker.unlockmethods.KeyguardUnlock.java
com.steelrat.nfcunlocker.unlockmethods.UnlockMethodFactory.java
com.steelrat.nfcunlocker.unlockmethods.UnlockMethod.java