Skip to content

Commit

Permalink
Update 16.9.1 (#671)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zerwin authored Aug 23, 2024
1 parent 516452d commit 3726177
Show file tree
Hide file tree
Showing 63 changed files with 283 additions and 301 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/scl/fi/eq9rvvhqsx7yiv5cnfhf7/twitch-16.9.1.apk\?rlkey=7q5pvwwjvl6nh5durgx74gp6d\&st=nmhes0u1\&dl=1" >> $GITHUB_ENV
# get keystore.kjs from secret
- name: create keystore.kjs from secret
Expand Down Expand Up @@ -98,4 +98,4 @@ jobs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./bttv.apk
asset_name: bttv-${{ steps.version_tag.outputs.version_tag }}.apk
asset_content_type: application/vnd.android.package-archive
asset_content_type: application/vnd.android.package-archive
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

# 0.41.0-beta
- rebase to v16.9.1

# 0.40.4-beta
- fix issue related to 7TV emote names

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ RUN echo "y\n" | cmdline-tools/bin/sdkmanager --sdk_root=/opt/android-sdk-linux

# apktool

RUN wget https://github.com/iBotPeaches/Apktool/releases/download/v2.5.0/apktool_2.5.0.jar
RUN wget https://github.com/iBotPeaches/Apktool/releases/download/v2.9.3/apktool_2.9.3.jar

ENV APKTOOL_PATH /opt/apktool_2.5.0.jar
ENV APKTOOL_PATH /opt/apktool_2.9.3.jar

# uber apk signer

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ A mod of the Twitch Android Mobile<sup><a href="#no-tv">1</a></sup> App adding B

# Build it yourself

> This patch is meant to be applied to version **15.4.1** of the official twitch app
> This patch is meant to be applied to version **16.9.1** of the official twitch app
> Make sure you use this version before you create an issue!
## Easy way: Docker
Expand Down Expand Up @@ -128,7 +128,7 @@ Made with ♥️ by [@FoseFx](https://github.com/FoseFx) and contributors. MIT L
[license-badge]: https://img.shields.io/github/license/bttv-android/bttv?style=flat-square
[license-file]: ./LICENSE
[bttv-version]: https://img.shields.io/github/v/release/bttv-android/bttv?style=flat-square
[base-version]: https://img.shields.io/badge/build%20on-v15.4.1-blueviolet?style=flat-square
[base-version]: https://img.shields.io/badge/build%20on-v16.9.1-blueviolet?style=flat-square
[downloads-latest]: https://img.shields.io/github/downloads/bttv-android/bttv/latest/total?color=yellow&style=flat-square
[downloads-total]: https://img.shields.io/github/downloads/bttv-android/bttv/total?color=yellowgreen&label=downloads%20total&style=flat-square
[latest-release]: https://github.com/bttv-android/bttv/releases/latest
Expand Down
4 changes: 2 additions & 2 deletions bttv.manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "0.40.4-beta",
"versionCode": "01208000333"
"version": "0.41.0-beta",
"versionCode": "01208000334"
}
5 changes: 5 additions & 0 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ sed -i "s/android:text=\"BTTV .*\"/android:text=\"BTTV ${VERSION}\"/" $1/res/lay

cd $1

# Move classes2 to classes9
echo "Moving classes8 to classes9"
mv smali_classes8/com smali_classes9
mv smali_classes8/tv smali_classes9

APK_PATH=./dist/twitch.apk

# Build using APKTool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import java.util.List;

import bttv.highlight.Highlight;
import tv.twitch.android.models.chat.MessageToken;
import tv.twitch.android.shared.chat.pub.model.messages.MessageToken;
import tv.twitch.android.models.chomments.ChommentModel;
import tv.twitch.android.shared.chat.pub.model.ChatMessageTokenizerWrapper;
import tv.twitch.android.provider.experiments.ExperimentHelper;
Expand Down
4 changes: 1 addition & 3 deletions mod/app/src/main/java/bttv/SplitChat.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

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.chomments.ChommentRecyclerItem.ChommentItemViewHolder;
import tv.twitch.android.shared.chat.messagefactory.adapteritem.UserNoticeRecyclerItem.UserNoticeViewHolder;

Expand Down Expand Up @@ -50,8 +49,7 @@ public static void setBackgroundColor(int position, RecyclerView.ViewHolder view
// so make sure not to do anything when
// not a ViewHolder used in Chat
if (
!(viewHolder instanceof ChatMessageViewHolder)
&& !(viewHolder instanceof ChommentItemViewHolder)
!(viewHolder instanceof ChommentItemViewHolder)
&& !(viewHolder instanceof UserNoticeViewHolder)
) {
Log.i(TAG, "viewHolder is not known: " + viewHolder.toString());
Expand Down
8 changes: 4 additions & 4 deletions mod/app/src/main/java/bttv/Tokenizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.android.shared.chat.pub.model.messages.MessageToken;
import tv.twitch.android.shared.chat.pub.model.messages.MessageToken.TextToken;
import tv.twitch.android.shared.chat.pub.model.messages.MessageToken.EmoticonToken;
import tv.twitch.android.shared.chat.pub.ChatMessageInterface;
import tv.twitch.android.shared.chat.ChatMessageDelegate;
import tv.twitch.chat.AutoModFlags;
Expand Down
4 changes: 3 additions & 1 deletion mod/app/src/main/java/bttv/api/Highlight.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package bttv.api;

import kotlin.jvm.functions.Function1;
import android.content.Context;
import tv.twitch.android.shared.chat.pub.ChatMessageInterface;

public class Highlight {
public static Integer replaceNum(ChatMessageInterface chatMessageInterface, boolean z, boolean z2, int i, int i2, Object iClickableUsernameSpanListener, Object twitchUrlSpanClickListener, Object webViewSource, String str, boolean z3, Object chatFiltersSettings, Integer num) {
public static Integer replaceNum(ChatMessageInterface chatMessageInterface, boolean z, boolean z2, Function1<Context, Integer> function, int i, Object iClickableUsernameSpanListener, Object twitchUrlSpanClickListener, Object webViewSource, String str, boolean z3, Object chatFiltersSettings, Integer num) {
return bttv.highlight.Highlight.replaceNum(chatMessageInterface, num);
}
}
2 changes: 1 addition & 1 deletion mod/app/src/test/java/bttv/mod/TokenizerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
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.MessageToken;

import static org.junit.Assert.*;
import static org.mockito.Mockito.when;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package tv.twitch.android.core.mvp.viewdelegate;

public class EventDispatcher {

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import androidx.fragment.app.FragmentActivity;

import tv.twitch.android.core.mvp.viewdelegate.BaseViewDelegate;
import tv.twitch.android.core.mvp.viewdelegate.RxViewDelegate;

public class StreamSettingsViewDelegate extends BaseViewDelegate {
public class StreamSettingsViewDelegate extends RxViewDelegate {
public FragmentActivity activity;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
public abstract class EmoteCardModel {
public String emoteId;

private EmoteCardModel(String emoteId, String emoteToken, EmoteModelAssetType emoteModelAssetType, EmoteCardType emoteCardType) {
public EmoteCardModel(String emoteId, String emoteToken, EmoteModelAssetType emoteModelAssetType, EmoteCardType emoteCardType) {
}

public static final class GenericEmoteCardModel extends EmoteCardModel {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.android.shared.chat.pub.model.messages.MessageToken;
import tv.twitch.android.shared.chat.pub.ChatMessageInterface;
import tv.twitch.chat.ChatMessageInfo;

Expand Down Expand Up @@ -57,8 +57,4 @@ public String getUserName() {
public int getUserId() {
return 0;
}

public String getMessageId() {
return "";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,5 @@
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");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.android.shared.chat.pub.model.messages.MessageToken;
import tv.twitch.android.models.chomments.ChommentModel;
import tv.twitch.android.shared.chat.pub.model.ChatMessageTokenizerWrapper;
import tv.twitch.android.provider.experiments.ExperimentHelper;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package tv.twitch.android.shared.chat.emotecard;

import tv.twitch.android.core.mvp.viewdelegate.BaseViewDelegate;
import tv.twitch.android.core.mvp.viewdelegate.RxViewDelegate;

public class EmoteCardViewDelegate extends BaseViewDelegate {
public class EmoteCardViewDelegate extends RxViewDelegate {
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@
import androidx.annotation.NonNull;

import tv.twitch.android.core.adapters.AbstractTwitchRecyclerViewHolder;
import tv.twitch.android.core.mvp.viewdelegate.EventDispatcher;

public class UserNoticeRecyclerItem {
public static final class UserNoticeViewHolder extends AbstractTwitchRecyclerViewHolder {
public UserNoticeViewHolder(@NonNull View itemView) {
public UserNoticeViewHolder(@NonNull View itemView, EventDispatcher eventDispatcher) {
super(itemView);
}

public final android.widget.TextView getChatMessage() {
throw new IllegalStateException("");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public interface ChatMessageInterface {

String getDisplayName();

java.util.List<tv.twitch.android.models.chat.MessageToken> getTokens();
java.util.List<tv.twitch.android.shared.chat.pub.model.messages.MessageToken> getTokens();

int getUserId();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.android.shared.chat.pub.model.messages;
import kotlin.jvm.internal.BTTVDefaultConstructorMarker;
import tv.twitch.android.shared.chat.pub.model.messages.AutoModMessageFlags;


public abstract class MessageToken {
Expand All @@ -20,27 +21,23 @@ public EmoticonToken(String text, String id) {
this.id = id;
}

public final String component1() {
return this.text;
}
public final String component2() {
return this.id;
}
}

public static final class TextToken extends MessageToken {
private final String text;
public TextToken(String str, AutoModMessageFlags autoModMessageFlags) {
private final AutoModMessageFlags flags;
public TextToken(String str, AutoModMessageFlags flags) {
super(null);
this.text = str;
this.flags = flags;
}

public final String getText() {
return text;
}

public final AutoModMessageFlags getFlags() {
return null;
return flags;
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public final EmoteUrlDetails generateEmoteUrl(Context context, String emoticonId
throw new IllegalStateException("AnimatedEmotesUrlUtil.generateEmoteUrl() called");
}

public final String getEmoteUrl(Context context, String emoticonId) {
public final String getEmoteUrl(Context context, String emoticonId, Float f) {
throw new IllegalStateException("AnimatedEmotesUrlUtil.getEmoteUrl() called");
}

Expand Down
20 changes: 10 additions & 10 deletions patches/AndroidManifest.xml.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ diff --git a/AndroidManifest.xml b/AndroidManifest.xml
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1,4 +1,15 @@
-<?xml version="1.0" encoding="utf-8" standalone="no"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" android:compileSdkVersion="33" android:compileSdkVersionCodename="13" android:installLocation="auto" package="tv.twitch.android.app" platformBuildVersionCode="33" platformBuildVersionName="13">
-<?xml version="1.0" encoding="utf-8" standalone="no"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" android:compileSdkVersion="34" android:compileSdkVersionCodename="14" android:installLocation="auto" package="tv.twitch.android.app" platformBuildVersionCode="34" platformBuildVersionName="14">
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<manifest
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:versionCode="${BTTVVERSIONCODE}"
+ android:versionName="${BTTVVERSION}"
+ android:compileSdkVersion="33"
+ android:compileSdkVersionCodename="13"
+ android:compileSdkVersion="34"
+ android:compileSdkVersionCodename="14"
+ android:installLocation="auto"
+ package="tv.twitch.bttvandroid.app"
+ platformBuildVersionCode="33"
+ platformBuildVersionName="13">
+ platformBuildVersionCode="34"
+ platformBuildVersionName="14">
+
<uses-feature android:name="android.hardware.type.pc" android:required="false"/>
<uses-feature android:name="android.hardware.touchscreen" android:required="false"/>
Expand All @@ -25,8 +25,8 @@ diff --git a/AndroidManifest.xml b/AndroidManifest.xml
+ <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>
<uses-permission android:maxSdkVersion="32" android:name="android.permission.READ_EXTERNAL_STORAGE" android:required="false"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:required="false"/>
<uses-feature android:name="android.hardware.camera" android:required="false"/>
@@ -69,8 +81,8 @@
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" android:required="false"/>
@@ -70,8 +82,8 @@
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
<uses-permission android:name="com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE"/>
Expand All @@ -37,7 +37,7 @@ diff --git a/AndroidManifest.xml b/AndroidManifest.xml
<application android:allowBackup="false" android:appComponentFactory="androidx.core.app.CoreComponentFactory" android:enabled="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:largeHeap="true" android:name="tv.twitch.android.app.consumer.TwitchApplication" android:networkSecurityConfig="@xml/default_security_config" android:requestLegacyExternalStorage="false" android:supportsRtl="true" android:theme="@style/Theme.TwitchApp">
<profileable android:shell="true"/>
<meta-data android:name="WindowManagerPreference:FreeformWindowSize" android:value="phone"/>
@@ -176,15 +188,15 @@
@@ -178,15 +190,15 @@
<action android:name="android.intent.action.MEDIA_BUTTON"/>
</intent-filter>
</service>
Expand All @@ -56,7 +56,7 @@ diff --git a/AndroidManifest.xml b/AndroidManifest.xml
<meta-data android:name="io.branch.sdk.BranchKey" android:value="key_live_jgBdao5vVtyZ3hdckxy8jlkkzqooQltZ"/>
<meta-data android:name="io.branch.sdk.BranchKey.test" android:value="key_test_ahupan1EKvF7XkpepyA3vpfivrdlOlMg"/>
<meta-data android:name="io.branch.sdk.TestMode" android:value="false"/>
@@ -287,7 +299,7 @@
@@ -291,7 +303,7 @@
<receiver android:enabled="true" android:exported="false" android:name="com.google.android.gms.measurement.AppMeasurementReceiver"/>
<service android:enabled="true" android:exported="false" android:name="com.google.android.gms.measurement.AppMeasurementService"/>
<service android:enabled="true" android:exported="false" android:name="com.google.android.gms.measurement.AppMeasurementJobService" android:permission="android.permission.BIND_JOB_SERVICE"/>
Expand All @@ -65,7 +65,7 @@ diff --git a/AndroidManifest.xml b/AndroidManifest.xml
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>
<uses-library android:name="androidx.window.extensions" android:required="false"/>
<uses-library android:name="androidx.window.sidecar" android:required="false"/>
@@ -346,5 +358,18 @@
@@ -348,5 +360,18 @@
<action android:name="com.amazon.dcp.sso.action.session.users.changed"/>
</intent-filter>
</receiver>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
diff --git a/smali_classes6/tv/twitch/android/shared/chat/ChatViewPresenter.smali b/smali_classes6/tv/twitch/android/shared/chat/ChatViewPresenter.smali
--- a/smali_classes6/tv/twitch/android/shared/chat/ChatViewPresenter.smali
+++ b/smali_classes6/tv/twitch/android/shared/chat/ChatViewPresenter.smali
@@ -38,7 +38,7 @@
@@ -36,7 +36,7 @@

.field private final buildConfigUtil:Ltv/twitch/android/core/buildconfig/BuildConfigUtil;

Expand All @@ -10,7 +10,7 @@ diff --git a/smali_classes6/tv/twitch/android/shared/chat/ChatViewPresenter.smal

.field private channelInfo:Ltv/twitch/chat/ChatChannelInfo;

@@ -66,7 +66,7 @@
@@ -74,7 +74,7 @@

.field private chatConnectDisposable:Lio/reactivex/disposables/Disposable;

Expand All @@ -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 @@
@@ -1549,6 +1549,10 @@

iput-object v1, v0, Ltv/twitch/android/shared/chat/ChatViewPresenter;->messageInputListener:Ltv/twitch/android/shared/chat/ChatViewPresenter$messageInputListener$1;

Expand All @@ -30,7 +30,7 @@ diff --git a/smali_classes6/tv/twitch/android/shared/chat/ChatViewPresenter.smal
return-void
.end method

@@ -1753,6 +1757,13 @@
@@ -2109,6 +2113,13 @@
:cond_0
return-void
.end method
Expand Down
Loading

0 comments on commit 3726177

Please sign in to comment.