|
|
@ -35,7 +35,7 @@ import java.util.regex.Matcher; |
|
|
|
import java.util.regex.Pattern; |
|
|
|
|
|
|
|
|
|
|
|
public class WebActivity extends AppCompatActivity |
|
|
|
public class CabinetActivity extends AppCompatActivity |
|
|
|
implements NavigationView.OnNavigationItemSelectedListener { |
|
|
|
|
|
|
|
|
|
|
@ -272,7 +272,7 @@ public class WebActivity extends AppCompatActivity |
|
|
|
// НЕИЗВЕСТНОЕ ИСКЛЮЧЕНИЕ
|
|
|
|
public void unknownState(int currentState){ |
|
|
|
Log.e("unknownState","Не удалось получить ссылки на странице студента"); |
|
|
|
Log.e("unknownState",browser.getUrl()); |
|
|
|
Log.e("unknownState",getURL()); |
|
|
|
finish(); |
|
|
|
} |
|
|
|
// АВТОРИЗАЦИЯ
|
|
|
@ -283,8 +283,8 @@ public class WebActivity extends AppCompatActivity |
|
|
|
Log.i("Auth|Login", login); |
|
|
|
Log.i("Auth|Password", password); |
|
|
|
//console("Auth|Password",MainActivity.password.getText().toString());
|
|
|
|
//browser.loadUrl("javascript:apex.submit({request:'LOGIN',set:{'P101_USERNAME':'s75389','P101_PASSWORD':'v97KFxmP'}});");
|
|
|
|
browser.loadUrl("javascript:apex.submit({request:'LOGIN',set:{'P101_USERNAME':'"+login+"','P101_PASSWORD':'"+password+"'}});"); |
|
|
|
//loadSite("javascript:apex.submit({request:'LOGIN',set:{'P101_USERNAME':'s75389','P101_PASSWORD':'v97KFxmP'}});");
|
|
|
|
loadSite("javascript:apex.submit({request:'LOGIN',set:{'P101_USERNAME':'"+login+"','P101_PASSWORD':'"+password+"'}});"); |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
@ -293,7 +293,7 @@ public class WebActivity extends AppCompatActivity |
|
|
|
if(taskFinished) return 127; |
|
|
|
Intent intent = new Intent(); |
|
|
|
Log.i("sessionActive","Checking session"); |
|
|
|
String a = parser.cutLine("http://web-iais.admin.tstu.ru:7777/zion/f?p=503:",":",browser.getUrl()); |
|
|
|
String a = parser.cutLine("http://web-iais.admin.tstu.ru:7777/zion/f?p=503:",":",getURL()); |
|
|
|
switch (a){ |
|
|
|
case "LOGIN_DESKTOP": |
|
|
|
Log.i("sessionActive","Окно авторизации"); |
|
|
@ -308,7 +308,7 @@ public class WebActivity extends AppCompatActivity |
|
|
|
case "1": |
|
|
|
Log.i("sessionActive","Страница студента"); |
|
|
|
intent.putExtra("error","Вход производился успешно"); |
|
|
|
MainURL = browser.getUrl(); |
|
|
|
MainURL = getURL(); |
|
|
|
taskGenerator(2); |
|
|
|
return 2; |
|
|
|
case "40": |
|
|
@ -322,11 +322,11 @@ public class WebActivity extends AppCompatActivity |
|
|
|
case "43": |
|
|
|
Log.i("sessionActive","Страница - Рейтинг|Главная"); |
|
|
|
String s = parser.cutLine("","503:",MainURL) + "503:43:" + parser.cutLine(":1:","",MainURL)+":"; |
|
|
|
if(parser.cutLine(s,":NO:",browser.getUrl()).equals("RATE_GROUP")) { |
|
|
|
if(parser.cutLine(s,":NO:", getURL()).equals("RATE_GROUP")) { |
|
|
|
taskGenerator(6); |
|
|
|
return 6; |
|
|
|
} |
|
|
|
if(parser.cutLine(s,":NO:",browser.getUrl()).equals("RATE_INST")) { |
|
|
|
if(parser.cutLine(s,":NO:", getURL()).equals("RATE_INST")) { |
|
|
|
taskGenerator(7); |
|
|
|
return 7; |
|
|
|
} |
|
|
@ -350,7 +350,7 @@ public class WebActivity extends AppCompatActivity |
|
|
|
MainHTML); |
|
|
|
studentName.setText(parser.cutLine(""," /",studNameGroup)); |
|
|
|
studentGroup.setText("Группа: " + parser.cutLine("/ ","",studNameGroup)); |
|
|
|
browser.loadUrl("javascript:apex.submit('T_ЗАНЯТИЯ/ОЦЕНКИ');"); |
|
|
|
loadSite("javascript:apex.submit('T_ЗАНЯТИЯ/ОЦЕНКИ');"); |
|
|
|
break; |
|
|
|
case 3: |
|
|
|
AdditionalHTML = siteBuf; |
|
|
@ -358,11 +358,11 @@ public class WebActivity extends AppCompatActivity |
|
|
|
parser.cutLine("<td headers=\\\"BRS\\\"><a href=\\\"","\" title=\\\"Просмотр журналов\\\">",AdditionalHTML); |
|
|
|
RateValueURL = "http://web-iais.admin.tstu.ru:7777/zion/" + |
|
|
|
parser.cutLine("<td headers=\\\"RTG\\\"><a href=\\\"","\\\" title=\\\"Просмотр успеваемости\\\">",AdditionalHTML); |
|
|
|
browser.loadUrl(JournalURL); |
|
|
|
loadSite(JournalURL); |
|
|
|
break; |
|
|
|
case 4: |
|
|
|
JournalHTML = siteBuf; |
|
|
|
browser.loadUrl(RateValueURL); |
|
|
|
loadSite(RateValueURL); |
|
|
|
break; |
|
|
|
case 5: |
|
|
|
RateValueHTML = siteBuf; |
|
|
@ -370,12 +370,12 @@ public class WebActivity extends AppCompatActivity |
|
|
|
studentRate.setText("Балл: " + rate); |
|
|
|
GroupRateURL = "http://web-iais.admin.tstu.ru:7777/zion/" + parser.cutLine("><td headers=\\\"GROUP_NAME\\\"><a href=\\\"","\\\">",RateValueHTML); |
|
|
|
FacultyRateURL = "http://web-iais.admin.tstu.ru:7777/zion/" + parser.cutLine("<td headers=\\\"INST\\\"><a href=\\\"","\\\">", RateValueHTML); |
|
|
|
browser.loadUrl(GroupRateURL); |
|
|
|
loadSite(GroupRateURL); |
|
|
|
break; |
|
|
|
case 6: |
|
|
|
GroupRateHTML = siteBuf; |
|
|
|
fillGroup(); |
|
|
|
browser.loadUrl(FacultyRateURL); |
|
|
|
loadSite(FacultyRateURL); |
|
|
|
break; |
|
|
|
case 7: |
|
|
|
FacultyRateHTML = siteBuf; |
|
|
@ -472,7 +472,6 @@ public class WebActivity extends AppCompatActivity |
|
|
|
|
|
|
|
@TargetApi(19) |
|
|
|
public void getHTML(){ |
|
|
|
|
|
|
|
browser.evaluateJavascript("javascript:document.documentElement.outerHTML;", new ValueCallback<String>() { |
|
|
|
@Override |
|
|
|
public void onReceiveValue(String s) { |
|
|
@ -484,6 +483,10 @@ public class WebActivity extends AppCompatActivity |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public String getURL(){ |
|
|
|
return browser.getUrl(); |
|
|
|
} |
|
|
|
|
|
|
|
public void encodeHTML(){ |
|
|
|
if(siteBuf != null){ |
|
|
|
OldParser parser = new OldParser(); |
|
|
@ -498,7 +501,7 @@ public class WebActivity extends AppCompatActivity |
|
|
|
@Override |
|
|
|
public void onPageFinished(WebView view, String url) { |
|
|
|
getHTML(); |
|
|
|
Log.i("onPageFinished", browser.getUrl()); |
|
|
|
Log.i("onPageFinished", getURL()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |