mirror of
https://github.com/wulkanowy/wulkanowy.git
synced 2025-01-31 15:18:20 +01:00
Step 3 complete
This commit is contained in:
parent
8a8f1359d1
commit
e1b0c87aa2
@ -3,6 +3,7 @@
|
|||||||
package="leszcz_team.wulkanowy">
|
package="leszcz_team.wulkanowy">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
|
@ -7,9 +7,11 @@ import android.widget.Toast;
|
|||||||
import org.jsoup.Connection;
|
import org.jsoup.Connection;
|
||||||
import org.jsoup.Jsoup;
|
import org.jsoup.Jsoup;
|
||||||
import org.jsoup.nodes.Document;
|
import org.jsoup.nodes.Document;
|
||||||
|
import org.jsoup.nodes.Element;
|
||||||
import org.jsoup.select.Elements;
|
import org.jsoup.select.Elements;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStreamWriter;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class Login extends AsyncTask<Void, Void, Void> {
|
public class Login extends AsyncTask<Void, Void, Void> {
|
||||||
@ -19,6 +21,13 @@ public class Login extends AsyncTask<Void, Void, Void> {
|
|||||||
String county;
|
String county;
|
||||||
Activity activity;
|
Activity activity;
|
||||||
String userMesage;
|
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){
|
public Login(String emailT, String passwordT, String countyT, Activity mainAC){
|
||||||
|
|
||||||
@ -32,8 +41,6 @@ public class Login extends AsyncTask<Void, Void, Void> {
|
|||||||
@Override
|
@Override
|
||||||
protected Void doInBackground(Void... params) {
|
protected Void doInBackground(Void... params) {
|
||||||
|
|
||||||
String htmlDefault = "https://cufs.vulcan.net.pl/Default/Account/LogOn";
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Connection.Response initial = Jsoup
|
Connection.Response initial = Jsoup
|
||||||
.connect(htmlDefault)
|
.connect(htmlDefault)
|
||||||
@ -46,6 +53,28 @@ public class Login extends AsyncTask<Void, Void, Void> {
|
|||||||
|
|
||||||
CheckPass checkPass = new CheckPass(initial);
|
CheckPass checkPass = new CheckPass(initial);
|
||||||
userMesage = checkPass.start();
|
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){
|
catch (IOException e){
|
||||||
userMesage = e.toString();
|
userMesage = e.toString();
|
||||||
@ -57,7 +86,7 @@ public class Login extends AsyncTask<Void, Void, Void> {
|
|||||||
protected void onPostExecute(Void result) {
|
protected void onPostExecute(Void result) {
|
||||||
super.onPostExecute(result);
|
super.onPostExecute(result);
|
||||||
if (!userMesage.isEmpty()){
|
if (!userMesage.isEmpty()){
|
||||||
Toast.makeText(activity, userMesage, Toast.LENGTH_LONG).show();
|
Toast.makeText(activity, userMesage , Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user