// Path: app/src/main/java/party/minge/reddit/client/Manager.java
// @EBean(scope = EBean.Scope.Singleton)
// public class Manager {
//     @Bean(ResFactory.class)
//     protected UserAgentFactory userAgentFactory;
// 
//     @Bean(ResFactory.class)
//     protected CredentialFactory credentialFactory;
// 
//     @Bean(UserlessCredentialFactory.class)
//     protected CredentialFactory anonymousCredentialFactory;
// 
//     protected RedditClient redditClient;
// 
//     protected AuthenticationManager authenticationManager;
// 
//     protected AccountManager accountManager;
// 
//     @Bean(PreferenceTokenStore.class)
//     protected TokenStore tokenStore;
// 
//     @AfterInject
//     public void afterInject() {
//         this.redditClient = new RedditClient(this.userAgentFactory.getUserAgent());
//         this.authenticationManager = AuthenticationManager.get();
//         this.authenticationManager.init(this.redditClient, new RefreshTokenHandler(this.tokenStore, this.redditClient));
//         this.accountManager = new AccountManager(this.redditClient);
//     }
// 
//     /**
//      * Anonymously authenticates if required.
//      * If already authenticated, does not re-authenticate.
//      *
//      * @param authenticationCallback Methods to call on success or failure.
//      */
//     public void authenticateIfRequired(AuthenticationCallback authenticationCallback) {
//         AuthenticationState state = AuthenticationManager.get().checkAuthState();
// 
//         if (state == AuthenticationState.READY) {
//             authenticationCallback.onSuccessfulAuthentication();
//             return;
//         }
// 
//         if (state == AuthenticationState.NEED_REFRESH) {
//             try {
//                 this.authenticationManager.refreshAccessToken(this.getCredentials());
//                 authenticationCallback.onSuccessfulAuthentication();
//             } catch (Exception ex) {
//                 authenticationCallback.onFailedAuthentication(ex);
//             }
// 
//             return;
//         }
// 
//         try {
//             OAuthData authData = this.getClient().getOAuthHelper().easyAuth(this.getAnonymousCredentials());
//             this.getClient().authenticate(authData);
// 
//             authenticationCallback.onSuccessfulAuthentication();
//         } catch (Exception ex) {
//             authenticationCallback.onFailedAuthentication(ex);
//         }
//     }
// 
//     public RedditClient getClient() {
//         return this.redditClient;
//     }
// 
//     public AccountManager getAccountManager() {
//         return this.accountManager;
//     }
// 
//     public AuthenticationManager getAuthenticationManager() {
//         return this.authenticationManager;
//     }
// 
//     public Credentials getCredentials() {
//         return this.credentialFactory.getCredentials();
//     }
// 
//     public Credentials getAnonymousCredentials() {
//         return this.anonymousCredentialFactory.getCredentials();
//     }
// }


import android.app.Activity;
import android.graphics.Bitmap;
import android.util.Log;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Toast;
import net.dean.jraw.http.oauth.Credentials;
import net.dean.jraw.http.oauth.OAuthData;
import net.dean.jraw.http.oauth.OAuthException;
import net.dean.jraw.http.oauth.OAuthHelper;
import org.androidannotations.annotations.AfterInject;
import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.Background;
import org.androidannotations.annotations.Bean;
import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.UiThread;
import org.androidannotations.annotations.ViewById;
import java.net.URL;
import party.minge.reddit.client.Manager;
package party.minge.reddit;






@EActivity(R.layout.activity_login)
public class LoginActivity extends Activity {
    @ViewById
    protected WebView webviewLogin;

    @Bean
// Path: app/src/main/java/party/minge/reddit/client/Manager.java
// @EBean(scope = EBean.Scope.Singleton)
// public class Manager {
//     @Bean(ResFactory.class)
//     protected UserAgentFactory userAgentFactory;
// 
//     @Bean(ResFactory.class)
//     protected CredentialFactory credentialFactory;
// 
//     @Bean(UserlessCredentialFactory.class)
//     protected CredentialFactory anonymousCredentialFactory;
// 
//     protected RedditClient redditClient;
// 
//     protected AuthenticationManager authenticationManager;
// 
//     protected AccountManager accountManager;
// 
//     @Bean(PreferenceTokenStore.class)
//     protected TokenStore tokenStore;
// 
//     @AfterInject
//     public void afterInject() {
//         this.redditClient = new RedditClient(this.userAgentFactory.getUserAgent());
//         this.authenticationManager = AuthenticationManager.get();
//         this.authenticationManager.init(this.redditClient, new RefreshTokenHandler(this.tokenStore, this.redditClient));
//         this.accountManager = new AccountManager(this.redditClient);
//     }
// 
//     /**
//      * Anonymously authenticates if required.
//      * If already authenticated, does not re-authenticate.
//      *
//      * @param authenticationCallback Methods to call on success or failure.
//      */
//     public void authenticateIfRequired(AuthenticationCallback authenticationCallback) {
//         AuthenticationState state = AuthenticationManager.get().checkAuthState();
// 
//         if (state == AuthenticationState.READY) {
//             authenticationCallback.onSuccessfulAuthentication();
//             return;
//         }
// 
//         if (state == AuthenticationState.NEED_REFRESH) {
//             try {
//                 this.authenticationManager.refreshAccessToken(this.getCredentials());
//                 authenticationCallback.onSuccessfulAuthentication();
//             } catch (Exception ex) {
//                 authenticationCallback.onFailedAuthentication(ex);
//             }
// 
//             return;
//         }
// 
//         try {
//             OAuthData authData = this.getClient().getOAuthHelper().easyAuth(this.getAnonymousCredentials());
//             this.getClient().authenticate(authData);
// 
//             authenticationCallback.onSuccessfulAuthentication();
//         } catch (Exception ex) {
//             authenticationCallback.onFailedAuthentication(ex);
//         }
//     }
// 
//     public RedditClient getClient() {
//         return this.redditClient;
//     }
// 
//     public AccountManager getAccountManager() {
//         return this.accountManager;
//     }
// 
//     public AuthenticationManager getAuthenticationManager() {
//         return this.authenticationManager;
//     }
// 
//     public Credentials getCredentials() {
//         return this.credentialFactory.getCredentials();
//     }
// 
//     public Credentials getAnonymousCredentials() {
//         return this.anonymousCredentialFactory.getCredentials();
//     }
// }


// Path: app/src/main/java/party/minge/reddit/LoginActivity.java
import android.app.Activity;
import android.graphics.Bitmap;
import android.util.Log;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Toast;
import net.dean.jraw.http.oauth.Credentials;
import net.dean.jraw.http.oauth.OAuthData;
import net.dean.jraw.http.oauth.OAuthException;
import net.dean.jraw.http.oauth.OAuthHelper;
import org.androidannotations.annotations.AfterInject;
import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.Background;
import org.androidannotations.annotations.Bean;
import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.UiThread;
import org.androidannotations.annotations.ViewById;
import java.net.URL;
import party.minge.reddit.client.Manager;

package party.minge.reddit;






@EActivity(R.layout.activity_login)
public class LoginActivity extends Activity {
    @ViewById
    protected WebView webviewLogin;

    @Bean
    protected Manager manager;