Add recaptcha
This commit is contained in:
1 parent
550d3735c7
commit
2c3fa31e91
29 files changed
+1591
-519
No files matched your search
@@ -17,6 +17,7 @@
|
||||
package com.hippo.ehviewer.client;
|
||||
|
||||
import android.support.annotation.Nullable;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.util.Pair;
|
||||
|
||||
@@ -120,13 +121,17 @@ public class EhEngine {
|
||||
}
|
||||
|
||||
public static String signIn(@Nullable EhClient.Task task, OkHttpClient okHttpClient,
|
||||
String username, String password) throws Exception {
|
||||
String username, String password, String recaptchaChallenge, String recaptchaResponse) throws Exception {
|
||||
FormBody.Builder builder = new FormBody.Builder()
|
||||
.add("UserName", username)
|
||||
.add("PassWord", password)
|
||||
.add("submit", "Log me in")
|
||||
.add("CookieDate", "1")
|
||||
.add("temporary_https", "off");
|
||||
if (!TextUtils.isEmpty(recaptchaChallenge) && !TextUtils.isEmpty(recaptchaResponse)) {
|
||||
builder.add("recaptcha_challenge_field", recaptchaChallenge);
|
||||
builder.add("recaptcha_response_field", recaptchaResponse);
|
||||
}
|
||||
String url = EhUrl.API_SIGN_IN;
|
||||
Log.d(TAG, url);
|
||||
Request request = new EhRequestBuilder(url, null != task ? task.getEhConfig() : Settings.getEhConfig())
|
||||
|
||||
Reference in new issue
Block a user