WorkflowyList icon indicating copy to clipboard operation
WorkflowyList copied to clipboard

A URL change is all that is needed

Open keithcrone opened this issue 5 years ago • 7 comments

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.

keithcrone avatar Feb 27 '19 22:02 keithcrone

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.

rmnoon avatar Feb 27 '19 22:02 rmnoon

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?

keithcrone avatar Feb 27 '19 23:02 keithcrone

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!

twtu avatar May 19 '19 19:05 twtu

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.

rmnoon avatar May 20 '19 03:05 rmnoon

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).

sersorrel avatar Nov 11 '19 01:11 sersorrel

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

ErranticSam avatar Mar 22 '22 13:03 ErranticSam

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

"WidgetFlowy" would be a good name.

joboyx avatar Mar 28 '22 14:03 joboyx