Android Open Source - NCUWirelessPassport N C T U Guest Loginer

From Project

Back to project page NCUWirelessPassport.


The source code is released under:

Apache License

If you think the Android project NCUWirelessPassport 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

/*from  w ww .  j  av a2s  .c  om*/
import android.content.Context;

import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;

import java.util.ArrayList;
import java.util.List;


 * Created by Davy on 3/22/14.
public class NCTUGuestLoginer extends WirelessLoginer {
    protected String getLoginURL() { return ""; }
    protected String getLoginSucceedURL() { return null; }
    protected String getLoginFailedURL() { return null; }
    protected InputStream getSSLCAStream() { return context.getResources().openRawResource(R.raw.securelogin_arubanetworks_com); }
    protected String getLoginSucceedMessage() { return "External Welcome Page"; }
    protected String getLoginFailedMessage() { return "Authentication failed"; }

    public boolean isSupport() {
        Account account = new Account(context);
        return !(account.getDomain().equals("iTaiwan") || account.getDomain().endsWith(""));

    public NCTUGuestLoginer(Context context) {

    protected List<NameValuePair> getLoginParams()
        List<NameValuePair> params = new ArrayList<NameValuePair>();
        Account account = new Account(context);

        params.add(new BasicNameValuePair("user", account.getUsername() + account.getDomain()));
        params.add(new BasicNameValuePair("password", account.getPassword()));
        params.add(new BasicNameValuePair("cmd", "authenticate"));
        return params;

Java Source Code List