Skip to content

Commit

Permalink
修正訪客登入判斷, 新增燕巢校區其他網段, 修正校區判斷方式 (改為IP網段)
Browse files Browse the repository at this point in the history
  • Loading branch information
hearsilent committed Jun 9, 2015
1 parent c2bbadd commit a44c997
Show file tree
Hide file tree
Showing 6 changed files with 353 additions and 481 deletions.
510 changes: 180 additions & 330 deletions KUASWifiAutoLogin/.idea/workspace.xml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions KUASWifiAutoLogin/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "tw.edu.kuas.wifiautologin"
minSdkVersion 9
targetSdkVersion 22
versionCode 211
versionName "2.1.1"
versionCode 212
versionName "2.1.2"
}
buildTypes {
release {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ private void saveAndLogin() {
String password = mPasswordEditText.getText().toString();
if (mUsernameEditText.getText().toString().equals("") || mPasswordEditText.getText().toString().equals(""))
{
userData = tranUser("0937808285@guest@guest");
userData = tranUser("0937808285@guest");
password = "1306";
}
else
Expand Down Expand Up @@ -169,15 +169,18 @@ private String tranUser(String user)
return user + ",1,Student";
else
return user + ",@gm.kuas.edu.tw,Student";
else if (user.length() == 10)
else if (user.length() == 10 && !user.substring(0,2).equals("09"))
if (Integer.parseInt(user.substring(1,4)) <= 102)
return user + "@kuas.edu.tw" + ",1,Student";
else
return user + "@gm.kuas.edu.tw" + ",@gm.kuas.edu.tw,Student";
else if (user.contains("@") && !user.contains("@guest"))
return user + ",,Cyber";
else
return user + ",,Guest";
if (user.contains("@guest"))
return user + ",,Guest";
else
return user + "@guest,,Guest";
}

private void showMessage(CharSequence message, boolean shake) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,22 @@ public void onReceive(final Context context, Intent intent) {

private String tranUser(String user)
{
if (user.contains("@kuas.edu.tw") || user.contains("@gm.kuas.edu.tw"))
if (user.contains("@kuas.edu.tw"))
return user + ",1,Student";
else
return user + ",@gm.kuas.edu.tw,Student";
else if (user.length() == 10)
if (Integer.parseInt(user.substring(1,4)) <= 102)
return user + "@kuas.edu.tw" + ",1,Student";
else
return user + "@gm.kuas.edu.tw" + ",@gm.kuas.edu.tw,Student";
else if (user.contains("@") && !user.contains("@guest"))
return user + ",,Cyber";
else
return user + ",,Guest";
if (user.contains("@kuas.edu.tw") || user.contains("@gm.kuas.edu.tw"))
if (user.contains("@kuas.edu.tw"))
return user + ",1,Student";
else
return user + ",@gm.kuas.edu.tw,Student";
else if (user.length() == 10 && !user.substring(0,2).equals("09"))
if (Integer.parseInt(user.substring(1,4)) <= 102)
return user + "@kuas.edu.tw" + ",1,Student";
else
return user + "@gm.kuas.edu.tw" + ",@gm.kuas.edu.tw,Student";
else if (user.contains("@") && !user.contains("@guest"))
return user + ",,Cyber";
else
if (user.contains("@guest"))
return user + ",,Guest";
else
return user + "@guest,,Guest";
}
}
Loading

0 comments on commit a44c997

Please sign in to comment.