Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Add Exhentai cookies into settings #159

Closed
Solipso opened this issue Nov 9, 2020 · 7 comments
Closed

[Feature Request] Add Exhentai cookies into settings #159

Solipso opened this issue Nov 9, 2020 · 7 comments

Comments

@Solipso
Copy link

Solipso commented Nov 9, 2020

Why/User Benefit/User Problem

Currently, after exhentai login, app automatically gets cookies and saves some of them as preferences (login and password hash, as well as igneous). Problem here is that sometimes exhentai returns igneous value "mystery", which means no access and white screen on webview. After that cookie is saved, you only get to exit from exhentai, clear cookies (or all data completely) and try to login again.
Old exhentai users have their cookies info saved, so they should be able to bypass unknown/random white screen after successful logins into their accounts on new devices by entering igneous value themselves, thus removing random factor of getting correct cookie.

What/Requirements

One way would be to ask for igneous cookie right before login webview. Leaving that dialogue string empty would default to asking the site for cookie.
Another way would be to add cookie strings into exhentai settings, allowing users to change their value without having to look for tachi's preferences. After change tachi would have to clear any exhentai cookies and add new ones from the settings.

@Solipso
Copy link
Author

Solipso commented Nov 14, 2020

Update

Looked into ways to implement this, and the first way I described could be implemented by doing following:

(mind you, never coded for android, nevermind Kotlin, so... sorry)

in master/app/src/main/java/exh/ui/login/LoginController.kt, in function applyExHentaiCookies(url: String): Boolean, after checking for missing cookies it would be nice to insert following:

if (igneous == "mystery") {
/* AlertDialog with EditText, asking user to input igneous value.*\
} 

Leaving EditText NULL, pressing back or canceling will result in login fail (return false; should work) and asking to clear cookies before attempting again (or automatically clearing exhentai related cookies, if needed. Don't know if this webview shares cookies with browse one, or if webview can share cookies at all).
If EditText was entered correctly, for simplicity reasons, bootleg solution would be to accept anything but null, and leave another dialogue, asking to relaunch app (if needed for updating cookies from preferences), as well as saying that should igneous value be entered incorrectly, user should relogin once again.
Not bootleg(?) solution - launch webview once again to check whether it loads gallery or gives white screen, and base login success or fail on that.

@jobobby04
Copy link
Owner

What is the benefit of having users input it themselves, I don't see a way for users to get this value

@Solipso
Copy link
Author

Solipso commented Nov 16, 2020

Almost any browser with extension support has something like "Cookie manager" extension, which allows to browse (and sometimes change) existing cookies. So most of users with confirmed access (say, on PC Chrome) can go and look it up. Instructions for that can be included to the dialogue.

As for benefit - much easier login to exhentai, be it completely new tachi user, or migrating to new device, considering that current backup does not migrate preferences. (As far as I know, at least. I don't know whether updated full backup stores cookies as well).

@jobobby04
Copy link
Owner

I get that you can get it from your browser, I just don't think we should provide this for a 'normal user'. People who can successfully login on the browser will generally be able to successfully login in SY. People who cant, which seems to be because of the igneous cookie based on what you have said, generally cant login on the browser either

@Solipso
Copy link
Author

Solipso commented Nov 16, 2020

"Generally" is the problem here.

Day before i started this issue, i switched to new Samsung device. I don't want to lose Knox warancy, so I cannot just edit cookies where they are saved usually, meaning that I've got 3 solutions to this problem:

  1. Go with other device which I can safely root.

  2. Repackage apk, changing it to "debuggable" and then changing preferences via adb. (For first time, from second - just repackage so update can be installed) <-- my current situation

  3. Try until I get lucky and get correct cookie.

All 3 are... well, shitty, because first costs money, second is troublesome (and incomprehensible for most users), and third is unreliable, coming from personal experience.

So, as a solution, I propose explaining that, well, if user sees "Enter igneous value" prompt, he either has no access to exhentai (if he didn't access it before from some other browser, asking them to wait a week or two before trying again, preferably on browser with Ext. support, so he can save his cookies), or simply unlucky (and ask him to enter the cookie, which he can find with cookie manager extension on most browsers).

Honestly idea came after wasting hour of resetting cookies, resetting whole app storage data, reinstalling and trying to login. The other reason I propose exactly that is only because i remember EHViewer (which is deprecated from 2019, IIRC) where you could login by simply entering all 3 cookies (though i would imagine that adding new login option via entering cookies would be much more troublesome for you, and entering hashes would be no less troublesome for user).

Also, adding this prompt would also explain to users why after successful login they can't see anything in Exhentai Browse, possibly removing that one question from Discord.

@jobobby04
Copy link
Owner

Should be addressed by e500d0b
It adds a option to pass a igneous cookie under the advanced button of the Exh login menu, which should cover all your needs

@jobobby04
Copy link
Owner

jobobby04 commented May 12, 2021

I may come back to this and address some of your suggestions though, like notifying the user that the igneous cookie may not work or throwing a error in browse if the cookie is detected to be "mystery"

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants