From 37ef3f7fd04e5fddc41d67cad78ef77244a8ea3d Mon Sep 17 00:00:00 2001 From: Yuriy Liskov Date: Sun, 22 Sep 2024 15:40:17 +0300 Subject: [PATCH] sign in fix --- MediaServiceCore | 2 +- README.md | 2 +- SharedModules | 2 +- .../common/app/models/errors/CategoryEmptyError.java | 5 ++--- .../common/app/models/errors/SignInError.java | 5 ++--- .../common/app/presenters/SignInPresenter.java | 8 ++++---- .../common/app/presenters/YTSignInPresenter.java | 6 +++--- 7 files changed, 14 insertions(+), 16 deletions(-) diff --git a/MediaServiceCore b/MediaServiceCore index a09c2c247..dcd90f832 160000 --- a/MediaServiceCore +++ b/MediaServiceCore @@ -1 +1 @@ -Subproject commit a09c2c247b5e656ad93cf44b6193199cced4fd78 +Subproject commit dcd90f832ff35d0ea9f57da0266af287bf7dc78e diff --git a/README.md b/README.md index d396b804f..851b2bfe4 100644 --- a/README.md +++ b/README.md @@ -177,7 +177,7 @@ You can report in our Telegram group or via [issue tracker on Github](https://gi > **Telegram group (international)**: [@SmartTubeEN](http://t.me/SmartTubeEN) > **Telegram group (RU/UA)**: [@SmartTubeUA](http://t.me/SmartTubeUA) -> **Email**: first.hash at gmail dot com +> **Email**: firsthash@gmail.com The international group is in **English only**. But don't worry if your English is not perfect, we have a friendly international community. diff --git a/SharedModules b/SharedModules index ee7ca4b2c..19a3e08ec 160000 --- a/SharedModules +++ b/SharedModules @@ -1 +1 @@ -Subproject commit ee7ca4b2c1da28cc32ffc19ac42be26f756c4c15 +Subproject commit 19a3e08ec55c5f1e00f728a0d886a70333976dde diff --git a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/errors/CategoryEmptyError.java b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/errors/CategoryEmptyError.java index 3f05b2e27..838d85e26 100644 --- a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/errors/CategoryEmptyError.java +++ b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/errors/CategoryEmptyError.java @@ -2,8 +2,7 @@ package com.liskovsoft.smartyoutubetv2.common.app.models.errors; import android.content.Context; import com.liskovsoft.smartyoutubetv2.common.R; -import com.liskovsoft.smartyoutubetv2.common.app.views.SignInView; -import com.liskovsoft.smartyoutubetv2.common.app.views.ViewManager; +import com.liskovsoft.smartyoutubetv2.common.app.presenters.YTSignInPresenter; public class CategoryEmptyError implements ErrorFragmentData { private final Context mContext; @@ -14,7 +13,7 @@ public class CategoryEmptyError implements ErrorFragmentData { @Override public void onAction() { - ViewManager.instance(mContext).startView(SignInView.class); + YTSignInPresenter.instance(mContext).start(); } @Override diff --git a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/errors/SignInError.java b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/errors/SignInError.java index 3739b3cba..a40298a19 100644 --- a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/errors/SignInError.java +++ b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/errors/SignInError.java @@ -2,8 +2,7 @@ package com.liskovsoft.smartyoutubetv2.common.app.models.errors; import android.content.Context; import com.liskovsoft.smartyoutubetv2.common.R; -import com.liskovsoft.smartyoutubetv2.common.app.views.SignInView; -import com.liskovsoft.smartyoutubetv2.common.app.views.ViewManager; +import com.liskovsoft.smartyoutubetv2.common.app.presenters.YTSignInPresenter; public class SignInError implements ErrorFragmentData { private final Context mContext; @@ -14,7 +13,7 @@ public class SignInError implements ErrorFragmentData { @Override public void onAction() { - ViewManager.instance(mContext).startView(SignInView.class); + YTSignInPresenter.instance(mContext).start(); } @Override diff --git a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/SignInPresenter.java b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/SignInPresenter.java index cb486ca32..0f4ce0047 100644 --- a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/SignInPresenter.java +++ b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/SignInPresenter.java @@ -49,12 +49,12 @@ public class SignInPresenter extends BasePresenter { mPresenter = YTSignInPresenter.instance(getContext()); } else if (GoogleSignInPresenter.instance(getContext()).isWaiting()) { mPresenter = GoogleSignInPresenter.instance(getContext()); + } else { + throw new IllegalStateException("At least one nested sign in presenter should be initialized."); } - if (mPresenter != null) { - mPresenter.setView(getView()); - mPresenter.onViewInitialized(); - } + mPresenter.setView(getView()); + mPresenter.onViewInitialized(); } public void onActionClicked() { diff --git a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/YTSignInPresenter.java b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/YTSignInPresenter.java index 8a16c3079..36a336fbf 100644 --- a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/YTSignInPresenter.java +++ b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/YTSignInPresenter.java @@ -13,9 +13,9 @@ import io.reactivex.disposables.Disposable; public class YTSignInPresenter extends SignInPresenter { private static final String TAG = YTSignInPresenter.class.getSimpleName(); - //private static final String SIGN_IN_URL_SHORT = "https://yt.be/activate"; // doesn't support query params, no search history - //private static final String SIGN_IN_URL_FULL = "https://youtube.com/tv/activate"; // support query params, no search history - private static final String SIGN_IN_URL = "https://youtube.com/activate"; // supports search history + private static final String SIGN_IN_URL = "https://yt.be/activate"; // 18+, no search history + //private static final String SIGN_IN_URL = "https://youtube.com/tv/activate"; // 18+, no search history + //private static final String SIGN_IN_URL = "https://youtube.com/activate"; // age restricted, supports search history @SuppressLint("StaticFieldLeak") private static YTSignInPresenter sInstance; private final ServiceManager mService;