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

A URL change is all that is needed #3

Open
keithcrone opened this issue Feb 27, 2019 · 7 comments
Open

A URL change is all that is needed #3

keithcrone opened this issue Feb 27, 2019 · 7 comments

Comments

@keithcrone
Copy link

Hey @rmnoon (or anyone that makes it here),
Soraiyu figured out the url to fix the login problem to this widget. I choked through compiling the APK (not a programmer) with those changes and it works ok.

@rmnoon
Copy link
Owner

rmnoon commented Feb 27, 2019

oh, cool! can you submit a PR or describe the URL? If that works I can try and do a new build / Play Store submission.

@keithcrone
Copy link
Author

keithcrone commented Feb 27, 2019

in client/WFClient.java:

33 public static final String LOGIN_URL = "https://workflowy.com/ajax_login";

348 if (code != 200 || cookie.isEmpty() || sessionId == null) {
349 throw new BadLoginException();
350 }

Sorry. I understand the premise behind Github but it would probably take me so much longer to figure out how to submit the PR than just paste the few changes.

It's in the fork here: https://github.com/soraiyu/WorkflowyList/tree/feature/fix_url
You can probably just merge that file back, correct?

@twtu
Copy link

twtu commented May 19, 2019

Any chance this fix can be implemented and a new Google Play app put up? I'm sure I'm not the only one who really likes this app and would love to see it back. Unfortunately I logged out of my old version and now can't log in again :(

Thanks!

@rmnoon
Copy link
Owner

rmnoon commented May 20, 2019

A couple things:

  1. I got a Play Store copyright takedown from the Workflowy people because of the name and the icon which is the reason I had to pull the app itself.
  2. I've been really really busy with a new startup (Stellarite) and honestly haven't had the bandwidth to reinstall the Android SDK and get my whole environment spun up again. All the source is here if someone wants to submit a pull request with the url fix and then rebuild / post the APK.

@sersorrel
Copy link

It's not quite just a URL change that's required, but here is the patch I'm using (plus copious modifications to get it to build in current Android Studio, though the GUI will mostly walk you through that):

diff --git a/app/src/main/java/com/rmnoon/workflowy/client/WFClient.java b/app/src/main/java/com/rmnoon/workflowy/client/WFClient.java
index 5ec7e7438..bbce5401d 100644
--- a/app/src/main/java/com/rmnoon/workflowy/client/WFClient.java
+++ b/app/src/main/java/com/rmnoon/workflowy/client/WFClient.java
@@ -30,7 +30,7 @@ public class WFClient {

     public static final Logger log = Logger.getLogger(WFClient.class.getName());

-    public static final String LOGIN_URL = "https://workflowy.com/accounts/login/";
+    public static final String LOGIN_URL = "https://workflowy.com/ajax_login";
     public static final String API_URL = "https://workflowy.com/%s";
     public static final String USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.94 Safari/537.36";
     public static final int TIMEOUT_MS = 2500;
@@ -334,7 +334,6 @@ public class WFClient {
                 .post(new FormBody.Builder()
                         .add("username", username)
                         .add("password", password)
-                        .add("next", "")
                         .build()
                 )
                 .build();
@@ -342,10 +341,9 @@ public class WFClient {

         int code = res.code();
         Map<String, String> cookie = Utils.parseCookie(res.header("Set-Cookie"));
-        String locationHeader = res.header("Location");
         String sessionId = cookie.get("sessionid");

-        if (code != 302 || cookie.isEmpty() || !String.format(API_URL, "").equals(locationHeader) || sessionId == null) {
+        if (code != 200 || cookie.isEmpty() || sessionId == null) {
             throw new BadLoginException();
         }
         synchronized (this) {

The summary is that the new login endpoint is located at /ajax_login rather than /accounts/login/, and it returns 200 on success rather than 302 (and as such there's no Location header any more, and doesn't need a next parameter).

@ErranticSam
Copy link

ErranticSam commented Mar 22, 2022

A couple things:

  1. I got a Play Store copyright takedown from the Workflowy people because of the name and the icon which is the reason I had to pull the app itself.
  2. I've been really really busy with a new startup (Stellarite) and honestly haven't had the bandwidth to reinstall the Android SDK and get my whole environment spun up again. All the source is here if someone wants to submit a pull request with the url fix and then rebuild / post the APK.

maybe is it possible to release it on other repositories, like F-Droid or via an .apk file here
I'm aware that there were any response and probably any work or update for +5 years, but if by any chance you're still working on this, I think your widget will still be welcome

@joboyx
Copy link

joboyx commented Mar 28, 2022

+1 for upload to external appstore or just rebundle the app with different name+icon.

"WidgetFlowy" would be a good name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants