-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow "login" for google, needed because of their policy changes
- Loading branch information
Showing
6 changed files
with
233 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
app/src/fdroid/java/org/voidsink/anewjkuapp/mock/DummyLogin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* ____.____ __.____ ___ _____ | ||
* | | |/ _| | \ / _ \ ______ ______ | ||
* | | < | | / / /_\ \\____ \\____ \ | ||
* /\__| | | \| | / / | \ |_> > |_> > | ||
* \________|____|__ \______/ \____|__ / __/| __/ | ||
* \/ \/|__| |__| | ||
* | ||
* Copyright (c) 2023 Paul "Marunjar" Pretsch | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/> | ||
* | ||
*/ | ||
|
||
package org.voidsink.anewjkuapp.mock; | ||
|
||
import java.net.CookieStore; | ||
|
||
public class DummyLogin implements IDummyLogin { | ||
@Override | ||
public boolean isGoogleLogin(String user, String password) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public String getSessionId() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean isGoogleSession(String sessionId) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public void prepareCookies(CookieStore cookieStore, String url) { | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
app/src/google/java/org/voidsink/anewjkuapp/mock/DummyLogin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* ____.____ __.____ ___ _____ | ||
* | | |/ _| | \ / _ \ ______ ______ | ||
* | | < | | / / /_\ \\____ \\____ \ | ||
* /\__| | | \| | / / | \ |_> > |_> > | ||
* \________|____|__ \______/ \____|__ / __/| __/ | ||
* \/ \/|__| |__| | ||
* | ||
* Copyright (c) 2023 Paul "Marunjar" Pretsch | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/> | ||
* | ||
*/ | ||
|
||
package org.voidsink.anewjkuapp.mock; | ||
|
||
import java.net.CookieStore; | ||
import java.net.HttpCookie; | ||
import java.net.URI; | ||
import java.net.URISyntaxException; | ||
import java.util.List; | ||
|
||
public class DummyLogin implements IDummyLogin { | ||
|
||
private static final String USER = "google"; | ||
private static final String PASSWORD = "ThisIsAMockBecauseOfGooglePolicyWhichSuxx"; | ||
private static final String SESSION_ID = " e1f8f2c4-70ed-4c39-908e-89c3afc850e1"; | ||
|
||
@Override | ||
public boolean isGoogleLogin(String user, String password) { | ||
return USER.equals(user) && PASSWORD.equals(password); | ||
} | ||
|
||
@Override | ||
public String getSessionId() { | ||
return SESSION_ID; | ||
} | ||
|
||
@Override | ||
public boolean isGoogleSession(String sessionId) { | ||
return SESSION_ID.equals(sessionId); | ||
} | ||
|
||
@Override | ||
public void prepareCookies(CookieStore cookieStore, String url) { | ||
try { | ||
List<HttpCookie> cookies = cookieStore.get(new URI(url)); | ||
cookies.add(new HttpCookie("JSESSIONID", getSessionId())); | ||
} catch (URISyntaxException ignored) { | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
app/src/main/java/org/voidsink/anewjkuapp/mock/IDummyLogin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* ____.____ __.____ ___ _____ | ||
* | | |/ _| | \ / _ \ ______ ______ | ||
* | | < | | / / /_\ \\____ \\____ \ | ||
* /\__| | | \| | / / | \ |_> > |_> > | ||
* \________|____|__ \______/ \____|__ / __/| __/ | ||
* \/ \/|__| |__| | ||
* | ||
* Copyright (c) 2023 Paul "Marunjar" Pretsch | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/> | ||
* | ||
*/ | ||
|
||
package org.voidsink.anewjkuapp.mock; | ||
|
||
import java.net.CookieStore; | ||
|
||
public interface IDummyLogin { | ||
boolean isGoogleLogin(String user, String password); | ||
|
||
String getSessionId(); | ||
|
||
boolean isGoogleSession(String sessionId); | ||
|
||
void prepareCookies(CookieStore cookieStore, String url); | ||
} |