forked from github/wulkanowy-mirror
Step 3 complete
This commit is contained in:
parent
8a8f1359d1
commit
e1b0c87aa2
@ -3,6 +3,7 @@
|
||||
package="leszcz_team.wulkanowy">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
|
@ -7,9 +7,11 @@ import android.widget.Toast;
|
||||
import org.jsoup.Connection;
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Document;
|
||||
import org.jsoup.nodes.Element;
|
||||
import org.jsoup.select.Elements;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.util.Map;
|
||||
|
||||
public class Login extends AsyncTask<Void, Void, Void> {
|
||||
@ -19,6 +21,13 @@ public class Login extends AsyncTask<Void, Void, Void> {
|
||||
String county;
|
||||
Activity activity;
|
||||
String userMesage;
|
||||
String wresults;
|
||||
String wa;
|
||||
Document doc4;
|
||||
String htmlDefault = "https://cufs.vulcan.net.pl/Default/Account/LogOn";
|
||||
String htmlStage2 = "https://cufs.vulcan.net.pl/{locationID}/FS/LS?wa=wsignin1.0&wtrealm=https://uonetplus.vulcan.net.pl/{locationID}/LoginEndpoint.aspx&wctx=https://uonetplus.vulcan.net.pl/{locationID}/LoginEndpoint.aspx";
|
||||
String htmlStage3 = "https://uonetplus.vulcan.net.pl/{locationID}/LoginEndpoint.aspx";
|
||||
|
||||
|
||||
public Login(String emailT, String passwordT, String countyT, Activity mainAC){
|
||||
|
||||
@ -32,8 +41,6 @@ public class Login extends AsyncTask<Void, Void, Void> {
|
||||
@Override
|
||||
protected Void doInBackground(Void... params) {
|
||||
|
||||
String htmlDefault = "https://cufs.vulcan.net.pl/Default/Account/LogOn";
|
||||
|
||||
try {
|
||||
Connection.Response initial = Jsoup
|
||||
.connect(htmlDefault)
|
||||
@ -46,6 +53,28 @@ public class Login extends AsyncTask<Void, Void, Void> {
|
||||
|
||||
CheckPass checkPass = new CheckPass(initial);
|
||||
userMesage = checkPass.start();
|
||||
|
||||
county = county.replace("ł", "l");
|
||||
htmlStage2 = htmlStage2.replace("{locationID}", county);
|
||||
|
||||
Document doc = Jsoup.connect(htmlStage2)
|
||||
.cookies(loginCookies)
|
||||
.get();
|
||||
|
||||
Elements wresultsInput = doc.select("input[name=wresult]");
|
||||
wresults = wresultsInput.attr("value");
|
||||
|
||||
Elements waInput = doc.select("input[name=wa]");
|
||||
wa = waInput.attr("value");
|
||||
|
||||
htmlStage3 = htmlStage3.replace("{locationID}", county);
|
||||
|
||||
doc4 = Jsoup.connect(htmlStage3)
|
||||
.data("wa", wa)
|
||||
.data("wresults", wresults)
|
||||
.post();
|
||||
|
||||
|
||||
}
|
||||
catch (IOException e){
|
||||
userMesage = e.toString();
|
||||
@ -57,7 +86,7 @@ public class Login extends AsyncTask<Void, Void, Void> {
|
||||
protected void onPostExecute(Void result) {
|
||||
super.onPostExecute(result);
|
||||
if (!userMesage.isEmpty()){
|
||||
Toast.makeText(activity, userMesage, Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(activity, userMesage , Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user