From 2a41a139daae084c3d7c266ac9eff33641065c10 Mon Sep 17 00:00:00 2001 From: Max Baumann Date: Mon, 17 Jul 2023 18:31:33 +0200 Subject: [PATCH 1/6] update workflow --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 41cdc72e..d60f4e19 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: # set env variables - name: set variables run: | - echo "APK_URL=https://www.dropbox.com/s/at7p13mfn08k77j/twitch-15.4.1.apk\?\dl=1" >> $GITHUB_ENV + echo "APK_URL=https://www.dropbox.com/s/5ucfad7tsjjbosh/twitch-15.6.2.apk\?\dl=1" >> $GITHUB_ENV # get keystore.kjs from secret - name: create keystore.kjs from secret From c00380a2d293811d58f8e96567926e6a6c3d5862 Mon Sep 17 00:00:00 2001 From: Max Baumann Date: Mon, 17 Jul 2023 18:59:33 +0200 Subject: [PATCH 2/6] merge changes --- patches/AndroidManifest.xml.patch | 10 +++++----- ...android.shared.chat.ChatViewPresenter.smali.patch | 4 ++-- ...ewer.main.navigation.ToolbarPresenter.smali.patch | 4 ++-- .../tv.twitch.android.sdk.ChatController.smali.patch | 2 +- ...hat.messagefactory.ChatMessageFactory.smali.patch | 2 +- ...messagefactory.ChatMessageSpanFactory.smali.patch | 4 ++-- .../tv.twitch.android.util.EmoteUrlUtil.smali.patch | 6 +++--- patches/res.values.colors.xml.patch | 2 +- patches/res.values.ids.xml.patch | 2 +- patches/res.values.public.xml.patch | 2 +- ...r.DaggerAppComponent$AppComponentImpl.smali.patch | 4 ++-- ...nent$SettingsActivitySubcomponentImpl.smali.patch | 8 ++++---- ...yout-v22.bottom_player_overlay_controls.xml.patch | 8 +++----- ...ut.bottom_player_control_overlay_widget.xml.patch | 2 +- ...s.layout.bottom_player_overlay_controls.xml.patch | 8 +++----- ...ottomPlayerControlOverlayViewDelegate.smali.patch | 4 ++-- ...ottomPlayerControlOverlayViewDelegate.smali.patch | 6 +++--- ...ng.BottomPlayerOverlayControlsBinding.smali.patch | 2 +- ...hared.chat.adapter.ChannelChatAdapter.smali.patch | 6 +++--- ...hatuserdialog.ChatUserDialogPresenter.smali.patch | 4 ++-- ...ndroid.app.consumer.TwitchApplication.smali.patch | 12 +++++++----- 21 files changed, 50 insertions(+), 52 deletions(-) diff --git a/patches/AndroidManifest.xml.patch b/patches/AndroidManifest.xml.patch index e436e55c..4dee55c6 100644 --- a/patches/AndroidManifest.xml.patch +++ b/patches/AndroidManifest.xml.patch @@ -25,8 +25,8 @@ diff --git a/AndroidManifest.xml b/AndroidManifest.xml + - -@@ -69,8 +81,8 @@ + +@@ -70,8 +82,8 @@ @@ -37,7 +37,7 @@ diff --git a/AndroidManifest.xml b/AndroidManifest.xml -@@ -176,15 +188,15 @@ +@@ -177,15 +189,15 @@ @@ -56,7 +56,7 @@ diff --git a/AndroidManifest.xml b/AndroidManifest.xml -@@ -287,7 +299,7 @@ +@@ -288,7 +300,7 @@ @@ -65,7 +65,7 @@ diff --git a/AndroidManifest.xml b/AndroidManifest.xml -@@ -346,5 +358,18 @@ +@@ -347,5 +359,18 @@ diff --git a/patches/anonchat/tv.twitch.android.shared.chat.ChatViewPresenter.smali.patch b/patches/anonchat/tv.twitch.android.shared.chat.ChatViewPresenter.smali.patch index 43ef8a4e..c3ccd858 100644 --- a/patches/anonchat/tv.twitch.android.shared.chat.ChatViewPresenter.smali.patch +++ b/patches/anonchat/tv.twitch.android.shared.chat.ChatViewPresenter.smali.patch @@ -19,7 +19,7 @@ diff --git a/smali_classes6/tv/twitch/android/shared/chat/ChatViewPresenter.smal .field private final chatDialogRouter:Ltv/twitch/android/shared/chat/pub/ChatDialogRouter; -@@ -1262,6 +1262,10 @@ +@@ -1300,6 +1300,10 @@ iput-object v1, v0, Ltv/twitch/android/shared/chat/ChatViewPresenter;->messageInputListener:Ltv/twitch/android/shared/chat/ChatViewPresenter$messageInputListener$1; @@ -30,7 +30,7 @@ diff --git a/smali_classes6/tv/twitch/android/shared/chat/ChatViewPresenter.smal return-void .end method -@@ -1753,6 +1757,13 @@ +@@ -1791,6 +1795,13 @@ :cond_0 return-void .end method diff --git a/patches/devtools/tv.twitch.android.feature.viewer.main.navigation.ToolbarPresenter.smali.patch b/patches/devtools/tv.twitch.android.feature.viewer.main.navigation.ToolbarPresenter.smali.patch index ac6097da..68cee01f 100644 --- a/patches/devtools/tv.twitch.android.feature.viewer.main.navigation.ToolbarPresenter.smali.patch +++ b/patches/devtools/tv.twitch.android.feature.viewer.main.navigation.ToolbarPresenter.smali.patch @@ -1,8 +1,8 @@ diff --git a/smali_classes5/tv/twitch/android/feature/viewer/main/navigation/ToolbarPresenter.smali b/smali_classes5/tv/twitch/android/feature/viewer/main/navigation/ToolbarPresenter.smali --- a/smali_classes5/tv/twitch/android/feature/viewer/main/navigation/ToolbarPresenter.smali +++ b/smali_classes5/tv/twitch/android/feature/viewer/main/navigation/ToolbarPresenter.smali -@@ -2480,6 +2480,10 @@ - .line 410 +@@ -2491,6 +2491,10 @@ + .line 412 invoke-direct {p0, p1}, Ltv/twitch/android/feature/viewer/main/navigation/ToolbarPresenter;->updateSearchVisibilityForCreatorMode(Landroid/view/Menu;)V + # BTTV diff --git a/patches/emotes/tv.twitch.android.sdk.ChatController.smali.patch b/patches/emotes/tv.twitch.android.sdk.ChatController.smali.patch index 4ea6d32b..1d4abeea 100644 --- a/patches/emotes/tv.twitch.android.sdk.ChatController.smali.patch +++ b/patches/emotes/tv.twitch.android.sdk.ChatController.smali.patch @@ -1,7 +1,7 @@ diff --git a/smali_classes5/tv/twitch/android/sdk/ChatController.smali b/smali_classes5/tv/twitch/android/sdk/ChatController.smali --- a/smali_classes5/tv/twitch/android/sdk/ChatController.smali +++ b/smali_classes5/tv/twitch/android/sdk/ChatController.smali -@@ -341,6 +341,13 @@ +@@ -332,6 +332,13 @@ move-result p1 diff --git a/patches/emotes/tv.twitch.android.shared.chat.messagefactory.ChatMessageFactory.smali.patch b/patches/emotes/tv.twitch.android.shared.chat.messagefactory.ChatMessageFactory.smali.patch index 846be22d..30a9b96b 100644 --- a/patches/emotes/tv.twitch.android.shared.chat.messagefactory.ChatMessageFactory.smali.patch +++ b/patches/emotes/tv.twitch.android.shared.chat.messagefactory.ChatMessageFactory.smali.patch @@ -1,7 +1,7 @@ diff --git a/smali_classes6/tv/twitch/android/shared/chat/messagefactory/ChatMessageFactory.smali b/smali_classes6/tv/twitch/android/shared/chat/messagefactory/ChatMessageFactory.smali --- a/smali_classes6/tv/twitch/android/shared/chat/messagefactory/ChatMessageFactory.smali +++ b/smali_classes6/tv/twitch/android/shared/chat/messagefactory/ChatMessageFactory.smali -@@ -667,6 +667,21 @@ +@@ -676,6 +676,21 @@ invoke-static {v15, v1}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V diff --git a/patches/emotes/tv.twitch.android.shared.chat.messagefactory.ChatMessageSpanFactory.smali.patch b/patches/emotes/tv.twitch.android.shared.chat.messagefactory.ChatMessageSpanFactory.smali.patch index 1d097e95..ae3a3f43 100644 --- a/patches/emotes/tv.twitch.android.shared.chat.messagefactory.ChatMessageSpanFactory.smali.patch +++ b/patches/emotes/tv.twitch.android.shared.chat.messagefactory.ChatMessageSpanFactory.smali.patch @@ -1,7 +1,7 @@ diff --git a/smali_classes6/tv/twitch/android/shared/chat/messagefactory/ChatMessageSpanFactory.smali b/smali_classes6/tv/twitch/android/shared/chat/messagefactory/ChatMessageSpanFactory.smali --- a/smali_classes6/tv/twitch/android/shared/chat/messagefactory/ChatMessageSpanFactory.smali +++ b/smali_classes6/tv/twitch/android/shared/chat/messagefactory/ChatMessageSpanFactory.smali -@@ -2261,6 +2261,12 @@ +@@ -2286,6 +2286,12 @@ goto :goto_2 :cond_3 @@ -13,4 +13,4 @@ diff --git a/smali_classes6/tv/twitch/android/shared/chat/messagefactory/ChatMes + if-eqz p12, :cond_4 - .line 111 + .line 113 diff --git a/patches/emotes/tv.twitch.android.util.EmoteUrlUtil.smali.patch b/patches/emotes/tv.twitch.android.util.EmoteUrlUtil.smali.patch index 7a6f5c70..743d709a 100644 --- a/patches/emotes/tv.twitch.android.util.EmoteUrlUtil.smali.patch +++ b/patches/emotes/tv.twitch.android.util.EmoteUrlUtil.smali.patch @@ -20,7 +20,7 @@ diff --git a/smali_classes7/tv/twitch/android/util/EmoteUrlUtil.smali b/smali_cl @@ -703,7 +712,7 @@ .end method - .method public static final getEmoteUrl(Landroid/content/Context;Ljava/lang/String;)Ljava/lang/String; + .method public static final getEmoteUrl(Landroid/content/Context;Ljava/lang/String;Ljava/lang/Float;)Ljava/lang/String; - .locals 1 + .locals 2 @@ -38,6 +38,6 @@ diff --git a/smali_classes7/tv/twitch/android/util/EmoteUrlUtil.smali b/smali_cl + :dont_return + # /BTTV + - .line 73 - sget-object v0, Ltv/twitch/android/util/EmoteUrlUtil;->INSTANCE:Ltv/twitch/android/util/EmoteUrlUtil; + if-eqz p2, :cond_0 + .line 74 diff --git a/patches/res.values.colors.xml.patch b/patches/res.values.colors.xml.patch index 3991b0b2..a9c6b837 100644 --- a/patches/res.values.colors.xml.patch +++ b/patches/res.values.colors.xml.patch @@ -1,7 +1,7 @@ diff --git a/res/values/colors.xml b/res/values/colors.xml --- a/res/values/colors.xml +++ b/res/values/colors.xml -@@ -624,4 +624,6 @@ +@@ -656,4 +656,6 @@ #ff60600b #ff7a7a00 #ffcd201f diff --git a/patches/res.values.ids.xml.patch b/patches/res.values.ids.xml.patch index 6c712c7e..abf356ef 100644 --- a/patches/res.values.ids.xml.patch +++ b/patches/res.values.ids.xml.patch @@ -1,7 +1,7 @@ diff --git a/res/values/ids.xml b/res/values/ids.xml --- a/res/values/ids.xml +++ b/res/values/ids.xml -@@ -4332,4 +4332,8 @@ +@@ -4401,4 +4401,8 @@ diff --git a/patches/res.values.public.xml.patch b/patches/res.values.public.xml.patch index 63919bb3..ba2d6b0a 100644 --- a/patches/res.values.public.xml.patch +++ b/patches/res.values.public.xml.patch @@ -1,7 +1,7 @@ diff --git a/res/values/public.xml b/res/values/public.xml --- a/res/values/public.xml +++ b/res/values/public.xml -@@ -16786,4 +16786,98 @@ +@@ -17012,4 +17012,98 @@ diff --git a/patches/settings/tv.twitch.android.app.consumer.dagger.DaggerAppComponent$AppComponentImpl.smali.patch b/patches/settings/tv.twitch.android.app.consumer.dagger.DaggerAppComponent$AppComponentImpl.smali.patch index 742bbae6..93a91013 100644 --- a/patches/settings/tv.twitch.android.app.consumer.dagger.DaggerAppComponent$AppComponentImpl.smali.patch +++ b/patches/settings/tv.twitch.android.app.consumer.dagger.DaggerAppComponent$AppComponentImpl.smali.patch @@ -1,7 +1,7 @@ diff --git a/smali_classes4/tv/twitch/android/app/consumer/dagger/DaggerAppComponent$AppComponentImpl.smali b/smali_classes4/tv/twitch/android/app/consumer/dagger/DaggerAppComponent$AppComponentImpl.smali --- a/smali_classes4/tv/twitch/android/app/consumer/dagger/DaggerAppComponent$AppComponentImpl.smali +++ b/smali_classes4/tv/twitch/android/app/consumer/dagger/DaggerAppComponent$AppComponentImpl.smali -@@ -14507,6 +14507,13 @@ +@@ -14629,6 +14629,13 @@ iput-object v4, v0, Ltv/twitch/android/app/consumer/dagger/DaggerAppComponent$AppComponentImpl;->pageViewTrackerProvider:Ljavax/inject/Provider; @@ -12,6 +12,6 @@ diff --git a/smali_classes4/tv/twitch/android/app/consumer/dagger/DaggerAppCompo + invoke-static {v4}, Lbttv/settings/SettingsFragmentBindingFactory;->setPageViewTrackerProvider(Ljavax/inject/Provider;)V + # /BTTV + - .line 55929 + .line 56859 iget-object v5, v0, Ltv/twitch/android/app/consumer/dagger/DaggerAppComponent$AppComponentImpl;->provideTwitchAccountManagerProvider:Ljavax/inject/Provider; diff --git a/patches/settings/tv.twitch.android.app.consumer.dagger.DaggerAppComponent$SettingsActivitySubcomponentImpl.smali.patch b/patches/settings/tv.twitch.android.app.consumer.dagger.DaggerAppComponent$SettingsActivitySubcomponentImpl.smali.patch index 37727c6f..f1865ebf 100644 --- a/patches/settings/tv.twitch.android.app.consumer.dagger.DaggerAppComponent$SettingsActivitySubcomponentImpl.smali.patch +++ b/patches/settings/tv.twitch.android.app.consumer.dagger.DaggerAppComponent$SettingsActivitySubcomponentImpl.smali.patch @@ -2,7 +2,7 @@ diff --git a/smali_classes4/tv/twitch/android/app/consumer/dagger/DaggerAppCompo --- a/smali_classes4/tv/twitch/android/app/consumer/dagger/DaggerAppComponent$SettingsActivitySubcomponentImpl.smali +++ b/smali_classes4/tv/twitch/android/app/consumer/dagger/DaggerAppComponent$SettingsActivitySubcomponentImpl.smali @@ -919,10 +919,25 @@ - .line 14422 + .line 14560 iput-object p2, p0, Ltv/twitch/android/app/consumer/dagger/DaggerAppComponent$SettingsActivitySubcomponentImpl;->settingsActivityModule:Ltv/twitch/android/settings/dagger/SettingsActivityModule; + # BTTV @@ -12,7 +12,7 @@ diff --git a/smali_classes4/tv/twitch/android/app/consumer/dagger/DaggerAppCompo + invoke-static {p2}, Lbttv/settings/SettingsFragmentBindingFactory;->setSettingsActivityModule(Ltv/twitch/android/settings/dagger/SettingsActivityModule;)V + # /BTTV + - .line 14423 + .line 14561 iput-object p3, p0, Ltv/twitch/android/app/consumer/dagger/DaggerAppComponent$SettingsActivitySubcomponentImpl;->activityModule:Ltv/twitch/android/app/core/dagger/modules/ActivityModule; + # BTTV @@ -22,7 +22,7 @@ diff --git a/smali_classes4/tv/twitch/android/app/consumer/dagger/DaggerAppCompo + invoke-static {p3}, Lbttv/settings/SettingsFragmentBindingFactory;->setActivityModule(Ltv/twitch/android/app/core/dagger/modules/ActivityModule;)V + # /BTTV + - .line 14424 + .line 14562 + invoke-direct {p0, p2, p3, p4}, Ltv/twitch/android/app/consumer/dagger/DaggerAppComponent$SettingsActivitySubcomponentImpl;->initialize(Ltv/twitch/android/settings/dagger/SettingsActivityModule;Ltv/twitch/android/app/core/dagger/modules/ActivityModule;Ltv/twitch/android/settings/SettingsActivity;)V @@ -38,7 +38,7 @@ diff --git a/smali_classes4/tv/twitch/android/app/consumer/dagger/DaggerAppCompo + invoke-static {p3}, Lbttv/settings/SettingsFragmentBindingFactory;->setFragmentActivityProvider(Ljavax/inject/Provider;)V + # /BTTV - .line 14826 + .line 14964 invoke-static {}, Ltv/twitch/android/shared/billing/postalcodecapture/PostalCodeEventDispatcher_Factory;->create()Ltv/twitch/android/shared/billing/postalcodecapture/PostalCodeEventDispatcher_Factory; @@ -2031,6 +2052,19 @@ diff --git a/patches/sleeptimer/res.layout-v22.bottom_player_overlay_controls.xml.patch b/patches/sleeptimer/res.layout-v22.bottom_player_overlay_controls.xml.patch index 21fe03cf..f81694a9 100644 --- a/patches/sleeptimer/res.layout-v22.bottom_player_overlay_controls.xml.patch +++ b/patches/sleeptimer/res.layout-v22.bottom_player_overlay_controls.xml.patch @@ -1,11 +1,10 @@ diff --git a/res/layout-v22/bottom_player_overlay_controls.xml b/res/layout-v22/bottom_player_overlay_controls.xml --- a/res/layout-v22/bottom_player_overlay_controls.xml +++ b/res/layout-v22/bottom_player_overlay_controls.xml -@@ -7,6 +7,22 @@ +@@ -7,6 +7,20 @@ - + -+ + -+ - + diff --git a/patches/sleeptimer/res.layout.bottom_player_control_overlay_widget.xml.patch b/patches/sleeptimer/res.layout.bottom_player_control_overlay_widget.xml.patch index b4792804..35bf40b8 100644 --- a/patches/sleeptimer/res.layout.bottom_player_control_overlay_widget.xml.patch +++ b/patches/sleeptimer/res.layout.bottom_player_control_overlay_widget.xml.patch @@ -17,6 +17,6 @@ diff --git a/res/layout/bottom_player_control_overlay_widget.xml b/res/layout/bo + android:scaleType="fitCenter" + android:contentDescription="@string/bttv_sleep_timer_button_descr" + app:tint="@color/white" /> - + diff --git a/patches/sleeptimer/res.layout.bottom_player_overlay_controls.xml.patch b/patches/sleeptimer/res.layout.bottom_player_overlay_controls.xml.patch index 7002876a..0c0dac65 100644 --- a/patches/sleeptimer/res.layout.bottom_player_overlay_controls.xml.patch +++ b/patches/sleeptimer/res.layout.bottom_player_overlay_controls.xml.patch @@ -1,11 +1,10 @@ diff --git a/res/layout/bottom_player_overlay_controls.xml b/res/layout/bottom_player_overlay_controls.xml --- a/res/layout/bottom_player_overlay_controls.xml +++ b/res/layout/bottom_player_overlay_controls.xml -@@ -7,6 +7,22 @@ +@@ -7,6 +7,20 @@ - + -+ + -+ - + diff --git a/patches/sleeptimer/tv.twitch.android.shared.player.overlay.BottomPlayerControlOverlayViewDelegate.smali.patch b/patches/sleeptimer/tv.twitch.android.shared.player.overlay.BottomPlayerControlOverlayViewDelegate.smali.patch index fe9c941c..5e9f5ae2 100644 --- a/patches/sleeptimer/tv.twitch.android.shared.player.overlay.BottomPlayerControlOverlayViewDelegate.smali.patch +++ b/patches/sleeptimer/tv.twitch.android.shared.player.overlay.BottomPlayerControlOverlayViewDelegate.smali.patch @@ -2,7 +2,7 @@ diff --git a/smali_classes6/tv/twitch/android/shared/player/overlay/BottomPlayer --- a/smali_classes6/tv/twitch/android/shared/player/overlay/BottomPlayerControlOverlayViewDelegate.smali +++ b/smali_classes6/tv/twitch/android/shared/player/overlay/BottomPlayerControlOverlayViewDelegate.smali @@ -104,6 +104,13 @@ - .line 73 + .line 68 invoke-direct {p0, p1, p2}, Ltv/twitch/android/core/mvp/viewdelegate/BaseViewDelegate;->(Landroid/content/Context;Landroid/view/View;)V + # BTTV @@ -14,4 +14,4 @@ diff --git a/smali_classes6/tv/twitch/android/shared/player/overlay/BottomPlayer + const/4 p1, 0x1 - .line 53 + .line 48 diff --git a/patches/sleeptimer/tv.twitch.android.shared.player.overlay.RxBottomPlayerControlOverlayViewDelegate.smali.patch b/patches/sleeptimer/tv.twitch.android.shared.player.overlay.RxBottomPlayerControlOverlayViewDelegate.smali.patch index 4c61af4d..f93bf164 100644 --- a/patches/sleeptimer/tv.twitch.android.shared.player.overlay.RxBottomPlayerControlOverlayViewDelegate.smali.patch +++ b/patches/sleeptimer/tv.twitch.android.shared.player.overlay.RxBottomPlayerControlOverlayViewDelegate.smali.patch @@ -1,7 +1,7 @@ diff --git a/smali_classes6/tv/twitch/android/shared/player/overlay/RxBottomPlayerControlOverlayViewDelegate.smali b/smali_classes6/tv/twitch/android/shared/player/overlay/RxBottomPlayerControlOverlayViewDelegate.smali --- a/smali_classes6/tv/twitch/android/shared/player/overlay/RxBottomPlayerControlOverlayViewDelegate.smali +++ b/smali_classes6/tv/twitch/android/shared/player/overlay/RxBottomPlayerControlOverlayViewDelegate.smali -@@ -25,7 +25,7 @@ +@@ -26,7 +26,7 @@ # instance fields @@ -10,9 +10,9 @@ diff --git a/smali_classes6/tv/twitch/android/shared/player/overlay/RxBottomPlay # direct methods -@@ -713,6 +713,12 @@ +@@ -867,6 +867,12 @@ .method public render(Ltv/twitch/android/shared/player/overlay/RxBottomPlayerControlOverlayPresenter$State;)V - .locals 9 + .locals 10 + # BTTV + invoke-virtual {p0}, Ltv/twitch/android/core/mvp/viewdelegate/BaseViewDelegate;->getContext()Landroid/content/Context; diff --git a/patches/sleeptimer/tv.twitch.android.shared.player.overlay.databinding.BottomPlayerOverlayControlsBinding.smali.patch b/patches/sleeptimer/tv.twitch.android.shared.player.overlay.databinding.BottomPlayerOverlayControlsBinding.smali.patch index 1cea5c5b..225d08bd 100644 --- a/patches/sleeptimer/tv.twitch.android.shared.player.overlay.databinding.BottomPlayerOverlayControlsBinding.smali.patch +++ b/patches/sleeptimer/tv.twitch.android.shared.player.overlay.databinding.BottomPlayerOverlayControlsBinding.smali.patch @@ -1,7 +1,7 @@ diff --git a/smali_classes6/tv/twitch/android/shared/player/overlay/databinding/BottomPlayerOverlayControlsBinding.smali b/smali_classes6/tv/twitch/android/shared/player/overlay/databinding/BottomPlayerOverlayControlsBinding.smali --- a/smali_classes6/tv/twitch/android/shared/player/overlay/databinding/BottomPlayerOverlayControlsBinding.smali +++ b/smali_classes6/tv/twitch/android/shared/player/overlay/databinding/BottomPlayerOverlayControlsBinding.smali -@@ -15,7 +15,7 @@ +@@ -17,7 +17,7 @@ .field public final progressText:Landroid/widget/TextView; diff --git a/patches/splitchat/tv.twitch.android.shared.chat.adapter.ChannelChatAdapter.smali.patch b/patches/splitchat/tv.twitch.android.shared.chat.adapter.ChannelChatAdapter.smali.patch index 687d2b57..8eb742cf 100644 --- a/patches/splitchat/tv.twitch.android.shared.chat.adapter.ChannelChatAdapter.smali.patch +++ b/patches/splitchat/tv.twitch.android.shared.chat.adapter.ChannelChatAdapter.smali.patch @@ -1,9 +1,9 @@ diff --git a/smali_classes6/tv/twitch/android/shared/chat/adapter/ChannelChatAdapter.smali b/smali_classes6/tv/twitch/android/shared/chat/adapter/ChannelChatAdapter.smali --- a/smali_classes6/tv/twitch/android/shared/chat/adapter/ChannelChatAdapter.smali +++ b/smali_classes6/tv/twitch/android/shared/chat/adapter/ChannelChatAdapter.smali -@@ -340,6 +340,11 @@ +@@ -215,6 +215,11 @@ - .line 148 + .line 151 :cond_1 + + # BTTV @@ -12,4 +12,4 @@ diff --git a/smali_classes6/tv/twitch/android/shared/chat/adapter/ChannelChatAda + invoke-virtual {p0, v1, v0}, Landroidx/recyclerview/widget/RecyclerView$Adapter;->notifyItemRangeRemoved(II)V - .line 151 + .line 154 diff --git a/patches/subs/tv.twitch.android.shared.chat.chatuserdialog.ChatUserDialogPresenter.smali.patch b/patches/subs/tv.twitch.android.shared.chat.chatuserdialog.ChatUserDialogPresenter.smali.patch index 935317f1..5d35fee0 100644 --- a/patches/subs/tv.twitch.android.shared.chat.chatuserdialog.ChatUserDialogPresenter.smali.patch +++ b/patches/subs/tv.twitch.android.shared.chat.chatuserdialog.ChatUserDialogPresenter.smali.patch @@ -19,7 +19,7 @@ diff --git a/smali_classes6/tv/twitch/android/shared/chat/chatuserdialog/ChatUse .field private listeners:Ljava/util/Set; .annotation system Ldalvik/annotation/Signature; -@@ -697,7 +697,7 @@ +@@ -706,7 +706,7 @@ new-instance v1, Ltv/twitch/android/shared/chat/chatuserdialog/ChatUserDialogPresenter$$ExternalSyntheticLambda2; @@ -28,7 +28,7 @@ diff --git a/smali_classes6/tv/twitch/android/shared/chat/chatuserdialog/ChatUse invoke-virtual {v0, v1}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V -@@ -735,6 +735,11 @@ +@@ -744,6 +744,11 @@ invoke-direct {v0, p0, p1}, Ltv/twitch/android/shared/chat/chatuserdialog/ChatUserDialogPresenter$$ExternalSyntheticLambda7;->(Ltv/twitch/android/shared/chat/chatuserdialog/ChatUserDialogPresenter;Ltv/twitch/android/models/social/ChatUser;)V diff --git a/patches/tv.twitch.android.app.consumer.TwitchApplication.smali.patch b/patches/tv.twitch.android.app.consumer.TwitchApplication.smali.patch index bfe274ba..b724b670 100644 --- a/patches/tv.twitch.android.app.consumer.TwitchApplication.smali.patch +++ b/patches/tv.twitch.android.app.consumer.TwitchApplication.smali.patch @@ -1,7 +1,7 @@ diff --git a/smali_classes4/tv/twitch/android/app/consumer/TwitchApplication.smali b/smali_classes4/tv/twitch/android/app/consumer/TwitchApplication.smali --- a/smali_classes4/tv/twitch/android/app/consumer/TwitchApplication.smali +++ b/smali_classes4/tv/twitch/android/app/consumer/TwitchApplication.smali -@@ -196,6 +196,13 @@ +@@ -222,6 +222,13 @@ .line 99 invoke-super {p0}, Landroid/app/Application;->onCreate()V @@ -15,14 +15,16 @@ diff --git a/smali_classes4/tv/twitch/android/app/consumer/TwitchApplication.sma .line 102 invoke-static {p0}, Lcom/google/firebase/FirebaseApp;->initializeApp(Landroid/content/Context;)Lcom/google/firebase/FirebaseApp; -@@ -233,6 +240,10 @@ +@@ -259,7 +266,11 @@ - move-result-object v2 + move-result-object v1 +- const-string v2, "15.6.2" + # BTTV + const-string v2, "tv.twitch.android.app" + # /BTTV + - const-string v3, "15.4.1" ++ const-string v3, "15.6.2" + + const v3, 0x16fae4 - const v4, 0x16f30a From 7324aaf786a6de38a778cfa0b6592f35736f9706 Mon Sep 17 00:00:00 2001 From: Max Baumann Date: Mon, 17 Jul 2023 19:06:02 +0200 Subject: [PATCH 3/6] fix version issues --- ...tch.android.app.consumer.TwitchApplication.smali.patch | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/patches/tv.twitch.android.app.consumer.TwitchApplication.smali.patch b/patches/tv.twitch.android.app.consumer.TwitchApplication.smali.patch index b724b670..66d62e5d 100644 --- a/patches/tv.twitch.android.app.consumer.TwitchApplication.smali.patch +++ b/patches/tv.twitch.android.app.consumer.TwitchApplication.smali.patch @@ -15,16 +15,14 @@ diff --git a/smali_classes4/tv/twitch/android/app/consumer/TwitchApplication.sma .line 102 invoke-static {p0}, Lcom/google/firebase/FirebaseApp;->initializeApp(Landroid/content/Context;)Lcom/google/firebase/FirebaseApp; -@@ -259,7 +266,11 @@ +@@ -259,6 +266,10 @@ move-result-object v1 -- const-string v2, "15.6.2" + # BTTV -+ const-string v2, "tv.twitch.android.app" ++ const-string v1, "tv.twitch.android.app" + # /BTTV + -+ const-string v3, "15.6.2" + const-string v2, "15.6.2" const v3, 0x16fae4 - From 9fd0f251d7b3b881eb99e8e8fa91801327b7dfc5 Mon Sep 17 00:00:00 2001 From: Max Baumann Date: Mon, 17 Jul 2023 19:38:41 +0200 Subject: [PATCH 4/6] refactorino --- .../bttv/ChommentModelDelegateWrapper.java | 2 +- mod/app/src/main/java/bttv/SplitChat.java | 2 +- mod/app/src/main/java/bttv/Tokenizer.java | 14 ++--- .../src/test/java/bttv/mod/TokenizerTest.java | 52 +++++++++---------- .../shared/chat/ChatMessageDelegate.java | 2 +- .../adapter/item/ChatMessageViewHolder.java | 18 +++++++ .../adapter/item/MessageRecyclerItem.java | 21 -------- .../chat/chomments/ChommentModelDelegate.java | 2 +- .../shared/chat/pub/ChatMessageInterface.java | 4 +- .../model/messages}/AutoModMessageFlags.java | 2 +- .../library/model}/MessageToken.java | 7 +-- 11 files changed, 63 insertions(+), 63 deletions(-) create mode 100644 mod/twitch/src/main/java/tv/twitch/android/shared/chat/adapter/item/ChatMessageViewHolder.java delete mode 100644 mod/twitch/src/main/java/tv/twitch/android/shared/chat/adapter/item/MessageRecyclerItem.java rename mod/twitch/src/main/java/tv/twitch/android/{models/chat => shared/chat/pub/model/messages}/AutoModMessageFlags.java (71%) rename mod/twitch/src/main/java/tv/twitch/{android/models/chat => chat/library/model}/MessageToken.java (85%) diff --git a/mod/app/src/main/java/bttv/ChommentModelDelegateWrapper.java b/mod/app/src/main/java/bttv/ChommentModelDelegateWrapper.java index 368ecca3..b9fa6c70 100644 --- a/mod/app/src/main/java/bttv/ChommentModelDelegateWrapper.java +++ b/mod/app/src/main/java/bttv/ChommentModelDelegateWrapper.java @@ -7,7 +7,7 @@ import java.util.List; import bttv.highlight.Highlight; -import tv.twitch.android.models.chat.MessageToken; +import tv.twitch.chat.library.model.MessageToken; import tv.twitch.android.models.chomments.ChommentModel; import tv.twitch.android.shared.chat.pub.model.ChatMessageTokenizerWrapper; import tv.twitch.android.provider.experiments.ExperimentHelper; diff --git a/mod/app/src/main/java/bttv/SplitChat.java b/mod/app/src/main/java/bttv/SplitChat.java index 9006aa56..72fd828f 100644 --- a/mod/app/src/main/java/bttv/SplitChat.java +++ b/mod/app/src/main/java/bttv/SplitChat.java @@ -12,7 +12,7 @@ import bttv.settings.Settings; import tv.twitch.android.app.core.ThemeManager; -import tv.twitch.android.shared.chat.adapter.item.MessageRecyclerItem.ChatMessageViewHolder; +import tv.twitch.android.shared.chat.adapter.item.ChatMessageViewHolder; import tv.twitch.android.shared.chat.chomments.ChommentRecyclerItem.ChommentItemViewHolder; import tv.twitch.android.shared.chat.messagefactory.adapteritem.UserNoticeRecyclerItem.UserNoticeViewHolder; diff --git a/mod/app/src/main/java/bttv/Tokenizer.java b/mod/app/src/main/java/bttv/Tokenizer.java index 3c390df0..fe9196af 100644 --- a/mod/app/src/main/java/bttv/Tokenizer.java +++ b/mod/app/src/main/java/bttv/Tokenizer.java @@ -14,10 +14,10 @@ import bttv.emote.Emotes; import bttv.highlight.Blacklist; import bttv.highlight.Highlight; -import tv.twitch.android.models.chat.AutoModMessageFlags; -import tv.twitch.android.models.chat.MessageToken.TextToken; -import tv.twitch.android.models.chat.MessageToken; -import tv.twitch.android.models.chat.MessageToken.EmoticonToken; +import tv.twitch.android.shared.chat.pub.model.messages.AutoModMessageFlags; +import tv.twitch.chat.library.model.MessageToken.TextToken; +import tv.twitch.chat.library.model.MessageToken; +import tv.twitch.chat.library.model.MessageToken.EmoteToken; import tv.twitch.android.shared.chat.pub.ChatMessageInterface; import tv.twitch.android.shared.chat.ChatMessageDelegate; import tv.twitch.chat.AutoModFlags; @@ -45,8 +45,8 @@ public static Pair, Boolean> tokenize(List orig for (MessageToken token : orig) { // possible issue: emotes won't work in e.g. MentionToken or BitsToken if (!(token instanceof TextToken)) { - if (token instanceof EmoticonToken && newTokens.size() > 0) { - if (newTokens.get(newTokens.size() - 1) instanceof EmoticonToken) { + if (token instanceof EmoteToken && newTokens.size() > 0) { + if (newTokens.get(newTokens.size() - 1) instanceof EmoteToken) { newTokens.add(new TextToken(" ", new AutoModMessageFlags())); } } @@ -79,7 +79,7 @@ public static Pair, Boolean> tokenize(List orig if (!before.isEmpty()) { newTokens.add(new TextToken(currentText.toString(), text.getFlags())); // add everything before Emote as TextToken } - newTokens.add(new EmoticonToken(word, "BTTV-" + emote.id)); // add Emote + newTokens.add(new EmoteToken(word, "BTTV-" + emote.id)); // add Emote // prepare next TextToken currentText.setLength(0); diff --git a/mod/app/src/test/java/bttv/mod/TokenizerTest.java b/mod/app/src/test/java/bttv/mod/TokenizerTest.java index 629d111b..a62974de 100644 --- a/mod/app/src/test/java/bttv/mod/TokenizerTest.java +++ b/mod/app/src/test/java/bttv/mod/TokenizerTest.java @@ -21,8 +21,8 @@ import bttv.Tokenizer; import bttv.emote.Emote; import bttv.emote.Emotes; -import tv.twitch.android.models.chat.AutoModMessageFlags; -import tv.twitch.android.models.chat.MessageToken; +import tv.twitch.android.shared.chat.pub.model.messages.AutoModMessageFlags; +import tv.twitch.chat.library.model.MessageToken; import static org.junit.Assert.*; import static org.mockito.Mockito.when; @@ -35,12 +35,12 @@ private static class Cases { static Object[] TrivialCase = { // Input Arrays.asList(new MessageToken.TextToken("Test Message, fam ", flags), - new MessageToken.EmoticonToken("LUL", "123"), + new MessageToken.EmoteToken("LUL", "123"), new MessageToken.TextToken("Haha", flags) ), // Expected Output Arrays.asList(new MessageToken.TextToken("Test Message, fam ", flags), - new MessageToken.EmoticonToken("LUL", "123"), + new MessageToken.EmoteToken("LUL", "123"), new MessageToken.TextToken("Haha ", flags) ), }; @@ -48,16 +48,16 @@ private static class Cases { static Object[] FoundInBeginning = { // Input Arrays.asList(new MessageToken.TextToken("KEKW Pog and ", flags), - new MessageToken.EmoticonToken("LUL", "123"), + new MessageToken.EmoteToken("LUL", "123"), new MessageToken.TextToken("Haha", flags) ), // Expected Output Arrays.asList( - new MessageToken.EmoticonToken("KEKW", "BTTV-5ea831f074046462f768097a"), + new MessageToken.EmoteToken("KEKW", "BTTV-5ea831f074046462f768097a"), new MessageToken.TextToken(" ", flags), - new MessageToken.EmoticonToken("Pog", "BTTV-5ff827395ef7d10c7912c106"), + new MessageToken.EmoteToken("Pog", "BTTV-5ff827395ef7d10c7912c106"), new MessageToken.TextToken(" and ", flags), - new MessageToken.EmoticonToken("LUL", "123"), + new MessageToken.EmoteToken("LUL", "123"), new MessageToken.TextToken("Haha ", flags) ), }; @@ -65,40 +65,40 @@ private static class Cases { static Object[] FoundAtEnd = { // Input Arrays.asList(new MessageToken.TextToken("Test message ", flags), - new MessageToken.EmoticonToken("LUL", "123"), + new MessageToken.EmoteToken("LUL", "123"), new MessageToken.TextToken("Haha, Pog", flags) ), // Expected Output Arrays.asList( new MessageToken.TextToken("Test message ", flags), - new MessageToken.EmoticonToken("LUL", "123"), + new MessageToken.EmoteToken("LUL", "123"), new MessageToken.TextToken("Haha, ", flags), - new MessageToken.EmoticonToken("Pog", "BTTV-5ff827395ef7d10c7912c106") + new MessageToken.EmoteToken("Pog", "BTTV-5ff827395ef7d10c7912c106") ) }; static Object[] FoundInMid = { // Input Arrays.asList( - new MessageToken.EmoticonToken("LUL", "123"), + new MessageToken.EmoteToken("LUL", "123"), new MessageToken.TextToken("Test message ", flags), - new MessageToken.EmoticonToken("LUL", "123"), + new MessageToken.EmoteToken("LUL", "123"), new MessageToken.TextToken("test Pog test", flags), - new MessageToken.EmoticonToken("LUL", "123"), + new MessageToken.EmoteToken("LUL", "123"), new MessageToken.TextToken("Haha", flags), - new MessageToken.EmoticonToken("LUL", "123") + new MessageToken.EmoteToken("LUL", "123") ), // Expected Output Arrays.asList( - new MessageToken.EmoticonToken("LUL", "123"), + new MessageToken.EmoteToken("LUL", "123"), new MessageToken.TextToken("Test message ", flags), - new MessageToken.EmoticonToken("LUL", "123"), + new MessageToken.EmoteToken("LUL", "123"), new MessageToken.TextToken("test ", flags), - new MessageToken.EmoticonToken("Pog", "BTTV-5ff827395ef7d10c7912c106"), + new MessageToken.EmoteToken("Pog", "BTTV-5ff827395ef7d10c7912c106"), new MessageToken.TextToken(" test ", flags), - new MessageToken.EmoticonToken("LUL", "123"), + new MessageToken.EmoteToken("LUL", "123"), new MessageToken.TextToken("Haha ", flags), - new MessageToken.EmoticonToken("LUL", "123") + new MessageToken.EmoteToken("LUL", "123") ) }; @@ -172,8 +172,8 @@ public void test() { if (token instanceof MessageToken.TextToken) { System.out.println("text: '" + ((MessageToken.TextToken) token).getText() + "'"); } - if (token instanceof MessageToken.EmoticonToken) { - System.out.println("name: " + ((MessageToken.EmoticonToken) token).component1()); + if (token instanceof MessageToken.EmoteToken) { + System.out.println("name: " + ((MessageToken.EmoteToken) token).component1()); } } System.out.println("---------------"); @@ -186,16 +186,16 @@ public void test() { System.out.println(received); // both same type assertEquals(expected instanceof MessageToken.TextToken, received instanceof MessageToken.TextToken); - assertEquals(expected instanceof MessageToken.EmoticonToken, received instanceof MessageToken.EmoticonToken); + assertEquals(expected instanceof MessageToken.EmoteToken, received instanceof MessageToken.EmoteToken); if (expected instanceof MessageToken.TextToken && received instanceof MessageToken.TextToken) { MessageToken.TextToken expectedTextToken = (MessageToken.TextToken) expected; MessageToken.TextToken receivedTextToken = (MessageToken.TextToken) received; assertEquals(expectedTextToken.getText(), receivedTextToken.getText()); - } else if (expected instanceof MessageToken.EmoticonToken && received instanceof MessageToken.EmoticonToken) { - MessageToken.EmoticonToken expectedEmoteToken = (MessageToken.EmoticonToken) expected; - MessageToken.EmoticonToken receivedEmoteToken = (MessageToken.EmoticonToken) received; + } else if (expected instanceof MessageToken.EmoteToken && received instanceof MessageToken.EmoteToken) { + MessageToken.EmoteToken expectedEmoteToken = (MessageToken.EmoteToken) expected; + MessageToken.EmoteToken receivedEmoteToken = (MessageToken.EmoteToken) received; assertEquals(expectedEmoteToken.component1(), receivedEmoteToken.component1()); assertEquals(expectedEmoteToken.component2(), receivedEmoteToken.component2()); diff --git a/mod/twitch/src/main/java/tv/twitch/android/shared/chat/ChatMessageDelegate.java b/mod/twitch/src/main/java/tv/twitch/android/shared/chat/ChatMessageDelegate.java index 2c30f3ee..c69f168d 100644 --- a/mod/twitch/src/main/java/tv/twitch/android/shared/chat/ChatMessageDelegate.java +++ b/mod/twitch/src/main/java/tv/twitch/android/shared/chat/ChatMessageDelegate.java @@ -8,7 +8,7 @@ import java.util.List; import tv.twitch.android.models.chat.MessageBadge; -import tv.twitch.android.models.chat.MessageToken; +import tv.twitch.chat.library.model.MessageToken; import tv.twitch.android.shared.chat.pub.ChatMessageInterface; import tv.twitch.chat.ChatMessageInfo; diff --git a/mod/twitch/src/main/java/tv/twitch/android/shared/chat/adapter/item/ChatMessageViewHolder.java b/mod/twitch/src/main/java/tv/twitch/android/shared/chat/adapter/item/ChatMessageViewHolder.java new file mode 100644 index 00000000..4c7c632e --- /dev/null +++ b/mod/twitch/src/main/java/tv/twitch/android/shared/chat/adapter/item/ChatMessageViewHolder.java @@ -0,0 +1,18 @@ +package tv.twitch.android.shared.chat.adapter.item; + +import android.view.View; +import android.widget.TextView; + +import androidx.annotation.NonNull; + +import tv.twitch.android.core.adapters.AbstractTwitchRecyclerViewHolder; + +public class ChatMessageViewHolder extends AbstractTwitchRecyclerViewHolder { + public ChatMessageViewHolder(@NonNull View itemView) { + super(itemView); + } + + public final TextView getMessageTextView() { + throw new IllegalStateException("MessageRecyclerItem.ChatMessageViewHolder.getMessageTextView mock was called"); + } +} diff --git a/mod/twitch/src/main/java/tv/twitch/android/shared/chat/adapter/item/MessageRecyclerItem.java b/mod/twitch/src/main/java/tv/twitch/android/shared/chat/adapter/item/MessageRecyclerItem.java deleted file mode 100644 index 4f1dab91..00000000 --- a/mod/twitch/src/main/java/tv/twitch/android/shared/chat/adapter/item/MessageRecyclerItem.java +++ /dev/null @@ -1,21 +0,0 @@ -package tv.twitch.android.shared.chat.adapter.item; - -import android.view.View; -import android.widget.TextView; - -import androidx.annotation.NonNull; -import androidx.recyclerview.widget.RecyclerView.ViewHolder; - -import tv.twitch.android.core.adapters.AbstractTwitchRecyclerViewHolder; - -public class MessageRecyclerItem implements tv.twitch.android.core.adapters.RecyclerAdapterItem { - public static class ChatMessageViewHolder extends AbstractTwitchRecyclerViewHolder { - public ChatMessageViewHolder(@NonNull View itemView) { - super(itemView); - } - - public final TextView getMessageTextView() { - throw new IllegalStateException("MessageRecyclerItem.ChatMessageViewHolder.getMessageTextView mock was called"); - } - } -} diff --git a/mod/twitch/src/main/java/tv/twitch/android/shared/chat/chomments/ChommentModelDelegate.java b/mod/twitch/src/main/java/tv/twitch/android/shared/chat/chomments/ChommentModelDelegate.java index b1d37ec6..7b8b97e8 100644 --- a/mod/twitch/src/main/java/tv/twitch/android/shared/chat/chomments/ChommentModelDelegate.java +++ b/mod/twitch/src/main/java/tv/twitch/android/shared/chat/chomments/ChommentModelDelegate.java @@ -7,7 +7,7 @@ import java.util.List; import tv.twitch.android.models.chat.MessageBadge; -import tv.twitch.android.models.chat.MessageToken; +import tv.twitch.chat.library.model.MessageToken; import tv.twitch.android.models.chomments.ChommentModel; import tv.twitch.android.shared.chat.pub.model.ChatMessageTokenizerWrapper; import tv.twitch.android.provider.experiments.ExperimentHelper; diff --git a/mod/twitch/src/main/java/tv/twitch/android/shared/chat/pub/ChatMessageInterface.java b/mod/twitch/src/main/java/tv/twitch/android/shared/chat/pub/ChatMessageInterface.java index 74621cf4..d0e9f207 100644 --- a/mod/twitch/src/main/java/tv/twitch/android/shared/chat/pub/ChatMessageInterface.java +++ b/mod/twitch/src/main/java/tv/twitch/android/shared/chat/pub/ChatMessageInterface.java @@ -4,12 +4,14 @@ */ package tv.twitch.android.shared.chat.pub; +import tv.twitch.chat.library.model.MessageToken; + public interface ChatMessageInterface { java.util.List getBadges(); String getDisplayName(); - java.util.List getTokens(); + java.util.List getTokens(); int getUserId(); diff --git a/mod/twitch/src/main/java/tv/twitch/android/models/chat/AutoModMessageFlags.java b/mod/twitch/src/main/java/tv/twitch/android/shared/chat/pub/model/messages/AutoModMessageFlags.java similarity index 71% rename from mod/twitch/src/main/java/tv/twitch/android/models/chat/AutoModMessageFlags.java rename to mod/twitch/src/main/java/tv/twitch/android/shared/chat/pub/model/messages/AutoModMessageFlags.java index d7bd2437..bc2788f8 100644 --- a/mod/twitch/src/main/java/tv/twitch/android/models/chat/AutoModMessageFlags.java +++ b/mod/twitch/src/main/java/tv/twitch/android/shared/chat/pub/model/messages/AutoModMessageFlags.java @@ -2,7 +2,7 @@ * This file is a stub, so javac does not throw errors, * it is not used in the actual patch. */ -package tv.twitch.android.models.chat; +package tv.twitch.android.shared.chat.pub.model.messages; public class AutoModMessageFlags { diff --git a/mod/twitch/src/main/java/tv/twitch/android/models/chat/MessageToken.java b/mod/twitch/src/main/java/tv/twitch/chat/library/model/MessageToken.java similarity index 85% rename from mod/twitch/src/main/java/tv/twitch/android/models/chat/MessageToken.java rename to mod/twitch/src/main/java/tv/twitch/chat/library/model/MessageToken.java index 842c61af..593bc0e3 100644 --- a/mod/twitch/src/main/java/tv/twitch/android/models/chat/MessageToken.java +++ b/mod/twitch/src/main/java/tv/twitch/chat/library/model/MessageToken.java @@ -2,8 +2,9 @@ * This file is a stub, so javac does not throw errors, * it is not used in the actual patch. */ -package tv.twitch.android.models.chat; +package tv.twitch.chat.library.model; import kotlin.jvm.internal.BTTVDefaultConstructorMarker; +import tv.twitch.android.shared.chat.pub.model.messages.AutoModMessageFlags; public abstract class MessageToken { @@ -11,10 +12,10 @@ public abstract class MessageToken { public MessageToken(BTTVDefaultConstructorMarker u) { } - public static final class EmoticonToken extends MessageToken { + public static final class EmoteToken extends MessageToken { private final String text; private final String id; - public EmoticonToken(String text, String id) { + public EmoteToken(String text, String id) { super(null); this.text = text; this.id = id; From 7024792de5b65d2cafa8d46c550f109fc7782a9b Mon Sep 17 00:00:00 2001 From: Max Baumann Date: Mon, 17 Jul 2023 20:11:38 +0200 Subject: [PATCH 5/6] refactor some more --- mod/app/src/main/java/bttv/Tokenizer.java | 6 ++---- .../src/test/java/bttv/mod/TokenizerTest.java | 10 +++++----- .../shared/chat/ChatMessageDelegate.java | 3 --- .../adapter/item/ChatMessageViewHolder.java | 2 +- .../pub/model/messages/AutoModMessageFlags.java | 9 --------- .../emotes/utils/AnimatedEmotesUrlUtil.java | 17 ----------------- .../main/java/tv/twitch/chat/AutoModFlags.java | 6 ++++++ .../main/java/tv/twitch/chat/ChatTextToken.java | 2 +- .../twitch/chat/library/model/AutoModFlags.java | 10 ++++++++++ .../twitch/chat/library/model/MessageToken.java | 10 ++++------ 10 files changed, 29 insertions(+), 46 deletions(-) delete mode 100644 mod/twitch/src/main/java/tv/twitch/android/shared/chat/pub/model/messages/AutoModMessageFlags.java create mode 100644 mod/twitch/src/main/java/tv/twitch/chat/library/model/AutoModFlags.java diff --git a/mod/app/src/main/java/bttv/Tokenizer.java b/mod/app/src/main/java/bttv/Tokenizer.java index fe9196af..7c252e48 100644 --- a/mod/app/src/main/java/bttv/Tokenizer.java +++ b/mod/app/src/main/java/bttv/Tokenizer.java @@ -14,13 +14,11 @@ import bttv.emote.Emotes; import bttv.highlight.Blacklist; import bttv.highlight.Highlight; -import tv.twitch.android.shared.chat.pub.model.messages.AutoModMessageFlags; import tv.twitch.chat.library.model.MessageToken.TextToken; import tv.twitch.chat.library.model.MessageToken; import tv.twitch.chat.library.model.MessageToken.EmoteToken; import tv.twitch.android.shared.chat.pub.ChatMessageInterface; import tv.twitch.android.shared.chat.ChatMessageDelegate; -import tv.twitch.chat.AutoModFlags; import tv.twitch.chat.ChatEmoticonToken; import tv.twitch.chat.ChatMessageInfo; import tv.twitch.chat.ChatMessageToken; @@ -47,7 +45,7 @@ public static Pair, Boolean> tokenize(List orig if (!(token instanceof TextToken)) { if (token instanceof EmoteToken && newTokens.size() > 0) { if (newTokens.get(newTokens.size() - 1) instanceof EmoteToken) { - newTokens.add(new TextToken(" ", new AutoModMessageFlags())); + newTokens.add(new TextToken(" ", new tv.twitch.chat.library.model.AutoModFlags(0, 0, 0, 0))); } } newTokens.add(token); @@ -123,7 +121,7 @@ public static void retokenizeLiveChatMessage(ChatMessageInfo info) { if (prevToken != null && !endsWithSpace(prevToken)) { ChatTextToken spaceToken = new ChatTextToken(); spaceToken.text = " "; - spaceToken.autoModFlags = new AutoModFlags(); + spaceToken.autoModFlags = new tv.twitch.chat.AutoModFlags(); newTokens.add(spaceToken); } } diff --git a/mod/app/src/test/java/bttv/mod/TokenizerTest.java b/mod/app/src/test/java/bttv/mod/TokenizerTest.java index a62974de..f6e022c7 100644 --- a/mod/app/src/test/java/bttv/mod/TokenizerTest.java +++ b/mod/app/src/test/java/bttv/mod/TokenizerTest.java @@ -21,7 +21,7 @@ import bttv.Tokenizer; import bttv.emote.Emote; import bttv.emote.Emotes; -import tv.twitch.android.shared.chat.pub.model.messages.AutoModMessageFlags; +import tv.twitch.chat.library.model.AutoModFlags; import tv.twitch.chat.library.model.MessageToken; import static org.junit.Assert.*; @@ -29,7 +29,7 @@ @RunWith(Parameterized.class) public class TokenizerTest { - final static AutoModMessageFlags flags = new AutoModMessageFlags(); + final static AutoModFlags flags = new AutoModFlags(0, 0, 0, 0); private static class Cases { static Object[] TrivialCase = { @@ -173,7 +173,7 @@ public void test() { System.out.println("text: '" + ((MessageToken.TextToken) token).getText() + "'"); } if (token instanceof MessageToken.EmoteToken) { - System.out.println("name: " + ((MessageToken.EmoteToken) token).component1()); + System.out.println("name: " + ((MessageToken.EmoteToken) token).getText()); } } System.out.println("---------------"); @@ -197,8 +197,8 @@ public void test() { MessageToken.EmoteToken expectedEmoteToken = (MessageToken.EmoteToken) expected; MessageToken.EmoteToken receivedEmoteToken = (MessageToken.EmoteToken) received; - assertEquals(expectedEmoteToken.component1(), receivedEmoteToken.component1()); - assertEquals(expectedEmoteToken.component2(), receivedEmoteToken.component2()); + assertEquals(expectedEmoteToken.getText(), receivedEmoteToken.getText()); + assertEquals(expectedEmoteToken.getId(), receivedEmoteToken.getId()); } index++; diff --git a/mod/twitch/src/main/java/tv/twitch/android/shared/chat/ChatMessageDelegate.java b/mod/twitch/src/main/java/tv/twitch/android/shared/chat/ChatMessageDelegate.java index c69f168d..994c2263 100644 --- a/mod/twitch/src/main/java/tv/twitch/android/shared/chat/ChatMessageDelegate.java +++ b/mod/twitch/src/main/java/tv/twitch/android/shared/chat/ChatMessageDelegate.java @@ -58,7 +58,4 @@ public int getUserId() { return 0; } - public String getMessageId() { - return ""; - } } diff --git a/mod/twitch/src/main/java/tv/twitch/android/shared/chat/adapter/item/ChatMessageViewHolder.java b/mod/twitch/src/main/java/tv/twitch/android/shared/chat/adapter/item/ChatMessageViewHolder.java index 4c7c632e..c0c8bc6a 100644 --- a/mod/twitch/src/main/java/tv/twitch/android/shared/chat/adapter/item/ChatMessageViewHolder.java +++ b/mod/twitch/src/main/java/tv/twitch/android/shared/chat/adapter/item/ChatMessageViewHolder.java @@ -7,7 +7,7 @@ import tv.twitch.android.core.adapters.AbstractTwitchRecyclerViewHolder; -public class ChatMessageViewHolder extends AbstractTwitchRecyclerViewHolder { +public abstract class ChatMessageViewHolder extends AbstractTwitchRecyclerViewHolder { public ChatMessageViewHolder(@NonNull View itemView) { super(itemView); } diff --git a/mod/twitch/src/main/java/tv/twitch/android/shared/chat/pub/model/messages/AutoModMessageFlags.java b/mod/twitch/src/main/java/tv/twitch/android/shared/chat/pub/model/messages/AutoModMessageFlags.java deleted file mode 100644 index bc2788f8..00000000 --- a/mod/twitch/src/main/java/tv/twitch/android/shared/chat/pub/model/messages/AutoModMessageFlags.java +++ /dev/null @@ -1,9 +0,0 @@ -/** - * This file is a stub, so javac does not throw errors, - * it is not used in the actual patch. - */ -package tv.twitch.android.shared.chat.pub.model.messages; - -public class AutoModMessageFlags { - -} diff --git a/mod/twitch/src/main/java/tv/twitch/android/shared/emotes/utils/AnimatedEmotesUrlUtil.java b/mod/twitch/src/main/java/tv/twitch/android/shared/emotes/utils/AnimatedEmotesUrlUtil.java index ff623ab7..d241094a 100644 --- a/mod/twitch/src/main/java/tv/twitch/android/shared/emotes/utils/AnimatedEmotesUrlUtil.java +++ b/mod/twitch/src/main/java/tv/twitch/android/shared/emotes/utils/AnimatedEmotesUrlUtil.java @@ -1,27 +1,10 @@ package tv.twitch.android.shared.emotes.utils; -import android.content.Context; - public class AnimatedEmotesUrlUtil { - public final EmoteUrlDetails generateEmoteUrl(Context context, String emoticonId, float f, EmoteUrlAnimationSetting emoteUrlAnimationSetting) { - throw new IllegalStateException("AnimatedEmotesUrlUtil.generateEmoteUrl() called"); - } - - public final String getEmoteUrl(Context context, String emoticonId) { - throw new IllegalStateException("AnimatedEmotesUrlUtil.getEmoteUrl() called"); - } - public enum EmoteUrlAnimationSetting { DEFAULT("default"), STATIC("static"); EmoteUrlAnimationSetting(String s){}; } - - public static class EmoteUrlDetails { - public EmoteUrlDetails(String emoteUrl, EmoteUrlAnimationSetting emoteUrlAnimationSetting) {} - public final String getEmoteUrl() { - return ""; - } - } } diff --git a/mod/twitch/src/main/java/tv/twitch/chat/AutoModFlags.java b/mod/twitch/src/main/java/tv/twitch/chat/AutoModFlags.java index f96f62e3..64d0c17b 100644 --- a/mod/twitch/src/main/java/tv/twitch/chat/AutoModFlags.java +++ b/mod/twitch/src/main/java/tv/twitch/chat/AutoModFlags.java @@ -1,4 +1,10 @@ package tv.twitch.chat; +/* For some reason, probably an unpaid intern, there are two AutoModFlags Classes: +* - tv.twitch.chat.AutoModFlags +* - tv.twitch.chat.library.model.AutoModFlags +* +* The latter has methods and everything, the former does not. So I expect this one to be removed soon. +*/ public class AutoModFlags { } diff --git a/mod/twitch/src/main/java/tv/twitch/chat/ChatTextToken.java b/mod/twitch/src/main/java/tv/twitch/chat/ChatTextToken.java index 8579d29b..412d8422 100644 --- a/mod/twitch/src/main/java/tv/twitch/chat/ChatTextToken.java +++ b/mod/twitch/src/main/java/tv/twitch/chat/ChatTextToken.java @@ -1,7 +1,7 @@ package tv.twitch.chat; public class ChatTextToken extends ChatMessageToken { - public AutoModFlags autoModFlags; + public tv.twitch.chat.AutoModFlags autoModFlags; public String text = null; public ChatTextToken() { diff --git a/mod/twitch/src/main/java/tv/twitch/chat/library/model/AutoModFlags.java b/mod/twitch/src/main/java/tv/twitch/chat/library/model/AutoModFlags.java new file mode 100644 index 00000000..f73fb7b2 --- /dev/null +++ b/mod/twitch/src/main/java/tv/twitch/chat/library/model/AutoModFlags.java @@ -0,0 +1,10 @@ +package tv.twitch.chat.library.model; + +/* For some reason, probably an unpaid intern, there are two AutoModFlags Classes: + * - tv.twitch.chat.AutoModFlags + * - tv.twitch.chat.library.model.AutoModFlags + */ +public class AutoModFlags { + public AutoModFlags(int identityLvl, int sexualLvl, int aggressiveLvl, int profanityLvl) { + } +} diff --git a/mod/twitch/src/main/java/tv/twitch/chat/library/model/MessageToken.java b/mod/twitch/src/main/java/tv/twitch/chat/library/model/MessageToken.java index 593bc0e3..743b0c39 100644 --- a/mod/twitch/src/main/java/tv/twitch/chat/library/model/MessageToken.java +++ b/mod/twitch/src/main/java/tv/twitch/chat/library/model/MessageToken.java @@ -4,8 +4,6 @@ */ package tv.twitch.chat.library.model; import kotlin.jvm.internal.BTTVDefaultConstructorMarker; -import tv.twitch.android.shared.chat.pub.model.messages.AutoModMessageFlags; - public abstract class MessageToken { @@ -21,17 +19,17 @@ public EmoteToken(String text, String id) { this.id = id; } - public final String component1() { + public final String getText() { return this.text; } - public final String component2() { + public final String getId() { return this.id; } } public static final class TextToken extends MessageToken { private final String text; - public TextToken(String str, AutoModMessageFlags autoModMessageFlags) { + public TextToken(String str, AutoModFlags autoModMessageFlags) { super(null); this.text = str; } @@ -40,7 +38,7 @@ public final String getText() { return text; } - public final AutoModMessageFlags getFlags() { + public final AutoModFlags getFlags() { return null; } From e102d760344dc37727b3c4cb6dcbac492cd01b22 Mon Sep 17 00:00:00 2001 From: Max Baumann Date: Mon, 17 Jul 2023 20:17:30 +0200 Subject: [PATCH 6/6] update ids --- patches/res.values.public.xml.patch | 180 ++++++++++++++-------------- 1 file changed, 90 insertions(+), 90 deletions(-) diff --git a/patches/res.values.public.xml.patch b/patches/res.values.public.xml.patch index ba2d6b0a..f5cfa45d 100644 --- a/patches/res.values.public.xml.patch +++ b/patches/res.values.public.xml.patch @@ -8,96 +8,96 @@ diff --git a/res/values/public.xml b/res/values/public.xml + + + -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + \ No newline at end of file