// Path: app/src/pro/java/gdg/devfest/passwordmanager/model/LoginInteractor.java
// public class LoginInteractor {
//   private static final String AUTH_URL = "http://" + BuildConfig.REALM + "/auth";
//   private static final String SERVER_URL = "realm://" + BuildConfig.REALM + "/~/default";
// 
//   public Single<User> signIn(String userName, String password) {
//     return login(userName, password, false);
//   }
// 
//   public Single<User> signUp(String userName, String password) {
//     return login(userName, password, true);
//   }
// 
//   public void setRealmSyncConfiguration(User user) {
//     SyncConfiguration configuration = new SyncConfiguration.Builder(user, SERVER_URL).build();
//     Realm.setDefaultConfiguration(configuration);
//   }
// 
//   @NonNull private Single<User> login(String userName, String password, boolean createUser) {
//     return Single.create(singleSubscriber -> {
//       try {
//         Credentials credentials = Credentials.usernamePassword(userName, password, createUser);
//         User user = User.login(credentials, AUTH_URL);
//         singleSubscriber.onSuccess(user);
//       } catch (Exception e) {
//         singleSubscriber.onError(e);
//       }
//     });
//   }
// }


import gdg.devfest.passwordmanager.model.LoginInteractor;
import io.realm.Realm;
import io.realm.User;
package gdg.devfest.passwordmanager.framework;


public class ProApplication extends PasswordManagerApplication {
  @Override protected void initRealm() {
    Realm.init(this);

    User user = User.currentUser();

// Path: app/src/pro/java/gdg/devfest/passwordmanager/model/LoginInteractor.java
// public class LoginInteractor {
//   private static final String AUTH_URL = "http://" + BuildConfig.REALM + "/auth";
//   private static final String SERVER_URL = "realm://" + BuildConfig.REALM + "/~/default";
// 
//   public Single<User> signIn(String userName, String password) {
//     return login(userName, password, false);
//   }
// 
//   public Single<User> signUp(String userName, String password) {
//     return login(userName, password, true);
//   }
// 
//   public void setRealmSyncConfiguration(User user) {
//     SyncConfiguration configuration = new SyncConfiguration.Builder(user, SERVER_URL).build();
//     Realm.setDefaultConfiguration(configuration);
//   }
// 
//   @NonNull private Single<User> login(String userName, String password, boolean createUser) {
//     return Single.create(singleSubscriber -> {
//       try {
//         Credentials credentials = Credentials.usernamePassword(userName, password, createUser);
//         User user = User.login(credentials, AUTH_URL);
//         singleSubscriber.onSuccess(user);
//       } catch (Exception e) {
//         singleSubscriber.onError(e);
//       }
//     });
//   }
// }


// Path: app/src/pro/java/gdg/devfest/passwordmanager/framework/ProApplication.java
import gdg.devfest.passwordmanager.model.LoginInteractor;
import io.realm.Realm;
import io.realm.User;

package gdg.devfest.passwordmanager.framework;


public class ProApplication extends PasswordManagerApplication {
  @Override protected void initRealm() {
    Realm.init(this);

    User user = User.currentUser();

    if (user != null) new LoginInteractor().setRealmSyncConfiguration(user);